summaryrefslogtreecommitdiff
path: root/anykernel.sh
diff options
context:
space:
mode:
authorosm0sis <osm0sis@outlook.com>2016-11-25 08:34:22 -0400
committerosm0sis <osm0sis@outlook.com>2016-11-26 10:25:15 -0400
commiteeddea9c3b727bb494bd728caa68c7c3d4dbb059 (patch)
treedf7414a2fce4968cb29c5685b5c936dd72272248 /anykernel.sh
parent8534510bf849f092b0eb4424502b8186f9d0ab7d (diff)
AK2: add support for slot-based systems (ie. Pixel support!)
- new shell variable "is_slot_device" to enable slot suffix detection ("block" shell variable remains the partition filepath minus the suffix) Notes: on slot-based systems now the boot.img contains only the recovery ramdisk, not rootfs, by default, but when rooted contains both, with rootfs in /boot. Since modifications to both recovery and (when rooted) boot ramdisks are now possible through AK2 no other behavior is changed so that the dev may modify what they wish, e.g. to add files to rooted boot ramdisk put them in AK2's ramdisk/ folder in a boot/ subfolder, and to make modifications to rooted boot files add "boot/" to the filenames used with the commands.
Diffstat (limited to 'anykernel.sh')
-rwxr-xr-xanykernel.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/anykernel.sh b/anykernel.sh
index 5e8b781..94a8741 100755
--- a/anykernel.sh
+++ b/anykernel.sh
@@ -16,6 +16,7 @@ device.name5=
# shell variables
block=/dev/block/platform/omap/omap_hsmmc.0/by-name/boot;
+is_slot_device=0;
## end setup
@@ -30,6 +31,15 @@ patch=/tmp/anykernel/patch;
chmod -R 755 $bin;
mkdir -p $ramdisk $split_img;
+if [ "$is_slot_device" == 1 ]; 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);
+ test "$slot" && block=$block$slot;
+ if [ $? != 0 -o ! -e "$block" ]; then
+ ui_print " "; ui_print "Unable to determine active boot slot. Aborting..."; exit 1;
+ fi;
+fi;
+
OUTFD=/proc/self/fd/$1;
# ui_print <text>