fs_mgr: Look for fstab file in /system/etc
Look for the fstab file in /system/etc as an alternative to /, in order to allow fstab files to be installed using the "prebuilt_etc" Soong module. This new path is meant to be used by the vendor ramdisk only. As before, fstabs should *not* be placed in /system/etc on the system partition. In more detail: sometimes, multiple nearly-identical fstabs need to be installed to a device, with the correct one being selected at boot time (b/191417025 as well as other cases that partners have run into). To avoid error-prone duplication of configuration files, these fstabs should be generated from a template by the build system instead of being duplicated in the source tree. But if this is done, the usual way of installing fstabs (PRODUCT_COPY_FILES) can't be used; they need to be made into real build system modules instead. Currently, the "prebuilt_etc" Soong module can't correctly install the vendor_ramdisk copy of the fstab(s), since it will install it into the /system/etc directory whereas Android currently requires that the vendor_ramdisk copy of the fstab(s) be placed in the root directory. Earlier I proposed adding a "prebuilt_fstab" module to handle this quirk (https://r.android.com/1744033). However, it was requested to instead always look for the fstabs in /etc too, in order to allow "prebuilt_etc" to be used and because /etc is the appropriate place for this file. This change implements that suggestion (but actually using /system/etc, since that is where "prebuilt_etc" actually installs it). Bug: 191417025 Test: Tested that a device boots both with this, both before and after http://ag/15075136 which uses the new location. Change-Id: Id083070e51ae85959167e4615cd96b31a0b1bd6a
Loading