Fix scripts

manager.sh + boot_patch.sh:
- all listed files from boot_patch.sh header are required for boot patching, but stub.apk was being removed so install_magisk via addon.d.sh would fail without it; leave it in place

addon.d.sh:
- remove old redundant recovery_actions call (it's also performed by setup_flashable in initialize)
- print ABI to match flash_script.sh output

boot_patch.sh:
- catch and abort on any errors from ramdisk.cpio patching in the future

util_functions.sh:
- fix hiding of mount_partitions /system_root umount stderr
- quote mount_apex .pb DEST name parsing charset for safety even though both work

Fixes #6828
This commit is contained in:
osm0sis
2023-04-05 22:53:55 -03:00
committed by John Wu
parent a70c73bffd
commit 18fe0e6442
4 changed files with 10 additions and 11 deletions

View File

@ -273,8 +273,8 @@ mount_partitions() {
# Mount ro partitions
if is_mounted /system_root; then
umount /system 2&>/dev/null
umount /system_root 2&>/dev/null
umount /system 2>/dev/null
umount /system_root 2>/dev/null
fi
mount_ro_ensure "system$SLOT app$SLOT" /system
if [ -f /system/init -o -L /system/init ]; then
@ -329,7 +329,7 @@ mount_apex() {
[ -f /apex/original_apex ] && APEX=/apex/original_apex # unzip doesn't do return codes
# APEX APKs, extract and loop mount
unzip -qo $APEX apex_payload.img -d /apex
DEST=$(unzip -qp $APEX apex_manifest.pb | strings | head -n 1 | tr -dc [:alnum:].-_'\n')
DEST=$(unzip -qp $APEX apex_manifest.pb | strings | head -n 1 | tr -dc '[:alnum:].-_\n')
[ -z $DEST ] && DEST=$(unzip -qp $APEX apex_manifest.json | sed -n $PATTERN)
[ -z $DEST ] && continue
DEST=/apex/$DEST
@ -345,7 +345,7 @@ mount_apex() {
if [ -f $APEX/apex_manifest.json ]; then
DEST=/apex/$(sed -n $PATTERN $APEX/apex_manifest.json)
elif [ -f $APEX/apex_manifest.pb ]; then
DEST=/apex/$(strings $APEX/apex_manifest.pb | head -n 1 | tr -dc [:alnum:].-_'\n')
DEST=/apex/$(strings $APEX/apex_manifest.pb | head -n 1 | tr -dc '[:alnum:].-_\n')
else
continue
fi