11__author__ = "desultory"
2- __version__ = "7.1.0 "
2+ __version__ = "7.1.1 "
33
44from pathlib import Path
55from re import search
@@ -861,26 +861,25 @@ def mount_late(self) -> list[str]:
861861
862862def mount_fstab (self ) -> list [str ]:
863863 """Generates the init function for mounting the fstab.
864- Keeps re-attempting with mount_timeout or rootdelay until successful.
864+ Keeps re-attempting with mount_timeout until successful.
865865 mount_retries sets the number of times to retry the mount, infinite otherwise.
866866 """
867867 if not self ._get_build_path ("/etc/fstab" ).exists ():
868868 return self .logger .warning ("No initramfs fstab found, skipping mount_fstab." )
869869
870870 out = [
871871 'einfo "Attempting to mount all filesystems."' ,
872- f"timeout=$(readvar rootdelay { self .get ('mount_timeout' , 1 )} )" ,
873872 ]
874873
875874 if retries := self .get ("mount_retries" ):
876875 out += [
877- f'retry { retries } "$timeout " mount -a || rd_fail "Failed to mount all filesystems."' ,
876+ f'retry { retries } "$(readvar ugrd_mount_timeout) " mount -a || rd_fail "Failed to mount all filesystems."' ,
878877 ]
879878 else :
880879 out += [
881- "while ! mount -a; do" , # Actually retry forever, retry with a short timeout may fail
882- ' if prompt_user "Press space to break, waiting: ${timeout} s" "$timeout "; then' ,
883- ' rd_fail "Failed to mount all filesystems."' ,
880+ "while ! mount -a; do" , # Retry forever, retry with a very short timeout may fail
881+ ' if prompt_user "Press space to break, waiting: $(readvar ugrd_mount_timeout) s" "$(readvar ugrd_mount_timeout) "; then' ,
882+ ' rd_fail "Failed to mount all filesystems. Process interrupted by user. "' ,
884883 " fi" ,
885884 ' eerror "Failed to mount all filesystems, retrying."' ,
886885 "done" ,
@@ -950,7 +949,7 @@ def check_mounts(self) -> None:
950949
951950def mount_default_root (self ) -> str :
952951 """Mounts the root partition to $MOUNTS_ROOT_TARGET."""
953- return f """
952+ return """
954953 mount_source=$(readvar MOUNTS_ROOT_SOURCE)
955954 mount_type=$(readvar MOUNTS_ROOT_TYPE auto)
956955 mount_options="$(readvar MOUNTS_ROOT_OPTIONS 'defaults,ro')$(readvar root_extra_options)"
@@ -962,7 +961,7 @@ def mount_default_root(self) -> str:
962961 einfo "[/] Mounting '$mount_source' ($mount_type) to '$mount_target' with options: $mount_options"
963962 while ! mount "$mount_source" -t "$mount_type" -o "$mount_options" "$mount_target"; do
964963 eerror "Failed to mount root partition."
965- if prompt_user "Press space to break, waiting: { self [ "mount_timeout" ] } s" { self [ "mount_timeout" ] } ; then
964+ if prompt_user "Press space to break, waiting: $(readvar ugrd_mount_timeout) s" "$(readvar ugrd_mount_timeout)" ; then
966965 rd_fail "Failed to mount root partition."
967966 fi
968967 done
@@ -996,6 +995,7 @@ def export_mount_info(self) -> None:
996995 self ["exports" ]["MOUNTS_ROOT_TYPE" ] = self ["mounts" ]["root" ].get ("type" , "auto" )
997996 self ["exports" ]["MOUNTS_ROOT_OPTIONS" ] = "," .join (self ["mounts" ]["root" ]["options" ])
998997 self ["exports" ]["MOUNTS_ROOT_TARGET" ] = self ["mounts" ]["root" ]["destination" ]
998+ self ["exports" ]["ugrd_mount_timeout" ] = self .get ("mount_timeout" , 1 )
999999
10001000
10011001def autodetect_zfs_device_kmods (self , poolname ) -> list [str ]:
0 commit comments