mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-22 07:57:39 +00:00
find_boot_image: keep symlink
This commit is contained in:
parent
821a6c6954
commit
ab04c6ab39
@ -207,7 +207,7 @@ find_block() {
|
||||
for BLOCK in "$@"; do
|
||||
DEVICE=$(find /dev/block \( -type b -o -type c -o -type l \) -iname $BLOCK | head -n 1) 2>/dev/null
|
||||
if [ ! -z $DEVICE ]; then
|
||||
readlink -f $DEVICE
|
||||
echo $DEVICE
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
@ -226,7 +226,7 @@ find_block() {
|
||||
for DEV in "$@"; do
|
||||
DEVICE=$(find /dev \( -type b -o -type c -o -type l \) -maxdepth 1 -iname $DEV | head -n 1) 2>/dev/null
|
||||
if [ ! -z $DEVICE ]; then
|
||||
readlink -f $DEVICE
|
||||
echo $DEVICE
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
@ -371,13 +371,13 @@ find_boot_image() {
|
||||
BOOTIMAGE=
|
||||
if $RECOVERYMODE; then
|
||||
BOOTIMAGE=$(find_block "recovery$SLOT" "sos")
|
||||
elif [ -L "/dev/block/by-name/init_boot$SLOT" ] && uname -r | grep -vq "android12-"; then
|
||||
elif [ -e "/dev/block/by-name/init_boot$SLOT" ] && uname -r | grep -vq "android12-"; then
|
||||
# init_boot is only used with GKI 13+. It is possible that some devices with init_boot
|
||||
# partition still uses Android 12 GKI, so we need to explicitly detect that scenario.
|
||||
BOOTIMAGE=$(readlink -f "/dev/block/by-name/init_boot$SLOT")
|
||||
elif [ -L "/dev/block/by-name/boot$SLOT" ]; then
|
||||
BOOTIMAGE="/dev/block/by-name/init_boot$SLOT"
|
||||
elif [ -e "/dev/block/by-name/boot$SLOT" ]; then
|
||||
# Standard location since AOSP Android 10+
|
||||
BOOTIMAGE=$(readlink -f "/dev/block/by-name/boot$SLOT")
|
||||
BOOTIMAGE="/dev/block/by-name/boot$SLOT"
|
||||
elif [ -n "$SLOT" ]; then
|
||||
# Fallback for A/B devices running < Android 10
|
||||
BOOTIMAGE=$(find_block "ramdisk$SLOT" "boot$SLOT")
|
||||
|
Loading…
x
Reference in New Issue
Block a user