Skip to content

Commit

Permalink
improve docs, increase default "infinite" retries to 1000
Browse files Browse the repository at this point in the history
Signed-off-by: Zen <[email protected]>
  • Loading branch information
desultory committed Dec 31, 2024
1 parent 4cb84fe commit a1cf835
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,8 @@ This module handles CPIO creation.

These are set at the global level and are not associated with an individual mount:

* `mount_wait` (false) Waits for user input before attenmpting to mount the generated fstab at `init_main`.
* `mount_timeout` - Timeout for `mount_wait` to automatically continue, passed to `read -t`.
* `mount_timeout` (1.0) - Timeout in seconds for mount retries, can be set with `rootdelay` in the kernel command line.
* `mount_retries` - Number of times to retry running `mount -a`, no limit if unset.

#### ugrd.fs.btrfs

Expand Down
4 changes: 2 additions & 2 deletions src/ugrd/base/base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__author__ = "desultory"
__version__ = "5.4.0"
__version__ = "5.5.0"

from importlib.metadata import version
from pathlib import Path
Expand Down Expand Up @@ -230,7 +230,7 @@ def retry(self) -> list[str]:
' "$@"', # If retries is 0, just run the command
' return "$?"',
'elif [ "$retries" -lt 0 ]; then',
" retries=100",
" retries=1000",
"fi",
'i=-1; while [ "$((i += 1))" -lt "$retries" ]; do',
' if "$@"; then',
Expand Down
2 changes: 1 addition & 1 deletion src/ugrd/fs/mounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ def mount_root(self) -> list[str]:
' umount "$(readvar MOUNTS_ROOT_TARGET)"',
"fi",
'''einfo "Mounting '$(readvar MOUNTS_ROOT_SOURCE)' ($(readvar MOUNTS_ROOT_TYPE)) to '$(readvar MOUNTS_ROOT_TARGET)' with options: $(readvar MOUNTS_ROOT_OPTIONS)"''',
f'retry {self["mount_retries"]} {self["mount_timeout"] or 1} mount "$(readvar MOUNTS_ROOT_SOURCE)" -t "$(readvar MOUNTS_ROOT_TYPE)" "$(readvar MOUNTS_ROOT_TARGET)" -o "$(readvar MOUNTS_ROOT_OPTIONS)"',
f'retry {self["mount_retries"] or -1} {self["mount_timeout"]} mount "$(readvar MOUNTS_ROOT_SOURCE)" -t "$(readvar MOUNTS_ROOT_TYPE)" "$(readvar MOUNTS_ROOT_TARGET)" -o "$(readvar MOUNTS_ROOT_OPTIONS)"',
]


Expand Down

0 comments on commit a1cf835

Please sign in to comment.