Skip to content

Commit 6ed1e33

Browse files
committed
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.
1 parent 8534510 commit 6ed1e33

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Diff for: anykernel.sh

+10
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ device.name5=
1616

1717
# shell variables
1818
block=/dev/block/platform/omap/omap_hsmmc.0/by-name/boot;
19+
is_slot_device=0;
1920

2021
## end setup
2122

@@ -30,6 +31,15 @@ patch=/tmp/anykernel/patch;
3031
chmod -R 755 $bin;
3132
mkdir -p $ramdisk $split_img;
3233

34+
if [ "$is_slot_device" == 1 ]; then
35+
slot=$(getprop ro.boot.slot_suffix 2>/dev/null);
36+
test ! "$slot" && slot=$(grep -o 'androidboot.slot_suffix=.*$' /proc/cmdline | cut -d\ -f1 | cut -d= -f2);
37+
test "$slot" && block=$block$slot;
38+
if [ $? != 0 -o ! -e "$block" ]; then
39+
ui_print " "; ui_print "Unable to determine active boot slot. Aborting..."; exit 1;
40+
fi;
41+
fi;
42+
3343
OUTFD=/proc/self/fd/$1;
3444

3545
# ui_print <text>

0 commit comments

Comments
 (0)