avoid boot hang
authorIan Kelling <iank@fsf.org>
Tue, 23 Feb 2021 03:43:48 +0000 (22:43 -0500)
committerIan Kelling <iank@fsf.org>
Tue, 23 Feb 2021 03:43:48 +0000 (22:43 -0500)
fai/config/hooks/partition.DEFAULT

index 988ce06f925d4abe1f84ac14031fb4337d3b590e..bb625fd1d35c1305ef22f1cdea477783739b5f4b 100755 (executable)
@@ -609,7 +609,7 @@ umount /mnt
 if [[ $DISTRO == debianbuster_bootstrap ]]; then
   cat > /tmp/fai/fstab <<EOF
 $first_boot_dev  /  btrfs  noatime,subvol=$boot_vol  0 0
-$first_efi  /boot/efi  vfat          nofail  0 0
+$first_efi  /boot/efi  vfat          nofail,x-systemd.device-timeout=30s,x-systemd.mount-timeout=30s  0 0
 EOF
   cat >/tmp/fai/disk_var.sh <<EOF
 BOOT_DEVICE="${short_devs[@]}"
@@ -618,11 +618,11 @@ EOF
 else
   # note, fai creates the mountpoints listed here
   cat > /tmp/fai/fstab <<EOF
-$first_root_crypt  /  btrfs          noatime,subvol=root_$DISTRO$mopts  0 0
-$first_root_crypt  /mnt/root  btrfs  nofail,noatime,subvolid=0$mopts  0 0
-$first_boot_dev  /boot  btrfs        nofail,noatime,subvol=$boot_vol  0 0
-$first_efi  /boot/efi  vfat          nofail  0 0
-$first_boot_dev  /mnt/boot  btrfs    nofail,noatime,subvolid=0  0 0
+$first_root_crypt  /  btrfs          x-systemd.device-timeout=90s,x-systemd.mount-timeout=90s,noatime,subvol=root_$DISTRO$mopts  0 0
+$first_root_crypt  /mnt/root  btrfs  nofail,x-systemd.device-timeout=30s,x-systemd.mount-timeout=30s,noatime,subvolid=0$mopts  0 0
+$first_boot_dev  /boot  btrfs        nofail,x-systemd.device-timeout=30s,x-systemd.mount-timeout=30s,noatime,subvol=$boot_vol  0 0
+$first_efi  /boot/efi  vfat          nofail,x-systemd.device-timeout=30s,x-systemd.mount-timeout=30s  0 0
+$first_boot_dev  /mnt/boot  btrfs    nofail,x-systemd.device-timeout=30s,x-systemd.mount-timeout=30s,noatime,subvolid=0  0 0
 EOF
   swaps=()
   rm -f /tmp/fai/crypttab
@@ -633,7 +633,7 @@ $(root-cryptname) $(rootdev)  none  keyscript=/root/keyscript,discard,luks,initr
 $(swap-cryptname) $(swapdev)  /dev/urandom  swap,cipher=aes-xts-plain64,size=256,hash=ripemd160
 EOF
     cat >> /tmp/fai/fstab <<EOF
-$(swap-cryptdev)  none  swap  nofail,sw  0 0
+$(swap-cryptdev)  none  swap  nofail,x-systemd.device-timeout=30s,x-systemd.mount-timeout=30s,sw  0 0
 EOF
   done