AK3: partition auto-detect improvements
- remove whitelist to allow auto-detect for any partition based on by-name filename only - add more error catching for manually specified partition paths - restore Huawei Treble partitions to auto-detect (kernel, ramdisk and recovery_ramdisk)
This commit is contained in:
2 files changed
+21
-21
No files matched your search
@@ -3,4 +3,4 @@
|
|||||||
# Dummy file; update-binary is a shell script (DO NOT CHANGE)
|
# Dummy file; update-binary is a shell script (DO NOT CHANGE)
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# AK_BASE_VERSION=20221111
|
# AK_BASE_VERSION=20221201
|
||||||
+20
-20
@@ -821,17 +821,24 @@ setup_ak() {
|
|||||||
touch $blockfiles/current;
|
touch $blockfiles/current;
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
# target block partition detection enabled by block=boot recovery init_boot vendor_boot or auto (from anykernel.sh)
|
# target block partition detection enabled by block=<partition filename> or auto (from anykernel.sh)
|
||||||
case $block in
|
case $block in
|
||||||
auto|"") block=boot;;
|
auto|"") block=boot;;
|
||||||
esac;
|
esac;
|
||||||
case $block in
|
case $block in
|
||||||
boot|recovery|init_boot|vendor_boot)
|
/dev/*)
|
||||||
|
if [ "$slot" ] && [ -e "$block$slot" ]; then
|
||||||
|
target=$block$slot;
|
||||||
|
elif [ -e "$block" ]; then
|
||||||
|
target=$block;
|
||||||
|
fi;
|
||||||
|
;;
|
||||||
|
*)
|
||||||
case $block in
|
case $block in
|
||||||
boot) parttype="boot BOOT LNX android_boot bootimg KERN-A kernel KERNEL";;
|
boot|kernel) parttype="boot BOOT LNX android_boot bootimg KERN-A kernel KERNEL";;
|
||||||
recovery) parttype="recovery RECOVERY SOS android_recovery";;
|
recovery|recovery_ramdisk) parttype="recovery RECOVERY SOS android_recovery recovery_ramdisk";;
|
||||||
init_boot) parttype="init_boot";;
|
init_boot|ramdisk) parttype="init_boot ramdisk";;
|
||||||
vendor_boot) parttype="vendor_boot";;
|
*) parttype=$block;;
|
||||||
esac;
|
esac;
|
||||||
for name in $parttype; do
|
for name in $parttype; do
|
||||||
for part in $name$slot $name; do
|
for part in $name$slot $name; do
|
||||||
@@ -843,9 +850,7 @@ setup_ak() {
|
|||||||
else
|
else
|
||||||
abort "Unable to determine mtd $block partition. Aborting...";
|
abort "Unable to determine mtd $block partition. Aborting...";
|
||||||
fi;
|
fi;
|
||||||
if [ -e /dev/mtd/$mtdname ]; then
|
[ -e /dev/mtd/$mtdname ] && target=/dev/mtd/$mtdname;
|
||||||
target=/dev/mtd/$mtdname;
|
|
||||||
fi;
|
|
||||||
elif [ -e /dev/block/by-name/$part ]; then
|
elif [ -e /dev/block/by-name/$part ]; then
|
||||||
target=/dev/block/by-name/$part;
|
target=/dev/block/by-name/$part;
|
||||||
elif [ -e /dev/block/bootdevice/by-name/$part ]; then
|
elif [ -e /dev/block/bootdevice/by-name/$part ]; then
|
||||||
@@ -860,18 +865,13 @@ setup_ak() {
|
|||||||
[ "$target" ] && break 2;
|
[ "$target" ] && break 2;
|
||||||
done;
|
done;
|
||||||
done;
|
done;
|
||||||
if [ "$target" ]; then
|
|
||||||
block=$(ls $target 2>/dev/null);
|
|
||||||
else
|
|
||||||
abort "Unable to determine $block partition. Aborting...";
|
|
||||||
fi;
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
if [ "$slot" ]; then
|
|
||||||
[ -e "$block$slot" ] && block=$block$slot;
|
|
||||||
fi;
|
|
||||||
;;
|
;;
|
||||||
esac;
|
esac;
|
||||||
|
if [ "$target" ]; then
|
||||||
|
block=$(ls $target 2>/dev/null);
|
||||||
|
else
|
||||||
|
abort "Unable to determine $block partition. Aborting...";
|
||||||
|
fi;
|
||||||
if [ ! "$no_block_display" ]; then
|
if [ ! "$no_block_display" ]; then
|
||||||
ui_print "$block";
|
ui_print "$block";
|
||||||
fi;
|
fi;
|
||||||
|
|||||||
Reference in new issue
Block a user