index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Anton Hvornum <anton.feeds@gmail.com> | 2019-04-10 08:37:52 +0200 |
---|---|---|
committer | Anton Hvornum <anton.feeds@gmail.com> | 2019-04-10 08:37:52 +0200 |
commit | ee7dff7f84053d82388704a992f82a2baac57fe8 (patch) | |
tree | 3dfc80fd7b5aca08612bab841fa73072133475dc | |
parent | 5ececaba1c642ca1793e96791637ff2733b1a471 (diff) |
-rw-r--r-- | archinstall.py | 13 |
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) |