From 33a9abc94665672e4e5692da64c1b3f026a62704 Mon Sep 17 00:00:00 2001 From: LoveSy Date: Sat, 24 Jun 2023 17:02:25 +0800 Subject: [PATCH] Fix backup fails when ramdisk does not exist --- scripts/boot_patch.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/boot_patch.sh b/scripts/boot_patch.sh index 41f5df822..abeb78785 100644 --- a/scripts/boot_patch.sh +++ b/scripts/boot_patch.sh @@ -112,9 +112,11 @@ ui_print "- Checking ramdisk status" if [ -e ramdisk.cpio ]; then ./magiskboot cpio ramdisk.cpio test STATUS=$? + SKIP_BACKUP="" else # Stock A only legacy SAR, or some Android 13 GKIs STATUS=0 + SKIP_BACKUP="#" fi case $((STATUS & 3)) in 0 ) # Stock boot @@ -193,7 +195,7 @@ fi "$SKIP64 add 0644 overlay.d/sbin/magisk64.xz magisk64.xz" \ "add 0644 overlay.d/sbin/stub.xz stub.xz" \ "patch" \ -"backup ramdisk.cpio.orig" \ +"$SKIP_BACKUP backup ramdisk.cpio.orig" \ "mkdir 000 .backup" \ "add 000 .backup/.magisk config" \ || abort "! Unable to patch ramdisk"