mirror of
https://github.com/kernelkit/infix.git
synced 2026-08-05 15:13:02 +02:00
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:
committed by
Joachim Wiberg
parent
17d1a529e8
commit
e53fd91c7f
@@ -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"
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user