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
1 file changed