From: Plom Heller Date: Mon, 7 Sep 2026 03:26:21 +0000 (+0200) Subject: Retry passwd until successful rather than aborting script. X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/booking/processes?a=commitdiff_plain;h=dc3fff2b566e81bed533efad448fa9618dd05177;p=confplom Retry passwd until successful rather than aborting script. --- diff --git a/setup_scripts/_lib.sh b/setup_scripts/_lib.sh index 149f046..1dfa7e5 100644 --- a/setup_scripts/_lib.sh +++ b/setup_scripts/_lib.sh @@ -139,6 +139,11 @@ unmount_unrbind() { chroot_sh() { LANG=C.UTF-8 chroot "${PATH_MNT_ROOT}" /bin/sh -c "$@" } +retry_until_success() { + until "$@"; do + msg 'Command failed, retrying: %s …' "$*" + done +} create_lv() { local VG=$1 local LV=$2 diff --git a/setup_scripts/install_debian.sh b/setup_scripts/install_debian.sh index 6c9a05f..87938b3 100755 --- a/setup_scripts/install_debian.sh +++ b/setup_scripts/install_debian.sh @@ -147,7 +147,7 @@ efibootmgr \ # ask root login at latest possible moment, so that on fails: less left undone msg 'Setting up root login …' -chroot_sh "passwd" +retry_until_success chroot_sh "passwd" # clean up unmount_unrbind diff --git a/setup_scripts/start_root.sh b/setup_scripts/start_root.sh index 2e13e68..94e9ca3 100755 --- a/setup_scripts/start_root.sh +++ b/setup_scripts/start_root.sh @@ -46,7 +46,8 @@ udevadm control --reload-rules udevadm trigger --action=add --subsystem-match=backlight msg 'Setting up user: %s' "${USERNAME}" -adduser --comment "" "${USERNAME}" +adduser --disabled-password --comment "" "${USERNAME}" +retry_until_success passwd "${USERNAME}" usermod -a -G sudo,video "${USERNAME}" msg 'Synchronizing clock …'