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 # we don't set this to fai check so we can't get into
17 # an infinite reboot cycle. We depend on the os to
18 # create the initial grubenv file.
19 set default
=/debianstable_bootstrap
# could use 0 here.
22 for part
in (ahci
*4) (ata
*4); do
24 if [ -s $envfile ]; then
25 load_env
--file $envfile
26 if [ x
$did_fai_check != xtrue
-a x
$last_boot != x
$default ]; then
28 elif [ ! -z $last_boot ]; then
29 set default
=$last_boot
37 bs_dir
=/debianstable_bootstrap
38 menuentry
$bs_dir --id=$bs_dir {
39 # note, we might be able to use $chosen and avoid setting this here,
40 # and set it inside save_chosen. but I haven't tested it,
41 # it's just one less line of repitition.
44 configfile
$bs_dir/boot
/grub
/grub.cfg
47 for dir
in /boot_
*; do
48 if [ $dir == '/boot_*' ]; then
51 menuentry
$dir --id=$dir {
54 configfile
$1/grub
/grub.cfg
58 menuentry fai-check
--id=fai-check
{
60 save_vars did_fai_check
61 configfile
$bs_dir/boot
/grub
/grub.cfg