Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Serial configuration
- serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
- # Boot configuration
- default=0
- timeout = 10
- set CMDLINE="console=ttyS0,115200 console=tty0 quit"
- # Rauc scrupt stuff
- set ORDER="A B"
- set A_OK=0
- set B_OK=0
- set A_TRY=0
- set B_TRY=0
- load_env --file /boot/EFI/BOOT/grubenv
- # 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 0 ]; 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
- fi
- save_env --file /boot/EFI/BOOT/grubenv A_TRY B_TRY
- # Entries
- menuentry "Slot A (OK=$A_OK TRY=$A_TRY)" {
- linux /bzImage root=/dev/mmcblk1p2 rootwait rootwait rootfstype=ext4 $CMDLINE rauc.slot=A
- }
- menuentry "Slot B (OK=$B_OK TRY=$B_TRY)" {
- linux /bzImage root=/dev/mmcblk1p3 rootwait rootwait rootfstype=ext4 $CMDLINE rauc.slot=B
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement