From 64f5dd30bb4f89cadf7640e04cdad27315896a50 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Wed, 10 Apr 2019 16:30:50 +0200 Subject: Reorder of when password is set. And added a boot options to boot into the new OS without actually rebooting. To set up things like databases etc that needs services running --- archinstall.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/archinstall.py b/archinstall.py index d2284e9d..59cdde3b 100644 --- a/archinstall.py +++ b/archinstall.py @@ -471,14 +471,6 @@ if __name__ == '__main__': o = run('arch-chroot /mnt locale-gen') o = run('arch-chroot /mnt chmod 700 /root') - ## == Passwords - # o = run('arch-chroot /mnt usermod --password {} root'.format(args['password'])) - # o = run("arch-chroot /mnt sh -c 'echo {pin} | passwd --stdin root'".format(pin='"{pin}"'.format(**args, pin=args['password'])), echo=True) - o = run("arch-chroot /mnt sh -c \"echo 'root:{pin}' | chpasswd\"".format(**args, pin=args['password'])) - if 'user' in args: - o = run('arch-chroot /mnt useradd -m -G wheel {user}'.format(**args)) - o = run("arch-chroot /mnt sh -c \"echo '{user}:{pin}' | chpasswd\"".format(**args, pin=args['password'])) - with open('/mnt/etc/mkinitcpio.conf', 'w') as mkinit: ## TODO: Don't replace it, in case some update in the future actually adds something. mkinit.write('MODULES=(btrfs)\n') @@ -560,6 +552,14 @@ if __name__ == '__main__': print('[W] Post install command failed: {}'.format(o.decode('UTF-8'))) #print(o) + ## == Passwords + # o = run('arch-chroot /mnt usermod --password {} root'.format(args['password'])) + # o = run("arch-chroot /mnt sh -c 'echo {pin} | passwd --stdin root'".format(pin='"{pin}"'.format(**args, pin=args['password'])), echo=True) + o = run("arch-chroot /mnt sh -c \"echo 'root:{pin}' | chpasswd\"".format(**args, pin=args['password'])) + if 'user' in args: + o = run('arch-chroot /mnt useradd -m -G wheel {user}'.format(**args)) + o = run("arch-chroot /mnt sh -c \"echo '{user}:{pin}' | chpasswd\"".format(**args, pin=args['password'])) + if args['post'] == 'reboot': o = run('umount -R /mnt') o = run('reboot now') -- cgit v1.2.3-70-g09d2