Fix hostname None (#2893)

This commit is contained in:
codefiles 2024-11-20 00:32:05 -05:00 committed by GitHub
parent f827851560
commit 3453816b38
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View File

@ -821,7 +821,7 @@ class Installer:
testing: bool = False,
multilib: bool = False,
mkinitcpio: bool = True,
hostname: str = 'archinstall',
hostname: str | None = None,
locale_config: LocaleConfiguration = LocaleConfiguration.default()
):
if self._disk_config.lvm_config:
@ -874,7 +874,9 @@ class Installer:
# os.remove(f'{self.target}/etc/localtime')
# sys_command(f'/usr/bin/arch-chroot {self.target} ln -s /usr/share/zoneinfo/{localtime} /etc/localtime')
# sys_command('/usr/bin/arch-chroot /mnt hwclock --hctosys --localtime')
self.set_hostname(hostname)
if hostname:
self.set_hostname(hostname)
self.set_locale(locale_config)
self.set_keyboard_language(locale_config.kb_layout)

View File

@ -73,7 +73,7 @@ def perform_installation(mountpoint: Path) -> None:
testing=enable_testing,
multilib=enable_multilib,
mkinitcpio=run_mkinitcpio,
hostname=archinstall.arguments.get('hostname', 'archlinux'),
hostname=archinstall.arguments.get('hostname'),
locale_config=locale_config
)