X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=fai%2Fconfig%2Fdistro-install-common%2Flibreboot_grub.cfg;h=9ea539022947821a1a1657d1755d50032c298e34;hb=137ffae7de84a51c4b438ccf2fb50f5571f522a6;hp=b48ea52889d2cff95d015242dcd410bef1e29370;hpb=d6df8985152a6c17523cedc3fee62694544eeaf2;p=automated-distro-installer diff --git a/fai/config/distro-install-common/libreboot_grub.cfg b/fai/config/distro-install-common/libreboot_grub.cfg index b48ea52..9ea5390 100644 --- a/fai/config/distro-install-common/libreboot_grub.cfg +++ b/fai/config/distro-install-common/libreboot_grub.cfg @@ -10,21 +10,30 @@ function save_vars { } function save_chosen { - last_boot=$CHOSEN save_vars did_fai_check last_boot } -# we don't set this to fai check so we can't get into +# fai_check is so we can act like a pxe boot, but just for fai, and by +# using /bullseye_bootstrap to do it. We toggle on and off the grub var +# did_fai_check so we can do the check every other boot. Then +# /debian_bootstrap checks for that var on boot and if we want to do a +# fai check, it does it, then reboots. But fai-check also sets +# did_fai_check to a 3rd state os_true which means we did the fai check, +# and we don't want to do it again. This is useful for systems without +# libreboot, although it's not used yet. + +# We don't set this to fai check so we can't get into # an infinite reboot cycle. We depend on the os to # create the initial grubenv file. -set default=/debianstable_bootstrap # could use 0 here. +set default=/debianbullseye_bootstrap # could use 0 here. set timeout=1 +# grub_extn for part in (ahci*4) (ata*4); do envfile=$part/grubenv if [ -s $envfile ]; then load_env --file $envfile - if [ x$did_fai_check != xtrue -a x$last_boot != x$default ]; then + if [ x$did_fai_check == xfalse -a x$last_boot != x$default ]; then set default=fai-check elif [ ! -z $last_boot ]; then set default=$last_boot @@ -35,8 +44,12 @@ done did_fai_check=false -bs_dir=/debianstable_bootstrap +bs_dir=/debianbullseye_bootstrap menuentry $bs_dir --id=$bs_dir { + # note, we might be able to use $chosen and avoid setting this here, + # and set it inside save_chosen. but I haven't tested it, + # it's just one less line of repitition. + last_boot=$1 save_chosen configfile $bs_dir/boot/grub/grub.cfg } @@ -46,6 +59,7 @@ for dir in /boot_*; do break fi menuentry $dir --id=$dir { + last_boot=$1 save_chosen configfile $1/grub/grub.cfg }