From f4d6bd93dc0010cd69ef463bd812398743c0eafd Mon Sep 17 00:00:00 2001 From: Ziyan Date: Thu, 27 Nov 2014 19:56:50 +0100 Subject: tuna: simplify /factory partition handling Currently, we do the following sequence on every bootup: 1. mount /factory ro (fstab) 2. remount /factory as rw 3. update selinux labels on the partition 4. remount /factory as ro By mounting /factory in rw mode from the fstab, we can avoid the second step, simplifying the bootup sequence. Also replaced the restorecons with one restorecon_recursive, which does the same task in one line. And lastly, removed some unnecessary chown/chmods - remounting does not overwrite the permissions and the owner. --- rootdir/fstab.tuna | 2 +- rootdir/init.tuna.rc | 18 +----------------- 2 files changed, 2 insertions(+), 18 deletions(-) (limited to 'rootdir') diff --git a/rootdir/fstab.tuna b/rootdir/fstab.tuna index 9ae0928..d89b422 100644 --- a/rootdir/fstab.tuna +++ b/rootdir/fstab.tuna @@ -5,7 +5,7 @@ /dev/block/platform/omap/omap_hsmmc.0/by-name/system /system ext4 ro wait -/dev/block/platform/omap/omap_hsmmc.0/by-name/efs /factory ext4 ro wait +/dev/block/platform/omap/omap_hsmmc.0/by-name/efs /factory ext4 rw wait /dev/block/platform/omap/omap_hsmmc.0/by-name/cache /cache ext4 noatime,nosuid,nodev,nomblk_io_submit,errors=panic wait,check /dev/block/platform/omap/omap_hsmmc.0/by-name/userdata /data ext4 noatime,nosuid,nodev,nomblk_io_submit,errors=panic wait,check,encryptable=/dev/block/platform/omap/omap_hsmmc.0/by-name/metadata /dev/block/platform/omap/omap_hsmmc.0/by-name/misc /misc emmc defaults defaults diff --git a/rootdir/init.tuna.rc b/rootdir/init.tuna.rc index 591ba74..e4d127a 100755 --- a/rootdir/init.tuna.rc +++ b/rootdir/init.tuna.rc @@ -68,19 +68,7 @@ on fs mkdir /factory 0775 radio radio mount_all /fstab.tuna restorecon /dev/block/platform/omap/omap_hsmmc.0/by-name/radio - mount ext4 /dev/block/platform/omap/omap_hsmmc.0/by-name/efs /factory rw remount - restorecon /factory - restorecon /factory/imei/mps_code.dat - restorecon /factory/.nv_state - restorecon /factory/.nv_data.bak - restorecon /factory/nv_data.bin - restorecon /factory/nv_data.bin.md5 - restorecon /factory/hdcp.keys - restorecon /factory/imei - restorecon /factory/wifi - restorecon /factory/wv.keys - restorecon /factory/bluetooth - restorecon /factory/bluetooth/bt_addr + restorecon_recursive /factory mount ext4 /dev/block/platform/omap/omap_hsmmc.0/by-name/efs /factory ro remount setprop ro.crypto.fuse_sdcard true @@ -103,10 +91,6 @@ on fs # change permissions for ION driver chmod 0777 /dev/ion -# We chown/chmod /factory because mount is run as root + defaults - chown radio radio /factory - chmod 0775 /factory - # add symlink for HDCP key symlink /factory/hdcp.keys /system/vendor/firmware/hdcp.keys -- cgit v1.1