Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-04-28 05:38:16 +0000
committerGitHub <noreply@github.com>2021-04-28 05:38:16 +0000
commit932517e20d92a1e69c258aa58f387246248eaff7 (patch)
treec7645e3a8275afbb2ddea73f08e74ab494f67403
parente7a429db117313294ebeee2cc460405ba28da8b8 (diff)
parent0e89173ddf4827353874c611fba75f99d9693e27 (diff)
Merge pull request #366 from advaithm/master
Bug fixes for kernel select and grub-install
-rw-r--r--archinstall/lib/installer.py14
-rw-r--r--profiles/sway.py3
-rw-r--r--profiles/xorg.py9
3 files changed, 19 insertions, 7 deletions
diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py
index 577a2ae1..a5449662 100644
--- a/archinstall/lib/installer.py
+++ b/archinstall/lib/installer.py
@@ -1,6 +1,5 @@
import os, stat, time, shutil, pathlib
import subprocess, logging
-
from .exceptions import *
from .disk import *
from .general import *
@@ -40,8 +39,8 @@ class Installer():
:type hostname: str, optional
"""
- def __init__(self, target, *, base_packages='base base-devel linux linux-firmware', kernels='linux'):
- base_packages = base_packages + kernels.replace(',', ' ')
+ def __init__(self, target, *, base_packages='base base-devel linux-firmware', kernels='linux'):
+ kernels = kernels.split(",")
self.target = target
self.init_time = time.strftime('%Y-%m-%d_%H-%M-%S')
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
+ for kernel in kernels:
+ self.base_packages.append(kernel)
if hasUEFI():
self.base_packages.append("efibootmgr")
else:
@@ -363,8 +364,10 @@ class Installer():
boot_partition = partition
elif partition.mountpoint == self.target:
root_partition = partition
-
- self.log(f'Adding bootloader {bootloader} to {boot_partition}', level=logging.INFO)
+ if hasUEFI():
+ 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 not hasUEFI():
@@ -439,6 +442,7 @@ class Installer():
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}'))
sys_command('/usr/bin/arch-chroot /mnt grub-mkconfig -o /boot/grub/grub.cfg')
+ self.helper_flags['bootloader'] = bootloader
return True
else:
raise RequirementError(f"Unknown (or not yet implemented) bootloader requested: {bootloader}")
diff --git a/profiles/sway.py b/profiles/sway.py
index 53eb8c5a..f132df33 100644
--- a/profiles/sway.py
+++ b/profiles/sway.py
@@ -11,7 +11,8 @@ def _prep_function(*args, **kwargs):
other code in this stage. So it's a safe way to ask the user
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()
return True
diff --git a/profiles/xorg.py b/profiles/xorg.py
index 413a6308..cd89668d 100644
--- a/profiles/xorg.py
+++ b/profiles/xorg.py
@@ -25,7 +25,14 @@ def _prep_function(*args, **kwargs):
# or through conventional import xorg
if __name__ == 'xorg':
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:
installation.add_additional_packages(f"xorg-server xorg-xinit") # Prep didn't run, so there's no driver to install