password, hashed = context.config.root_password or (None, False)
pwopt = "--root-password-hashed" if hashed else "--root-password"
- pwcred = "passwd.hashed-password.root" if hashed else "passwd.plaintext-password.root"
settings = (
("--locale", "firstboot.locale", context.config.locale),
("--keymap", "firstboot.keymap", context.config.keymap),
("--timezone", "firstboot.timezone", context.config.timezone),
("--hostname", None, context.config.hostname),
- (pwopt, pwcred, password),
+ (pwopt, None, password),
("--root-shell", "passwd.shell.root", context.config.root_shell),
)
(context.root / "usr/lib/credstore").mkdir(exist_ok=True)
for cred, value in creds:
- with umask(~0o600 if "password" in cred else ~0o644):
+ with umask(~0o644):
(context.root / "usr/lib/credstore" / cred).write_text(value)