fsgen: Use prebuilt_{root,any} in case install_in_root is set

If any of the other modules relative dir matches (eg lib/) it
would hit a neverallow as installing in the root directory
is allowlisted.

Test: m --no-skip-soong-tests
Test: m on tegra device with
PRODUCT_COPY_FILES += \
    tegra21x_xusb_firmware:recovery/root/tegra21x_xusb_firmware \

Change-Id: I157826703974544614f0049b8fa157358e7b17a7
This commit is contained in:
Luca Stefani 2025-03-19 21:21:04 +01:00
parent 6f53e14455
commit fc4af1f5cc
No known key found for this signature in database

View file

@ -335,6 +335,10 @@ func createPrebuiltEtcModulesInDirectory(ctx android.LoadHookContext, partition,
propsList = append(propsList, &prebuiltInstallInRootProperties{
Install_in_root: proptools.BoolPtr(true),
})
// Discard any previously picked module and force it to prebuilt_{root,any} as
// they are the only modules allowed to specify the `install_in_root` property.
etcInstallPathKey = ""
relDestDirFromInstallDirBase = destDir
}
// Set appropriate srcs, dsts, and releative_install_path based on