4 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
6 # keep it short so we don't delay too much wnen we don't have networking.
10 # we could just as well check if last_boot != /debianstable_boostrap
11 # the intent with this one is just a little clearer.
12 if [[ $did_fai_check == true
]]; then
13 grub-editenv
/mnt
/grubenv
set did_fai_check
=os_true
14 # ref: https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/
15 deadline
=$
(( `date +%s` + NETWORK_TIMOUT_SECS
))
16 while ! systemctl status network-online.target
&& \
17 (( `date +%s` < deadline
)); do
20 pxe-kexec
-n --ignore-whitelist -l fai-generated faiserver ||
:
27 for dev
in $
(btrfs
fi show
/ |
sed -rn 's#^\s*devid\s.*\s([^0-9 ]+)\S+$#\1#p' \
32 if [[ -e /mnt
/grubenv
]]; then
33 source <(grub-editenv
/mnt
/grubenv list
)
38 # we make sure there is only 1 grubenv,
39 # so grub can just find the first one, in whatever order
40 # if looks at them, which may not be the same as us.
41 # If the disk dies, we just lose the default boot option,
42 # we will have to do manual steps to replace it anyways.
48 # the check for last_boot is not needed afaik, just sanity check.
49 if [[ $did_fai_check == true
&& $last_boot != /debianstable_boostrap
]]; then
50 # no need to reboot if we actually want to boot into this os.