Modified the install command and debug output

This commit is contained in:
Lord Anton Hvornum 2018-04-07 10:05:30 +02:00
parent 828cca1beb
commit 95b4d073ed
2 changed files with 26 additions and 22 deletions

View File

@ -213,7 +213,8 @@ if __name__ == '__main__':
#o = run('arch-chroot /mnt usermod --password {} root'.format(PIN)) #o = run('arch-chroot /mnt usermod --password {} root'.format(PIN))
#TODO: This doesn't work either: (why the hell not?) #TODO: This doesn't work either: (why the hell not?)
# echo "newpass" | passwd --stdin root ? # echo "newpass" | passwd --stdin root ?
o = run("arch-chroot /mnt echo 'root:{pin}' | chpasswd".format(**args, pin=PIN)) #o = run("arch-chroot /mnt echo 'root:{pin}' | chpasswd".format(**args, pin=PIN))
o = run('arch-chroot /mnt echo "{pin}" | passwd --stdin root'.format(**args, pin=PIN))
if 'user' in args: if 'user' in args:
o = run('arch-chroot /mnt useradd -m -G wheel {user}'.format(**args)) o = run('arch-chroot /mnt useradd -m -G wheel {user}'.format(**args))
o = run("arch-chroot /mnt echo '{user}:{pin}' | chpasswd".format(**args, pin=PIN)) o = run("arch-chroot /mnt echo '{user}:{pin}' | chpasswd".format(**args, pin=PIN))
@ -241,6 +242,9 @@ if __name__ == '__main__':
entry.write('initrd /initramfs-linux.img\n') entry.write('initrd /initramfs-linux.img\n')
entry.write('options cryptdevice=UUID={UUID}:luksdev root=/dev/mapper/luksdev rw intel_pstate=no_hwp\n'.format(UUID=UUID)) entry.write('options cryptdevice=UUID={UUID}:luksdev root=/dev/mapper/luksdev rw intel_pstate=no_hwp\n'.format(UUID=UUID))
## == If we got networking,
# Try fetching instructions for this box and execute them.
if get_default_gateway_linux():
locmac = get_local_MACs() locmac = get_local_MACs()
for mac in locmac: for mac in locmac:
try: try:
@ -255,11 +259,11 @@ if __name__ == '__main__':
print('[N] {}'.format(title)) print('[N] {}'.format(title))
for command in instructions[title]: for command in instructions[title]:
o = run(command) # arch-chroot /mnt ... o = run(command) # arch-chroot /mnt ...
if instructions[title][command]: #if instructions[title][command]:
print(o) print(o)
o = run('umount -R /mnt') #o = run('umount -R /mnt')
if args['post'] == 'reboot': #if args['post'] == 'reboot':
o = run('reboot now') # o = run('reboot now')
else: #else:
print('Done. "reboot" when you\'re done tinkering.') # print('Done. "reboot" when you\'re done tinkering.')

View File

@ -1,5 +1,5 @@
{ {
"install ssh": { "install ssh": {
"pacman -y -S cmatrix" : null "pacman -Syy --noconfirm cmatrix" : null
} }
} }