Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall.py
diff options
context:
space:
mode:
authorAnton Hvornum <anton.feeds+github@gmail.com>2020-03-15 17:32:04 +0000
committerAnton Hvornum <anton.feeds+github@gmail.com>2020-03-15 17:32:04 +0000
commitfe69d970a3563ceb0d09dcc4e229123aec6ac213 (patch)
tree3740ea9bb64bb708d52249a2b4f24652abc2497e /archinstall.py
parent2a3aa2738d1faf65c7949c0eed90c317fd77e13d (diff)
Added somre more error handling and removed potentially unessecary code.
Diffstat (limited to 'archinstall.py')
-rw-r--r--archinstall.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/archinstall.py b/archinstall.py
index fab7586b..745ec93e 100644
--- a/archinstall.py
+++ b/archinstall.py
@@ -639,8 +639,8 @@ def format_disk(drive='drive', start='start', end='size', emulate=False, *positi
if not SAFETY_LOCK:
# 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
- if sys_command(f'/usr/bin/parted -s {drive} mklabel gpt', emulate=emulate, *positionals, **kwargs).exit_code != 0:
- return None
+ #if sys_command(f'/usr/bin/parted -s {drive} mklabel gpt', emulate=emulate, *positionals, **kwargs).exit_code != 0:
+ # return None
if sys_command(f'/usr/bin/parted -s {drive} mklabel gpt', emulate=emulate, *positionals, **kwargs).exit_code != 0:
return None
if sys_command(f'/usr/bin/parted -s {drive} mkpart primary FAT32 1MiB {start}', emulate=emulate, *positionals, **kwargs).exit_code != 0:
@@ -954,7 +954,7 @@ def mount_mountpoints(drive, bootpartition, mountpoint='/mnt', *positionals, **k
return True
def re_rank_mirrors(top=10, *positionals, **kwargs):
- if sys_command(('/usr/bin/rankmirrors -n {top} /etc/pacman.d/mirrorlist > /etc/pacman.d/mirrorlist')).exit_code == 0:
+ if sys_command((f'/usr/bin/rankmirrors -n {top} /etc/pacman.d/mirrorlist > /etc/pacman.d/mirrorlist')).exit_code == 0:
return True
return False
@@ -1008,6 +1008,10 @@ def strap_in_base(*positionals, **kwargs):
def configure_base_system(*positionals, **kwargs):
## TODO: Replace a lot of these syscalls with just python native operations.
o = b''.join(sys_command('/usr/bin/genfstab -pU /mnt >> /mnt/etc/fstab'))
+ if not os.path.isfile('/mnt/etc/fstab'):
+ log(f'Could not locate fstab, strapping in packages most likely failed.', level=3, origin='configure_base_system')
+ return False
+
with open('/mnt/etc/fstab', 'a') as fstab:
fstab.write('\ntmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0\n') # Redundant \n at the start? who knoes?