install --ondev: don't ask for user password (MR 1954)

With postmarketos-ondev 0.2.0, the password is set in the on-device
installer.
This commit is contained in:
Oliver Smith 2020-07-01 00:14:08 +02:00
parent 90f57bbbcc
commit 324ea788ba
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
1 changed files with 12 additions and 11 deletions

View File

@ -190,18 +190,19 @@ def setup_login(args):
Loop until the password for user has been set successfully, and disable root
login.
"""
# User password
logging.info(" *** SET LOGIN PASSWORD FOR: '" + args.user + "' ***")
suffix = "rootfs_" + args.device
while True:
try:
pmb.chroot.root(args, ["passwd", args.user], suffix,
output="interactive")
break
except RuntimeError:
logging.info("WARNING: Failed to set the password. Try it"
" one more time.")
pass
if not args.on_device_installer:
# User password
logging.info(" *** SET LOGIN PASSWORD FOR: '" + args.user + "' ***")
while True:
try:
pmb.chroot.root(args, ["passwd", args.user], suffix,
output="interactive")
break
except RuntimeError:
logging.info("WARNING: Failed to set the password. Try it"
" one more time.")
pass
# Disable root login
pmb.chroot.root(args, ["passwd", "-l", "root"], suffix)