Commit 901d22cd authored by osm0sis's avatar osm0sis Committed by John Wu

scripts: add boot_patch unpack error catching

- failure to unpack wasn't being caught so boot_patch would continue to build a new cpio out of nothing and attempt to repack it (identified in #4049)
parent 93e1266e
...@@ -86,6 +86,7 @@ ui_print "- Unpacking boot image" ...@@ -86,6 +86,7 @@ ui_print "- Unpacking boot image"
./magiskboot unpack "$BOOTIMAGE" ./magiskboot unpack "$BOOTIMAGE"
case $? in case $? in
0 ) ;;
1 ) 1 )
abort "! Unsupported/Unknown image format" abort "! Unsupported/Unknown image format"
;; ;;
...@@ -93,6 +94,9 @@ case $? in ...@@ -93,6 +94,9 @@ case $? in
ui_print "- ChromeOS boot image detected" ui_print "- ChromeOS boot image detected"
CHROMEOS=true CHROMEOS=true
;; ;;
* )
abort "! Unable to unpack boot image"
;;
esac esac
[ -f recovery_dtbo ] && RECOVERYMODE=true [ -f recovery_dtbo ] && RECOVERYMODE=true
...@@ -191,7 +195,7 @@ fi ...@@ -191,7 +195,7 @@ fi
################# #################
ui_print "- Repacking boot image" ui_print "- Repacking boot image"
./magiskboot repack "$BOOTIMAGE" || abort "! Unable to repack boot image!" ./magiskboot repack "$BOOTIMAGE" || abort "! Unable to repack boot image"
# Sign chromeos boot # Sign chromeos boot
$CHROMEOS && sign_chromeos $CHROMEOS && sign_chromeos
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment