Skip to content

Commit

Permalink
modify the way update-binary mounts /system
Browse files Browse the repository at this point in the history
I'm extremely new to magisk modules (in fact, this is the first time Iook into one), so excuse the ignorance.

This PR should solve issue Magisk-Modules-Repo#16 as it mounts /system as it does in https://github.com/nathanchance/magisk-modules/blob/master/META-INF/com/google/android/update-binary .

This removes the systemless check (and mounts /data twice), but it works if installed from the magisk app module manager. Probably needs some modification before merging
  • Loading branch information
FAB1150 authored Feb 9, 2024
1 parent 0934acc commit 6872d6e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions META-INF/com/google/android/update-binary
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,17 @@ is_mounted /data || mount /data || abort "Error occured while mounting /data"
MAGISK_VER=$(getprop MAGISK_VER_CODE $DE_DATA/magisk/util_functions.sh)
[ -n "$MAGISK_VER" ] && [ $MAGISK_VER -ge 18105 ] || SYSTEMLESS=false

$SYSTEMLESS && RW=ro || RW=rw
mount -o $RW /system || mount -o $RW,remount /system || abort "Error occured while mounting /system"
ui_print "- Mounting /system(ro), /vendor(ro), /data, /cache"
mount -o ro /system 2>/dev/null
mount -o ro /vendor 2>/dev/null
mount /data 2>/dev/null
mount /cache 2>/dev/null

if [ ! -f '/system/build.prop' ]; then
ui_print "! Failed: /system could not be mounted!"
exit 1
fi

if [ -f /system/init ]; then
mkdir /system_root
mount -o move /system /system_root
Expand Down

0 comments on commit 6872d6e

Please sign in to comment.