Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Hvornum <anton.feeds@gmail.com>2019-04-10 08:37:52 +0200
committerAnton Hvornum <anton.feeds@gmail.com>2019-04-10 08:37:52 +0200
commitee7dff7f84053d82388704a992f82a2baac57fe8 (patch)
tree3dfc80fd7b5aca08612bab841fa73072133475dc
parent5ececaba1c642ca1793e96791637ff2733b1a471 (diff)
Reworked according to the new data structure. Changing rooms still doesnt work. And some other things might not as well.. such as file uploads.. but meh, beta test time! Fix issue #10
-rw-r--r--archinstall.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/archinstall.py b/archinstall.py
index c7d6062b..e5b02b1a 100644
--- a/archinstall.py
+++ b/archinstall.py
@@ -113,6 +113,10 @@ def grab_partitions(dev):
drive_name = os.path.basename(dev)
parts = oDict()
o = run('lsblk -o name -J -b {dev}'.format(dev=dev))
+ if b'not a block device' in o:
+ ## TODO: Replace o = run() with code, o = run()
+ ## and make run() return the exit-code, way safer than checking output strings :P
+ return {}
r = json.loads(o)
if len(r['blockdevices']) and 'children' in r['blockdevices'][0]:
for part in r['blockdevices'][0]['children']:
@@ -465,7 +469,14 @@ if __name__ == '__main__':
command = command.format(**args)
#print('[N] Command: {} ({})'.format(command, opts))
- o = run('arch-chroot /mnt {c}'.format(c=command), opts)
+
+ ## https://superuser.com/questions/1242978/start-systemd-nspawn-and-execute-commands-inside
+ ## !IMPORTANT
+ ##
+ ## arch-chroot mounts /run into the chroot environment, this breaks name resolves for some reason.
+ ## Either skipping mounting /run and using traditional chroot is an option, but using
+ ## `systemd-nspawn -D /mnt --machine temporary` might be a more flexible solution in case of file structure changes.
+ o = run('systemd-nspawn -D /mnt --machine temporary {c}'.format(c=command), opts)
if type(conf[title][raw_command]) == bytes and len(conf[title][raw_command]) and not conf[title][raw_command] in o:
print('[W] Post install command failed: {}'.format(o.decode('UTF-8')))
#print(o)