-
Notifications
You must be signed in to change notification settings - Fork 959
Commit
* Use GRUB bootloader for all UEFI platforms * Introduce and use file_env command * Compress squashfs for aarch64 as well
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
cmdline="" | ||
console=tty1 console=ttyS0 |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
set default=99 | ||
set timeout=5 | ||
|
||
set ORDER="A B" | ||
set A_OK=0 | ||
set B_OK=0 | ||
set A_TRY=0 | ||
set B_TRY=0 | ||
set MACHINE_ID="" | ||
load_env | ||
|
||
# select bootable slot | ||
for SLOT in $ORDER; do | ||
if [ "$SLOT" == "A" ]; then | ||
INDEX=0 | ||
OK=$A_OK | ||
TRY=$A_TRY | ||
A_TRY=1 | ||
fi | ||
if [ "$SLOT" == "B" ]; then | ||
INDEX=1 | ||
OK=$B_OK | ||
TRY=$B_TRY | ||
B_TRY=1 | ||
fi | ||
if [ "$OK" -eq 1 -a "$TRY" -eq 0 ]; then | ||
default=$INDEX | ||
break | ||
fi | ||
done | ||
|
||
# reset booted flags | ||
if [ "$default" -eq 99 ]; then | ||
if [ "$A_OK" -eq 1 -a "$A_TRY" -eq 1 ]; then | ||
A_TRY=0 | ||
fi | ||
if [ "$B_OK" -eq 1 -a "$B_TRY" -eq 1 ]; then | ||
B_TRY=0 | ||
fi | ||
default=0 | ||
fi | ||
|
||
save_env A_TRY A_OK B_TRY B_OK ORDER MACHINE_ID | ||
|
||
default_cmdline="rootwait zram.enabled=1 zram.num_devices=3 apparmor=1 security=apparmor systemd.machine_id=$MACHINE_ID cgroup_enable=memory fsck.repair=yes" | ||
file_env -f ($root)/cmdline.txt cmdline | ||
|
||
# root is a full HDD/partition definition in GRUB format like hd0,gpt1 | ||
# We extract the part before the comma to then append our own partition index | ||
# at the end. This is hacky but the best way I found | ||
regexp --set 1:boothd (.+),.+ ${root} | ||
|
||
menuentry "Slot A (OK=$A_OK TRY=$A_TRY)" { | ||
linux (${boothd},gpt2)/bzImage root=PARTUUID=8d3d53e3-6d49-4c38-8349-aff6859e82fd $default_cmdline $cmdline rauc.slot=A | ||
} | ||
|
||
menuentry "Slot B (OK=$B_OK TRY=$B_TRY)" { | ||
linux (${boothd},gpt4)/bzImage root=PARTUUID=a3ec664e-32ce-4665-95ea-7ae90ce9aa20 $default_cmdline $cmdline rauc.slot=B | ||
} |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.