- |sort); do
- dev+=4
- mount $dev /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 != /debianbuster_boostrap
- # 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
+ |sort); do
+ dev+=4
+ mount $dev /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 != /debianbuster_boostrap
+ # 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 ||: