Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall.py
diff options
context:
space:
mode:
authorLord Anton Hvornum <anton.feeds@gmail.com>2018-04-07 22:48:14 +0200
committerLord Anton Hvornum <anton.feeds@gmail.com>2018-04-07 22:48:14 +0200
commit13a1c2ab3a1035d22cfe05a9ef1c801daa2a2a82 (patch)
tree4a5568de19979d60f70fbb82eec3505fca5f3dad /archinstall.py
parent36d024b8032278bed8c119aa05d486dc088b002c (diff)
Verified a working network install, removing debugs
Diffstat (limited to 'archinstall.py')
-rw-r--r--archinstall.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/archinstall.py b/archinstall.py
index 9f185b77..b43c7e2f 100644
--- a/archinstall.py
+++ b/archinstall.py
@@ -48,12 +48,14 @@ def run(cmd, echo=False, *args, **kwargs):
while handle.poll() is None:
data = handle.stdout.read()
if len(data):
- if echo:
+ if echo and 'flush':
print(data.decode('UTF-8'), end='')
# print(data.decode('UTF-8'), end='')
output += data
- output += handle.stdout.read()
- print('Command done:', output, handle.poll())
+ data = handle.stdout.read()
+ if echo:
+ print(data.decode('UTF-8'), end='')
+ output += data
handle.stdout.close()
return output
@@ -159,6 +161,7 @@ if __name__ == '__main__':
with open(args['pwfile'], 'r') as pw:
PIN = pw.read().strip()
+ print()
print('[!] Disk PASSWORD is: {}'.format(PIN))
print()
print('[N] Setting up {drive}.'.format(**args))
@@ -213,11 +216,13 @@ if __name__ == '__main__':
o = run("arch-chroot /mnt sed -i 's/#\(en_US\.UTF-8\)/\1/' /etc/locale.gen")
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(PIN))
#TODO: This doesn't work either: (why the hell not?)
# echo "newpass" | passwd --stdin root ?
#o = run("arch-chroot /mnt echo 'root:{pin}' | chpasswd".format(**args, pin=PIN))
- o = run("arch-chroot /mnt 'echo {pin} | passwd --stdin root".format(pin='"{pin}"'.format(**args, pin=PIN)))
+ o = run("arch-chroot /mnt sh -c 'echo {pin} | passwd --stdin root'".format(pin='"{pin}"'.format(**args, pin=PIN)), echo=True)
if 'user' in 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))
@@ -265,7 +270,7 @@ if __name__ == '__main__':
opts = instructions[title][command] if type(instructions[title][command]) in (dict, oDict) else {}
print('[N] Command: {} ({})'.format(command, opts))
- o = run('arch-chroot /mnt {c}'.format(c=command), echo=True, **opts)
+ o = run('arch-chroot /mnt {c}'.format(c=command), **opts)
if type(instructions[title][command]) == bytes and len(instructions[title][command]) and not instructions[title][command] in o:
print('[W] Post install command failed: {}'.format(o.decode('UTF-8')))
#print(o)