Added archinstall.Installer().set_mirrors, which allows to modify the mirrors in the finished installed medium.
This commit is contained in:
parent
6744d7ac1b
commit
323af39ed5
|
|
@ -5,6 +5,7 @@ from .disk import *
|
|||
from .general import *
|
||||
from .user_interaction import *
|
||||
from .profiles import Profile
|
||||
from .mirrors import *
|
||||
|
||||
class Installer():
|
||||
"""
|
||||
|
|
@ -82,6 +83,9 @@ class Installer():
|
|||
else:
|
||||
log(f'Could not sync mirrors: {sync_mirrors.exit_code}')
|
||||
|
||||
def set_mirrors(self, mirrors):
|
||||
return use_mirrors(mirrors, destination=f'{self.mountpoint}/etc/pacman.d/mirrorlist')
|
||||
|
||||
def genfstab(self, flags='-Pu'):
|
||||
o = b''.join(sys_command(f'/usr/bin/genfstab -pU {self.mountpoint} >> {self.mountpoint}/etc/fstab'))
|
||||
if not os.path.isfile(f'{self.mountpoint}/etc/fstab'):
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ def insert_mirrors(mirrors, *args, **kwargs):
|
|||
return True
|
||||
|
||||
def use_mirrors(regions :dict, destination='/etc/pacman.d/mirrorlist'):
|
||||
log(f'Updating mirror list: {destination}')
|
||||
log(f'A new package mirror-list has been created: {destination}')
|
||||
for region, mirrors in regions.items():
|
||||
with open(destination, 'w') as mirrorlist:
|
||||
for mirror in mirrors:
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import archinstall, getpass, time
|
||||
|
||||
def perform_installation(device, boot_partition, language):
|
||||
def perform_installation(device, boot_partition, language, mirrors):
|
||||
"""
|
||||
Performs the installation steps on a block device.
|
||||
Only requirement is that the block devices are
|
||||
|
|
@ -8,6 +8,7 @@ def perform_installation(device, boot_partition, language):
|
|||
"""
|
||||
with archinstall.Installer(device, boot_partition=boot_partition, hostname=hostname) as installation:
|
||||
if installation.minimal_installation():
|
||||
installation.set_mirrors(mirrors)
|
||||
installation.set_keyboard_language(language)
|
||||
installation.add_bootloader()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue