summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorosm0sis <osm0sis@outlook.com>2018-03-23 12:19:08 -0300
committerosm0sis <osm0sis@outlook.com>2018-03-23 12:19:08 -0300
commit19a49f1f34f817af47b9e375009e883ff20b925b (patch)
tree6147a32cf5b8ce84fc3e519bdbd0089cf950b0a5 /tools
parent79b4c2c5931e475ed6c76bee53820eb20e2375df (diff)
AK2: allow is_slot_device=auto (#21)
- for use with broad, device non-specific AK2-based mod zips
Diffstat (limited to 'tools')
-rwxr-xr-xtools/ak2-core.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/ak2-core.sh b/tools/ak2-core.sh
index 7e326e3..6fe29be 100755
--- a/tools/ak2-core.sh
+++ b/tools/ak2-core.sh
@@ -518,7 +518,7 @@ fi;
test ! -d "$ramdisk" && mkdir -p $ramdisk;
# slot detection enabled by is_slot_device=1 (from anykernel.sh)
-if [ "$is_slot_device" == 1 ]; then
+if [ "$is_slot_device" == 1 -o "$is_slot_device" == "auto" ]; then
slot=$(getprop ro.boot.slot_suffix 2>/dev/null);
test ! "$slot" && slot=$(grep -o 'androidboot.slot_suffix=.*$' /proc/cmdline | cut -d\ -f1 | cut -d= -f2);
if [ ! "$slot" ]; then
@@ -526,8 +526,10 @@ if [ "$is_slot_device" == 1 ]; then
test ! "$slot" && slot=$(grep -o 'androidboot.slot=.*$' /proc/cmdline | cut -d\ -f1 | cut -d= -f2);
test "$slot" && slot=_$slot;
fi;
- test "$slot" && block=$block$slot;
- if [ $? != 0 -o ! -e "$block" ]; then
+ if [ "$slot" ]; then
+ test -e "$block$slot" && block=$block$slot;
+ fi;
+ if [ $? != 0 -a "$is_slot_device" == 1 ]; then
ui_print " "; ui_print "Unable to determine active boot slot. Aborting..."; exit 1;
fi;
fi;