common: probe: Support default passwords on devicetree based systems

In addition to QEMU, we can now source the factory default password
from real VPD EEPROMs, on systems that use a devicetree.
This commit is contained in:
Tobias Waldekranz
2023-11-25 20:37:15 +01:00
committed by Joachim Wiberg
parent 17d1a529e8
commit e53fd91c7f
3 changed files with 262 additions and 42 deletions
+3 -3
View File
@@ -2,11 +2,11 @@
# This script extracts the admin user's password hash from VPD
shell="$1"
pwhash="$(jq .pwhash /run/system.json)"
pwhash=$(jq -r '."factory-password-hash"' /run/system.json)
if [ -z "$pwhash" ] || [ "$pwhash" = "null" ]; then
# Do not fail, lock account instead. This way developers can enable
# root account login at build-tiem to diagnose the system.
# root account login at build-time to diagnose the system.
pwhash="!"
rc=1
else
@@ -20,7 +20,7 @@ cat <<EOF
"user": [
{
"name": "admin",
"password": $pwhash,
"password": "$pwhash",
"infix-system:shell": "$shell"
}
]