Skip to content

Commit

Permalink
chore: update Grub boot scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
koehlma committed May 12, 2024
1 parent b07c2fe commit b7b244a
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 21 deletions.
26 changes: 26 additions & 0 deletions boot/grub/first.grub.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
set rugpi_bootpart=2
set rugpi_boot_spare=false

set RUGPI_DEFAULT_ENV=(${root})/rugpi/bootpart.default.grubenv
set RUGPI_SPARE_ENV=(${root})/rugpi/boot_spare.grubenv

load_env -f "${RUGPI_DEFAULT_ENV}"
load_env -f "${RUGPI_SPARE_ENV}"

if [ "${rugpi_boot_spare}" = "true" ]; then
if [ "${rugpi_bootpart}" = "2" ]; then
set rugpi_bootpart=3
elif [ "${rugpi_bootpart}" = "3" ]; then
set rugpi_bootpart=2
fi

set rugpi_boot_spare=false
save_env -f "${RUGPI_SPARE_ENV}" rugpi_boot_spare
set rugpi_boot_spare=true
fi

# TODO: This should not be hardcoded to `hd0`, either use `search` or extract the correct
# root drive from the existing value of `root` in some way.
set root=(hd0,${rugpi_bootpart})

source (${root})/second.grub.cfg
21 changes: 0 additions & 21 deletions boot/grub/grub.cfg

This file was deleted.

3 changes: 3 additions & 0 deletions boot/grub/second.grub.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
linux /vmlinuz ro init=/usr/bin/rugpi-ctrl
initrd /initrd.img
boot

0 comments on commit b7b244a

Please sign in to comment.