Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update-binary: Add support for A/B devices using static partitions #570

Merged
merged 1 commit into from
Jul 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions app/magisk/update-binary
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,18 @@ if [ -f /sbin/recovery ] || [ -f /system/bin/recovery ]; then

ui_print 'Mounting system'

if [[ "$(getprop ro.boot.dynamic_partitions)" == true ]]; then
slot=$(getprop ro.boot.slot_suffix)

if [[ -e /dev/block/mapper/system"${slot}" ]]; then
ui_print "- Device uses dynamic partitions"
slot=$(getprop ro.boot.slot_suffix)
block_dev=/dev/block/mapper/system"${slot}"
blockdev --setrw "${block_dev}"
else
elif [[ -e /dev/block/bootdevice/by-name/system"${slot}" ]]; then
ui_print "- Device uses static partitions"
block_dev=/dev/block/bootdevice/by-name/system
block_dev=/dev/block/bootdevice/by-name/system"${slot}"
else
ui_print "- System block device not found"
exit 1
fi

ui_print "- System block device: ${block_dev}"
Expand Down