aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* doc: add new cmdline options to man page4.3.10Ben Kohler2024-01-191-0/+6
| | | | Signed-off-by: Ben Kohler <bkohler@gentoo.org>
* Plymouth support for genkernel (squashed).FlyingWaffle2023-08-301-0/+7
| | | | | | Bug: https://bugs.gentoo.org/753617 Signed-off-by: FlyingWaffle <flyingwaffle@pm.me> Signed-off-by: Sam James <sam@gentoo.org>
* Fix build->builtSam James2023-08-081-1/+1
| | | | Signed-off-by: Sam James <sam@gentoo.org>
* Don't require obsolete /var/lib/module-rebuild/moduledb to existv4.3.4Sam James2023-07-051-3/+1
| | | | | | | | See 71110f715fc46f148280b52b297121786504a325 and d9687a4df038382187300d6f44230661ff5bc377 in gentoo.git. Bug: https://bugs.gentoo.org/909722 Signed-off-by: Sam James <sam@gentoo.org>
* genkernel: add keyctl support for loading LUKS passphrase into a keyringMaciej S. Szmigiero2022-05-221-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Add support for LUKS detached header (another attempt)Robin H. Johnson2022-05-151-0/+22
|\ | | | | | | | | | | | | | | Note: commit 73a05632d61171685ac4960c6b684cefa6d82afd is significantly easier to review by ignoring whitespace changes. Closes: https://github.com/gentoo/genkernel/pull/28 Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
| * Add support for LUKS detached headerDmitry Baranov2021-08-071-0/+22
| | | | | | | | Signed-off-by: Dmitry Baranov <reagentoo@gmail.com>
* | gen_cmdline.sh: Correctly sort --{kernel,utils}-{as,nm}Matt Turner2021-09-121-9/+9
|/ | | | Signed-off-by: Matt Turner <mattst88@gentoo.org>
* gen_cmdline.sh: parse_cmdline(): Allow to override AS, AR, NM & Co via CLIv4.2.2Thomas Deutschmann2021-07-061-1/+43
| | | | | Bug: https://bugs.gentoo.org/786405 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Change --firmware-files handlingThomas Deutschmann2021-03-151-2/+2
| | | | | | | | | | | | | | | | - 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>
* linuxrc: Refactor switch_root error handlingThomas Deutschmann2021-03-141-1/+7
| | | | | | | | | | | | | | | | | | | | | | | Previous idea (commit 93bf318e5114233f3cacc4575ab2e58d60e785c7) never worked: Exec will replace initramfs' init (PID 1) with specified command so that any further line will never be reached. If that command will fail now, init basically ended which will trigger a kernel panic: !! A fatal error has occured since /sbin/openrc-init did not !! boot correctly. Trying to open a shell ... + exec /bin/bash /init: exec: line 1366: /bin/bash: not found [ 55.060649] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00007f00 The new error handling will keep init running in loop which will allow user to fix every detected problem until we are confident that switch_root call has a chance to succeed. In case the user cannot fix the problem (maybe because of gk.userinteraction.disabled), we will call the newly added gk.emergency action (reboot, poweroff or halt). Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* linuxrc: Drop "console" kernel argument handlingThomas Deutschmann2021-03-141-4/+0
| | | | | | | It was never really used; Kernel's console handling already did the work. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* linuxrc: Mark kernel command-line argument lvmraid as deprecatedThomas Deutschmann2021-03-141-4/+0
| | | | | | Not used anymore since we moved to (e)udev. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* linuxrc: Add gk.preserverun.disabledThomas Deutschmann2021-02-081-0/+6
| | | | | | | | | | | | When this boolean option is set and enabled, genkernel initramfs will unmount /run before calling switch_root. This can help in SELinux context for example where labeling is required which is not supported by genkernel. Bug: https://bugs.gentoo.org/739424 Bug: https://bugs.gentoo.org/740576 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* linuxrc: add kernel command-line argument to allow user to pass additional ↵Thomas Deutschmann2021-02-071-0/+10
| | | | | | | | | | | | | | | | | options to cryptsetup Cryptsetup supports additional options like "--perf-no_read_workqueue" or "--perf-no_write_workqueue". While it is recommended to use LUKS2 format and make these activiation flags permanent, you can also make use of the new kernel command-line arguments "crypt_root_options" for root device or "crypt_swap_options" for swap device to pass additional options to cryptsetup. These arguments can be specified multiple times or separate multiple options with a comma. Bug: https://bugs.gentoo.org/755587 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Remove "dobtrfs" kernel command-line argumentThomas Deutschmann2020-09-111-3/+0
| | | | | | | This is no longer necessary with the switch to UDEV. Bug: https://bugs.gentoo.org/739892 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* defaults/initrd.scripts: openLUKS(): Trigger module loading when mounting ↵Thomas Deutschmann2020-09-021-0/+6
| | | | | | | | | {root,swap}_keydev We need to do the same we do for rootfs since commit 05f968fda2c6839744b36c442b3feaa6de974e63 also for {root,swap}_keydev. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* manpage: Update rootfstype documentationThomas Deutschmann2020-09-021-1/+2
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* defaults/linuxrc: Add gk.udev.debug to run udevd in debug modeThomas Deutschmann2020-08-281-0/+4
| | | | | | | When gk.udev.debug=yes is set (boolean option), udevd will run in debug mode. Output will be written to /run/initramfs/udevd.log. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* defaults/linuxrc: Always preserve logThomas Deutschmann2020-08-281-12/+1
| | | | | | | | | | Now that we are using UDEV and have to preserve /run, we can also use /run to always store log from initramfs. This will make debugging easier because user don't have to explicit enable logging (disabling is still possible). Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Remove --disklabel optionThomas Deutschmann2020-08-281-4/+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/linuxrc: Disable processing of modules_load file by defaultThomas Deutschmann2020-08-261-6/+11
| | | | | | | | | | | Now that we are using (e)udev with kmod support, we can rely on UDEV to load required kernel modules. Old module loading based on modules_load file can still be enabled via boolean "gk.hw.use-modules_load" kernel command-line option which is inverting and replacing previous "nodetect" kernel command-line option. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Rename INSTALL_MOD_PATH option to KERNEL_MODULES_PREFIXThomas Deutschmann2020-08-031-3/+3
| | | | | | | | | | 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>
* Switch from MDEV to UDEVThomas Deutschmann2020-07-241-0/+4
| | | | | | | | | We need to switch from using MDEV to UDEV to avoid boot problems due to timeouts caused by some UDEV rules from real system when real system is using systemd. Bug: https://bugs.gentoo.org/706434 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* linuxrc: Add gk.userinteraction.disabledThomas Deutschmann2020-07-161-0/+8
| | | | | | | | When this option is set and enabled, genkernel initramfs will not prompt on errors, i.e. this will disable any user interaction, e.g. for a kiosk system. Bug: https://bugs.gentoo.org/730966 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Add ZSTD compression support for initramfsThomas Deutschmann2020-07-161-1/+2
| | | | | Bug: https://bugs.gentoo.org/731294 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_initramfs.sh: create_initramfs(): Move and unify validation of ↵Thomas Deutschmann2020-07-161-3/+7
| | | | | | | | | | | | | | | --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>
* Document lz4 compression supportRichard Yao2020-05-251-1/+1
| | | | | | Signed-off-by: Richard Yao <ryao@gentoo.org> Closes: https://github.com/gentoo/genkernel/pull/15 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Make kernel config filename customizableThomas Deutschmann2020-03-041-0/+6
| | | | | | | | 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/+4
| | | | | | | b2sum can be used to verify (boot) media since commit 5c55dd467a563623f16be27f670b5a3ddc79fb02. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* defaults/config.sh: Use --buildpkg=n and --usepkg=n in DEFAULT_MODULEREBUILD_CMDThomas Deutschmann2020-01-291-1/+1
| | | | | | | | | While we call emerge with "--ignore-default-opts" since commit da5a5fa797a5fffa6c4d694cbfe2edc83bab4890 to avoid conflicting emerge options, we also need to ensure that we don't clash with problematic emerge FEATURES like "getbinpkg". Reported-by: Rick Farina <zerochaos@gentoo.org> Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* defaults/config.sh: Use --quiet-build=y in DEFAULT_MODULEREBUILD_CMDThomas Deutschmann2020-01-121-1/+1
| | | | | | | | | --quiet-build=y instead of just --quiet will output error message in case emerge failed. Because we catch output this will make genkernel.log a single point of truth logfile without the need to consult any additional logfile. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* --module-rebuild: Call emerge with --ignore-default-optsThomas Deutschmann2020-01-111-4/+11
| | | | | | | | | | | | | 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>
* genkernel.conf: Disable MICROCODE_INITRAMFS option by defaultThomas Deutschmann2019-12-041-0/+3
| | | | | | | Embedding microcode updates into initramfs is deprecated when system is able to load multiple initramfs. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* initrd.scripts: modules_load() refactoredThomas Deutschmann2019-11-241-0/+7
| | | | | | | | | | | | | | | | | - Add support for LABEL/UUID in root kernel parameter - When loading network, always load all network modules even when root block device is already available - Always load crypto and USB module group when CRYPT_{ROOT,SWAP} is set. - Always load fs module group. - Add gk.hw.load-all kernel command-line argument to allow user to force loading of all module groups. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Add support for a custom font at bootThomas Deutschmann2019-11-241-0/+15
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Add --utils-cxx optionThomas Deutschmann2019-09-301-1/+4
| | | | | | | | | | | To compile thin-provisioning-tools, required for LVM thin provisioning support which was added in commit 9dea735590ebfff278710148fa8743777a18c4bd, we need a C++ compiler. This option will allow user to specify custom C++ compiler (for example when using ccache/distcc). Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* manpage: Add documentation about initramfs.mounts fileThomas Deutschmann2019-08-071-0/+14
| | | | | Bug: https://bugs.gentoo.org/560710 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* initrd.scripts: prompt_user(): Read answer from $GK_PROMPT_FILE on timeoutThomas Deutschmann2019-08-071-0/+9
| | | | | | | | | | | | | | | | | | | | This commit will bring back read timeout which was removed in Commit a280829. Read timeout is still disabled by default but can now be controlled via gk.prompt.timeout kernel command-line argument. When gk.prompt.timeout is != 0, the current prompt will be written to $GK_PROMPT_FILE. This will allow remote user to notice that there's a prompt. In addition, on timeout, $GK_PROMPT_FILE will be read allowing remote user to answer prompt and hopefully to fix the problem and resume booting. To make this work, gk.prompt.timeout will be set to 30 seconds by default when SSH usage is enabled. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* linuxrc: Log initramfs output/commandsThomas Deutschmann2019-08-071-0/+16
| | | | | | | | | | | | | | | | | | By default, any {bad,good,warn}_msg output and external command calls will now be logged to /tmp/init.log in initramfs. This can be turned off via gk.log.disabled={1,yes} kernel command-line argument. This is especially helpful when working with remote servers when you can access initramfs system through SSH. In addition, initramfs' log file can be preserved, i.e. copied to real system just before switch_root call. This can be controlled via gk.log.keep kernel command-line argument: When just enabled, initramfs will copy log to $NEWROOT/genkernel-boot.log. Keep in my that the file path must be accessible for initramfs and by default, initramfs will only mount / as $NEWROOT and no additional mountpoints. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* manpage: Clarify that dosshd will start networkv4.0.0_beta10Thomas Deutschmann2019-07-291-2/+3
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Add --kernel-append-localversion optionThomas Deutschmann2019-07-291-0/+6
| | | | | | | | | | | | | | | | | | Now that we moved $ARCH value to kernel's LOCALVERSION setting, you cannot easily change LOCALVERSION anymore without losing $ARCH information. This can be annoying when you just want to build a new revision which should have its own kernel binary, initramfs and modules directory because you would have to remember to include default value. The new option will allow you to just append to genkernel's KERNEL_LOCALVERSION value. This way you can just call genkernel with --kernel-append-localversion=-rN option to build and test a new revision. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Change kernel and initramfs default filename in $BOOTDIRThomas Deutschmann2019-07-291-5/+16
| | | | | | | | | | | | | | | | | | This commit will change default kernel and initramfs filename: kernel-genkernel-%%ARCH%%-%%KV%% -> vmlinuz-%%KV%% System.map-genkernel--%%ARCH%%-%%KV%% -> System.map-%%KV%% initramfs-genkernel-%%ARCH%%-%%KV%% -> initramfs-%%KV%%.img The new naming will be consistent with kernel's "make install" and will allow to match files in /lib/modules with actual kernel. In addition, $ARCH value was moved to kernel's LOCALVERSION. This will ensure that this information is still present and when you do cross-compilation, that /lib/modules content don't get mixed. Bug: https://bugs.gentoo.org/390407 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Make initramfs and kernel filename customizableThomas Deutschmann2019-07-291-13/+77
| | | | | | | | | | | | | New options like --initramfs-filename or --kernel-filename will allow user to customize filenames used when installing initramfs or kernel into $BOOTDIR. Therefore --kernelname (KNAME) option was removed. Filename can contain placeholders like '%%ARCH%%' which will get replaced at runtime. Man page contains more information. Bug: https://bugs.gentoo.org/395095 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Update help text and man pageThomas Deutschmann2019-07-281-17/+30
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Add feature to check for free disk space early at genkernel startv4.0.0_beta9Thomas Deutschmann2019-07-231-0/+8
| | | | | | | | | | | | To avoid preventable errors like running out of disk space while building a new kernel, two new options, --check-free-disk-space-bootdir and --check-free-disk-space-kerneloutputdir, were added. When set, disabled by default, genkernel will check early before starting to build kernel/initramfs for specified amount of free disk space. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Rename --tempdir option to --tmpdir to match used variable namev4.0.0_beta8Thomas Deutschmann2019-07-211-1/+1
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* manpage: Add missing --utils-cflags optionThomas Deutschmann2019-07-211-0/+3
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Add --kernel-localversion optionThomas Deutschmann2019-07-211-0/+4
| | | | | | | This option will set/unset kernel option CONFIG_LOCALVERSION. Closes: https://bugs.gentoo.org/521774 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Add --no-sandbox optionThomas Deutschmann2019-07-211-0/+3
| | | | | | | This option is useful when you are calling genkernel within a sandboxed environment, i.e. when using genkernel within an ebuild. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>