feat(firstboot): force root + operator password on first boot (console gate) #139
1 changed files with 16 additions and 3 deletions
|
|
@ -105,6 +105,19 @@ _rootpw_prompt_and_set() {
|
|||
done
|
||||
}
|
||||
|
||||
# Visible "Continuing in 3s 2s 1s" countdown before boot resumes, so the
|
||||
# operator can read the result before clawdie_live_gpu repaints the screen.
|
||||
_rootpw_continue_countdown() {
|
||||
_n="${1:-3}"
|
||||
printf ' Continuing in '
|
||||
while [ "${_n}" -gt 0 ]; do
|
||||
printf '%ss ' "${_n}"
|
||||
sleep 1
|
||||
_n=$((_n - 1))
|
||||
done
|
||||
printf '... proceeding.\n'
|
||||
}
|
||||
|
||||
clawdie_firstboot_rootpw_start() {
|
||||
_rootpw_secured && return 0
|
||||
|
||||
|
|
@ -124,12 +137,12 @@ clawdie_firstboot_rootpw_start() {
|
|||
_rootpw_prompt_and_set root "ROOT (admin)"
|
||||
_rootpw_prompt_and_set clawdie "OPERATOR (clawdie)"
|
||||
_rootpw_mark_secured
|
||||
printf ' Node secured. Continuing boot...\n'
|
||||
sleep 2
|
||||
printf ' Node secured.\n'
|
||||
_rootpw_continue_countdown 3
|
||||
else
|
||||
printf '\n\n [skipped] passwords NOT set — this node remains OPEN.\n'
|
||||
printf ' You will be prompted again on the next boot.\n'
|
||||
sleep 3
|
||||
_rootpw_continue_countdown 3
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue