Skip to content

Commit

Permalink
Make the early boot process boot-location-agnostic
Browse files Browse the repository at this point in the history
Instead of using fixed block device names for /system and /data, let
fsfinder set up links for us based on the boot location.  This allows us
to run unmodified from both eMMC and external SD card.
  • Loading branch information
steven676 committed Apr 25, 2014
1 parent 4ba84fa commit c9095b5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 2 additions & 0 deletions encore.mk
Expand Up @@ -29,6 +29,8 @@ PRODUCT_COPY_FILES += \
device/bn/encore/ueventd.encore.rc:root/ueventd.encore.rc \
device/bn/encore/fstab.encore:root/fstab.encore

PRODUCT_PACKAGES += fsfinder

# key mapping and touchscreen files
PRODUCT_COPY_FILES += \
device/bn/encore/prebuilt/usr/idc/cyttsp-i2c.idc:/system/usr/idc/cyttsp-i2c.idc \
Expand Down
6 changes: 3 additions & 3 deletions fstab.encore
Expand Up @@ -3,11 +3,11 @@
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
######################
/dev/block/mmcblk0p5 /system ext4 ro,barrier=1 wait
/dev/block/mmcblk0p6 /data ext4 noatime,nosuid,nodev,barrier=1,noauto_da_alloc wait,check
/dev/block/by-name/system /system ext4 ro,barrier=1 wait
/dev/block/by-name/userdata /data ext4 noatime,nosuid,nodev,barrier=1,noauto_da_alloc wait,check
/dev/block/mmcblk0p7 /cache ext4 noatime,nosuid,nodev,barrier=1 wait,check
/dev/block/mmcblk0p2 /rom vfat sync,noatime,nodiratime,uid=1000,gid=1000,fmask=117,dmask=007 defaults
/dev/block/mmcblk0p1 /boot vfat fmask=177,dmask=077 recoveryonly
/dev/block/by-name/boot /boot vfat fmask=177,dmask=077 recoveryonly

# Swap devices
/dev/block/zram0 none swap defaults zramsize=100663296
Expand Down
10 changes: 10 additions & 0 deletions init.encore.rc
Expand Up @@ -44,6 +44,11 @@ on init
write /proc/sys/vm/swappiness 20

on fs
# set up links to block devices based on boot location
mkdir /dev/block/by-name 0755 root root
start fsfinder
wait /dev/block/by-name/system

# mount partitions
mount_all /fstab.encore
swapon_all /fstab.encore
Expand Down Expand Up @@ -211,6 +216,11 @@ on property:dev.bootcomplete=1
write /sys/kernel/mm/ksm/sleep_millisecs 500
write /sys/kernel/mm/ksm/run 1

service fsfinder /sbin/fsfinder
class core
disabled
oneshot

#service mountd /system/bin/mountd
# socket mountd stream 0660 root mount

Expand Down

0 comments on commit c9095b5

Please sign in to comment.