aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* firmware: copy only the necessary firmware(s) into initramfsDmitry Baranov2023-08-301-0/+1
| | | | | | | | | | | | | | | | | | | FIRMWARE=yes behavior is changed: Only the minimum number of firmware files will be copied. The list is generated using the `modinfo -F firmware [modules]...` command. The ability to copy all firmware(s) is also available with a new ALLFIRMWARE setting (see the modified genkernel.conf for more details). As for changes in the source code: gen_moddeps.sh: Significantly redesigned module list generation. To get a list of modules, use the `mod_dep_list()` function instead of `gen_dep_list()`. Modules that are not in the kernel (=n or invalid) will be filtered out. Aliases will be replaced with real names (including dependencies). Signed-off-by: Dmitry Baranov <reagentoo@gmail.com> Closes: https://github.com/gentoo/genkernel/pull/40 Signed-off-by: Sam James <sam@gentoo.org>
* Changed firmware and modules requirements to warnings.FlyingWaffle2023-08-301-2/+2
| | | | | | | | | | Depending on system configuration and hardware, added firmware and modules might not be required for Plymouth to function. Bug: https://bugs.gentoo.org/753617 Signed-off-by: FlyingWaffle <flyingwaffle@pm.me> Closes: https://github.com/gentoo/genkernel/pull/29 Signed-off-by: Sam James <sam@gentoo.org>
* Plymouth support for genkernel (squashed).FlyingWaffle2023-08-301-0/+16
| | | | | | Bug: https://bugs.gentoo.org/753617 Signed-off-by: FlyingWaffle <flyingwaffle@pm.me> Signed-off-by: Sam James <sam@gentoo.org>
* Replace use of `which`Sam James2023-07-271-7/+7
| | | | | | | We're trying to phase it out as it's non-portable. Use bash's `type -P` where available (preferable as it avoids user functions) or `command -v` if POSIX. Signed-off-by: Sam James <sam@gentoo.org>
* gen_determineargs.sh: update sys-fs/udev referenceSam James2023-07-271-1/+1
| | | | | | Noticed after ulm reported it on IRC. Signed-off-by: Sam James <sam@gentoo.org>
* Reimplement --kernel-cross-compile= for genkernel 4.xMatoro Mahri2023-01-081-11/+12
| | | | | | | | | | | | | This restores the --kernel-cross-compile= option from genkernel 3.x, which controls only the --kernel-xxx= options as opposed to both kernel and userspace options controlled by --cross-compile=. Also adds documentation on the missing options in default genkernel.conf. Bug: https://bugs.gentoo.org/716862 Signed-off-by: Matoro Mahri <matoro@users.noreply.github.com> Signed-off-by: Matt Turner <mattst88@gentoo.org>
* genkernel: add keyctl support for loading LUKS passphrase into a keyringMaciej S. Szmigiero2022-05-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cryptsetup LUKS2 format comes with an ability to automatically unlock multiple devices (root, swap, etc.) sharing the same passphrase, without retyping it for each of them, by loading it into the user keyring. This commit adds such (optional) genkernel support for loading LUKS passphrase into the user keyring on boot. In the default mode of operation the newly added key is (possibly) used only to unlock root and swap devices and is removed soon after that. By providing appropriate kernel command line parameter the key can be left in the keyring instead (with an optional timeout) for unlocking other LUKS devices post-initramfs time. Because one of the most common use cases of this functionality will be having an encrypted swap for doing suspend to disk (hibernation) let's also make sure that we don't unlock the root device when doing so is unnecessary (when we are resuming the system from hibernation). Since the security of a FDE passphrase is of paramount importance in this solution significant care has been taken not to leak it accidentally: * The passphrase is read directly by keyctl to avoid storing it in the shell, * If the passphrase is used only to unlock root and swap devices (which is the default mode of operation) the init script will check whether its removal from keyring has actually succeeded and, if not, reboot the system rather than continue while leaving it exposed, * keyutils includes a patch (already upstreamed) to wipe the passphrase from memory when no longer needed. Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
* gen_determineargs.sh: determine_real_args(): Make kmod only required for ↵Thomas Deutschmann2021-11-151-6/+9
| | | | | | | | non-static kernels Fixes: 153a877d ("Refactor (compressed) kernel module handling") Bug: https://bugs.gentoo.org/821484 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Refactor (compressed) kernel module handlingThomas Deutschmann2021-09-091-0/+6
| | | | | | | | | | | | | | | | | | | | | | To support a specific module compression algorithm, two things are needed: Used depmod utility on host system building the kernel must support chosen module compression algorithm to generate proper modules.dep file or genkernel would be unable to read module dependencies when copying modules to initramfs. At runtime, used modprobe utility must be able to handle chosen module compression algorithm or modules would be unloadable. To address the first requirement, genkernel will now check if used kmod utility on host system supports chosen module compression algorithm. To address the runtime requirement, this commit will switch from BusyBox's modutils implementation to kmod because BusyBox does not support ZSTD compression (yet). Bug: https://bugs.gentoo.org/809344 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_moddeps.sh: Move modules_kext() to determine_KEXT()Thomas Deutschmann2021-07-081-0/+35
| | | | | | | | | | | We want debug output but then we cannot use return value from this function. Transforming function to determine_KEXT() like determine_KV() will fix the problem and allows us to keep debug output. Fixes: 234ce29 ("gen_moddeps.sh: modules_kext() refactored") Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Change --firmware-files handlingThomas Deutschmann2021-03-151-4/+8
| | | | | | | | | | | | | | | | - Move from space-separated list to comma-separated list to add support for firmware files with spaces. - Add support for firmware files with spaces. - Check for specified firmware files in determine_real_args() which will allow us to error out early. - Clarify documentation. Fixes: c576f99b0b ("Misc improvements for FIRMWARE* handling") Bug: https://bugs.gentoo.org/775221 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_determineargs.sh: determine_real_args(): remove duplicated config ↵Karlson2k (Evgeny Grin)2020-09-021-1/+0
| | | | | | | | override for BUSYBOX_CONFIG Signed-off-by: Karlson2k (Evgeny Grin) <k2k@narod.ru> Closes: https://github.com/gentoo/genkernel/pull/23 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Remove --disklabel optionThomas Deutschmann2020-08-281-1/+0
| | | | | | | Now that we always build util-linux for switch_root, we no longer need this option. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* defaults/config.sh: Add DEFAULT_<TYPE>_<TCVAR> to allow overrideThomas Deutschmann2020-08-281-5/+21
| | | | | | | _tc-getPROG() can only override variable with user provided value when there is a default value. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_determineargs.sh: determine_real_args(): --integrated-initramfs requires ↵Thomas Deutschmann2020-08-181-0/+8
| | | | | | building of kernel and initramfs Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_determineargs.sh: determine_real_args(): Set KERNEL_MODULES_PREFIX to ↵Thomas Deutschmann2020-08-031-0/+25
| | | | | | | | | | | | temporary location when --no-install is set This will ensure that we won't install anything on user's system when --no-install was set. While here, make use of expand_file() for --kernel-modules-prefix. Bug: https://bugs.gentoo.org/505810 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Make use of expand_file() for --linuxrc optionThomas Deutschmann2020-08-031-0/+13
| | | | | Bug: https://bugs.gentoo.org/483146 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Rename INSTALL_MOD_PATH option to KERNEL_MODULES_PREFIXThomas Deutschmann2020-08-031-1/+1
| | | | | | | | | | Before this change we had different names in config file and command-line for the same thing. With this change we have one option named KERNEL_MODULES_PREFIX and its corresponding --kernel-modules-prefix command-line argument. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_determineargs.sh: determine_real_args(): Check if we can write into ↵Thomas Deutschmann2020-08-011-0/+15
| | | | | | /etc/kernels when --save-config is set Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Unify grep usageThomas Deutschmann2020-08-011-2/+2
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* genkernel: Move grep/zgrep check to determine_real_args()Thomas Deutschmann2020-08-011-0/+14
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* busybox: Honor toolchainThomas Deutschmann2020-07-161-1/+1
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_determineargs.sh: determine_real_args(): Don't call gcc directlyThomas Deutschmann2020-07-161-7/+6
| | | | | | | Set $CHOST variable via config so that we no longer need to call gcc directly to determine CHOST value. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_configkernel.sh: set_initramfs_compression_method() refactoredThomas Deutschmann2020-07-161-0/+2
| | | | | | | | | | | | | - Add handling for compression method "best" and "fastest". - Make use of new get_initramfs_compression_method_by_{compression,speed} functions. - Set CONFIG_RD_<TYPE>=n or CONFIG_INITRAMFS_COMPRESSION_<TYPE>=n only when required to avoid second `make oldconfig` call due to changed .config file. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_initramfs.sh: create_initramfs(): Move and unify validation of ↵Thomas Deutschmann2020-07-161-0/+91
| | | | | | | | | | | | | | | --compress-initramfs-type to determine_real_args() This will allow us to error out early if required user space tool needed to compress initramfs based on specified --compress-initramfs-type is missing or selected type is invalid/unsupported. Best/fastest list is based on results from [Link1][Link2][Link3]. Link1: https://events.static.linuxfound.org/sites/events/files/lcjpcojp13_klee.pdf Link2: https://kernel.ubuntu.com/~cking/boot-speed-eoan-5.3/kernel-compression-method.txt Link3: https://lwn.net/Articles/817134/ Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_determineargs.sh: determine_real_args(): Fix unsetting toolchain variableThomas Deutschmann2020-07-161-1/+1
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_determineargs.sh: determine_real_args(): Fix styleThomas Deutschmann2020-07-161-3/+3
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_determineargs.sh: determine_real_args(): Quote $SANDBOX_ONThomas Deutschmann2020-04-121-1/+1
| | | | | | | $SANDBOX_ON can be unset causing 'unary operator expected' error. Fixes c0e013c ("gen_determineargs.sh: determine_real_args(): Error out early when already running within a sandbox") Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_determineargs.sh: determine_real_args(): Error out early when already ↵Thomas Deutschmann2020-04-081-0/+5
| | | | | | | | | | running within a sandbox We cannot spawn a sandbox when we are already running within a sandbox. This commit will make genkernel error out early to tell user about the problem. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Make kernel config filename customizableThomas Deutschmann2020-03-041-2/+17
| | | | | | | | This commit will make kernel config filename used by --save-config feature customizable like previous commit 769a07fd3e947 did for initramfs and kernel image. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Add b2sumThomas Deutschmann2020-02-151-0/+1
| | | | | | | b2sum can be used to verify (boot) media since commit 5c55dd467a563623f16be27f670b5a3ddc79fb02. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_initramfs.sh: append_splash(): Move check for splash_geninitramfs to ↵Thomas Deutschmann2020-01-141-0/+8
| | | | | | | | | determine_real_args() This will allow us to fail early if splash_geninitramfs isn't available. Bug: https://bugs.gentoo.org/705304 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* --module-rebuild: Call emerge with --ignore-default-optsThomas Deutschmann2020-01-111-0/+12
| | | | | | | | | | | | | It's possible that user has set conflicting emerge options like "--ask" in EMERGE_DEFAULT_OPTS which could break genkernel. Calling emerge with --ignore-default-opts will allow us to avoid such scenarios. In addition, --module-rebuild-cmd (MODULEREBUILD_CMD) option was added to allow user to alter default command. Closes: https://bugs.gentoo.org/705082 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Style fix: Use curly bracesThomas Deutschmann2020-01-111-15/+15
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Change separator in mktemp() templatesThomas Deutschmann2019-12-311-2/+2
| | | | | | | | | | Some packages will fail to build when path contains character sequences like ".o". Using "_" as separator in mktemp() template will avoid that problem. Link: https://github.com/jthornber/thin-provisioning-tools/issues/127 Thanks-to: Doug Freed <dwfreed@mtu.edu> Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_determineargs.sh: determine_output_filenames(): Always set GK_FILENAME_* ↵Thomas Deutschmann2019-12-141-2/+0
| | | | | | | | variables We always need GK_FILENAME_* variables, even when not installing anything. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_determineargs.sh: determine_real_args(): Fix /etc/multipath.conf checkThomas Deutschmann2019-12-041-2/+5
| | | | | | Using "-s" is not enough, file could be a directory. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_determineargs.sh: determine_real_args(): Adjust authorized_keys file ↵Thomas Deutschmann2019-12-041-2/+2
| | | | | | | | | validation Using "-s" is not enough, file could be a directory. Better check for content! Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* genkernel.conf: Disable MICROCODE_INITRAMFS option by defaultThomas Deutschmann2019-12-041-1/+1
| | | | | | | Embedding microcode updates into initramfs is deprecated when system is able to load multiple initramfs. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_determineargs.sh: determine_real_args(): Create kernel module group for ↵Thomas Deutschmann2019-11-271-0/+9
| | | | | | | | | | additional modules This is needed to get modules, used by genkernel features, like bcache module which is used by "dobcache" feature, into initramfs. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_determineargs.sh: determine_real_args(): Cleanup old codeThomas Deutschmann2019-11-271-3/+1
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_compile.sh: determine_busybox_config_file(): Move --busybox-config ↵Thomas Deutschmann2019-11-241-0/+19
| | | | | | | | validation to determine_real_args() This will allow us to fail early. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_determineargs.sh: determine_real_args(): Log when --no-clean forces ↵Thomas Deutschmann2019-11-241-10/+11
| | | | | | --no-mrproper Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Add support for a custom font at bootThomas Deutschmann2019-11-241-0/+38
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_determineargs.sh: determine_real_args(): Expand $TMPDIRThomas Deutschmann2019-11-211-0/+6
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_determineargs.sh: determine_real_args(): Expand $LOGFILEThomas Deutschmann2019-11-211-0/+6
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_determineargs.sh: determine_real_args(): clarify ↵Thomas Deutschmann2019-11-191-3/+4
| | | | | | $SSH_AUTHORIZED_KEYS_FILE errors Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_determineargs.sh: determine_real_args(): Initialize $KERNEL_OUTPUTDIR ↵Thomas Deutschmann2019-11-191-7/+48
| | | | | | | after $KERNEL_DIR Bug: https://bugs.gentoo.org/698828 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_determineargs.sh: determine_real_args(): Check for `realpath -m` supportThomas Deutschmann2019-11-191-0/+11
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_determineargs.sh: determine_real_args(): Quote $KERNEL_DIRThomas Deutschmann2019-11-191-1/+1
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>