index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Anton Hvornum <anton.feeds+github@gmail.com> | 2019-11-18 20:09:18 +0000 |
---|---|---|
committer | Anton Hvornum <anton.feeds+github@gmail.com> | 2019-11-18 20:09:18 +0000 |
commit | da36b4f4e108369c91d8eb8ec1a7d26468c20010 (patch) | |
tree | 41e8f71947640bca297c87bdcd1879ad7ddd31b8 | |
parent | 30752a49c6b7a394508aee381fcc293bad584aae (diff) |
-rw-r--r-- | archinstall.py | 21 |
diff --git a/archinstall.py b/archinstall.py index 6b26059c..d9d5556f 100644 --- a/archinstall.py +++ b/archinstall.py @@ -593,16 +593,25 @@ def format_disk(drive=None, start='512MiB', end='100%', emulate=False, *args, ** print(f'[N] Setting up {drive}.') # dd if=/dev/random of=args['drive'] bs=4096 status=progress # https://github.com/dcantrell/pyparted would be nice, but isn't officially in the repo's #SadPanda - o = b''.join(sys_command(f'/usr/bin/parted -s {drive} mklabel gpt', emulate=emulate)) - o = b''.join(sys_command(f'/usr/bin/parted -s {drive} mkpart primary FAT32 1MiB {start}', emulate=emulate)) - o = b''.join(sys_command(f'/usr/bin/parted -s {drive} name 1 "EFI"', emulate=emulate)) - o = b''.join(sys_command(f'/usr/bin/parted -s {drive} set 1 esp on', emulate=emulate)) - o = b''.join(sys_command(f'/usr/bin/parted -s {drive} set 1 boot on', emulate=emulate)) - o = b''.join(sys_command(f'/usr/bin/parted -s {drive} mkpart primary {start} {end}', emulate=emulate)) + if sys_command(f'/usr/bin/parted -s {drive} mklabel gpt', emulate=emulate).exit_code != 0: + return None + if sys_command(f'/usr/bin/parted -s {drive} mklabel gpt', emulate=emulate).exit_code != 0: + return None + if sys_command(f'/usr/bin/parted -s {drive} mkpart primary FAT32 1MiB {start}', emulate=emulate).exit_code != 0: + return None + if sys_command(f'/usr/bin/parted -s {drive} name 1 "EFI"', emulate=emulate).exit_code != 0: + return None + if sys_command(f'/usr/bin/parted -s {drive} set 1 esp on', emulate=emulate).exit_code != 0: + return None + if sys_command(f'/usr/bin/parted -s {drive} set 1 boot on', emulate=emulate).exit_code != 0: + return None + if sys_command(f'/usr/bin/parted -s {drive} mkpart primary {start} {end}', emulate=emulate).exit_code != 0: + return None # TODO: grab paritions after each parted/partition step instead of guessing which partiton is which later on. # Create one, grab partitions - dub that to "boot" or something. do the next partition, grab that and dub it "system".. or something.. # This "assumption" has bit me in the ass so many times now I've stoped counting.. Jerker is right.. Don't do it like this :P + def multisplit(s, splitters): s = [s,] for key in splitters: |