From 57fbc4f01594573938c910fda39895976ae11626 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Fri, 6 Sep 2019 15:10:28 +0200 Subject: [PATCH 1/6] Whitelist radio HALs (needed because they need to e in framework because of weird jarjar issue) Change-Id: If1ccbedde92955bb86f4c6db6d68502784de1d8d --- core/tasks/check_boot_jars/package_whitelist.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/tasks/check_boot_jars/package_whitelist.txt b/core/tasks/check_boot_jars/package_whitelist.txt index 610301841a..45266c5f16 100644 --- a/core/tasks/check_boot_jars/package_whitelist.txt +++ b/core/tasks/check_boot_jars/package_whitelist.txt @@ -258,3 +258,6 @@ org\.codeaurora\.internal.* ################################################### # IFAA Manager used for Alipay and/or WeChat payment org\.ifaa\.android\.manager.* + +vendor\.samsung\.hardware\.radio\.V1_2 +vendor\.mediatek\.hardware\.radio\.V2_0 -- GitLab From 2a93af7f52d6b9235495ac9efeb7882c8a0fea85 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Sat, 14 Sep 2019 21:25:07 +0200 Subject: [PATCH 2/6] Add BOARD_SYSTEMIMAGE_AS_SYSTEM parameter to build SaS GSI Change-Id: I764f0ef4e3be9a338fbe93944445cedc29d2bb81 --- core/Makefile | 1 + tools/releasetools/build_image.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/core/Makefile b/core/Makefile index e2e9ba3aea..c5d0e88752 100644 --- a/core/Makefile +++ b/core/Makefile @@ -1378,6 +1378,7 @@ endif # PRODUCT_USE_DYNAMIC_PARTITIONS # $(3): additional "key=value" pairs to append to the dictionary file. define generate-image-prop-dictionary $(if $(filter $(2),system),\ + $(if $(BOARD_SYSTEMIMAGE_AS_SYSTEM),$(hide) echo "system_as_system=$(BOARD_SYSTEMIMAGE_AS_SYSTEM)" >> $(1)) $(if $(BOARD_SYSTEMIMAGE_PARTITION_SIZE),$(hide) echo "system_size=$(BOARD_SYSTEMIMAGE_PARTITION_SIZE)" >> $(1)) $(if $(INTERNAL_SYSTEM_OTHER_PARTITION_SIZE),$(hide) echo "system_other_size=$(INTERNAL_SYSTEM_OTHER_PARTITION_SIZE)" >> $(1)) $(if $(BOARD_SYSTEMIMAGE_FILE_SYSTEM_TYPE),$(hide) echo "system_fs_type=$(BOARD_SYSTEMIMAGE_FILE_SYSTEM_TYPE)" >> $(1)) diff --git a/tools/releasetools/build_image.py b/tools/releasetools/build_image.py index d8a65d2950..9b77167331 100755 --- a/tools/releasetools/build_image.py +++ b/tools/releasetools/build_image.py @@ -157,6 +157,8 @@ def SetUpInDirAndFsConfig(origin_in, prop_dict): if prop_dict["mount_point"] != "system": return origin_in, fs_config + if "system_as_system" in prop_dict: + return origin_in, fs_config if "first_pass" in prop_dict: prop_dict["mount_point"] = "/" @@ -565,6 +567,8 @@ def ImagePropFromGlobalDict(glob_dict, mount_point): if not copy_prop("system_extfs_rsv_pct", "extfs_rsv_pct"): d["extfs_rsv_pct"] = "0" copy_prop("system_reserved_size", "partition_reserved_size") + + copy_prop("system_as_system", "system_as_system") elif mount_point == "system_other": # We inherit the selinux policies of /system since we contain some of its # files. -- GitLab From 29098a6040ce2f0a685bfd3d70bc771210ac5541 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Sun, 22 Mar 2020 18:09:04 +0100 Subject: [PATCH 3/6] Skip mounting /oem, because if it exists, it includes framework-level stuff we dont want --- target/product/gsi/skip_mount.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/target/product/gsi/skip_mount.cfg b/target/product/gsi/skip_mount.cfg index 549767edf2..3276763844 100644 --- a/target/product/gsi/skip_mount.cfg +++ b/target/product/gsi/skip_mount.cfg @@ -1,2 +1,3 @@ /product /product_services +/oem -- GitLab From 141f3cb04e354277010fa73e13cc7eee3eae4f77 Mon Sep 17 00:00:00 2001 From: Andy CrossGate Yan Date: Tue, 22 Oct 2019 12:36:03 +0000 Subject: [PATCH 4/6] build: Don't handle apns-conf Leave it to vendor/lineage instead Change-Id: I743e2d8ab8b6527c887b4d9bbc219ff4dcf6a9ba --- target/product/full_base_telephony.mk | 5 ----- target/product/gsi_common.mk | 7 ------- target/product/mainline.mk | 4 ---- 3 files changed, 16 deletions(-) diff --git a/target/product/full_base_telephony.mk b/target/product/full_base_telephony.mk index e3442147a9..0aa9e7700b 100644 --- a/target/product/full_base_telephony.mk +++ b/target/product/full_base_telephony.mk @@ -30,10 +30,5 @@ endif PRODUCT_COPY_FILES := \ frameworks/native/data/etc/handheld_core_hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/handheld_core_hardware.xml -ifeq ($(LINEAGE_BUILD),) -PRODUCT_COPY_FILES += \ - device/sample/etc/apns-full-conf.xml:system/etc/apns-conf.xml -endif - $(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/telephony.mk) diff --git a/target/product/gsi_common.mk b/target/product/gsi_common.mk index 6507adb95f..ff19f1d3cd 100644 --- a/target/product/gsi_common.mk +++ b/target/product/gsi_common.mk @@ -92,13 +92,6 @@ PRODUCT_PACKAGES += \ WAPPushManager \ WallpaperPicker \ -# Telephony: -# Provide a APN configuration to GSI product -ifeq ($(LINEAGE_BUILD),) -PRODUCT_COPY_FILES += \ - device/sample/etc/apns-full-conf.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/apns-conf.xml -endif - # NFC: # Provide a libnfc-nci.conf to GSI product PRODUCT_COPY_FILES += \ diff --git a/target/product/mainline.mk b/target/product/mainline.mk index ca16fc6564..70da48b256 100644 --- a/target/product/mainline.mk +++ b/target/product/mainline.mk @@ -40,7 +40,3 @@ endif PRODUCT_PACKAGES += \ PhotoTable \ WallpaperPicker \ - -ifeq ($(LINEAGE_BUILD),) -PRODUCT_COPY_FILES += device/sample/etc/apns-full-conf.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/apns-conf.xml -endif -- GitLab From 8d8ae41b25666fc49f8c103d47fa75253c437132 Mon Sep 17 00:00:00 2001 From: Alexandre Roux D'Anzi Date: Wed, 14 Oct 2020 14:01:44 +0200 Subject: [PATCH 5/6] build option to pack prebuilt boot.img --- core/Makefile | 8 ++++ tools/releasetools/add_img_to_target_files.py | 43 ++++++++++++++----- 2 files changed, 41 insertions(+), 10 deletions(-) diff --git a/core/Makefile b/core/Makefile index c5d0e88752..1f0872a242 100644 --- a/core/Makefile +++ b/core/Makefile @@ -4160,6 +4160,14 @@ endif # BOARD_PREBUILT_DTBOIMAGE @# INSTALLED_RADIOIMAGE_TARGET. $(hide) $(foreach part,$(BOARD_PACK_RADIOIMAGES), \ echo $(part) >> $(zip_root)/META/pack_radioimages.txt;) + + + + @# The boot image in BOARD_PACK_BOOTIMAGE will be additionally copied from RADIO/ into + @# IMAGES/, which then will be added into -img.zip. + $(hide) $(foreach part,$(BOARD_PACK_BOOTIMAGE), \ + echo $(part) >> $(zip_root)/META/pack_bootimage.txt;) + @# Run fs_config on all the system, vendor, boot ramdisk, @# and recovery ramdisk files in the zip, and save the output ifdef BUILDING_SYSTEM_IMAGE diff --git a/tools/releasetools/add_img_to_target_files.py b/tools/releasetools/add_img_to_target_files.py index 96b7f0b04d..78b030d42c 100755 --- a/tools/releasetools/add_img_to_target_files.py +++ b/tools/releasetools/add_img_to_target_files.py @@ -781,16 +781,22 @@ def AddImagesToTargetFiles(filename): banner("boot") # common.GetBootableImage() returns the image directly if present. - boot_image = common.GetBootableImage( - "IMAGES/boot.img", "boot.img", OPTIONS.input_tmp, "BOOT") - # boot.img may be unavailable in some targets (e.g. aosp_arm64). - if boot_image: - partitions['boot'] = os.path.join(OPTIONS.input_tmp, "IMAGES", "boot.img") - if not os.path.exists(partitions['boot']): - boot_image.WriteToDir(OPTIONS.input_tmp) - if output_zip: - boot_image.AddToZip(output_zip) - + pack_bootimage_txt = os.path.join( + OPTIONS.input_tmp, "META", "pack_bootimage.txt") + if os.path.exists(pack_bootimage_txt): + with open(pack_bootimage_txt) as f: + AddPackBootImage(output_zip, f.readlines()) + else: + boot_image = common.GetBootableImage( + "IMAGES/boot.img", "boot.img", OPTIONS.input_tmp, "BOOT") + print("OPTIONS.input_tmp "+OPTIONS.input_tmp) + # boot.img may be unavailable in some targets (e.g. aosp_arm64). + if boot_image: + partitions['boot'] = os.path.join(OPTIONS.input_tmp, "IMAGES", "boot.img") + if not os.path.exists(partitions['boot']): + boot_image.WriteToDir(OPTIONS.input_tmp) + if output_zip: + boot_image.AddToZip(output_zip) recovery_image = None if has_recovery: banner("recovery") @@ -924,6 +930,23 @@ def AddImagesToTargetFiles(filename): OPTIONS.replace_updated_files_list) +def AddPackBootImage(output_zip, images): + image = images[0] + img_name = image.strip() + _, ext = os.path.splitext(img_name) + if not ext: + img_name += ".img" + img_boot_path = os.path.join(OPTIONS.input_tmp, "IMAGES", "boot.img") + shutil.copy(img_name, img_boot_path) + prebuilt_path = os.path.join(OPTIONS.input_tmp, "BOOT", "boot.img") + assert os.path.exists(img_boot_path), \ + "Failed to find %s at %s" % (img_name, img_boot_path) + if output_zip: + common.ZipWrite(output_zip, img_boot_path, "IMAGES/" + img_name) + else: + shutil.copy(img_boot_path, prebuilt_path) + + def main(argv): def option_handler(o, a): if o in ("-a", "--add_missing"): -- GitLab From f504ad7c2b695a30ade2086a5513c733654d6b40 Mon Sep 17 00:00:00 2001 From: Alexandre Roux D'Anzi Date: Wed, 14 Oct 2020 15:20:12 +0200 Subject: [PATCH 6/6] assign boot_image --- tools/releasetools/add_img_to_target_files.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/releasetools/add_img_to_target_files.py b/tools/releasetools/add_img_to_target_files.py index 78b030d42c..b01eb324f2 100755 --- a/tools/releasetools/add_img_to_target_files.py +++ b/tools/releasetools/add_img_to_target_files.py @@ -780,6 +780,7 @@ def AddImagesToTargetFiles(filename): logger.info("\n\n++++ %s ++++\n\n", s) banner("boot") + boot_image = None # common.GetBootableImage() returns the image directly if present. pack_bootimage_txt = os.path.join( OPTIONS.input_tmp, "META", "pack_bootimage.txt") -- GitLab