X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=fai%2Fconfig%2Ffiles%2Froot%2Ffai-check%2FVOL_BULLSEYE_BOOTSTRAP;h=18c54ebb27726401a35321a417a6bd40339f28d3;hb=5c8f49a1d5321a0d3f01284f0087740af070962b;hp=6717987e003a25502fc752c9eed6daadd2780d44;hpb=bfd6bbd3a188aac6871f8b5e1116a0979682d52b;p=automated-distro-installer diff --git a/fai/config/files/root/fai-check/VOL_BULLSEYE_BOOTSTRAP b/fai/config/files/root/fai-check/VOL_BULLSEYE_BOOTSTRAP deleted file mode 100755 index 6717987..0000000 --- a/fai/config/files/root/fai-check/VOL_BULLSEYE_BOOTSTRAP +++ /dev/null @@ -1,99 +0,0 @@ -#!/bin/bash - -set -eE -o pipefail -trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR - - - -usage() { - cat < deadline )); then - echo "fai-check: hit $NETWORK_TIMOUT_SECS s tftp server timeout" - return 0 - fi - sleep 1 - done - m pxe-kexec -n --ignore-whitelist -l fai-generated faiserver ||: -} - -case $1 in - -f|--force) - try-kexec - exit - ;; -esac - - -first=true -for dev in $(btrfs fi show / | sed -rn 's#^\s*devid\s.*\s([^0-9 ]+)\S+$#\1#p' \ - |sort); do - - # Decide which is my grub_ext partition. see partition.DEFAULT file - # for details - if [[ $(blockdev --getsize64 ${dev}4) == 8388608 ]]; then - # Old partition scheme - grub_extn=${dev}4 - elif [[ $(blockdev --getsize64 ${dev}5) == 8388608 ]]; then - # Old partition scheme - grub_extn=${dev}5 - else - grub_extn=${dev}7 - fi - mount $grub_extn /mnt - if $first; then - if [[ -e /mnt/grubenv ]]; then - set -x - source <(grub-editenv /mnt/grubenv list) - set +x - fi - first=false - # we could just as well check if last_boot != /debianbullseye_bootstrap - # the intent with this one is just a little clearer. - if [[ $did_fai_check == true ]]; then - grub-editenv /mnt/grubenv set did_fai_check=os_true - # our service does not wait for network-online.target, - # because it will wait for too long when we don't have a network - # connection. So, we wait for 10 seconds. - # ref: https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/ - try-kexec ||: - fi - else - # we make sure there is only 1 grubenv, - # so grub can just find the first one, in whatever order - # if looks at them, which may not be the same as us. - # If the disk dies, we just lose the default boot option, - # we will have to do manual steps to replace it anyways. - rm -f /mnt/gruvenv - fi - umount /mnt -done - -# the check for last_boot is not needed afaik, just sanity check. -if [[ $did_fai_check == true && $last_boot != /debianbullseye_bootstrap ]]; then - # no need to reboot if we actually want to boot into this os. - reboot -fi diff --git a/fai/config/files/root/fai-check/VOL_BULLSEYE_BOOTSTRAP b/fai/config/files/root/fai-check/VOL_BULLSEYE_BOOTSTRAP new file mode 120000 index 0000000..18c54eb --- /dev/null +++ b/fai/config/files/root/fai-check/VOL_BULLSEYE_BOOTSTRAP @@ -0,0 +1 @@ +VOL_BOOKWORM_BOOTSTRAP \ No newline at end of file