|
| 1 | +From 12382e7d66d993d89e52e840e7965009de2f81e5 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Samuel Dionne-Riel <samuel@dionne-riel.com> |
| 3 | +Date: Sat, 24 Apr 2021 21:05:00 -0400 |
| 4 | +Subject: [PATCH] Work around source files being read-only |
| 5 | + |
| 6 | +--- |
| 7 | + core/Makefile | 33 +++++++++++++++++---------------- |
| 8 | + 1 file changed, 17 insertions(+), 16 deletions(-) |
| 9 | + |
| 10 | +diff --git a/core/Makefile b/core/Makefile |
| 11 | +index 2f7219daa..43017a35b 100644 |
| 12 | +--- a/core/Makefile |
| 13 | ++++ b/core/Makefile |
| 14 | +@@ -84,7 +84,7 @@ gen := $(OUT_DOCS)/index.html |
| 15 | + ALL_DOCS += $(gen) |
| 16 | + $(gen): frameworks/base/docs/docs-redirect-index.html |
| 17 | + @mkdir -p $(dir $@) |
| 18 | +- @cp -f $< $@ |
| 19 | ++ @cp --no-preserve=owner,mode -f $< $@ |
| 20 | + endif |
| 21 | + |
| 22 | + ndk_doxygen_out := $(OUT_NDK_DOCS) |
| 23 | +@@ -1052,7 +1052,7 @@ $(TARGET_OUT_ETC)/update_engine/update-payload-key.pub.pem: $(addsuffix .x509.pe |
| 24 | + |
| 25 | + ALL_DEFAULT_INSTALLED_MODULES += $(TARGET_RECOVERY_ROOT_OUT)/etc/update_engine/update-payload-key.pub.pem |
| 26 | + $(TARGET_RECOVERY_ROOT_OUT)/etc/update_engine/update-payload-key.pub.pem: $(TARGET_OUT_ETC)/update_engine/update-payload-key.pub.pem |
| 27 | +- $(hide) cp -f $< $@ |
| 28 | ++ $(hide) cp --no-preserve=owner,mode -f $< $@ |
| 29 | + endif |
| 30 | + endif |
| 31 | + |
| 32 | +@@ -1413,27 +1413,28 @@ define build-recoveryramdisk |
| 33 | + # Use rsync because "cp -Rf" fails to overwrite broken symlinks on Mac. |
| 34 | + $(hide) rsync -a --exclude=etc --exclude=sdcard --exclude=vendor $(IGNORE_RECOVERY_SEPOLICY) $(IGNORE_CACHE_LINK) $(TARGET_ROOT_OUT) $(TARGET_RECOVERY_OUT) |
| 35 | + # Copy adbd from system/bin to recovery/root/sbin |
| 36 | +- $(hide) cp -f $(TARGET_OUT_EXECUTABLES)/adbd $(TARGET_RECOVERY_ROOT_OUT)/sbin/adbd |
| 37 | ++ $(hide) cp --no-preserve=owner,mode -f $(TARGET_OUT_EXECUTABLES)/adbd $(TARGET_RECOVERY_ROOT_OUT)/sbin/adbd |
| 38 | + # Modifying ramdisk contents... |
| 39 | + $(if $(BOARD_RECOVERY_KERNEL_MODULES), \ |
| 40 | + $(call build-image-kernel-modules,$(BOARD_RECOVERY_KERNEL_MODULES),$(TARGET_RECOVERY_ROOT_OUT),,$(call intermediates-dir-for,PACKAGING,depmod_recovery))) |
| 41 | + # Removes $(TARGET_RECOVERY_ROOT_OUT)/init*.rc EXCEPT init.recovery*.rc. |
| 42 | + $(hide) find $(TARGET_RECOVERY_ROOT_OUT) -maxdepth 1 -name 'init*.rc' -type f -not -name "init.recovery.*.rc" | xargs rm -f |
| 43 | +- $(hide) cp -f $(recovery_initrc) $(TARGET_RECOVERY_ROOT_OUT)/ |
| 44 | +- $(hide) cp $(TARGET_ROOT_OUT)/init.recovery.*.rc $(TARGET_RECOVERY_ROOT_OUT)/ || true # Ignore error when the src file doesn't exist. |
| 45 | ++ $(hide) cp --no-preserve=owner,mode -f $(recovery_initrc) $(TARGET_RECOVERY_ROOT_OUT)/ |
| 46 | ++ chmod -R +w $(TARGET_RECOVERY_ROOT_OUT) |
| 47 | ++ $(hide) cp --no-preserve=owner,mode $(TARGET_ROOT_OUT)/init.recovery.*.rc $(TARGET_RECOVERY_ROOT_OUT)/ || true # Ignore error when the src file doesn't exist. |
| 48 | + $(hide) mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/res |
| 49 | + $(hide) rm -rf $(TARGET_RECOVERY_ROOT_OUT)/res/* |
| 50 | +- $(hide) cp -rf $(recovery_resources_common)/* $(TARGET_RECOVERY_ROOT_OUT)/res |
| 51 | +- $(hide) cp -f $(recovery_font) $(TARGET_RECOVERY_ROOT_OUT)/res/images/font.png |
| 52 | ++ $(hide) cp --no-preserve=owner,mode -rf $(recovery_resources_common)/* $(TARGET_RECOVERY_ROOT_OUT)/res |
| 53 | ++ $(hide) cp --no-preserve=owner,mode -f $(recovery_font) $(TARGET_RECOVERY_ROOT_OUT)/res/images/font.png |
| 54 | + $(hide) $(foreach item,$(recovery_root_private), \ |
| 55 | +- cp -rf $(item) $(TARGET_RECOVERY_OUT)/;) |
| 56 | ++ cp --no-preserve=owner,mode -rf $(item) $(TARGET_RECOVERY_OUT)/;) |
| 57 | + $(hide) $(foreach item,$(TARGET_PRIVATE_RES_DIRS), \ |
| 58 | +- cp -rf $(item) $(TARGET_RECOVERY_ROOT_OUT)/$(newline)) |
| 59 | ++ cp --no-preserve=owner,mode -rf $(item) $(TARGET_RECOVERY_ROOT_OUT)/$(newline)) |
| 60 | + $(hide) $(foreach item,$(recovery_fstab), \ |
| 61 | +- cp -f $(item) $(TARGET_RECOVERY_ROOT_OUT)/etc/recovery.fstab) |
| 62 | ++ cp --no-preserve=owner,mode -f $(item) $(TARGET_RECOVERY_ROOT_OUT)/etc/recovery.fstab) |
| 63 | + $(if $(strip $(recovery_wipe)), \ |
| 64 | +- $(hide) cp -f $(recovery_wipe) $(TARGET_RECOVERY_ROOT_OUT)/etc/recovery.wipe) |
| 65 | +- $(hide) cp $(RECOVERY_INSTALL_OTA_KEYS) $(TARGET_RECOVERY_ROOT_OUT)/res/keys |
| 66 | ++ $(hide) cp --no-preserve=mode -f $(recovery_wipe) $(TARGET_RECOVERY_ROOT_OUT)/etc/recovery.wipe) |
| 67 | ++ $(hide) cp --no-preserve=owner,mode $(RECOVERY_INSTALL_OTA_KEYS) $(TARGET_RECOVERY_ROOT_OUT)/res/keys |
| 68 | + $(hide) cat $(INSTALLED_DEFAULT_PROP_TARGET) \ |
| 69 | + > $(TARGET_RECOVERY_ROOT_OUT)/prop.default |
| 70 | + $(if $(INSTALLED_VENDOR_DEFAULT_PROP_TARGET), \ |
| 71 | +@@ -1514,7 +1515,7 @@ $(recovery_uncompressed_ramdisk): $(MKBOOTFS) $(ADBD) \ |
| 72 | + $(BOARD_RECOVERY_KERNEL_MODULES) \ |
| 73 | + $(DEPMOD) |
| 74 | + $(call build-recoveryramdisk) |
| 75 | +- @echo ----- Making uncompressed recovery ramdisk ------ |
| 76 | ++ @echo ----- Making uncompressed recovery ramdisk YAY ------ |
| 77 | + $(hide) $(MKBOOTFS) $(TARGET_RECOVERY_ROOT_OUT) > $@ |
| 78 | + |
| 79 | + $(recovery_ramdisk): $(MINIGZIP) \ |
| 80 | +@@ -1857,7 +1858,7 @@ endif |
| 81 | + define build-boottarball-target |
| 82 | + $(hide) echo "Target boot fs tarball: $(INSTALLED_BOOTTARBALL_TARGET)" |
| 83 | + $(hide) mkdir -p $(PRODUCT_OUT)/boot |
| 84 | +- $(hide) cp -f $(INTERNAL_BOOTIMAGE_FILES) $(PRODUCT_OUT)/boot/. |
| 85 | ++ $(hide) cp --no-preserve=owner,mode -f $(INTERNAL_BOOTIMAGE_FILES) $(PRODUCT_OUT)/boot/. |
| 86 | + $(hide) echo $(INTERNAL_KERNEL_CMDLINE) > $(PRODUCT_OUT)/boot/cmdline |
| 87 | + $(hide) $(MKTARBALL) $(FS_GET_STATS) \ |
| 88 | + $(PRODUCT_OUT) boot $(PRIVATE_BOOT_TAR) \ |
| 89 | +@@ -3398,9 +3399,9 @@ $(INTERNAL_SDK_TARGET): $(deps) |
| 90 | + -v "DLL_EXTENSION=$(HOST_SHLIB_SUFFIX)" \ |
| 91 | + -v "FONT_OUT=$(SDK_FONT_TEMP)" \ |
| 92 | + -o $(PRIVATE_DIR) && \ |
| 93 | +- cp -f $(target_notice_file_txt) \ |
| 94 | ++ cp --no-preserve=owner,mode -f $(target_notice_file_txt) \ |
| 95 | + $(PRIVATE_DIR)/system-images/android-$(PLATFORM_VERSION)/$(TARGET_CPU_ABI)/NOTICE.txt && \ |
| 96 | +- cp -f $(tools_notice_file_txt) $(PRIVATE_DIR)/platform-tools/NOTICE.txt && \ |
| 97 | ++ cp --no-preserve=owner,mode -f $(tools_notice_file_txt) $(PRIVATE_DIR)/platform-tools/NOTICE.txt && \ |
| 98 | + HOST_OUT_EXECUTABLES=$(HOST_OUT_EXECUTABLES) HOST_OS=$(HOST_OS) \ |
| 99 | + development/build/tools/sdk_clean.sh $(PRIVATE_DIR) && \ |
| 100 | + chmod -R ug+rwX $(PRIVATE_DIR) && \ |
| 101 | +-- |
| 102 | +2.29.2 |
| 103 | + |
0 commit comments