Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b5b3bc6d authored by Bowgo Tsai's avatar Bowgo Tsai
Browse files

Do not remove init.recovery.*.rc in recovery root

When making recovery image, it removes init*.rc under recovery root,
then copies init.recovery.*.rc from normal root to recovery root.

However, init.recovery.*.rc shouldn't exist in normal root because it
is only needed for recovery mode.

This change removes init*.rc under recovery root as before but skips
removing init.recovery.*.rc. So in device/*/*.mk, we can just copy
init.recovery.*.rc to recovery root without coping it to normal root
directory.

Bug: 65570851
Test: normal/recovery boot sailfish, checks init.recovery.sailfish.rc
      only exists in recovery root.
Change-Id: I069596fe2192d9dcbbdf2b77079b93ede3ed39ae
parent b463cdc8
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1191,7 +1191,8 @@ define build-recoveryimage-target
  @echo Modifying ramdisk contents...
  $(if $(BOARD_RECOVERY_KERNEL_MODULES), \
    $(call build-image-kernel-modules,$(BOARD_RECOVERY_KERNEL_MODULES),$(TARGET_RECOVERY_ROOT_OUT),,$(call intermediates-dir-for,PACKAGING,depmod_recovery)))
  $(hide) rm -f $(TARGET_RECOVERY_ROOT_OUT)/init*.rc
  # Removes $(TARGET_RECOVERY_ROOT_OUT)/init*.rc EXCEPT init.recovery*.rc.
  $(hide) find $(TARGET_RECOVERY_ROOT_OUT) -maxdepth 1 -name 'init*.rc' -type f -not -name "init.recovery.*.rc" | xargs rm -f
  $(hide) cp -f $(recovery_initrc) $(TARGET_RECOVERY_ROOT_OUT)/
  $(hide) cp $(TARGET_ROOT_OUT)/init.recovery.*.rc $(TARGET_RECOVERY_ROOT_OUT)/ || true # Ignore error when the src file doesn't exist.
  $(hide) mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/res