index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Anton Hvornum <anton.feeds@gmail.com> | 2019-04-14 23:13:19 +0200 |
---|---|---|
committer | Anton Hvornum <anton.feeds@gmail.com> | 2019-04-14 23:13:19 +0200 |
commit | 620db3623ccf5328766656c89d023d89c4c056f6 (patch) | |
tree | 465e6bf4af822d316d86001eaafb034e81b224f3 | |
parent | 65aed10fa2c56dcce38bfbd6059e64a67f7118e6 (diff) |
-rw-r--r-- | archinstall.py | 16 |
diff --git a/archinstall.py b/archinstall.py index afb22d65..734bb6d0 100644 --- a/archinstall.py +++ b/archinstall.py @@ -218,6 +218,18 @@ def simple_command(cmd, opts=None, *args, **kwargs): handle.stdout.close() return output +def get_drive_from_uuid(uuid): + if len(harddrives) <= 0: raise ValueError("No hard drives to iterate in order to find: {}".format(uuid)) + + for drive in harddrives: + #for partition in psutil.disk_partitions('/dev/{}'.format(name)): + # pass #blkid -s PARTUUID -o value /dev/sda2 + o = simple_command('blkid -s PTUUID -o value /dev/sda') + if len(o): + return drive + + return None + def update_git(): default_gw = get_default_gateway_linux() if(default_gw): @@ -387,6 +399,10 @@ if __name__ == '__main__': if not 'profile' in args: args['profile'] = None if not 'profiles-path' in args: args['profiles-path'] = profiles_path + if args['drive'][0] != '/': + ## Remap the selected UUID to the device to be formatted. + args['drive'] = get_drive_from_uuid(args['drive']) + ## == If we got networking, # Try fetching instructions for this box and execute them. instructions = {} |