Skip to content

Commit

Permalink
module: Try to explicitly mount dm-linear block devices
Browse files Browse the repository at this point in the history
The source field for dm-linear block devices in the recovery's fstab is
not an actual file path.

Fixes: #338

Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
  • Loading branch information
chenxiaolong committed Sep 10, 2023
1 parent ae0c4ab commit e461578
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions app/magisk/update-binary
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,18 @@ if [ -f /sbin/recovery ] || [ -f /system/bin/recovery ]; then
set -exu

ui_print 'Mounting system'
if mount /system_root; then

slot=$(getprop ro.boot.slot_suffix)

if mount /system_root || mount /dev/block/mapper/system_root"${slot}" /system_root; then
mount -o remount,rw /system_root
root_dir=/system_root
else
mount /system
elif mount /system || mount /dev/block/mapper/system"${slot}" /system; then
mount -o remount,rw /system
root_dir=/
else
ui_print 'Failed to mount system partition'
exit 1
fi

ui_print 'Extracting files'
Expand Down

0 comments on commit e461578

Please sign in to comment.