2 # shebang is for editor file mode detection only
5 if [ -s $envfile ]; then
7 save_env
--file $envfile $var
12 function save_chosen
{
13 save_vars did_fai_check last_boot
16 # fai_check is so we can act like a pxe boot, but just for fai, and by
17 # using /stretch_bootstrap to do it. We toggle on and off the grub var
18 # did_fai_check so we can do the check every other boot. Then
19 # /debian_bootstrap checks for that var on boot and if we want to do a
20 # fai check, it does it, then reboots. But fai-check also sets
21 # did_fai_check to a 3rd state os_true which means we did the fai check,
22 # and we don't want to do it again. This is useful for systems without
23 # libreboot, although it's not used yet.
25 # We don't set this to fai check so we can't get into
26 # an infinite reboot cycle. We depend on the os to
27 # create the initial grubenv file.
28 set default
=/debianstretch_bootstrap
# could use 0 here.
31 for part
in (ahci
*4) (ata
*4); do
33 if [ -s $envfile ]; then
34 load_env
--file $envfile
35 if [ x
$did_fai_check == xfalse
-a x
$last_boot != x
$default ]; then
37 elif [ ! -z $last_boot ]; then
38 set default
=$last_boot
46 bs_dir
=/debianstretch_bootstrap
47 menuentry
$bs_dir --id=$bs_dir {
48 # note, we might be able to use $chosen and avoid setting this here,
49 # and set it inside save_chosen. but I haven't tested it,
50 # it's just one less line of repitition.
53 configfile
$bs_dir/boot
/grub
/grub.cfg
56 for dir
in /boot_
*; do
57 if [ $dir == '/boot_*' ]; then
60 menuentry
$dir --id=$dir {
63 configfile
$1/grub
/grub.cfg
67 menuentry fai-check
--id=fai-check
{
69 save_vars did_fai_check
70 configfile
$bs_dir/boot
/grub
/grub.cfg