diff options
author | Bowgo Tsai <bowgotsai@google.com> | 2019-02-27 11:43:39 +0800 |
---|---|---|
committer | Bowgo Tsai <bowgotsai@google.com> | 2019-03-07 12:39:56 +0800 |
commit | 0f961966e2320a748b4585b7139805d7bab13ba6 (patch) | |
tree | 44424ded1acc9d6e758e09796ffe6cc300ec5f99 /cppreopts | |
parent | 00b208191190221b5f10538aac9f7ae8cad332fa (diff) | |
download | extras-0f961966e2320a748b4585b7139805d7bab13ba6.tar.gz |
Allowing product-specific fstab.postinstall
To allow mount system_other with different file systems, mount options,
or verity settings, we need to put the fstab into /product and keep
the /system/etc/fstab.postinstall generic.
Device can add the following into device/*/BoardConfig.mk to use
the fstab from /product:
PRODUCT_PRODUCT_PROPERTIES += \
ro.postinstall.fstab.prefix=/product
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/fstab.postinstall:$(TARGET_COPY_OUT_PRODUCT)/etc/fstab.postinstall
In the $(LOCAL_PATH)/fstab.postinstall:
/dev/block/by-name/system /postinstall ext4 ro,nosuid,nodev,noexec slotselect_other,avb_keys=/product/etc/avb/system_other.avbpubkey
[serial log]:
init: Overriding previous 'ro.' property' ro.postinstall.fstab.prefix':'/system' with new value '/product'
init: processing action (ro.postinstall.fstab.prefix=/product && sys.cppreopt=requested) from (/system/etc/init/cppreopts.rc:27)
init: [libfs_avb]Returning avb_handle for '/postinstall' with status: Success
init: [libfs_avb]Built verity table: '1 /dev/block/by-name/system_a
/dev/block/by-name/system_a 4096 4096 709501 709501 sha1
71941953c7b61238a1779e55f8dbba2eab6c702a 0b7840796a7be
6ecadffaf6fc2f085400c9a0c78 10 use_fec_from_device
/dev/block/by-name/system_a fec_roots 2 fec_blocks 715089 fec_start
715089 restart_on_corruption ignore_zero_blocks
...
init: Command 'mount_all /product/etc/fstab.postinstall'
action=ro.postinstall.fstab.prefix=/product && sys.cppreopt=requested
(/system/etc/init/cppreopts.rc:28) took 109ms and succeeded
[logcat log]:
cppreopts: Copied file from /postinstall/priv-app/... to /data/dalvik-cache/arm64/...
...
1750 1750 I PackageManager: cppreopts took 21976 ms
Bug: 112103720
Test: factory reset and boot device, checks cppreopt logs
Change-Id: If826ac45804be085b48a50cab6741960658dc09f
Diffstat (limited to 'cppreopts')
-rw-r--r-- | cppreopts/cppreopts.rc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/cppreopts/cppreopts.rc b/cppreopts/cppreopts.rc index 4ce04c51..812b4ce8 100644 --- a/cppreopts/cppreopts.rc +++ b/cppreopts/cppreopts.rc @@ -18,8 +18,17 @@ service cppreopts /system/bin/cppreopts.sh /postinstall user root capabilities -on property:sys.cppreopt=requested +# Post install is above Treble VINTF, because it runs some utilities from +# /system. Therefore, the fstab can only be in either /system or /product. +on property:sys.cppreopt=requested && property:ro.postinstall.fstab.prefix=/system mount_all /system/etc/fstab.postinstall + setprop sys.cppreopt mounted + +on property:sys.cppreopt=requested && property:ro.postinstall.fstab.prefix=/product + mount_all /product/etc/fstab.postinstall + setprop sys.cppreopt mounted + +on property:sys.cppreopt=mounted exec_start cppreopts # Optional script to copy additional preloaded content to data directory exec - system system -- /system/bin/preloads_copy.sh /postinstall |