Merge pull request #366 from advaithm/master
Bug fixes for kernel select and grub-install
This commit is contained in:
commit
932517e20d
|
|
@ -1,6 +1,5 @@
|
||||||
import os, stat, time, shutil, pathlib
|
import os, stat, time, shutil, pathlib
|
||||||
import subprocess, logging
|
import subprocess, logging
|
||||||
|
|
||||||
from .exceptions import *
|
from .exceptions import *
|
||||||
from .disk import *
|
from .disk import *
|
||||||
from .general import *
|
from .general import *
|
||||||
|
|
@ -40,8 +39,8 @@ class Installer():
|
||||||
:type hostname: str, optional
|
:type hostname: str, optional
|
||||||
|
|
||||||
"""
|
"""
|
||||||
def __init__(self, target, *, base_packages='base base-devel linux linux-firmware', kernels='linux'):
|
def __init__(self, target, *, base_packages='base base-devel linux-firmware', kernels='linux'):
|
||||||
base_packages = base_packages + kernels.replace(',', ' ')
|
kernels = kernels.split(",")
|
||||||
self.target = target
|
self.target = target
|
||||||
self.init_time = time.strftime('%Y-%m-%d_%H-%M-%S')
|
self.init_time = time.strftime('%Y-%m-%d_%H-%M-%S')
|
||||||
self.milliseconds = int(str(time.time()).split('.')[1])
|
self.milliseconds = int(str(time.time()).split('.')[1])
|
||||||
|
|
@ -52,6 +51,8 @@ class Installer():
|
||||||
}
|
}
|
||||||
|
|
||||||
self.base_packages = base_packages.split(' ') if type(base_packages) is str else base_packages
|
self.base_packages = base_packages.split(' ') if type(base_packages) is str else base_packages
|
||||||
|
for kernel in kernels:
|
||||||
|
self.base_packages.append(kernel)
|
||||||
if hasUEFI():
|
if hasUEFI():
|
||||||
self.base_packages.append("efibootmgr")
|
self.base_packages.append("efibootmgr")
|
||||||
else:
|
else:
|
||||||
|
|
@ -363,8 +364,10 @@ class Installer():
|
||||||
boot_partition = partition
|
boot_partition = partition
|
||||||
elif partition.mountpoint == self.target:
|
elif partition.mountpoint == self.target:
|
||||||
root_partition = partition
|
root_partition = partition
|
||||||
|
if hasUEFI():
|
||||||
self.log(f'Adding bootloader {bootloader} to {boot_partition}', level=logging.INFO)
|
self.log(f'Adding bootloader {bootloader} to {boot_partition}', level=logging.INFO)
|
||||||
|
else:
|
||||||
|
self.log(f'Adding bootloader {bootloader} to {root_partition}', level=logging.INFO)
|
||||||
|
|
||||||
if bootloader == 'systemd-bootctl':
|
if bootloader == 'systemd-bootctl':
|
||||||
if not hasUEFI():
|
if not hasUEFI():
|
||||||
|
|
@ -439,6 +442,7 @@ class Installer():
|
||||||
root_device = f"{root_partition.path}"
|
root_device = f"{root_partition.path}"
|
||||||
o = b''.join(sys_command(f'/usr/bin/arch-chroot {self.target} grub-install --target=i386-pc /dev/{root_device}'))
|
o = b''.join(sys_command(f'/usr/bin/arch-chroot {self.target} grub-install --target=i386-pc /dev/{root_device}'))
|
||||||
sys_command('/usr/bin/arch-chroot /mnt grub-mkconfig -o /boot/grub/grub.cfg')
|
sys_command('/usr/bin/arch-chroot /mnt grub-mkconfig -o /boot/grub/grub.cfg')
|
||||||
|
self.helper_flags['bootloader'] = bootloader
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
raise RequirementError(f"Unknown (or not yet implemented) bootloader requested: {bootloader}")
|
raise RequirementError(f"Unknown (or not yet implemented) bootloader requested: {bootloader}")
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,8 @@ def _prep_function(*args, **kwargs):
|
||||||
other code in this stage. So it's a safe way to ask the user
|
other code in this stage. So it's a safe way to ask the user
|
||||||
for more input before any other installer steps start.
|
for more input before any other installer steps start.
|
||||||
"""
|
"""
|
||||||
|
if "nvidia" in _gfx_driver_packages:
|
||||||
|
raise archinstall.lib.exceptions.HardwareIncompatibilityError("Sway does not support the proprietary nvidia drivers")
|
||||||
__builtins__['_gfx_driver_packages'] = archinstall.select_driver()
|
__builtins__['_gfx_driver_packages'] = archinstall.select_driver()
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,14 @@ def _prep_function(*args, **kwargs):
|
||||||
# or through conventional import xorg
|
# or through conventional import xorg
|
||||||
if __name__ == 'xorg':
|
if __name__ == 'xorg':
|
||||||
try:
|
try:
|
||||||
installation.add_additional_packages(f"xorg-server xorg-xinit {' '.join(_gfx_driver_packages)}")
|
if "nvidia" in _gfx_driver_packages:
|
||||||
|
if "linux-zen" in installation.base_packages or "linux-lts" in installation.base_packages:
|
||||||
|
installation.add_additional_packages("dkms")#I've had kernel regen fail if it wasn't installed before nvidia-dkms
|
||||||
|
installation.add_additional_packages("xorg-server xorg-xinit nvidia-dkms")
|
||||||
|
else:
|
||||||
|
installation.add_additional_packages(f"xorg-server xorg-xinit {' '.join(_gfx_driver_packages)}")
|
||||||
|
else:
|
||||||
|
installation.add_additional_packages(f"xorg-server xorg-xinit {' '.join(_gfx_driver_packages)}")
|
||||||
except:
|
except:
|
||||||
installation.add_additional_packages(f"xorg-server xorg-xinit") # Prep didn't run, so there's no driver to install
|
installation.add_additional_packages(f"xorg-server xorg-xinit") # Prep didn't run, so there's no driver to install
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue