summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* kernel-install.eclass: run depmod after compressing modulesAndrew Ammerlaan2024-08-091-0/+3
| | | | | | | | | | | | (de)compressing modules changes the path of the module files so we need to run depmod to ensure that tools such as modprobe/modinfo work. Note that depmod is often, but *not* always, run by sys-kernel/installkernel. Systemd installs a hook to do this, but there is no equivalent on openrc systems. So instead just ensure that the tree of modules we install is consistent here in the eclass. Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
* (dist-)kernel-{install,utils}.eclass: fix finding config during cleanupAndrew Ammerlaan2024-08-081-1/+1
| | | | | | | | | | | | The source symlink does not exist on all systems. If we can't find any config at all then there will be no preferred suffix which means we fall back to the old '-nt' based cleaning. Closes: https://bugs.gentoo.org/937569 Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/38016 Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
* kernel-install.eclass: use dist-kernel_get_module_suffix to find compressionAndrew Ammerlaan2024-08-071-7/+29
| | | | | | | | | | | | Adjusts kernel-install_compress_modules to use the new function dist-kernel_get_module_suffix. This makes no functional difference at the moment since gentoo-kernel-bin is the only consumer and it has XZ compression in the config. Still this makes it possible to compile alternate prebuilt kernels with alternate module compression support, and may in the future help to support gzip and zstd module compression in gentoo-kernel-bin. Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
* kernel-install.eclass: fixup indentationAndrew Ammerlaan2024-08-041-12/+12
| | | | Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
* eclass/kernel-{build,install}.eclass: link to config,Sys.map in moddirAndrew Ammerlaan2024-07-241-0/+7
| | | | | | | | | | | | | | | | The kernels 'make rpm-pkg' and 'make deb-pkg' install the config and System.map into the modules directory for easy access. Let's do the same here so our gpkg's are more symetric to rpm's and deb's and tools that look for these files there can find it. This also provides an easy location for the user to access the config. Considering that /boot/config-x.y.z does not always exist (the config instalation via /sbin/installkernel depends on layout and +/-systemd configuration). Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/37684 Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
* kernel-install.eclass: improve kernel version checkJames Calligeros2024-07-151-5/+5
| | | | | | | | | Now that we have an improved version check in kernel-build.eclass, copy it here so that the two eclasses match. Signed-off-by: James Calligeros <jcalligeros99@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/37327 Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
* kernel-{build,install}.eclass: make kernel install paths match releaseJames Calligeros2024-07-151-24/+35
| | | | | | | | | | | | | | | | | | | | | | | | | dist-kernel releases are required to match the package's version, with '_' substituted for '-' as per kernel release format rules. Curiously, we made no such substitution on the kernel install directory names. The consequence of this is that Catalyst has technically only been working with dist-kernels by pure coincidence - it had never been tested with kernels containing '_' in ${PV}. When attempting to build install media for the Gentoo Asahi project, which necessitates using kernels versioned with '_p*', Catalyst's call to Dracut's --kver argument passes in the name of the source directory while Dracut expects the kernel release (module directory). Make sure that all directories installed by the kernel match the kernel's own idea of its version exactly. This fixes Catalyst, makes directories like /usr/src/linux-* consistent with /lib/modules For compatibility with existing bin kernels, KV_FULL will be set to ${PV}${KV_LOCALVERSION} in kernel-install.eclass if it has not been explicitly set elsewhere. Signed-off-by: James Calligeros <jcalligeros99@gmail.com> Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
* kernel-install: Improve warning, consider alternate initrd generatorsZen2024-07-151-11/+24
| | | | | Signed-off-by: Zen <z@pyl.onl> Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
* kernel-install.eclass: move mount-boot check to dist-kernel-utils.eclassAndrew Ammerlaan2024-06-291-35/+9
| | | | | | | | ebuilds and eclasses using dist-kernel_reinstall_initramfs should also have the check for mounted /boot and ESP. We can do this safely via mount-boot-utils.eclass which does not export any phases. Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
* kernel-install.eclass: explicitly set kernel image to 644Andrew Ammerlaan2024-02-111-0/+1
| | | | | | | | | | | | | | | The kernel build system sets the permissions on the kernel image to 644. However objcopy creates a file with permissions 755. This causes a discrepancy in the permissions on the installed kernel image between +generic-uki,-generic-uki and between gentoo-kernel, gentoo-kernel-bin. Restore the symmetry by explicitly setting the objcopy'ed files permissions to 644. Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/35214 Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
* kernel-install.eclass: install vmlinu{x,z} symlinkAndrew Ammerlaan2024-02-111-7/+21
| | | | | | and also link generic initrd/uki.efi Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
* kernel-install.eclass: drop sys-kernel/installkernel-systemdAndrew Ammerlaan2024-01-241-13/+3
| | | | Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
* kernel-install.eclass: Compress kernel modules in parallelMichał Górny2024-01-171-4/+9
| | | | | | | Closes: https://bugs.gentoo.org/922185 Signed-off-by: Michał Górny <mgorny@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/34843 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* kernel-install.eclass: USE=generic-uki drop requirement for installkernel[uki]Andrew Ammerlaan2024-01-161-1/+1
| | | | | | | | | | it is not strictly necessary, i.e. we might also want to just use the generic initrd. Or install the uki in the grub layout. But more importantly this requirement creates a bit of an unfortunate conflict in binpkg-docker that would otherwise have to be resolved with manual overrides of install.conf. See-also: https://github.com/projg2/binpkg-docker/pull/7 Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
* kernel-install.eclass: USE=generic-uki depend on installkernel[uki]Andrew Ammerlaan2024-01-121-1/+1
| | | | | | | and switch order since we are deprecating installkernel-systemd and have moved this functionality into installkernel(-gentoo). Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
* */*: move sys-kernel/installkernel-gentoo to sys-kernel/installkernelAndrew Ammerlaan2024-01-121-4/+4
| | | | | Bug: https://bugs.gentoo.org/917145 Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
* eclass/(dist-)kernel-*.eclass: drop installkernel-gentoo-7Andrew Ammerlaan2024-01-071-27/+12
| | | | | | | | because we drop the generation of the initrd/uki here we can remove KERNEL_IUSE_SECUREBOOT since this is now exactly the same as KERNEL_IUSE_MODULES_SIGN Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
* kernel-install.eclass: Call module cleanup in postinstMichał Górny2023-12-301-0/+3
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* kernel-{build,install}.eclass: Rename flag to modules-compressMichał Górny2023-12-301-3/+3
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* kernel-{build,install}.eclass: drop plymouth for generic-ukiAndrew Ammerlaan2023-12-251-5/+3
| | | | | | | | | | plymouth pulls in drm, and drm includes all gpu drivers and their firmware especially the firmware files are very big. The whole thing costs us 15M on each initrd, and therefore gpkg. Also exclude the netronome drivers, these also have ridiculously large firmware files. Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org> Signed-off-by: Michał Górny <mgorny@gentoo.org>
* kernel-install.eclass: Add kernel-install_compress_modulesMichał Górny2023-12-251-0/+11
| | | | | | | Add a function to compress modules manually. It will be used in sys-kernel/gentoo-kernel-bin. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* kernel-{build,install}.eclass: Support XZ module compressionMichał Górny2023-12-251-1/+4
| | | | | | | | | | When KERNEL_IUSE_GENERIC_UKI is set (to gatekeep for new ebuilds), enable XZ module compression in kernel and add IUSE=module-compress. When the flag is enabled, the modules are installed .xz compressed per the config. When it is disabled, they are installed uncompressed but the kernel retains module compression support. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* eclass/kernel-install.eclass: warn if USE=-initramfsAndrew Ammerlaan2023-12-241-0/+14
| | | | | | Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/34450 Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
* kernel-{build,install}.eclass: compress generic initrd with xzAndrew Ammerlaan2023-12-241-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Some basic benchmarks: -rw------- 1 root root 103494321 Dec 24 11:10 bzip2 -rw------- 1 root root 112179814 Dec 24 11:02 gzip-nostrip -rw------- 1 root root 112179814 Dec 24 11:06 gzip-strip -rw------- 1 root root 112179814 Dec 24 11:08 gzip-strip-aggressive -rw------- 1 root root 130847597 Dec 24 11:19 lz4 -rw------- 1 root root 66948253 Dec 24 11:13 lzma -rw------- 1 root root 124285638 Dec 24 11:18 lzop -rw------- 1 root root 80242444 Dec 24 11:14 xz -rw------- 1 root root 66744036 Dec 24 11:59 xz-9e--check -rw------- 1 root root 85917687 Dec 24 11:20 zstd Strip does nothing, which makes sense since portage already did this. xz is our size champion so pick this one to compress our initrd With this change the generic UKI is: 82515840, versus My own hostonly UKI of the same kernel version: 29390720. Which is still 2.8 times larger, but significantly better then the 5 times larger we had before! Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/34024 Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
* kernel-{build,install}.eclass: add USE=generic-ukiAndrew Ammerlaan2023-12-231-8/+204
| | | | | | | | | | - optionally build a generic unified kernel image - only install this uki.efi in any binary generated binpkgs, this saves space - extract the initrd and kernel image from the uki in pkg_postinst - own image, initrd and uki install paths Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org> Signed-off-by: Michał Górny <mgorny@gentoo.org>
* kernel-install.eclass: support loong in kernel-install_get_qemu_archWANG Xuerui2023-12-191-0/+3
| | | | | | | Right now the loong profiles in Gentoo only cover the 64-bit ISA, so we can unconditionally specify loongarch64 for QEMU. Signed-off-by: WANG Xuerui <xen0n@gentoo.org>
* kernel-install.eclass: fix test phase on systemd systemsAndrew Ammerlaan2023-12-111-0/+3
| | | | | | | | | | | | | On systemd systems the dracut systemd modules are included automatically. Systemd insists our dummy root has some valid /etc/os-release file, otherwise it refuses the switch root operation. However, with this fix it still does not boot up correctly on systemd systems, it gets stuck in an infinite boot loop. Presumably the reason has something to do with our dummy root not having a real systemd init to switch root to. We add the systemd dracut modules to the omit list to prevent the problem and ensure the test phase behaves the same on systemd and non-systemd systems. Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
* eclass/(dist-)kernel{-utils,-install}: More flexible initrd generationAndrew Ammerlaan2023-12-051-8/+22
| | | | | | | | | | | | | We only need to call dracut to generate an initrd/uki if we are using <=sys-kernel/installkernel-gentoo-7. sys-kernel/installkernel-systemd already calls dracut via its plugin system if it is installed. sys-kernel/installkernel-gentoo-8[dracut] now also contains the code required to generate an initrd or uki. This change makes it possible for users to use other/custom initrd generators with our dist kernels if they are using installkernel-systemd. Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
* kernel-install.eclass: also cleanup uki.efi in postrmAndrew Ammerlaan2023-11-181-1/+1
| | | | | | | Nowadays the name of the unified kernel image is always uki.efi, not initrd.uefi. Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
* kernel-install.eclass: bump minimal dracut versionAndrew Ammerlaan2023-11-101-1/+1
| | | | | | | 059-r4 contains the fixes to the kernel-install plugin that we need to be able to drop a workaround in dist-kernel-utils.eclass Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
* */*: move sys-kernel/installkernel-systemd-boot to ↵Andrew Ammerlaan2023-11-091-1/+1
| | | | | | | | | sys-kernel/installkernel-systemd This reflects better that we don't necessarily need the systemd bootloader to use the systemd kernel-install system. Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
* kernel-install.eclass: enforce signed modules in test with USE=modules-signAndrew Ammerlaan2023-08-271-0/+4
| | | | | | | | | | | | | | This only has effect when building the gpkg for gentoo-kernel-bin which overrides CONFIG_MODULE_SIG_FORCE. To ensure that the module signing was successful we instruct the kernel to reject modules with an invalid signature. This has no effect on other kernel packages which already have CONFIG_MODULE_SIG_FORCE=y. Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/32463 Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
* kernel-install.eclass: adjust test deps for sparcSam James2023-07-211-0/+1
| | | | Signed-off-by: Sam James <sam@gentoo.org>
* kernel-install.eclass: simplify caseSam James2023-07-211-18/+3
| | | | Signed-off-by: Sam James <sam@gentoo.org>
* kernel-install.eclass: kernel-install_get_qemu_arch: port to sparcSam James2023-07-211-1/+7
| | | | Signed-off-by: Sam James <sam@gentoo.org>
* kernel-install.eclass: drop EAPI 7 supportDavid Seifert2022-12-241-9/+4
| | | | | Signed-off-by: David Seifert <soap@gentoo.org> Signed-off-by: Michał Górny <mgorny@gentoo.org>
* kernel-install.eclass: Fix variable mismatchMichał Górny2022-10-301-1/+1
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* kernel-install.eclass: Account for PV/KV mismatchMichał Górny2022-10-291-26/+41
| | | | | | | | | Do not assume PV and kernel version must always match. Use PV for kernel install directory (i.e. /usr/src/linux) but get the release from the kernel build directory for the module directory. Update preinst version check to account for live ebuilds. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* kernel-install.eclass: Revert "Add KV_FULL [...]"Michał Górny2022-10-291-23/+17
| | | | | Reverts: 55a495ad71b0ce1620488f389baddeebc787ee64 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* kernel-install.eclass: Add KV_FULL for "upstream" kernel versionMichał Górny2022-10-191-17/+23
| | | | | | | | Add a KV_FULL variable that defaults to the kernel version derived from PV, and can be used by ebuilds to override the version if necessary. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* kernel-install.eclass: support EAPI 8Mike Gilbert2022-09-091-12/+10
| | | | Signed-off-by: Mike Gilbert <floppym@gentoo.org>
* kernel-install.eclass: pkg_preinst: fix symlinks for merged-usrMike Gilbert2022-09-061-0/+6
| | | | | Closes: https://bugs.gentoo.org/843821 Signed-off-by: Mike Gilbert <floppym@gentoo.org>
* kernel-install.eclass: add riscv supportSam James2022-05-081-1/+4
| | | | Signed-off-by: Sam James <sam@gentoo.org>
* *.eclass: @ECLASS-VARIABLE renamed to @ECLASS_VARIABLEUlrich Müller2022-03-241-1/+1
| | | | | Bug: https://bugs.gentoo.org/835396 Signed-off-by: Ulrich Müller <ulm@gentoo.org>
* kernel-install.eclass: add ppc(32) supportGeorgy Yakovlev2021-12-161-0/+9
| | | | | Bug: https://bugs.gentoo.org/794799 Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
* kernel-install.eclass: Set @PROVIDESMichał Górny2021-09-021-0/+1
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* kernel-install.eclass: Add a safety check for mismatched versionMichał Górny2021-07-241-2/+14
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* kernel-install.eclass: print uname() info after testGeorgy Yakovlev2021-07-071-1/+14
| | | | | Closes: https://github.com/gentoo/gentoo/pull/21549 Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
* eclass/kernel-install.eclass: omit some dracut modules for testsGeorgy Yakovlev2021-06-031-0/+14
| | | | | | | some modules slow down or even fail to boot in our test environment force qemu dracut module while at it. Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
* kernel-install.eclass: Update symlink if target has no sourcesMichał Górny2021-03-111-0/+3
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>