install --ondev: set username to "user"

This commit is contained in:
Oliver Smith 2020-06-29 20:54:32 +02:00
parent 4d940736a8
commit 5d5801b2a9
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
1 changed files with 13 additions and 0 deletions

View File

@ -223,6 +223,19 @@ def install(args):
raise ValueError("--on-device-installer cannot be combined with"
" --rsync")
# On-device installer overrides
if args.on_device_installer:
# To make code for the on-device installer not needlessly complex, just
# hardcode "user" as username here. (The on-device installer will set
# a password for the user, disable SSH password authentication,
# optionally add a new user for SSH that must not have the same
# username etc.)
if args.user != "user":
logging.warning(f"WARNING: custom username '{args.user}' will be"
" replaced with 'user' for the on-device"
" installer.")
args.user = "user"
if not args.sdcard and args.split is None:
# Default to split if the flash method requires it
flasher = pmb.config.flashers.get(args.deviceinfo["flash_method"], {})