debugging
This commit is contained in:
parent
76731be748
commit
673e607d4b
|
|
@ -866,14 +866,14 @@ def mkfs_btrfs(drive='/dev/mapper/luksdev', *positionals, **kwargs):
|
|||
return True
|
||||
|
||||
def mount_luksdev(where='/dev/mapper/luksdev', to='/mnt', *positionals, **kwargs):
|
||||
o = simple_command('/usr/bin/mount | /usr/bin/grep /mnt') # /dev/dm-0
|
||||
o = b''.join(sys_command('/usr/bin/mount | /usr/bin/grep /mnt')) # /dev/dm-0
|
||||
if len(o) <= 0:
|
||||
o = b''.join(sys_command('/usr/bin/mount /dev/mapper/luksdev /mnt'))
|
||||
return True
|
||||
|
||||
def mount_boot(drive, partition, mountpoint='/mnt/boot', *positionals, **kwargs):
|
||||
os.makedirs('/mnt/boot', exist_ok=True)
|
||||
o = simple_command('/usr/bin/mount | /usr/bin/grep /mnt/boot') # /dev/dm-0
|
||||
o = b''.join(sys_command('/usr/bin/mount | /usr/bin/grep /mnt/boot')) # /dev/dm-0
|
||||
if len(o) <= 0:
|
||||
o = b''.join(sys_command(f'/usr/bin/mount {drive}{partition} {mountpoint}'))
|
||||
return True
|
||||
|
|
@ -886,15 +886,15 @@ def mount_mountpoints(drive, bootpartition, mountpoint='/mnt/boot', *positionals
|
|||
return True
|
||||
|
||||
def re_rank_mirrors(top=10, *positionals, **kwargs):
|
||||
o = simple_command('/usr/bin/rankmirrors -n {top} /root/mirrorlist > /etc/pacman.d/mirrorlist')
|
||||
o = b''.join(sys_command(('/usr/bin/rankmirrors -n {top} /root/mirrorlist > /etc/pacman.d/mirrorlist')))
|
||||
|
||||
def filter_mirrors_by_country(countries, top=10, *positionals, **kwargs):
|
||||
## TODO: replace wget with urllib.request (no point in calling syscommand)
|
||||
country_list = []
|
||||
for country in countries.split(','):
|
||||
country_list.append(f'country={country}')
|
||||
o = simple_command(f"/usr/bin/wget 'https://www.archlinux.org/mirrorlist/?{'&'.join(country_list)}&protocol=https&ip_version=4&ip_version=6&use_mirror_status=on' -O /root/mirrorlist")
|
||||
o = simple_command("/usr/bin/sed -i 's/#Server/Server/' /root/mirrorlist")
|
||||
o = b''.join(sys_command((f"/usr/bin/wget 'https://www.archlinux.org/mirrorlist/?{'&'.join(country_list)}&protocol=https&ip_version=4&ip_version=6&use_mirror_status=on' -O /root/mirrorlist")))
|
||||
o = b''.join(sys_command(("/usr/bin/sed -i 's/#Server/Server/' /root/mirrorlist")))
|
||||
re_rank_mirrors(top, *positionals, **kwargs)
|
||||
return True
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue