Update microcode handling (#2384)
As of mkinitcpio v38, microcode is handled by a hook and inserted into the initrd. Therefore, we don't have to add microcode entries to bootloaders anymore.
This commit is contained in:
parent
1c071f3bb3
commit
85fda53847
|
|
@ -83,7 +83,7 @@ class Installer:
|
||||||
# systemd, sd-vconsole and sd-encrypt will be replaced by udev, keymap and encrypt
|
# systemd, sd-vconsole and sd-encrypt will be replaced by udev, keymap and encrypt
|
||||||
# if HSM is not used to encrypt the root volume. Check mkinitcpio() function for that override.
|
# if HSM is not used to encrypt the root volume. Check mkinitcpio() function for that override.
|
||||||
self._hooks: List[str] = [
|
self._hooks: List[str] = [
|
||||||
"base", "systemd", "autodetect", "keyboard",
|
"base", "systemd", "autodetect", "microcode", "keyboard",
|
||||||
"sd-vconsole", "modconf", "block", "filesystems", "fsck"
|
"sd-vconsole", "modconf", "block", "filesystems", "fsck"
|
||||||
]
|
]
|
||||||
self._kernel_params: List[str] = []
|
self._kernel_params: List[str] = []
|
||||||
|
|
@ -901,13 +901,6 @@ class Installer:
|
||||||
f'# Created on: {self.init_time}'
|
f'# Created on: {self.init_time}'
|
||||||
)
|
)
|
||||||
|
|
||||||
microcode = []
|
|
||||||
|
|
||||||
if ucode := self._get_microcode():
|
|
||||||
microcode.append(f'initrd /{ucode}')
|
|
||||||
else:
|
|
||||||
debug('Archinstall will not add any ucode to systemd-boot config.')
|
|
||||||
|
|
||||||
options = 'options ' + ' '.join(self._get_kernel_params(root_partition))
|
options = 'options ' + ' '.join(self._get_kernel_params(root_partition))
|
||||||
|
|
||||||
for kernel in self.kernels:
|
for kernel in self.kernels:
|
||||||
|
|
@ -917,7 +910,6 @@ class Installer:
|
||||||
*comments,
|
*comments,
|
||||||
f'title Arch Linux ({kernel}{variant})',
|
f'title Arch Linux ({kernel}{variant})',
|
||||||
f'linux /vmlinuz-{kernel}',
|
f'linux /vmlinuz-{kernel}',
|
||||||
*microcode,
|
|
||||||
f'initrd /initramfs-{kernel}{variant}.img',
|
f'initrd /initramfs-{kernel}{variant}.img',
|
||||||
options,
|
options,
|
||||||
]
|
]
|
||||||
|
|
@ -1083,11 +1075,6 @@ Exec = /bin/sh -c "{hook_command}"
|
||||||
hook_path = hooks_dir / '99-limine.hook'
|
hook_path = hooks_dir / '99-limine.hook'
|
||||||
hook_path.write_text(hook_contents)
|
hook_path.write_text(hook_contents)
|
||||||
|
|
||||||
microcode = []
|
|
||||||
|
|
||||||
if ucode := self._get_microcode():
|
|
||||||
microcode = [f'MODULE_PATH=boot:///{ucode}']
|
|
||||||
|
|
||||||
kernel_params = ' '.join(self._get_kernel_params(root_partition))
|
kernel_params = ' '.join(self._get_kernel_params(root_partition))
|
||||||
config_contents = 'TIMEOUT=5\n'
|
config_contents = 'TIMEOUT=5\n'
|
||||||
|
|
||||||
|
|
@ -1096,7 +1083,6 @@ Exec = /bin/sh -c "{hook_command}"
|
||||||
entry = [
|
entry = [
|
||||||
f'PROTOCOL=linux',
|
f'PROTOCOL=linux',
|
||||||
f'KERNEL_PATH=boot:///vmlinuz-{kernel}',
|
f'KERNEL_PATH=boot:///vmlinuz-{kernel}',
|
||||||
*microcode,
|
|
||||||
f'MODULE_PATH=boot:///initramfs-{kernel}{variant}.img',
|
f'MODULE_PATH=boot:///initramfs-{kernel}{variant}.img',
|
||||||
f'CMDLINE={kernel_params}',
|
f'CMDLINE={kernel_params}',
|
||||||
]
|
]
|
||||||
|
|
@ -1127,15 +1113,7 @@ Exec = /bin/sh -c "{hook_command}"
|
||||||
if not uki_enabled:
|
if not uki_enabled:
|
||||||
loader = '/vmlinuz-{kernel}'
|
loader = '/vmlinuz-{kernel}'
|
||||||
|
|
||||||
microcode = []
|
|
||||||
|
|
||||||
if ucode := self._get_microcode():
|
|
||||||
microcode.append(f'initrd=/{ucode}')
|
|
||||||
else:
|
|
||||||
debug('Archinstall will not add any ucode to firmware boot entry.')
|
|
||||||
|
|
||||||
entries = (
|
entries = (
|
||||||
*microcode,
|
|
||||||
'initrd=/initramfs-{kernel}.img',
|
'initrd=/initramfs-{kernel}.img',
|
||||||
*self._get_kernel_params(root_partition)
|
*self._get_kernel_params(root_partition)
|
||||||
)
|
)
|
||||||
|
|
@ -1178,8 +1156,6 @@ Exec = /bin/sh -c "{hook_command}"
|
||||||
kernel_parameters = self._get_kernel_params(root_partition)
|
kernel_parameters = self._get_kernel_params(root_partition)
|
||||||
cmdline.write(' '.join(kernel_parameters) + '\n')
|
cmdline.write(' '.join(kernel_parameters) + '\n')
|
||||||
|
|
||||||
ucode = self._get_microcode()
|
|
||||||
|
|
||||||
diff_mountpoint = None
|
diff_mountpoint = None
|
||||||
|
|
||||||
if efi_partition.mountpoint != Path('/efi'):
|
if efi_partition.mountpoint != Path('/efi'):
|
||||||
|
|
@ -1194,10 +1170,8 @@ Exec = /bin/sh -c "{hook_command}"
|
||||||
config = preset.read_text().splitlines(True)
|
config = preset.read_text().splitlines(True)
|
||||||
|
|
||||||
for index, line in enumerate(config):
|
for index, line in enumerate(config):
|
||||||
if not ucode and line.startswith('ALL_microcode='):
|
|
||||||
config[index] = '#' + line
|
|
||||||
# Avoid storing redundant image file
|
# Avoid storing redundant image file
|
||||||
elif m := image_re.match(line):
|
if m := image_re.match(line):
|
||||||
image = self.target / m.group(2)
|
image = self.target / m.group(2)
|
||||||
image.unlink(missing_ok=True)
|
image.unlink(missing_ok=True)
|
||||||
config[index] = '#' + m.group(1)
|
config[index] = '#' + m.group(1)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue