From 4999dc047c77d1652a04868fe99dac6d5958609c Mon Sep 17 00:00:00 2001 From: SzuWei Lin Date: Mon, 12 Nov 2018 18:58:22 +0800 Subject: [PATCH] Unmount product partition in GSI This is a workaround solution. It let GSI to unmount product partition when booting. The patch avoid the problem that - share UID between between system and product partition - the product partition override the content under /system/product Bug: 119391482 Test: Boot aosp_arm64-userdebug on a blueline device with Android P Change-Id: I48808fcc1ca527a23eb1446b97176b08268b500e --- target/product/aosp_arm.mk | 4 ++++ target/product/aosp_arm64.mk | 4 ++++ target/product/aosp_x86.mk | 4 ++++ target/product/aosp_x86_64.mk | 4 ++++ target/product/treble_common.mk | 6 +++++- target/product/vndk/init.gsi.rc | 4 ++-- target/product/vndk/init.legacy-gsi.rc | 3 +++ 7 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 target/product/vndk/init.legacy-gsi.rc diff --git a/target/product/aosp_arm.mk b/target/product/aosp_arm.mk index 795f8aac6..5a6a092c0 100644 --- a/target/product/aosp_arm.mk +++ b/target/product/aosp_arm.mk @@ -38,6 +38,10 @@ PRODUCT_PACKAGES += \ # Needed by Pi newly launched device to pass VtsTrebleSysProp on GSI PRODUCT_COMPATIBLE_PROPERTY_OVERRIDE := true +# GSI specific tasks on boot +PRODUCT_COPY_FILES += \ + build/make/target/product/vndk/init.gsi.rc:system/etc/init/init.gsi.rc + # Support addtional P vendor interface PRODUCT_EXTRA_VNDK_VERSIONS := 28 diff --git a/target/product/aosp_arm64.mk b/target/product/aosp_arm64.mk index f3f3c5af4..90c159f2f 100644 --- a/target/product/aosp_arm64.mk +++ b/target/product/aosp_arm64.mk @@ -54,6 +54,10 @@ PRODUCT_PACKAGES += \ # Needed by Pi newly launched device to pass VtsTrebleSysProp on GSI PRODUCT_COMPATIBLE_PROPERTY_OVERRIDE := true +# GSI specific tasks on boot +PRODUCT_COPY_FILES += \ + build/make/target/product/vndk/init.gsi.rc:system/etc/init/init.gsi.rc + # Support addtional P vendor interface PRODUCT_EXTRA_VNDK_VERSIONS := 28 diff --git a/target/product/aosp_x86.mk b/target/product/aosp_x86.mk index e3167af45..da31e2417 100644 --- a/target/product/aosp_x86.mk +++ b/target/product/aosp_x86.mk @@ -38,6 +38,10 @@ PRODUCT_PACKAGES += \ # Needed by Pi newly launched device to pass VtsTrebleSysProp on GSI PRODUCT_COMPATIBLE_PROPERTY_OVERRIDE := true +# GSI specific tasks on boot +PRODUCT_COPY_FILES += \ + build/make/target/product/vndk/init.gsi.rc:system/etc/init/init.gsi.rc + # Support addtional P vendor interface PRODUCT_EXTRA_VNDK_VERSIONS := 28 diff --git a/target/product/aosp_x86_64.mk b/target/product/aosp_x86_64.mk index 222adaab8..4ce40cc71 100644 --- a/target/product/aosp_x86_64.mk +++ b/target/product/aosp_x86_64.mk @@ -54,6 +54,10 @@ PRODUCT_PACKAGES += \ # Needed by Pi newly launched device to pass VtsTrebleSysProp on GSI PRODUCT_COMPATIBLE_PROPERTY_OVERRIDE := true +# GSI specific tasks on boot +PRODUCT_COPY_FILES += \ + build/make/target/product/vndk/init.gsi.rc:system/etc/init/init.gsi.rc + # Support addtional P vendor interface PRODUCT_EXTRA_VNDK_VERSIONS := 28 diff --git a/target/product/treble_common.mk b/target/product/treble_common.mk index d3cce7665..bbad48451 100644 --- a/target/product/treble_common.mk +++ b/target/product/treble_common.mk @@ -46,9 +46,13 @@ PRODUCT_COPY_FILES += \ PRODUCT_COPY_FILES += \ device/generic/common/nfc/libnfc-nci.conf:system/etc/libnfc-nci.conf +# GSI specific tasks on boot +PRODUCT_COPY_FILES += \ + build/make/target/product/vndk/init.gsi.rc:system/etc/init/init.gsi.rc + # Support for the O-MR1 devices PRODUCT_COPY_FILES += \ - build/make/target/product/vndk/init.gsi.rc:system/etc/init/init.gsi.rc \ + build/make/target/product/vndk/init.legacy-gsi.rc:system/etc/init/init.legacy-gsi.rc \ build/make/target/product/vndk/init.vndk-27.rc:system/etc/init/gsi/init.vndk-27.rc # Name space configuration file for non-enforcing VNDK diff --git a/target/product/vndk/init.gsi.rc b/target/product/vndk/init.gsi.rc index 0150b1a12..695820e87 100644 --- a/target/product/vndk/init.gsi.rc +++ b/target/product/vndk/init.gsi.rc @@ -1,2 +1,2 @@ -# If ro.vndk.version is not defined, import init.vndk-27.rc. -import /system/etc/init/gsi/init.vndk-${ro.vndk.version:-27}.rc +on early-init + umount /product # TODO(b/119391482): workaround for /system/product diff --git a/target/product/vndk/init.legacy-gsi.rc b/target/product/vndk/init.legacy-gsi.rc new file mode 100644 index 000000000..00dd576fc --- /dev/null +++ b/target/product/vndk/init.legacy-gsi.rc @@ -0,0 +1,3 @@ +# If ro.vndk.version is not defined, import init.vndk-27.rc. +import /system/etc/init/gsi/init.vndk-${ro.vndk.version:-27}.rc +