X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=fai%2Fconfig%2Fdistro-install-common%2Flibreboot_grub.cfg;h=69e1c52db3a1eaa3a4d543f350ca1f1c1fdff0cb;hb=a2b8051e808621b9a33617d0c75d212bd2141ddc;hp=32ab3922a5a79945b50260007ece5148a6f498a7;hpb=e729557712e9355ffa9103e6083d1161d5fd6063;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 32ab392..69e1c52 100644 --- a/fai/config/distro-install-common/libreboot_grub.cfg +++ b/fai/config/distro-install-common/libreboot_grub.cfg @@ -13,7 +13,15 @@ function save_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 /debian_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 it 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. + +# 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. @@ -23,7 +31,7 @@ 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