[gentoo-commits] proj/genkernel:master commit in: /, doc/
commit: d6a77d90fd511b04b12bd7ae40d710d3d144c077 Author: Ben Kohler gentoo org> AuthorDate: Fri Jan 19 20:05:49 2024 + Commit: Ben Kohler gentoo org> CommitDate: Fri Jan 19 20:09:41 2024 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=d6a77d90 doc: add new cmdline options to man page Signed-off-by: Ben Kohler gentoo.org> doc/genkernel.8.txt | 6 ++ genkernel | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index 3108dde..571ab06 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -241,6 +241,9 @@ LOW-LEVEL COMPILATION OPTIONS when the system running genkernel has a different architecture like the system which should boot the created kernel/initramfs. +*--kernel-cross-compile*=:: +Target triple (i.e. aarch64-linux-gnu) to build kernel for. + *--kernel-ar*=:: Archiver to use for the kernel compilation. @@ -620,6 +623,9 @@ NOTE: System.map filename and System.map symlink name must be different. *--*[*no-*]*firmware*:: Enable or disables copying of firmware into initramfs. +*--*[*no-*]*all-firmware*:: +Enable or disable copying of all firmware into initramfs + *--firmware-dir*=:: Specify directory to copy firmware from (defaults to '/lib/firmware'). diff --git a/genkernel b/genkernel index feaaad6..e825e7f 100755 --- a/genkernel +++ b/genkernel @@ -2,7 +2,7 @@ # $Id$ PATH="${PATH}:/sbin:/usr/sbin" -GK_V='4.3.9' +GK_V='4.3.10' # Normalize locales export LC_ALL=C
[gentoo-commits] proj/genkernel:master commit in: doc/, /
commit: d5f8f9c175332873a139e5d89197acca314aaf8c Author: Sam James gentoo org> AuthorDate: Tue Aug 8 05:33:15 2023 + Commit: Sam James gentoo org> CommitDate: Tue Aug 8 05:33:15 2023 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=d5f8f9c1 Fix build->built Signed-off-by: Sam James gentoo.org> doc/genkernel.8.txt | 2 +- gen_configkernel.sh | 2 +- genkernel | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index 3a1ae58..6f9a64f 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -198,7 +198,7 @@ specified. *--*[*no-*]*module-rebuild*:: Runs, or does not run "emerge --ignore-default-opts --buildpkg=n --usepkg=n --quiet-build=y @module-rebuild" to build out-of-tree modules when possible, i.e. when non-static -kernel and modules will be build, installed, *--kernel-modules-prefix* is not set. +kernel and modules will be built, installed, *--kernel-modules-prefix* is not set. NOTE: Command can be customized using '--module-rebuild-cmd' command-line argument or 'MODULEREBUILD_CMD' in '/etc/genkernel.conf'. diff --git a/gen_configkernel.sh b/gen_configkernel.sh index 44a06b3..ebb3a44 100755 --- a/gen_configkernel.sh +++ b/gen_configkernel.sh @@ -167,7 +167,7 @@ set_initramfs_compression_method() { local cfg_DECOMPRESS_SUPPORT=$(kconfig_get_opt "${kernel_config}" "CONFIG_RD_${COMPRESS_INITRD_TYPE}") if [[ "${cfg_DECOMPRESS_SUPPORT}" != "y" ]] then - gen_die "The kernel config '${kernel_config}' this initramfs will be build for cannot decompress set --compress-initrd-type '${COMPRESS_INITRD_TYPE}'!" + gen_die "The kernel config '${kernel_config}' this initramfs will be built for cannot decompress set --compress-initrd-type '${COMPRESS_INITRD_TYPE}'!" fi # If we are not building kernel, there is no point in diff --git a/genkernel b/genkernel index 0e3fc55..b32d0a3 100755 --- a/genkernel +++ b/genkernel @@ -207,7 +207,7 @@ fi if isTrue "${KERNCACHE_IS_VALID}" && ! isTrue "${CMD_INSTALL}" && ! isTrue "${BUILD_RAMDISK}" then error_msg="Nothing to do: Selected action does not include building initramfs." - error_msg+=" Because kerncache is valid, no kernel will be build." + error_msg+=" Because kerncache is valid, no kernel will be built." error_msg+=" However, due to set --no-install option, we will not even install kernel binary from kerncache." gen_die "${error_msg}" fi
[gentoo-commits] proj/genkernel:master commit in: doc/, /
commit: 57a4a1e250dfcc37f0169d3dd9d4a6a7d9308e67 Author: Sam James gentoo org> AuthorDate: Wed Jul 5 17:40:44 2023 + Commit: Sam James gentoo org> CommitDate: Wed Jul 5 17:40:44 2023 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=57a4a1e2 Don't require obsolete /var/lib/module-rebuild/moduledb to exist See 71110f715fc46f148280b52b297121786504a325 and d9687a4df038382187300d6f44230661ff5bc377 in gentoo.git. Bug: https://bugs.gentoo.org/909722 Signed-off-by: Sam James gentoo.org> doc/genkernel.8.txt | 4 +--- gen_compile.sh | 7 --- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index a5c0b92..3a1ae58 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -198,9 +198,7 @@ specified. *--*[*no-*]*module-rebuild*:: Runs, or does not run "emerge --ignore-default-opts --buildpkg=n --usepkg=n --quiet-build=y @module-rebuild" to build out-of-tree modules when possible, i.e. when non-static -kernel and modules will be build, installed, -*--kernel-modules-prefix* is not set, '/var/lib/module-rebuild/moduledb' exists -and is not empty. +kernel and modules will be build, installed, *--kernel-modules-prefix* is not set. NOTE: Command can be customized using '--module-rebuild-cmd' command-line argument or 'MODULEREBUILD_CMD' in '/etc/genkernel.conf'. diff --git a/gen_compile.sh b/gen_compile.sh index 9af128b..6db69ec 100755 --- a/gen_compile.sh +++ b/gen_compile.sh @@ -27,13 +27,6 @@ compile_external_modules() { return fi - local modulesdb_file="/var/lib/module-rebuild/moduledb" - if [ ! -s "${modulesdb_file}" ] - then - print_info 2 "$(get_indent 1)>> '${modulesdb_file}' does not exist or is empty; Skipping '${MODULEREBUILD_CMD}' ..." - return - fi - local -x KV_OUT_DIR="${KERNEL_OUTPUTDIR}" print_info 1 "$(get_indent 1)>> Compiling out-of-tree module(s) ..."
[gentoo-commits] proj/genkernel:master commit in: doc/, gkbuilds/, /, defaults/
commit: 72839de16243fb410d587e18d76d3b637fa3f389 Author: Maciej S. Szmigiero maciej szmigiero name> AuthorDate: Sun Nov 22 01:06:47 2020 + Commit: Robin H. Johnson gentoo org> CommitDate: Sun May 22 18:45:16 2022 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=72839de1 genkernel: add keyctl support for loading LUKS passphrase into a keyring 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 maciej.szmigiero.name> defaults/initrd.scripts | 52 ++- defaults/linuxrc | 34 +-- defaults/software.sh | 7 +++ doc/genkernel.8.txt | 24 ++ gen_cmdline.sh| 6 ++ gen_determineargs.sh | 2 ++ gen_initramfs.sh | 29 ++ genkernel.conf| 3 +++ gkbuilds/keyutils.gkbuild | 27 9 files changed, 181 insertions(+), 3 deletions(-) diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts index 4932783..eb556d6 100644 --- a/defaults/initrd.scripts +++ b/defaults/initrd.scripts @@ -2108,6 +2108,54 @@ openLUKS() { [ -d "${mntkey}" ] && run rmdir -p "${mntkey}" >/dev/null 2>&1 } +keyctl_keyadd() { + if [ -n "${KEYCTL_KEYDESC}" ] + then + if [ ! -x /bin/keyctl ] + then + bad_msg "keyctl program is missing. Was initramfs built without --keyctl parameter?" + exit 1 + fi + + # not using read to avoid secrets being left in memory + stty -echo + echo -n "Please type the key '${KEYCTL_KEYDESC}' for the user keyring then press Ctrl-D twice: " + KEYCTL_KEYID=`keyctl padd user "${KEYCTL_KEYDESC}" @u` + echo + stty echo + + if [ -n "${KEYCTL_KEYID}" -a -n "${KEYCTL_KEYTIMEOUT}" ] + then + keyctl timeout "${KEYCTL_KEYID}" "${KEYCTL_KEYTIMEOUT}" + fi + fi +} + +keyctl_keyremove() { + if [ -n "${KEYCTL_KEYID}" -a -z "${KEYCTL_KEYKEEP}" ] + then + if [ ! -x /bin/keyctl ] + then + bad_msg "keyctl program is missing. Was initramfs built without --keyctl parameter?" + exit 1 + fi + + keyctl revoke "${KEYCTL_KEYID}" + keyctl unlink "${KEYCTL_KEYID}" >/dev/null + + # trust but verify + if keyctl show "${KEYCTL_KEYID}" >/dev/null 2>&1 + then + # better reboot than leave the user passphrase accidentally exposed + bad_msg "unable to remove the newly added key from keyring, rebooting in 5 seconds for security" + sleep 5 + reboot -f + fi + + KEYCTL_KEYID= + fi +} + iface_name() { local ifname="${1}" @@ -2437,7 +2485,7 @@ ipv6_tentative() { fi } -start_LUKS() { +start_LUKS_root() { # if key is set but neither ssh enabled or key device is given, find # the key device @@ -2461,7 +2509,9 @@ start_LUKS() { REAL_ROOT="/dev/mapper/root" fi fi +} +start_LUKS_swap() { if [ -n "${CRYPT_SWAP_KEY}" ] then # same for swap, but no need to sleep if root was
[gentoo-commits] proj/genkernel:master commit in: /, doc/
commit: 0fb54668df8925cd81ed9d40917c19a78891f9da Author: Matt Turner gentoo org> AuthorDate: Mon Sep 13 05:07:05 2021 + Commit: Matt Turner gentoo org> CommitDate: Mon Sep 13 05:07:05 2021 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=0fb54668 gen_cmdline.sh: Correctly sort --{kernel,utils}-{as,nm} Signed-off-by: Matt Turner gentoo.org> doc/genkernel.8.txt | 18 +- gen_cmdline.sh | 40 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index 262027b..273f9c1 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -243,24 +243,24 @@ LOW-LEVEL COMPILATION OPTIONS when the system running genkernel has a different architecture like the system which should boot the created kernel/initramfs. -*--kernel-as*=:: -Assembler to use for the kernel compilation. - *--kernel-ar*=:: Archiver to use for the kernel compilation. +*--kernel-as*=:: +Assembler to use for the kernel compilation. + *--kernel-cc*=:: Compiler to use for the kernel compilation (e.g. distcc). *--kernel-ld*=:: Linker to use for the kernel compilation. -*--kernel-nm*=:: -NM utility to use for the kernel compilation. - *--kernel-make*=:: GNU Make to use for the kernel compilation. +*--kernel-nm*=:: +NM utility to use for the kernel compilation. + *--kernel-objcopy*=:: Objcopy utility to use for the kernel compilation. @@ -290,12 +290,12 @@ LOW-LEVEL COMPILATION OPTIONS tree (eg because cannot write to that directory as the user genkernel is running as). -*--utils-as*=:: -Assembler to use for utilities. - *--utils-ar*=:: Archiver to use for utilities. +*--utils-as*=:: +Assembler to use for utilities. + *--utils-cflags*=:: C compiler flags used to compile utilities. diff --git a/gen_cmdline.sh b/gen_cmdline.sh index b35750d..e3c985e 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -86,24 +86,24 @@ longusage() { echo " Low-Level Compile settings" echo " --cross-compile=" echo " Target triple (i.e. aarch64-linux-gnu) to build for" - echo " --kernel-as= Assembler to use for kernel" echo " --kernel-ar= Archiver to use for kernel" + echo " --kernel-as= Assembler to use for kernel" echo " --kernel-cc= Compiler to use for kernel (e.g. distcc)" echo " --kernel-ld=Linker to use for kernel" - echo " --kernel-nm=NM utility to use for kernel" echo " --kernel-make= GNU Make to use for kernel" + echo " --kernel-nm=NM utility to use for kernel" echo " --kernel-target= Override default make target (bzImage)" echo " --kernel-binary= Override default kernel binary path (arch/foo/boot/bar)" echo " --kernel-outputdir=" echo " Save output files outside the source tree" - echo " --utils-as= Assembler to use for utils" echo " --utils-ar= Archiver to use for utils" + echo " --utils-as= Assembler to use for utils" echo " --utils-cc= C Compiler to use for utilities" echo " --utils-cxx= C++ Compiler to use for utilities" echo " --utils-cflags= C compiler flags used to compile utilities" echo " --utils-ld= Linker to use for utils" - echo " --utils-nm= NM utility to use for utils" echo " --utils-make= GNU Make to use for utils" + echo " --utils-nm= NM utility to use for utils" echo " --makeopts= Make options such as -j2, etc ..." echo " --mountboot Mount BOOTDIR automatically if mountable" echo " --no-mountboot Don't mount BOOTDIR automatically" @@ -292,14 +292,14 @@ parse_cmdline() { CMD_CROSS_COMPILE="${*#*=}" print_info 3 "CMD_CROSS_COMPILE: ${CMD_CROSS_COMPILE}" ;; - --kernel-as=*) - CMD_KERNEL_AS="${*#*=}" - print_info 3 "CMD_KERNEL_AS: ${CMD_KERNEL_AS}" - ;; --kernel-ar=*) CMD_KERNEL_AR="${*#*=}" print_info 3 "CMD_KERNEL_AR: ${CMD_KERNEL_AR}" ;; + --kernel-as=*) + CMD_KERNEL_AS="${*#*=}" + print_info 3 "CMD_KERNEL_AS: ${CMD_KERNEL_AS}" + ;; --kernel-cc=*) CMD_KERNEL_CC="${*#*=}" print_info 3 "CMD_KERNEL_CC: ${CMD_KERNEL_CC}" @@ -308,14 +308,14 @@ parse_cmdline() { CMD_KERNEL_LD="${*#*=}" print_info 3 "CMD_KERNEL_LD: ${CMD_KERNEL_LD}" ;; - --kernel-nm=*) -
[gentoo-commits] proj/genkernel:master commit in: doc/, /
commit: a30b7139cfad7261c84345b136c671744e64ec29 Author: Thomas Deutschmann gentoo org> AuthorDate: Tue Jul 6 20:22:12 2021 + Commit: Thomas Deutschmann gentoo org> CommitDate: Tue Jul 6 20:59:30 2021 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=a30b7139 gen_cmdline.sh: parse_cmdline(): Allow to override AS, AR, NM & Co via CLI Bug: https://bugs.gentoo.org/786405 Signed-off-by: Thomas Deutschmann gentoo.org> doc/genkernel.8.txt | 44 +++- gen_cmdline.sh | 72 - genkernel.conf | 38 +++- 3 files changed, 135 insertions(+), 19 deletions(-) diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index aa18496..262027b 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -246,15 +246,36 @@ LOW-LEVEL COMPILATION OPTIONS *--kernel-as*=:: Assembler to use for the kernel compilation. +*--kernel-ar*=:: +Archiver to use for the kernel compilation. + *--kernel-cc*=:: Compiler to use for the kernel compilation (e.g. distcc). *--kernel-ld*=:: Linker to use for the kernel compilation. -*--kernel-make*=:: +*--kernel-nm*=:: +NM utility to use for the kernel compilation. + +*--kernel-make*=:: GNU Make to use for the kernel compilation. +*--kernel-objcopy*=:: +Objcopy utility to use for the kernel compilation. + +*--kernel-objdump*=:: +Objdump utility to use for the kernel compilation. + +*--kernel-ranlib*=:: +Ranlib utility to use for the kernel compilation. + +*--kernel-readelf*=:: +Readelf utility to use for the kernel compilation. + +*--kernel-strip*=:: +Strip utility to use for the kernel compilation. + *--kernel-target*=:: Override default make target (bzImage), note that values like *--kernel-target=* are also valid (useful for Xen @@ -272,6 +293,9 @@ LOW-LEVEL COMPILATION OPTIONS *--utils-as*=:: Assembler to use for utilities. +*--utils-ar*=:: +Archiver to use for utilities. + *--utils-cflags*=:: C compiler flags used to compile utilities. @@ -287,6 +311,24 @@ LOW-LEVEL COMPILATION OPTIONS *--utils-make*=:: GNU Make to use for utilities. +*--utils-nm*=:: +NM utility to use for utilities. + +*--utils-objcopy*=:: +Objcopy utility to use for utilities. + +*--utils-objdump*=:: +Objdump utility to use for utilities. + +*--utils-ranlib*=:: +Ranlib utility to use for utilities. + +*--utils-readelf*=:: +Readelf utility to use for utilities. + +*--utils-strip*=:: +Strip utility to use for utilities. + *--makeopts*=:: GNU Make options such as -j2, etc. diff --git a/gen_cmdline.sh b/gen_cmdline.sh index 33bf1c5..b35750d 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -87,18 +87,22 @@ longusage() { echo " --cross-compile=" echo " Target triple (i.e. aarch64-linux-gnu) to build for" echo " --kernel-as= Assembler to use for kernel" + echo " --kernel-ar= Archiver to use for kernel" echo " --kernel-cc= Compiler to use for kernel (e.g. distcc)" echo " --kernel-ld=Linker to use for kernel" + echo " --kernel-nm=NM utility to use for kernel" echo " --kernel-make= GNU Make to use for kernel" echo " --kernel-target= Override default make target (bzImage)" echo " --kernel-binary= Override default kernel binary path (arch/foo/boot/bar)" echo " --kernel-outputdir=" echo " Save output files outside the source tree" echo " --utils-as= Assembler to use for utils" + echo " --utils-ar= Archiver to use for utils" echo " --utils-cc= C Compiler to use for utilities" echo " --utils-cxx= C++ Compiler to use for utilities" echo " --utils-cflags= C compiler flags used to compile utilities" echo " --utils-ld= Linker to use for utils" + echo " --utils-nm= NM utility to use for utils" echo " --utils-make= GNU Make to use for utils" echo " --makeopts= Make options such as -j2, etc ..." echo " --mountboot Mount BOOTDIR automatically if mountable" @@ -288,6 +292,14 @@ parse_cmdline() { CMD_CROSS_COMPILE="${*#*=}" print_info 3 "CMD_CROSS_COMPILE: ${CMD_CROSS_COMPILE}" ;; + --kernel-as=*) + CMD_KERNEL_AS="${*#*=}" + print_info 3 "CMD_KERNEL_AS: ${CMD_KERNEL_AS}" + ;; + --kernel-ar=*) + CMD_KERNEL_AR="${*#*=}" + print_info 3 "CMD_KERNEL_AR: ${CMD_KERNEL_AR}" + ;; --kernel-cc=*) CMD_KERNEL_CC="${*#*=}" print_info 3 "CMD_KERNEL_CC: ${CMD_KERNEL_CC}" @@ -296,14 +308,34 @@
[gentoo-commits] proj/genkernel:master commit in: /, doc/
commit: 9722fb1b99011c720459fa5f11e9b78929b060ac Author: Thomas Deutschmann gentoo org> AuthorDate: Mon Mar 15 00:03:43 2021 + Commit: Thomas Deutschmann gentoo org> CommitDate: Mon Mar 15 00:03:43 2021 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=9722fb1b Change --firmware-files handling - 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 gentoo.org> doc/genkernel.8.txt | 4 ++-- gen_determineargs.sh | 12 gen_initramfs.sh | 4 ++-- genkernel.conf | 4 ++-- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index 44f3d59..aa18496 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -571,8 +571,8 @@ NOTE: System.map filename and System.map symlink name must be different. Specify directory to copy firmware from (defaults to '/lib/firmware'). *--firmware-files*=:: -Specifies specific firmware files to copy. This overrides *--firmware-dir*. -For multiple files, separate the filenames with a comma. +Specifies specific firmware files or directories to copy, relative to +*--firmware-dir*. For multiple files, separate the filenames with a comma. *--*[*no-*]*firmware-install*:: Enable or disables installation of firmware onto root filesystem. diff --git a/gen_determineargs.sh b/gen_determineargs.sh index 265c557..3e6e4dd 100755 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -1240,10 +1240,14 @@ determine_real_args() { if isTrue "${FIRMWARE}" then - for ff in ${FIRMWARE_FILES}; do - [[ ${ff} = /* ]] && gen_die "FIRMWARE_FILES should list paths relative to FIRMWARE_DIR, not absolute." + IFS=',' read -r -a FIRMWARE_FILES <<< "${FIRMWARE_FILES}" + pushd "${FIRMWARE_DIR}" &>/dev/null || gen_die "Failed to chdir to '${FIRMWARE_DIR}'!" + local ff + for ff in "${FIRMWARE_FILES[@]}" + do + [[ ${ff} = /* ]] && gen_die "--firmware-files contains value '${ff}' which is not a relative path from '${FIRMWARE_DIR}'!" + [[ ! -e "${ff}" ]] && gen_die "--firmware-files contains value '${ff}' which was not found in '${FIRMWARE_DIR}'!" done - - [[ "${FIRMWARE_FILES}" = *,* ]] && gen_die "FIRMWARE_FILES should be a space-separated list." + popd &>/dev/null || gen_die "Failed to chdir!" fi } diff --git a/gen_initramfs.sh b/gen_initramfs.sh index 65a966d..9c030c5 100755 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -1652,10 +1652,10 @@ append_firmware() { mkdir -p "${TDIR}"/lib/firmware || gen_die "Failed to create '${TDIR}/lib/firmware'!" - if [ -n "${FIRMWARE_FILES}" ] + if [ ${#FIRMWARE_FILES[@]} -gt 0 ] then pushd "${FIRMWARE_DIR}" &>/dev/null || gen_die "Failed to chdir to '${FIRMWARE_DIR}'!" - cp -rL --parents --target-directory="${TDIR}/lib/firmware" ${FIRMWARE_FILES} 2>/dev/null \ + cp -rL --parents --target-directory="${TDIR}/lib/firmware" "${FIRMWARE_FILES[@]}" 2>/dev/null \ || gen_die "Failed to copy firmware files (${FIRMWARE_FILES}) to '${TDIR}/lib/firmware'!" popd &>/dev/null || gen_die "Failed to chdir!" else diff --git a/genkernel.conf b/genkernel.conf index a8507d1..6c350a6 100644 --- a/genkernel.conf +++ b/genkernel.conf @@ -147,9 +147,9 @@ NOCOLOR="false" # Specify directory to pull from #FIRMWARE_DIR="/lib/firmware" -# Specify a space-separated list of firmware files or directories to include, +# Specify a comma-separated list of firmware files or directories to include, # relative to FIRMWARE_DIR. If empty or unset, the full contents of -# FIRMWARE_DIR will be included. +# FIRMWARE_DIR will be included (if FIRMWARE option above is set to YES). #FIRMWARE_FILES="" # Add new kernel to grub
[gentoo-commits] proj/genkernel:master commit in: doc/, defaults/
commit: 90138e02119bae09efe78f6ece02c039ad132137 Author: Thomas Deutschmann gentoo org> AuthorDate: Sun Mar 14 18:24:39 2021 + Commit: Thomas Deutschmann gentoo org> CommitDate: Sun Mar 14 19:39:48 2021 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=90138e02 linuxrc: Refactor switch_root error handling 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=0x7f00 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 gentoo.org> defaults/initrd.defaults | 1 + defaults/linuxrc | 73 +--- doc/genkernel.8.txt | 8 +- 3 files changed, 59 insertions(+), 23 deletions(-) diff --git a/defaults/initrd.defaults b/defaults/initrd.defaults index b4e1e1d..18e1382 100644 --- a/defaults/initrd.defaults +++ b/defaults/initrd.defaults @@ -71,6 +71,7 @@ VERIFY=0 IP='dhcp' GK_BOOTFONT_DISABLED=0 GK_DEBUGMODE_STATEFILE="/tmp/debug.enabled" +GK_EMERGENCY_ACTION="halt -f" GK_HW_LOAD_ALL_MODULES=0 GK_HW_USE_MODULES_LOAD=0 GK_INIT_LOG='/run/initramfs/init.log' diff --git a/defaults/linuxrc b/defaults/linuxrc index 8356aea..ebed7d8 100644 --- a/defaults/linuxrc +++ b/defaults/linuxrc @@ -289,6 +289,24 @@ do fi unset tmp_disabled ;; + gk.emergency=*) + tmp_action=${x#*=} + case "${tmp_action}" in + reboot) + GK_EMERGENCY_ACTION="reboot -f" + ;; + poweroff) + GK_EMERGENCY_ACTION="poweroff -f" + ;; + halt) + GK_EMERGENCY_ACTION="halt -f" + ;; + *) + warn_msg "'${x}' is an unsupported emergency action -- ignored!" + ;; + esac + unset tmp_action + ;; gk.hw.load-all=*) tmp_disabled=${x#*=} if is_true "${tmp_disabled}" @@ -1341,28 +1359,39 @@ fi # init_opts is set in the environment by the kernel when it parses the command line init=${REAL_INIT:-/sbin/init} -if ! mountpoint "${CHROOT}" 1>/dev/null 2>&1 -then - bad_msg "${CHROOT} was not a mountpoint" -elif chroot "${CHROOT}" test ! -x /${init#/} -then - bad_msg "init=${init} does not exist in the rootfs!" -elif [ $$ != 1 ] -then - bad_msg "PID was not 1! switch_root would fail" -else - good_msg "Switching to real root: switch_root ${CHROOT} ${init} ${init_opts}" - exec switch_root "${CHROOT}" "${init}" ${init_opts} -fi -# If we get here, something bad has happened -splash 'verbose' +while true +do + # switch_root can only be called from PID 1; + # So stay in loop as long as user is able + # to fix the problem. -bad_msg "A fatal error has occured since ${init} did not" -bad_msg "boot correctly. Trying to open a shell ..." + if ! mountpoint "${CHROOT}" 1>/dev/null 2>&1 + then + bad_msg "${CHROOT} is not a mountpoint; Was root device (${REAL_ROOT}) not mounted?" + elif ! chroot "${CHROOT}" test -x /${init#/} 1>/dev/null 2>&1 + then + mounted_root_device=$(mountpoint -n /newroot 2>/dev/null | awk '{ print $1 }') + bad_msg "init (${init}) not found in mounted root device (${mounted_root_device})!" + else + break + fi + + run_emergency_shell + if ! is_userinteraction_allowed + then + ${GK_EMERGENCY_ACTION} || exit 1 + fi +done -exec /bin/bash -exec /bin/sh -exec /bin/ash -exec /bin/dash -exec sh +good_msg "Switching to real root: switch_root ${CHROOT} ${init} ${init_opts}" +exec switch_root "${CHROOT}" "${init}" ${init_opts} + +# If we reached here, something went very badly wrong in the initramfs. +# However, spawning a rescue shell
[gentoo-commits] proj/genkernel:master commit in: doc/, defaults/
commit: 3fc2bfa183e05fe38bae40deb608bcb4e46ed065 Author: Thomas Deutschmann gentoo org> AuthorDate: Sat Mar 13 18:36:22 2021 + Commit: Thomas Deutschmann gentoo org> CommitDate: Sun Mar 14 19:33:50 2021 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=3fc2bfa1 linuxrc: Mark kernel command-line argument lvmraid as deprecated Not used anymore since we moved to (e)udev. Signed-off-by: Thomas Deutschmann gentoo.org> defaults/linuxrc| 3 +-- doc/genkernel.8.txt | 4 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/defaults/linuxrc b/defaults/linuxrc index 37a8dfa..28a504b 100644 --- a/defaults/linuxrc +++ b/defaults/linuxrc @@ -186,8 +186,7 @@ do ;; # /dev/md lvmraid=*) - RAID_DEVICES="${x#*=}" - RAID_DEVICES="$(echo ${RAID_DEVICES} | sed -e 's/,/ /g')" + warn_msg "'${x}' kernel command-line argument is deprecated; Use 'dolvm' instead!" USE_LVM_NORMAL=1 ;; part=*) diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index 74729be..d7afc07 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -780,10 +780,6 @@ when not set. This will allow remote user to provide answer through *dolvm*:: Activate LVM volumes on bootup. -*lvmraid*=<...>:: -Specify RAID devices to set up before the activation of LVM volumes. -Implies option *dolvm*. - *domdadm*:: Scan for RAID arrays on bootup.
[gentoo-commits] proj/genkernel:master commit in: doc/
commit: 496e3fbfc5871d3a8e735aa6d08ef6ef42f59576 Author: Thomas Deutschmann gentoo org> AuthorDate: Wed Sep 2 13:11:06 2020 + Commit: Thomas Deutschmann gentoo org> CommitDate: Wed Sep 2 13:11:46 2020 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=496e3fbf manpage: Update rootfstype documentation Signed-off-by: Thomas Deutschmann gentoo.org> doc/genkernel.8.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index 7b96879..7ce7391 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -790,7 +790,8 @@ when not set. This will allow remote user to provide answer through *rootfstype*=<...>:: Specify the file system type to mount the real root filesystem as. This can be useful when support for ext2/ext3/ext4 are -in competition. Default is "auto". +in competition or used filesystem was not built into kernel. +Default is "auto". *docache*:: *nocache*::
[gentoo-commits] proj/genkernel:master commit in: doc/, arch/mips/, /
commit: 945b3dc65cb2577a9962db40848eaeae3fc2a425 Author: Thomas Deutschmann gentoo org> AuthorDate: Fri Aug 28 13:53:51 2020 + Commit: Thomas Deutschmann gentoo org> CommitDate: Fri Aug 28 15:42:01 2020 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=945b3dc6 Remove --disklabel option Now that we always build util-linux for switch_root, we no longer need this option. Signed-off-by: Thomas Deutschmann gentoo.org> arch/mips/config.sh | 1 - doc/genkernel.8.txt | 4 gen_cmdline.sh | 6 -- gen_determineargs.sh | 1 - gen_initramfs.sh | 1 - genkernel.conf | 3 --- 6 files changed, 16 deletions(-) diff --git a/arch/mips/config.sh b/arch/mips/config.sh index b258fb2..1a10862 100644 --- a/arch/mips/config.sh +++ b/arch/mips/config.sh @@ -11,7 +11,6 @@ KERNEL_BINARY="./vmlinux" NOINITRDMODULES="yes" BUSYBOX=1 DMRAID=0 -DISKLABEL=0 # genkernel on mips is only used for LiveCDs && netboots. Catalyst # will know where to get the kernels at. diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index f0e4414..2625d6f 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -416,10 +416,6 @@ system is able to load multiple initramfs. *--genzimage*:: Make and install kernelz image from 'arch/powerpc/boot/zImage.initrd'. -*--*[*no-*]*disklabel*:: -Includes or excludes disk label and uuid support in your initramfs. -When enabled, this will compile util-linux for you. - *--*[*no-*]*luks*:: Includes or excludes LUKS support. When enabled, this will compile cryptsetup for you. diff --git a/gen_cmdline.sh b/gen_cmdline.sh index 5cc0d87..33bf1c5 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -163,8 +163,6 @@ longusage() { echo " --linuxrc=Specifies a user created linuxrc" echo " --busybox-config= Specifies a user created busybox config" echo " --genzimage Make and install kernelz image (PowerPC)" - echo " --disklabel Include disk label and uuid support in your initramfs" - echo " --no-disklabel Exclude disk label and uuid support in your initramfs" echo " --luks Include LUKS support" echo " --no-luks Exclude LUKS support" echo " --gpg Include GPG-armored LUKS key support" @@ -761,10 +759,6 @@ parse_cmdline() { # ENABLE_PEGASOS_HACKS="yes" # print_info 3 "ENABLE_PEGASOS_HACKS: ${ENABLE_PEGASOS_HACKS}" ;; - --disklabel|--no-disklabel) - CMD_DISKLABEL=$(parse_optbool "$*") - print_info 3 "CMD_DISKLABEL: ${CMD_DISKLABEL}" - ;; --luks|--no-luks) CMD_LUKS=$(parse_optbool "$*") print_info 3 "CMD_LUKS: ${CMD_LUKS}" diff --git a/gen_determineargs.sh b/gen_determineargs.sh index 0fe8886..f28c8d6 100755 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -396,7 +396,6 @@ determine_real_args() { set_config_with_override BOOL UNIONFS CMD_UNIONFS "no" set_config_with_override BOOL NETBOOT CMD_NETBOOT "no" set_config_with_override STRING REAL_ROOT CMD_REAL_ROOT - set_config_with_override BOOL DISKLABEL CMD_DISKLABEL "yes" set_config_with_override BOOL LUKS CMD_LUKS "no" set_config_with_override BOOL GPG CMD_GPG "no" set_config_with_override BOOL MDADM CMD_MDADM "no" diff --git a/gen_initramfs.sh b/gen_initramfs.sh index 479e6a6..9852719 100755 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -400,7 +400,6 @@ append_base_layout() { isTrue "${BUSYBOX}" && build_parameters+=( --busybox ) || build_parameters+=( --no-busybox ) isTrue "${BCACHE}" && build_parameters+=( --bcache ) || build_parameters+=( --no-bcache ) isTrue "${B2SUM}" && build_parameters+=( --b2sum ) || build_parameters+=( --no-b2sum ) - isTrue "${DISKLABEL}" && build_parameters+=( --disklabel ) || build_parameters+=( --no-disklabel ) isTrue "${BTRFS}" && build_parameters+=( --btrfs ) || build_parameters+=( --no-btrfs ) isTrue "${ISCSI}" && build_parameters+=( --iscsi ) || build_parameters+=( --no-iscsi ) isTrue "${MULTIPATH}" && build_parameters+=( --multipath ) || build_parameters+=( --no-multipath ) diff --git a/genkernel.conf b/genkernel.conf index 654f185..71d4fb9 100644 --- a/genkernel.conf +++ b/genkernel.conf @@ -152,9 +152,6 @@ NOCOLOR="false" #
[gentoo-commits] proj/genkernel:master commit in: doc/, defaults/, /
commit: 8c19b84644d3a0b7f70b101b9c83931280028eb7 Author: Thomas Deutschmann gentoo org> AuthorDate: Fri Aug 28 13:16:36 2020 + Commit: Thomas Deutschmann gentoo org> CommitDate: Fri Aug 28 16:35:55 2020 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=8c19b846 defaults/linuxrc: Always preserve log 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 gentoo.org> defaults/initrd.defaults | 4 +-- defaults/initrd.scripts | 74 +--- defaults/linuxrc | 39 - doc/genkernel.8.txt | 13 + gen_initramfs.sh | 10 ++- 5 files changed, 12 insertions(+), 128 deletions(-) diff --git a/defaults/initrd.defaults b/defaults/initrd.defaults index e4c861b..e310f19 100644 --- a/defaults/initrd.defaults +++ b/defaults/initrd.defaults @@ -74,9 +74,7 @@ GK_BOOTFONT_DISABLED=0 GK_DEBUGMODE_STATEFILE="/tmp/debug.enabled" GK_HW_LOAD_ALL_MODULES=0 GK_HW_USE_MODULES_LOAD=0 -GK_INIT_LOG='/tmp/init.log' -GK_INIT_LOG_COPYTO= -GK_INIT_LOG_COPYTO_DEFAULT='/genkernel-boot.log' +GK_INIT_LOG='/run/initramfs/init.log' GK_INIT_LOG_DISABLED='/tmp/no-init.log' GK_INIT_LOG_PREFIX= GK_NET_DHCP_PIDFILE='/var/run/udhcpc.pid' diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts index b579e4f..ee7ca2c 100644 --- a/defaults/initrd.scripts +++ b/defaults/initrd.scripts @@ -1177,78 +1177,6 @@ crypt_filter() { fi } -preserve_log() { - is_log_enabled || return - [ ! -s "${GK_INIT_LOG}" ] && return - [ -z "${GK_INIT_LOG_COPYTO}" ] && return - - local have_errors=0 - - local logfile_target="${CHROOT}/${GK_INIT_LOG_COPYTO#/}" - if ! echo "${logfile_target}" | grep -qE '^.*/[A-Za-z0-9._-]+$' - then - # The test above will make sure that a filename was given - # so we can be sure that dirname() will always return a - # path. - warn_msg "gk.log.keep value '${GK_INIT_LOG_COPYTO}' is invalid; Will copy log to '${GK_INIT_LOG_COPYTO_DEFAULT}' instead ..." - logfile_target="${CHROOT}/${GK_INIT_LOG_COPYTO_DEFAULT#/}" - fi - - local fail_msg="Failed to copy '${GK_INIT_LOG}' to '${logfile_target}'" - local logfile_target_dir="$(dirname "${logfile_target}")" - - if [ -z "${logfile_target_dir}" ] - then - bad_msg "${fail_msg}: Failed to determine dirname of '${logfile_target}'!" - return 1 - fi - - log_msg "Determining mountpoint of '${logfile_target}' ..." - - local logfile_mountpoint="${logfile_target_dir}" - while [ true ] - do - if run mountpoint "${logfile_mountpoint}" 1>/dev/null 2>&1 - then - if run mount -o remount,rw "${logfile_mountpoint}" 1>/dev/null 2>&1 - then - break - else - bad_msg "${fail_msg}: 'mount -o remount,rw \"${logfile_mountpoint}\"' failed!" - return 1 - fi - fi - - logfile_mountpoint="$(dirname "${logfile_mountpoint}")" - if [ "${logfile_mountpoint}" = "/" ] - then - # Stop here - bad_msg "${fail_msg}: Failed to determine mountpoint for '${logfile_target}'!" - return 1 - fi - done - - if [ ! -d "${logfile_target_dir}" ] - then - if ! run mkdir -p "${logfile_target_dir}" 2>/dev/null - then - bad_msg "${fail_msg}: Failed to create '${logfile_target_dir}'!" - return 1 - fi - fi - - good_msg "gk.log.keep set; Copying '${GK_INIT_LOG}' to '${logfile_target}' ..." - if ! run cp -f "${GK_INIT_LOG}" "${logfile_target}" 2>/dev/null - then - bad_msg "${fail_msg}!" - fi - - if ! run mount -o remount,ro "${logfile_mountpoint}" 1>/dev/null 2>&1 - then - bad_msg "Failed to re-mount ${logfile_mountpoint} read-only!" - fi -} - process_initramfs_mounts() { local fslist= @@ -2388,7 +2316,7 @@ start_sshd() { run touch /var/log/lastlog good_msg "Starting dropbear sshd ..." ${QUIET} - run dropbear -p ${GK_SSHD_PORT} -R -P "${GK_SSHD_PIDFILE}" 2>/var/log/dropbear.log + run dropbear -p ${GK_SSHD_PORT} -R -P "${GK_SSHD_PIDFILE}" 2>/run/initramfs/dropbear.log if [ $? -eq 0 ] then if [ "${GK_PROMPT_TIMEOUT}" = '0' ] diff --git a/defaults/linuxrc b/defaults/linuxrc index afb91d8..a4ed811 100644 ---
[gentoo-commits] proj/genkernel:master commit in: doc/, /
commit: 6882485e665f8b6eb388696dfc0fd983faa9d922 Author: Thomas Deutschmann gentoo org> AuthorDate: Sun Aug 2 10:40:47 2020 + Commit: Thomas Deutschmann gentoo org> CommitDate: Sun Aug 2 22:40:14 2020 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=6882485e Rename INSTALL_MOD_PATH option to KERNEL_MODULES_PREFIX 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 gentoo.org> doc/genkernel.8.txt | 6 +++--- gen_cmdline.sh | 9 + gen_compile.sh | 16 gen_determineargs.sh | 2 +- gen_initramfs.sh | 4 ++-- gen_moddeps.sh | 6 +++--- gen_package.sh | 13 ++--- genkernel| 15 --- genkernel.conf | 3 +-- 9 files changed, 37 insertions(+), 37 deletions(-) diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index 50f1471..8c527b0 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -198,8 +198,8 @@ specified. *--*[*no-*]*module-rebuild*:: Runs, or does not run "emerge --ignore-default-opts --buildpkg=n --usepkg=n --quiet-build=y @module-rebuild" to build out-of-tree modules when possible, i.e. when non-static -kernel and modules will be build, installed, no custom -'INSTALL_MOD_PATH' is set, '/var/lib/module-rebuild/moduledb' exists +kernel and modules will be build, installed, +*--kernel-modules-prefix* is not set, '/var/lib/module-rebuild/moduledb' exists and is not empty. NOTE: Command can be customized using '--module-rebuild-cmd' command-line @@ -231,7 +231,7 @@ KERNEL LOCATIONS Use the special value 'default' to force usage of default kernel config. -*--module-prefix*=:: +*--kernel-modules-prefix*=:: Prefix to kernel module destination, modules will be installed in '/lib/modules'. diff --git a/gen_cmdline.sh b/gen_cmdline.sh index f502350..5cc0d87 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -80,7 +80,8 @@ longusage() { echo " --kernel-localversion=<...>" echo " Set kernel CONFIG_LOCALVERSION, use special value" echo " 'UNSET' to unset any set LOCALVERSION" - echo " --module-prefix= Prefix to kernel module destination, modules" + echo " --kernel-modules-prefix=" + echo " Prefix to kernel module destination, modules" echo " will be installed in /lib/modules" echo " Low-Level Compile settings" echo " --cross-compile=" @@ -680,9 +681,9 @@ parse_cmdline() { CMD_KERNEL_LOCALVERSION="${*#*=}" print_info 3 "CMD_KERNEL_LOCALVERSION: ${CMD_KERNEL_LOCALVERSION}" ;; - --module-prefix=*) - CMD_INSTALL_MOD_PATH="${*#*=}" - print_info 3 "CMD_INSTALL_MOD_PATH: ${CMD_INSTALL_MOD_PATH}" + --kernel-modules-prefix=*) + CMD_KERNEL_MODULES_PREFIX="${*#*=}" + print_info 3 "CMD_KERNEL_MODULES_PREFIX: ${CMD_KERNEL_MODULES_PREFIX}" ;; --cachedir=*) CACHE_DIR="${*#*=}" diff --git a/gen_compile.sh b/gen_compile.sh index 0fa6912..d755150 100755 --- a/gen_compile.sh +++ b/gen_compile.sh @@ -20,10 +20,10 @@ compile_external_modules() { return fi - if [ -n "${INSTALL_MOD_PATH}" ] + if [ -n "${KERNEL_MODULES_PREFIX}" ] then # emerge would install to a different location - print_warning 1 "$(get_indent 1)>> INSTALL_MOD_PATH set; Skipping '${MODULEREBUILD_CMD}' ..." + print_warning 1 "$(get_indent 1)>> KERNEL_MODULES_PREFIX set; Skipping '${MODULEREBUILD_CMD}' ..." return fi @@ -182,7 +182,7 @@ compile_modules() { compile_generic modules kernel - [ -n "${INSTALL_MOD_PATH}" ] && local -x INSTALL_MOD_PATH="${INSTALL_MOD_PATH}" + [ -n "${KERNEL_MODULES_PREFIX}" ] && local -x INSTALL_MOD_PATH="${KERNEL_MODULES_PREFIX%/}" if [ "${CMD_STRIP_TYPE}" == "all" -o "${CMD_STRIP_TYPE}" == "modules" ] then print_info 1 "$(get_indent 1)>> Installing ${KV} modules (and stripping) ..." @@ -195,10 +195,10 @@ compile_modules() { compile_generic "modules_install" kernel print_info 1 "$(get_indent 1)>> Generating module dependency data ..." - if [ -n "${INSTALL_MOD_PATH}" ] + if [ -n "${KERNEL_MODULES_PREFIX}" ] then - depmod -a -e -F "${KERNEL_OUTPUTDIR}"/System.map -b "${INSTALL_MOD_PATH}" ${KV} \ - || gen_die "depmod (INSTALL_MOD_PATH=${INSTALL_MOD_PATH})
[gentoo-commits] proj/genkernel:master commit in: /, doc/, defaults/
commit: 944da1fc61bd64a47c2bc6415da5e5d5611b6ff5 Author: Thomas Deutschmann gentoo org> AuthorDate: Tue Jul 14 14:17:30 2020 + Commit: Thomas Deutschmann gentoo org> CommitDate: Thu Jul 16 14:29:15 2020 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=944da1fc gen_initramfs.sh: create_initramfs(): Move and unify validation of --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 gentoo.org> defaults/compression_methods.sh | 37 + doc/genkernel.8.txt | 10 +++-- gen_cmdline.sh | 3 +- gen_determineargs.sh| 91 + gen_funcs.sh| 24 +++ gen_initramfs.sh| 67 +++--- genkernel | 1 + 7 files changed, 168 insertions(+), 65 deletions(-) diff --git a/defaults/compression_methods.sh b/defaults/compression_methods.sh new file mode 100644 index 000..41ee9c4 --- /dev/null +++ b/defaults/compression_methods.sh @@ -0,0 +1,37 @@ +# NOTE: +# - This file (compression_methods.sh) is sourced by genkernel. +# Rather than changing this very file, please override specific variables +# somewhere in /etc/genkernel.conf . +# +# - This file should not override previously defined variables, as their values may +# originate from user changes to /etc/genkernel.conf . + +GKICM_BZ2_KOPTNAME="BZIP2" +GKICM_BZ2_CMD="bzip2 -z -f -9" +GKICM_BZ2_EXT=".bz2" +GKICM_BZ2_PKG="app-arch/bzip2" + +GKICM_GZ_KOPTNAME="GZIP" +GKICM_GZ_CMD="gzip -f -9" +GKICM_GZ_EXT=".gz" +GKICM_GZ_PKG="app-arch/gzip" + +GKICM_LZO_KOPTNAME="LZO" +GKICM_LZO_CMD="lzop -f -9" +GKICM_LZO_EXT=".lzo" +GKICM_LZO_PKG="app-arch/lzop" + +GKICM_LZ4_KOPTNAME="LZ4" +GKICM_LZ4_CMD="lz4 -f -9 -l -q" +GKICM_LZ4_EXT=".lz4" +GKICM_LZ4_PKG="app-arch/lz4" + +GKICM_LZMA_KOPTNAME="LZMA" +GKICM_LZMA_CMD="lzma -z -f -9" +GKICM_LZMA_EXT=".lzma" +GKICM_LZMA_PKG="app-arch/xz-utils" + +GKICM_XZ_KOPTNAME="XZ" +GKICM_XZ_CMD="xz -e --check=none -z -f -9" +GKICM_XZ_EXT=".xz" +GKICM_XZ_PKG="app-arch/xz-utils" diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index 494a29c..40c591e 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -598,9 +598,13 @@ NOTE: System.map filename and System.map symlink name must be different. Deprecated alias for *--*[*no-*]*compress-initramfs*. *--compress-initramfs-type*=:: -Compression type for initramfs (best, xz, lzma, bzip2, gzip, lzop, lz4). -"Best" causes selection of the best available algorithm that is selected -in your kernel configuration. +Compression type for initramfs (best, bzip2, fastest, gzip, lz4, lzma, lza, xz). ++ +*best* will select the algorithm providing best compression +from those selected in your kernel configuration. ++ +*fastest* will select the algorithm providing fastest decompression +from those selected in your kernel configuration. *--strip*=:: Strip debug symbols from none, all, installed kernel (obsolete) or diff --git a/gen_cmdline.sh b/gen_cmdline.sh index 9e59ed2..1daee5c 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -243,7 +243,8 @@ longusage() { echo " --compress-initrd Deprecated alias for --compress-initramfs" echo " --no-compress-initrdDeprecated alias for --no-compress-initramfs" echo " --compress-initramfs-type=" - echo " Compression type for initramfs (best, xz, lzma, bzip2, gzip, lzop, lz4)" + echo " Compression type for initramfs (best, bzip2, fastest, gzip, lz4," + echo " lzma, lza, xz)" echo " --strip=(all|kernel|modules|none)" echo " Strip debug symbols from none, all, installed kernel (obsolete) or" echo " modules (default)" diff --git a/gen_determineargs.sh b/gen_determineargs.sh index 0cbba36..406d1d5 100755 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -619,6 +619,73 @@ determine_real_args() { done unset v pn pn_varname pkg_prefixes + declare -gA GKICM_LOOKUP_TABLE_CMD=() + declare -gA GKICM_LOOKUP_TABLE_EXT=() + declare -gA GKICM_LOOKUP_TABLE_PKG=() + local known_initramfs_compression_methods_by_compression=( $(get_initramfs_compression_method_by_compression) ) + local known_initramfs_compression_methods_by_speed=(
[gentoo-commits] proj/genkernel:master commit in: /, doc/
commit: 06acd6f691351a99f7931a791682c4ac45abe650 Author: Richard Yao gentoo org> AuthorDate: Sun May 24 22:20:22 2020 + Commit: Thomas Deutschmann gentoo org> CommitDate: Sun May 24 22:27:23 2020 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=06acd6f6 Document lz4 compression support Signed-off-by: Richard Yao gentoo.org> Closes: https://github.com/gentoo/genkernel/pull/15 Signed-off-by: Thomas Deutschmann gentoo.org> doc/genkernel.8.txt | 2 +- gen_cmdline.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index 7cd65fe..494a29c 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -598,7 +598,7 @@ NOTE: System.map filename and System.map symlink name must be different. Deprecated alias for *--*[*no-*]*compress-initramfs*. *--compress-initramfs-type*=:: -Compression type for initramfs (best, xz, lzma, bzip2, gzip, lzop). +Compression type for initramfs (best, xz, lzma, bzip2, gzip, lzop, lz4). "Best" causes selection of the best available algorithm that is selected in your kernel configuration. diff --git a/gen_cmdline.sh b/gen_cmdline.sh index a34a739..9e59ed2 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -243,7 +243,7 @@ longusage() { echo " --compress-initrd Deprecated alias for --compress-initramfs" echo " --no-compress-initrdDeprecated alias for --no-compress-initramfs" echo " --compress-initramfs-type=" - echo " Compression type for initramfs (best, xz, lzma, bzip2, gzip, lzop)" + echo " Compression type for initramfs (best, xz, lzma, bzip2, gzip, lzop, lz4)" echo " --strip=(all|kernel|modules|none)" echo " Strip debug symbols from none, all, installed kernel (obsolete) or" echo " modules (default)"
[gentoo-commits] proj/genkernel:master commit in: /, doc/, defaults/
commit: 8768d9f1b9e8d166dbbd3428b221578c7504679c Author: Thomas Deutschmann gentoo org> AuthorDate: Tue Mar 3 00:38:31 2020 + Commit: Thomas Deutschmann gentoo org> CommitDate: Tue Mar 3 23:53:06 2020 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=8768d9f1 Make kernel config filename customizable 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 gentoo.org> defaults/config.sh | 1 + doc/genkernel.8.txt | 6 ++ gen_cmdline.sh | 6 ++ gen_configkernel.sh | 2 +- gen_determineargs.sh | 19 +-- 5 files changed, 31 insertions(+), 3 deletions(-) diff --git a/defaults/config.sh b/defaults/config.sh index fed5355..8c7cf7e 100644 --- a/defaults/config.sh +++ b/defaults/config.sh @@ -23,6 +23,7 @@ KERNEL_SUPPORT_MICROCODE=no # DEFAULT_INITRAMFS_FILENAME="initramfs-%%KV%%.img" DEFAULT_INITRAMFS_SYMLINK_NAME="initramfs" +DEFAULT_KERNEL_CONFIG_FILENAME="kernel-config-%%KV%%" DEFAULT_KERNEL_FILENAME="vmlinuz-%%KV%%" DEFAULT_KERNEL_SYMLINK_NAME="kernel" DEFAULT_SYSTEMMAP_FILENAME="System.map-%%KV%%" diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index e00e028..7cd65fe 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -506,6 +506,12 @@ NOTE: No modules outside of the initramfs will be included! Archive file created using tar containing kernel binary, content of '/lib/modules' and the kernel config after the callbacks have run. +*--kernel-config-filename*=<...>:: +Set the kernel config filename used by *--save-config*. Please see +*--kernel-filename* option for available placeholders and restrictions. ++ +By default, kernel config filename will be set to 'kernel-config-%%KV%%'. + *--kernel-filename*=<...>:: Set kernel filename which will be used when kernel will be installed into *BOOTDIR* (implies *--install* option). The following placeholders diff --git a/gen_cmdline.sh b/gen_cmdline.sh index aa54c29..a34a739 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -193,6 +193,8 @@ longusage() { echo " --postclear Clear all tmp files and caches after genkernel has run" echo " --no-postclear Do not clean up after genkernel has run" echo " Output Settings" + echo " --kernel-config-filename=<...>" + echo " Set kernel config filename" echo " --kernel-filename=<...>" echo " Set kernel filename" echo " --kernel-symlink-name=<...>" @@ -701,6 +703,10 @@ parse_cmdline() { CMD_KERNCACHE="${*#*=}" print_info 3 "KERNCACHE: ${CMD_KERNCACHE}" ;; + --kernel-config-filename=*) + CMD_KERNEL_CONFIG_FILENAME="${*#*=}" + print_info 3 "CMD_KERNEL_CONFIG_FILENAME: ${CMD_KERNEL_CONFIG_FILENAME}" + ;; --kernel-filename=*) CMD_KERNEL_FILENAME="${*#*=}" print_info 3 "CMD_KERNEL_FILENAME: ${CMD_KERNEL_FILENAME}" diff --git a/gen_configkernel.sh b/gen_configkernel.sh index 2f9a6a5..7804949 100755 --- a/gen_configkernel.sh +++ b/gen_configkernel.sh @@ -44,7 +44,7 @@ determine_kernel_config_file() { else local -a user_kconfig_candidates - # Always prefer kernel config based on actual $KV reading + # Always prefer kernel config based on set --kernel-config-filename user_kconfig_candidates+=( "/etc/kernels/${GK_FILENAME_CONFIG}" ) if [ -n "${KERNEL_LOCALVERSION}" -a "${KERNEL_LOCALVERSION}" != "UNSET" ] diff --git a/gen_determineargs.sh b/gen_determineargs.sh index 14ef757..6c5d01c 100755 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -87,7 +87,6 @@ determine_KV() { determine_output_filenames() { print_info 5 '' 1 0 - GK_FILENAME_CONFIG="kernel-config-${KV}" GK_FILENAME_KERNELZ="kernelz-${KV}" GK_FILENAME_TEMP_CONFIG="config-${ARCH}-${KV}" GK_FILENAME_TEMP_INITRAMFS="initramfs-${ARCH}-${KV}" @@ -96,7 +95,10 @@ determine_output_filenames() { GK_FILENAME_TEMP_SYSTEMMAP="System.map-${ARCH}-${KV}" # Do we have values? - if [ -z "${KERNEL_FILENAME}" ] + if [ -z "${KERNEL_CONFIG_FILENAME}" ] + then + gen_die "--kernel-config-filename must be set to a non-empty value!" + elif [ -z "${KERNEL_FILENAME}" ] then gen_die "--kernel-filename must be set to a non-empty value!" elif [ -z "${KERNEL_SYMLINK_NAME}" ] @@ -116,6 +118,17 @@ determine_output_filenames() { gen_die "--initramfs-filename must be set to a non-empty value!" fi + # Kernel
[gentoo-commits] proj/genkernel:master commit in: doc/, /, gkbuilds/
commit: 3d23af3d4a02c676702cf6d8ddc36a9317320ea8 Author: Thomas Deutschmann gentoo org> AuthorDate: Sat Feb 15 20:36:29 2020 + Commit: Thomas Deutschmann gentoo org> CommitDate: Sat Feb 15 20:38:11 2020 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=3d23af3d Add b2sum b2sum can be used to verify (boot) media since commit 5c55dd467a563623f16be27f670b5a3ddc79fb02. Signed-off-by: Thomas Deutschmann gentoo.org> doc/genkernel.8.txt| 4 +++ gen_cmdline.sh | 6 + gen_determineargs.sh | 1 + gen_initramfs.sh | 31 +- genkernel.conf | 3 +++ gkbuilds/coreutils.gkbuild | 66 ++ 6 files changed, 110 insertions(+), 1 deletion(-) diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index 6c7b9bd..e00e028 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -430,6 +430,10 @@ system is able to load multiple initramfs. `gpg --symmetric -o /path/to/LUKS-key.gpg /path/to/LUKS-key` . After that, re-point the *root_key* argument to the new .gpg file. +*--*[*no-*]*b2sum*:: +Includes or excludes b2sum in the initramfs. +When enabled, this will compile coreutils' b2sum for you. + *--*[*no-*]*busybox*:: Includes or excludes busybox in the initramfs. When enabled, this will compile busybox for you. diff --git a/gen_cmdline.sh b/gen_cmdline.sh index c0139d4..aa54c29 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -168,6 +168,8 @@ longusage() { echo " --no-luks Exclude LUKS support" echo " --gpg Include GPG-armored LUKS key support" echo " --no-gpgExclude GPG-armored LUKS key support" + echo " --b2sum Include b2sum" + echo " --no-b2sum Exclude b2sum" echo " --busybox Include busybox" echo " --no-busyboxExclude busybox" echo " --unionfs Include support for unionfs" @@ -383,6 +385,10 @@ parse_cmdline() { CMD_MDADM_CONFIG="${*#*=}" print_info 3 "CMD_MDADM_CONFIG: ${CMD_MDADM_CONFIG}" ;; + --b2sum|--no-b2sum) + CMD_B2SUM=$(parse_optbool "$*") + print_info 3 "CMD_B2SUM: ${CMD_B2SUM}" + ;; --busybox|--no-busybox) CMD_BUSYBOX=$(parse_optbool "$*") print_info 3 "CMD_BUSYBOX: ${CMD_BUSYBOX}" diff --git a/gen_determineargs.sh b/gen_determineargs.sh index fffb3e9..14ef757 100755 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -340,6 +340,7 @@ determine_real_args() { set_config_with_override BOOL HYPERV CMD_HYPERV"no" set_config_with_override STRING BOOTFONT CMD_BOOTFONT "none" set_config_with_override STRING BOOTLOADER CMD_BOOTLOADER"no" + set_config_with_override BOOL B2SUM CMD_B2SUM "no" set_config_with_override BOOL BUSYBOX CMD_BUSYBOX "yes" set_config_with_override STRING BUSYBOX_CONFIG CMD_BUSYBOX_CONFIG set_config_with_override BOOL NFS CMD_NFS "yes" diff --git a/gen_initramfs.sh b/gen_initramfs.sh index 2ad4e64..d055b24 100755 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -363,6 +363,7 @@ append_base_layout() { isTrue "${MICROCODE_INITRAMFS}" && build_parameters+=( --microcode-initramfs ) || build_parameters+=( --no-microcode-initramfs ) isTrue "${RAMDISKMODULES}" && build_parameters+=( --ramdisk-modules ) || build_parameters+=( --no-ramdisk-modules ) isTrue "${BUSYBOX}" && build_parameters+=( --busybox ) || build_parameters+=( --no-busybox ) + isTrue "${B2SUM}" && build_parameters+=( --b2sum ) || build_parameters+=( --no-b2sum ) isTrue "${DISKLABEL}" && build_parameters+=( --disklabel ) || build_parameters+=( --no-disklabel ) isTrue "${BTRFS}" && build_parameters+=( --btrfs ) || build_parameters+=( --no-btrfs ) isTrue "${ISCSI}" && build_parameters+=( --iscsi ) || build_parameters+=( --no-iscsi ) @@ -504,6 +505,33 @@ append_e2fsprogs() { fi } +append_b2sum() { + local PN="coreutils" + local TDIR="${TEMP}/initramfs-b2sum-temp" + if [ -d "${TDIR}" ] + then + rm -r "${TDIR}" || gen_die "Failed to clean out existing '${TDIR}'!" + fi + + populate_binpkg ${PN} + + mkdir -p "${TDIR}" || gen_die "Failed to create '${TDIR}'!" + + unpack
[gentoo-commits] proj/genkernel:master commit in: doc/, defaults/
commit: 93c4a548b0aa06c2b5fd40467b80e945e081be24 Author: Thomas Deutschmann gentoo org> AuthorDate: Wed Jan 29 22:04:22 2020 + Commit: Thomas Deutschmann gentoo org> CommitDate: Wed Jan 29 22:12:36 2020 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=93c4a548 defaults/config.sh: Use --buildpkg=n and --usepkg=n in DEFAULT_MODULEREBUILD_CMD 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 gentoo.org> Signed-off-by: Thomas Deutschmann gentoo.org> defaults/config.sh | 2 +- doc/genkernel.8.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/defaults/config.sh b/defaults/config.sh index 694b3e9..fed5355 100644 --- a/defaults/config.sh +++ b/defaults/config.sh @@ -34,7 +34,7 @@ DEFAULT_COMPRESS_INITRD_TYPE=best PORTAGE_MAKEOPTS="$(portageq envvar MAKEOPTS)" DEFAULT_MAKEOPTS="${PORTAGE_MAKEOPTS:- -j2}" -DEFAULT_MODULEREBUILD_CMD="emerge --ignore-default-opts --quiet-build=y @module-rebuild" +DEFAULT_MODULEREBUILD_CMD="emerge --ignore-default-opts --buildpkg=n --usepkg=n --quiet-build=y @module-rebuild" DEFAULT_KERNEL_MAKE=make DEFAULT_UTILS_MAKE=make diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index aebea03..6c7b9bd 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -196,7 +196,7 @@ specified. Copies or does not copy all kernel modules to the initrd. *--*[*no-*]*module-rebuild*:: -Runs, or does not run "emerge --ignore-default-opts --quiet-build=y @module-rebuild" +Runs, or does not run "emerge --ignore-default-opts --buildpkg=n --usepkg=n --quiet-build=y @module-rebuild" to build out-of-tree modules when possible, i.e. when non-static kernel and modules will be build, installed, no custom 'INSTALL_MOD_PATH' is set, '/var/lib/module-rebuild/moduledb' exists
[gentoo-commits] proj/genkernel:master commit in: doc/, defaults/
commit: fe50a5857ded294fef0d6f28e50616b84f99e111 Author: Thomas Deutschmann gentoo org> AuthorDate: Sun Jan 12 22:04:10 2020 + Commit: Thomas Deutschmann gentoo org> CommitDate: Sun Jan 12 22:09:32 2020 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=fe50a585 defaults/config.sh: Use --quiet-build=y in DEFAULT_MODULEREBUILD_CMD --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 gentoo.org> defaults/config.sh | 2 +- doc/genkernel.8.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/defaults/config.sh b/defaults/config.sh index 678c0f9..694b3e9 100644 --- a/defaults/config.sh +++ b/defaults/config.sh @@ -34,7 +34,7 @@ DEFAULT_COMPRESS_INITRD_TYPE=best PORTAGE_MAKEOPTS="$(portageq envvar MAKEOPTS)" DEFAULT_MAKEOPTS="${PORTAGE_MAKEOPTS:- -j2}" -DEFAULT_MODULEREBUILD_CMD="emerge --ignore-default-opts --quiet @module-rebuild" +DEFAULT_MODULEREBUILD_CMD="emerge --ignore-default-opts --quiet-build=y @module-rebuild" DEFAULT_KERNEL_MAKE=make DEFAULT_UTILS_MAKE=make diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index e9076a4..aebea03 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -196,7 +196,7 @@ specified. Copies or does not copy all kernel modules to the initrd. *--*[*no-*]*module-rebuild*:: -Runs, or does not run "emerge --ignore-default-opts --quiet @module-rebuild" +Runs, or does not run "emerge --ignore-default-opts --quiet-build=y @module-rebuild" to build out-of-tree modules when possible, i.e. when non-static kernel and modules will be build, installed, no custom 'INSTALL_MOD_PATH' is set, '/var/lib/module-rebuild/moduledb' exists
[gentoo-commits] proj/genkernel:master commit in: /, doc/
commit: be6974e7d7130845915e361f35d0534e6807f63d Author: Thomas Deutschmann gentoo org> AuthorDate: Tue Dec 3 23:59:25 2019 + Commit: Thomas Deutschmann gentoo org> CommitDate: Tue Dec 3 23:59:25 2019 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=be6974e7 genkernel.conf: Disable MICROCODE_INITRAMFS option by default Embedding microcode updates into initramfs is deprecated when system is able to load multiple initramfs. Signed-off-by: Thomas Deutschmann gentoo.org> doc/genkernel.8.txt | 3 +++ gen_determineargs.sh | 2 +- genkernel.conf | 8 +--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index cb2009f..6c4c155 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -334,6 +334,9 @@ INITIALIZATION But only when kernel configuration does support early microcode loading. See *--microcode* option to auto-update kernel configuration. +NOTE: Embedding microcode updates into initramfs is *deprecated* when +system is able to load multiple initramfs. + *--*[*no-*]*dmraid*:: Includes or excludes DMRAID support. When enabled, this will compile dmraid for you. diff --git a/gen_determineargs.sh b/gen_determineargs.sh index a5bebd5..9e46576 100755 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -345,7 +345,7 @@ determine_real_args() { set_config_with_override STRING BUSYBOX_CONFIG CMD_BUSYBOX_CONFIG set_config_with_override BOOL NFS CMD_NFS "yes" set_config_with_override STRING MICROCODE CMD_MICROCODE "all" - set_config_with_override BOOL MICROCODE_INITRAMFS CMD_MICROCODE_INITRAMFS "yes" + set_config_with_override BOOL MICROCODE_INITRAMFS CMD_MICROCODE_INITRAMFS "no" set_config_with_override BOOL UNIONFS CMD_UNIONFS "no" set_config_with_override BOOL NETBOOT CMD_NETBOOT "no" set_config_with_override STRING REAL_ROOT CMD_REAL_ROOT diff --git a/genkernel.conf b/genkernel.conf index f87ae15..bdb5df4 100644 --- a/genkernel.conf +++ b/genkernel.conf @@ -85,9 +85,11 @@ NOCOLOR="false" #MICROCODE="all" # Include early microcode in generated initramfs. -# This is enabled by default for upgrade compatability, however is obsoleted by -# sys-boot/grub-2.02-r1, which supports multiple initramfs in the bootloader. -#MICROCODE_INITRAMFS="yes" +# Only needed if system cannot load multiple initramfs. +# NOTE: >=sys-boot/grub-2 will detect and auto-load {amd,intel}-uc.img file +# provided by sys-firmware/intel-microcode[initramfs] or +# sys-kernel/linux-firmware[initramfs]. +#MICROCODE_INITRAMFS="no" # Add NFS support #NFS="no"
[gentoo-commits] proj/genkernel:master commit in: /, doc/, defaults/
commit: 2ca8d5bb635d8f9db68d87e078f4ce4f410e9152 Author: Thomas Deutschmann gentoo org> AuthorDate: Sun Sep 29 23:07:57 2019 + Commit: Thomas Deutschmann gentoo org> CommitDate: Sun Sep 29 23:07:57 2019 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=2ca8d5bb Add --utils-cxx option 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 gentoo.org> defaults/config.sh | 1 + doc/genkernel.8.txt | 5 - gen_cmdline.sh | 7 ++- gen_determineargs.sh | 1 + gen_funcs.sh | 3 +++ genkernel.conf | 6 +- 6 files changed, 20 insertions(+), 3 deletions(-) diff --git a/defaults/config.sh b/defaults/config.sh index 9d15633..d9ea32c 100644 --- a/defaults/config.sh +++ b/defaults/config.sh @@ -43,5 +43,6 @@ DEFAULT_KERNEL_LD=ld DEFAULT_UTILS_CFLAGS="-Os -pipe -fomit-frame-pointer" DEFAULT_UTILS_CC=gcc +DEFAULT_UTILS_CXX=g++ DEFAULT_UTILS_AS=as DEFAULT_UTILS_LD=ld diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index 82da1e1..3932e3d 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -269,7 +269,10 @@ LOW-LEVEL COMPILATION OPTIONS C compiler flags used to compile utilities. *--utils-cc*=:: -Compiler to use for utilities. +C Compiler to use for utilities. + +*--utils-cxx*=:: +C++ Compiler to use for utilities. *--utils-ld*=:: Linker to use for utilities. diff --git a/gen_cmdline.sh b/gen_cmdline.sh index 7e74182..d74c8f8 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -94,7 +94,8 @@ longusage() { echo " --kernel-outputdir=" echo " Save output files outside the source tree" echo " --utils-as= Assembler to use for utils" - echo " --utils-cc= Compiler to use for utilities" + echo " --utils-cc= C Compiler to use for utilities" + echo " --utils-cxx= C++ Compiler to use for utilities" echo " --utils-cflags= C compiler flags used to compile utilities" echo " --utils-ld= Linker to use for utils" echo " --utils-make= GNU Make to use for utils" @@ -309,6 +310,10 @@ parse_cmdline() { CMD_UTILS_CC="${*#*=}" print_info 3 "CMD_UTILS_CC: ${CMD_UTILS_CC}" ;; + --utils-cxx=*) + CMD_UTILS_CXX="${*#*=}" + print_info 3 "CMD_UTILS_CXX: ${CMD_UTILS_CXX}" + ;; --utils-cflags=*) CMD_UTILS_CFLAGS="${*#*=}" print_info 3 "CMD_UTILS_CFLAGS: ${CMD_UTILS_CFLAGS}" diff --git a/gen_determineargs.sh b/gen_determineargs.sh index f3cfedf..28590d3 100755 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -285,6 +285,7 @@ determine_real_args() { set_config_with_override STRING KERNEL_LD CMD_KERNEL_LD "$DEFAULT_KERNEL_LD" set_config_with_override STRING KERNEL_AS CMD_KERNEL_AS "$DEFAULT_KERNEL_AS" set_config_with_override STRING UTILS_CC CMD_UTILS_CC "$DEFAULT_UTILS_CC" + set_config_with_override STRING UTILS_CXX CMD_UTILS_CXX "$DEFAULT_UTILS_CXX" set_config_with_override STRING UTILS_LD CMD_UTILS_LD "$DEFAULT_UTILS_LD" set_config_with_override STRING UTILS_AS CMD_UTILS_AS "$DEFAULT_UTILS_AS" diff --git a/gen_funcs.sh b/gen_funcs.sh index 23f6d30..1d4a91d 100755 --- a/gen_funcs.sh +++ b/gen_funcs.sh @@ -1061,6 +1061,9 @@ _tc-getPROG() { CC) [[ -n "${multilib_cflags}" ]] && prog+=( "${multilib_cflags}" ) ;; + CXX) + [[ -n "${multilib_cflags}" ]] && prog+=( "${multilib_cflags}" ) + ;; LD) [[ -n "${multilib_ldflags}" ]] && prog+=( "${multilib_ldflags}" ) ;; diff --git a/genkernel.conf b/genkernel.conf index aa458fb..388502f 100644 --- a/genkernel.conf +++ b/genkernel.conf @@ -205,10 +205,14 @@ NOCOLOR="false" # option. #UTILS_MAKE="make" -# Compiler to use for the utilities (e.g. distcc). See also the --utils-cc +# C Compiler to use for the utilities (e.g. distcc). See also the --utils-cc # command line option. #UTILS_CC="gcc" +# C++ Compiler to use for the utilities (e.g. distcc). See
[gentoo-commits] proj/genkernel:master commit in: doc/
commit: 3c86ab829d04a3c7637f63091f3416b5015acd6d Author: Thomas Deutschmann gentoo org> AuthorDate: Tue Aug 6 21:52:11 2019 + Commit: Thomas Deutschmann gentoo org> CommitDate: Wed Aug 7 15:03:45 2019 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=3c86ab82 manpage: Add documentation about initramfs.mounts file Bug: https://bugs.gentoo.org/560710 Signed-off-by: Thomas Deutschmann gentoo.org> doc/genkernel.8.txt | 14 ++ 1 file changed, 14 insertions(+) diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index 3ebd320..82da1e1 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -877,6 +877,18 @@ make sure that this mountpoint is accessible, see *initramfs.mounts*. Loop-mount an ISO file from the boot device to get the filesystem image. Useful with chain-loading environments and USB keys. +initramfs.mounts + +By default, genkernel's initramfs will only mount *root* device. But +sometimes additional mounts are required before initramfs can switch to +real root (for example on systems with a seperate '/usr' mount). + +Therefore genkernel package contains '/etc/initramfs.mounts' file which +will allow you to specify additional mounts which should be mounted before +initramfs will switch to real root. + +NOTE: This file will not be included in initramfs. Instead, booted initramfs +will check for this file on specified *root* device. NETBOOTING -- @@ -930,6 +942,8 @@ AUTHORS SEE ALSO +'/etc/initramfs.mounts' - additional required mounts before switching to real root + '/etc/genkernel.conf' - genkernel configuration file // vim: ft=asciidoc et tw=72 sts=4 ts=4 :
[gentoo-commits] proj/genkernel:master commit in: doc/
commit: 6de79b848f4aaf0024e37530e48b3eba9ef7dcfd Author: Thomas Deutschmann gentoo org> AuthorDate: Mon Jul 29 19:47:03 2019 + Commit: Thomas Deutschmann gentoo org> CommitDate: Mon Jul 29 20:02:21 2019 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=6de79b84 manpage: Clarify that dosshd will start network Signed-off-by: Thomas Deutschmann gentoo.org> doc/genkernel.8.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index 1b36729..f5f877d 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -688,8 +688,9 @@ recognized by the kernel itself. By default we will wait up to 10 seconds for interface to show up. *dosshd*:: -Will start an SSH daemon within initramfs allowing to remotely unlock -encrypted devices or just for debugging purpose. +Will bring up an interface and start a SSH daemon within initramfs +allowing to remotely unlock encrypted devices or just for debugging +purpose. See *ip* option for how to configure network. *gk.sshd.port*=<...>:: By default, sshd will listen on port 22.
[gentoo-commits] proj/genkernel:master commit in: /, doc/
commit: 94d32a155ef3e5cd59f852a032e5887b74306d81 Author: Thomas Deutschmann gentoo org> AuthorDate: Sun Jul 28 22:06:33 2019 + Commit: Thomas Deutschmann gentoo org> CommitDate: Mon Jul 29 20:00:27 2019 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=94d32a15 Add --kernel-append-localversion option 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 gentoo.org> doc/genkernel.8.txt | 6 + gen_cmdline.sh | 6 + gen_determineargs.sh | 63 ++-- 3 files changed, 53 insertions(+), 22 deletions(-) diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index 35762a2..1b36729 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -124,6 +124,12 @@ KERNEL CONFIGURATION *--*[*no-*]*virtio*:: Adds, or skip adding VirtIO support to kernel configuration. +*--kernel-append-localversion*=<...>:: +Appends value to genkernel's *KERNEL_LOCALVERSION* option (see below). +The idea is to use this option to allow to easily build a new revision +with own kernel binary, initramfs and modules directory without losing +default *KERNEL_LOCALVERSION* value. + *--kernel-localversion*=<...>:: Set kernel option *LOCALVERSION*. Use special value *UNSET* to unset any already set *LOCALVERSION*. The following placeholders are diff --git a/gen_cmdline.sh b/gen_cmdline.sh index 6fbf309..dcf479b 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -71,6 +71,8 @@ longusage() { echo " --no-static Do not build a static (monolithic kernel)" echo " Kernel settings" echo " --kerneldir= Location of the kernel sources" + echo " --kernel-append-localversion=<...>" + echo " Appends value to genkernel's KERNEL_LOCALVERSION option" echo " --kernel-config=" echo " Kernel configuration file to use for compilation; Use" echo " 'default' to explicitly start from scratch using" @@ -648,6 +650,10 @@ parse_cmdline() { CMD_KERNEL_DIR="${*#*=}" print_info 3 "CMD_KERNEL_DIR: ${CMD_KERNEL_DIR}" ;; + --kernel-append-localversion=*) + CMD_KERNEL_APPEND_LOCALVERSION="${*#*=}" + print_info 3 "CMD_KERNEL_APPEND_LOCALVERSION: ${CMD_KERNEL_APPEND_LOCALVERSION}" + ;; --kernel-config=*) CMD_KERNEL_CONFIG="${*#*=}" print_info 3 "CMD_KERNEL_CONFIG: ${CMD_KERNEL_CONFIG}" diff --git a/gen_determineargs.sh b/gen_determineargs.sh index df0934d..f4b3cf7 100755 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -290,6 +290,7 @@ determine_real_args() { set_config_with_override STRING CROSS_COMPILE CMD_CROSS_COMPILE set_config_with_override STRING BOOTDIR CMD_BOOTDIR "/boot" set_config_with_override STRING KERNEL_OUTPUTDIR CMD_KERNEL_OUTPUTDIR "${KERNEL_DIR}" + set_config_with_override STRING KERNEL_APPEND_LOCALVERSION CMD_KERNEL_APPEND_LOCALVERSION set_config_with_override STRING KERNEL_LOCALVERSION CMD_KERNEL_LOCALVERSION "-%%ARCH%%" set_config_with_override STRING MODPROBEDIR CMD_MODPROBEDIR "/etc/modprobe.d" @@ -630,6 +631,46 @@ determine_real_args() { need_tar=yes fi + # We always need to populate KERNEL_LOCALVERSION to be able to warn + # if user changed value but didn't rebuild kernel + local valid_localversion_pattern='^[A-Za-z0-9_.-]{1,}$' + + if [ -n "${KERNEL_LOCALVERSION}" ] + then + case "${KERNEL_LOCALVERSION}" in + UNSET) + ;; + *) + KERNEL_LOCALVERSION=$(arch_replace "${KERNEL_LOCALVERSION}") + if [ -z "${KERNEL_LOCALVERSION}" ] + then + # We somehow lost value... + gen_die "Internal error: Variable 'KERNEL_LOCALVERSION' is empty!" +
[gentoo-commits] proj/genkernel:master commit in: doc/, defaults/, /
commit: 769a07fd3e947ffb216ea94887d752a27ea212d9 Author: Thomas Deutschmann gentoo org> AuthorDate: Sun Jul 28 14:33:25 2019 + Commit: Thomas Deutschmann gentoo org> CommitDate: Mon Jul 29 20:00:24 2019 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=769a07fd Make initramfs and kernel filename customizable 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 gentoo.org> defaults/config.sh | 7 +++ doc/genkernel.8.txt | 90 +++ gen_bootloader.sh| 12 ++-- gen_cmdline.sh | 40 ++-- gen_compile.sh | 26 gen_configkernel.sh | 2 +- gen_determineargs.sh | 169 ++- gen_funcs.sh | 7 +++ gen_initramfs.sh | 10 +-- gen_package.sh | 98 +++-- genkernel| 33 +- genkernel.conf | 22 +-- 12 files changed, 407 insertions(+), 109 deletions(-) diff --git a/defaults/config.sh b/defaults/config.sh index 3546299..7232671 100644 --- a/defaults/config.sh +++ b/defaults/config.sh @@ -21,6 +21,13 @@ KERNEL_SUPPORT_MICROCODE=no # Arch-specific defaults that can be overridden in the config file or on the # command line. # +DEFAULT_INITRAMFS_FILENAME="initramfs-genkernel-%%ARCH%%-%%KV%%" +DEFAULT_INITRAMFS_SYMLINK_NAME="initramfs" +DEFAULT_KERNEL_FILENAME="kernel-genkernel-%%ARCH%%-%%KV%%" +DEFAULT_KERNEL_SYMLINK_NAME="kernel" +DEFAULT_SYSTEMMAP_FILENAME="System.map-%%ARCH%%-%%KV%%" +DEFAULT_SYSTEMMAP_SYMLINK_NAME="System.map" + DEFAULT_COMPRESS_INITRD=yes DEFAULT_COMPRESS_INITRD_TYPE=best diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index f1ccbe6..e94fa12 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -150,16 +150,20 @@ KERNEL COMPILATION are copied over. *--*[*no-*]*symlink*:: -Manages, or does not manage, symlinks in '/boot' like the manual -kernel "make install" process does. A kernel (or, depending on -options, kernelz) symlink will link to the most recently built -kernel image and a kernel.old (or kernelz.old) symlink will link -to the second most recently built image, if one exists. Similar -symlinks (both * and *.old) are managed for initramfs and System.map. -The corresponding work products (i.e., the actual kernel -and initramfs images, and System.map) are also managed accordingly. -NOTE: Specifying *--symlink* does nothing unless -*--install* is also specified. +Manages, or does not manage, symlinks in '/boot' like the manual +kernel "make install" process does. A 'kernel' (or, depending on +options, 'kernelz') symlink will link to the most recently built +kernel image and a 'kernel.old' (or 'kernelz.old') symlink will link +to the second most recently built image, if one exists. Similar +symlinks (with and without '.old' suffix) are managed for initramfs and +System.map. The corresponding work products (i.e., the actual kernel +and initramfs images, and System.map) are also managed accordingly. ++ +The symlink name can be controlled via *--kernel-symlink-name* and/or +*--initramfs-symlink-name* option. + +NOTE: Specifying *--symlink* does nothing unless *--install* is also +specified. *--*[*no-*]*oldconfig*:: Runs, or does not run, "make oldconfig" before compilation. Specifying @@ -428,9 +432,22 @@ INTERNALS OUTPUT SETTINGS ~~~ -*--kernname*=<...>:: -Tag the kernel and initrd with a name, if not defined this -option defaults to genkernel. +*--initramfs-filename*=<...>:: +Set initramfs filename which will be used when initramfs will be installed +into *BOOTDIR* (implies *--install* option). Please see +*--kernel-filename* option for available placeholders and restrictions. ++ +By default, initramfs filename will be set to 'initramfs-genkernel-%%ARCH%%-%%KV%%'. + +*--initramfs-symlink-name*=<...>:: +Set initramfs symlink name which will be used when initramfs will be +installed into *BOOTDIR* (implies *--install* option) and *--symlink* +option is given. Please see *--kernel-filename* option for available +placeholders and restrictions. ++ +By default, initramfs symlink name will be set to 'initramfs'. + +NOTE: Initramfs filename and initramfs symlink name must be different. *--minkernpackage*=:: Archive file created using tar containing kernel and initramfs. @@ -445,11 +462,58 @@ NOTE: No modules outside of the initramfs will be included! Archive file created using tar containing kernel binary, content of '/lib/modules' and the kernel config after the callbacks have run.
[gentoo-commits] proj/genkernel:master commit in: /, doc/, defaults/
commit: c452f3d690dc695a55aee63f0f2e4ab0cbb7b93a Author: Thomas Deutschmann gentoo org> AuthorDate: Sun Jul 28 20:56:30 2019 + Commit: Thomas Deutschmann gentoo org> CommitDate: Mon Jul 29 20:00:26 2019 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=c452f3d6 Change kernel and initramfs default filename in $BOOTDIR 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 gentoo.org> defaults/config.sh | 6 +++--- doc/genkernel.8.txt | 21 - gen_configkernel.sh | 2 +- gen_determineargs.sh | 11 +-- genkernel| 10 ++ genkernel.conf | 6 +++--- 6 files changed, 42 insertions(+), 14 deletions(-) diff --git a/defaults/config.sh b/defaults/config.sh index 7232671..9d15633 100644 --- a/defaults/config.sh +++ b/defaults/config.sh @@ -21,11 +21,11 @@ KERNEL_SUPPORT_MICROCODE=no # Arch-specific defaults that can be overridden in the config file or on the # command line. # -DEFAULT_INITRAMFS_FILENAME="initramfs-genkernel-%%ARCH%%-%%KV%%" +DEFAULT_INITRAMFS_FILENAME="initramfs-%%KV%%.img" DEFAULT_INITRAMFS_SYMLINK_NAME="initramfs" -DEFAULT_KERNEL_FILENAME="kernel-genkernel-%%ARCH%%-%%KV%%" +DEFAULT_KERNEL_FILENAME="vmlinuz-%%KV%%" DEFAULT_KERNEL_SYMLINK_NAME="kernel" -DEFAULT_SYSTEMMAP_FILENAME="System.map-%%ARCH%%-%%KV%%" +DEFAULT_SYSTEMMAP_FILENAME="System.map-%%KV%%" DEFAULT_SYSTEMMAP_SYMLINK_NAME="System.map" DEFAULT_COMPRESS_INITRD=yes diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index e94fa12..35762a2 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -125,8 +125,19 @@ KERNEL CONFIGURATION Adds, or skip adding VirtIO support to kernel configuration. *--kernel-localversion*=<...>:: -Set kernel option CONFIG_LOCALVERSION. Use special value "UNSET" to -unset any already set LOCALVERSION. +Set kernel option *LOCALVERSION*. Use special value *UNSET* to +unset any already set *LOCALVERSION*. The following placeholders are +available: ++ +[horizontal] +*%%ARCH%%*::: +Will be replaced with genkernel arch value, for example 'x86_64'. + ++ +*LOCALVERSION* is only allowed to contain characters like 'a-z' or 'A-Z', +'0-9', '_', '.' and '-'. ++ +By default, *LOCALVERSION* will be set to '-%%ARCH%%'. KERNEL COMPILATION @@ -437,7 +448,7 @@ Set initramfs filename which will be used when initramfs will be installed into *BOOTDIR* (implies *--install* option). Please see *--kernel-filename* option for available placeholders and restrictions. + -By default, initramfs filename will be set to 'initramfs-genkernel-%%ARCH%%-%%KV%%'. +By default, initramfs filename will be set to 'initramfs-%%KV%%.img'. *--initramfs-symlink-name*=<...>:: Set initramfs symlink name which will be used when initramfs will be @@ -477,7 +488,7 @@ Will be replaced with kernel version, for example '5.2.3-gentoo'. Kernel filename is only allowed to contain characters like 'a-z' or 'A-Z', '0-9', '_', '.' and '-'. + -By default, kernel name will be set to 'kernel-genkernel-%%ARCH%%-%%KV%%'. +By default, kernel name will be set to 'vmlinuz-%%KV%%'. NOTE: When setting a custom kernel name make sure that your bootloader and tools like *kexec* when used are recognizing your custom kernel name. @@ -502,7 +513,7 @@ Set System.map filename which will be used when kernel will be installed into *BOOTDIR* (implies *--install* option). Please see *--kernel-filename* option for available placeholders and restrictions. + -By default, System.map filename will be set to 'System.map-genkernel-%%ARCH%%-%%KV%%'. +By default, System.map filename will be set to 'System.map-%%KV%%'. *--systemmap-symlink-name*=<...>:: Set System.map symlink name which will be used when kernel will be diff --git a/gen_configkernel.sh b/gen_configkernel.sh index 124852e..4cfd246 100755 --- a/gen_configkernel.sh +++ b/gen_configkernel.sh @@ -27,7 +27,7 @@ determine_kernel_config_file() { then print_info 1 "Default configuration was forced. Will ignore any user kernel configuration!" else - kconfig_candidates=( "/etc/kernels/${GK_FILENAME_CONFIG}" ${kconfig_candidates[@]} ) + kconfig_candidates=( "/etc/kernels/${GK_FILENAME_CONFIG}" "/etc/kernels/kernel-config-${ARCH}-${KV}" ${kconfig_candidates[@]} ) fi
[gentoo-commits] proj/genkernel:master commit in: /, doc/
commit: 28109e6345d31d46cc226f5d5d84fc893c248ced Author: Thomas Deutschmann gentoo org> AuthorDate: Sun Jul 28 01:31:42 2019 + Commit: Thomas Deutschmann gentoo org> CommitDate: Sun Jul 28 21:19:39 2019 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=28109e63 Update help text and man page Signed-off-by: Thomas Deutschmann gentoo.org> doc/genkernel.8.txt | 47 ++- gen_cmdline.sh | 4 ++-- 2 files changed, 32 insertions(+), 19 deletions(-) diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index 8650881..f1ccbe6 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -270,7 +270,7 @@ LOW-LEVEL COMPILATION OPTIONS *--*[*no-*]*nice*[=]:: Runs the kernel make at the default niceness (reduction in priority) of -10, or in the case of --no-nice, runs the kernel make at normal priority. +10, or in the case of *--no-nice*, runs the kernel make at normal priority. INITIALIZATION @@ -297,12 +297,12 @@ INITIALIZATION When enabled, this will compile LVM for you. *--*[*no-*]*mdadm*:: -Includes or excludes mdadm/mdmon support. -Without sys-fs/mdadm[static] installed, this will compile mdadm for you. +Includes or excludes mdadm support. +When enabled, this will compile mdadm for you. *--mdadm-config*=:: Use as configfile for MDADM. -By default the ramdisk will be built *without* an mdadm.conf and +By default the ramdisk will be built *without* an 'mdadm.conf' and will auto-detect arrays during boot-up. *--*[*no-*]*microcode-initramfs*:: @@ -312,43 +312,50 @@ INITIALIZATION *--*[*no-*]*dmraid*:: Includes or excludes DMRAID support. +When enabled, this will compile dmraid for you. *--*[*no-*]*nfs*:: Includes or excludes NFS support. *--*[*no-*]*e2fsprogs*:: Includes or excludes e2fsprogs. +When enabled, this will compile e2fsprogs for you. *--*[*no-*]*xfsprogs*:: Includes or excludes xfsprogs. +When enabled, this will compile xfsprogs for you. *--*[*no-*]*zfs*:: Includes or excludes ZFS support. *--*[*no-*]*btrfs*:: Includes or excludes Btrfs support. +When enabled, this will compile btrfs-progs for you. *--*[*no-*]*multipath*:: Includes or excludes Multipath support. +When enabled, this will compile multipath-tools for you. *--*[*no-*]*iscsi*:: Includes or excludes iSCSI support. +When enabled, this will compile open-iscsi for you. *--*[*no-*]*sandbox*:: Enables or disables sandbox-ing when building initramfs. *--*[*no-*]*ssh*:: Includes or excludes SSH (dropbear) support for remote LUKS keys. +When enabled, this will compile dropbear for you. *--ssh-authorized-keys-file*=:: Specifies a user created authorized_keys file. By default genkernel -will use "/etc/dropbear/authorized_keys". +will use '/etc/dropbear/authorized_keys'. *--ssh-host-keys*=:: When set to *create*, which is the default value, genkernel will embed -SSH host keys from "/etc/dropbear" and will create those keys when missing. +SSH host keys from '/etc/dropbear' and will create those keys when missing. When set to *create-from-host*, genkernel will embed SSH host keys from -"/etc/dropbear" but will create those keys from "/etc/ssh" when missing +'/etc/dropbear' but will create those keys from '/etc/ssh' when missing (not recommended for security reasons). When set to *runtime*, genkernel will not embed any SSH host key in initramfs and dropbear will generate needed host key at runtime (`dropbear -R`). @@ -366,10 +373,12 @@ INITIALIZATION Make and install kernelz image from 'arch/powerpc/boot/zImage.initrd'. *--*[*no-*]*disklabel*:: -Includes or excludes disk label and uuid support in your initrd. +Includes or excludes disk label and uuid support in your initramfs. +When enabled, this will compile util-linux for you. *--*[*no-*]*luks*:: Includes or excludes LUKS support. +When enabled, this will compile cryptsetup for you. *--*[*no-*]*gpg*:: Includes or excludes support for GnuPG 1.x, the portable standalone branch @@ -378,16 +387,19 @@ INITIALIZATION After that, re-point the *root_key* argument to the new .gpg file. *--*[*no-*]*busybox*:: -Includes or excludes busybox in the initrd or initramfs. +Includes or excludes busybox in the initramfs. +When enabled, this will compile busybox for you. *--*[*no-*]*unionfs*:: Includes or excludes support for unionfs. +When enabled, this will compile unionfs-fuse for you. *--*[*no-*]*netboot*:: Creates or does not create a self-contained env in the initramfs. *--real-root*=:: -Specify a default for *real_root*= kernel option. +Specify a default for *real_root*= kernel option which will be +embedded into initramfs. INTERNALS @@ -407,7 +419,8 @@ INTERNALS Clears or skips
[gentoo-commits] proj/genkernel:master commit in: /, doc/
commit: 467c2e82e62b75b5cf9884f3d741926a65338f15 Author: Thomas Deutschmann gentoo org> AuthorDate: Tue Jul 23 19:18:07 2019 + Commit: Thomas Deutschmann gentoo org> CommitDate: Tue Jul 23 19:37:02 2019 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=467c2e82 Add feature to check for free disk space early at genkernel start 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 gentoo.org> doc/genkernel.8.txt | 8 +++ gen_cmdline.sh | 14 gen_determineargs.sh | 191 ++- gen_funcs.sh | 79 + genkernel| 2 + genkernel.conf | 6 ++ 6 files changed, 206 insertions(+), 94 deletions(-) diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index 72029d6..8650881 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -395,6 +395,14 @@ INTERNALS *--cachedir*=:: Override the default cache location. +*--check-free-disk-space-bootdir*=:: +When set to a non-zero value, genkernel will check early on start for +specified amount of free disk space in megabyte in *BOOTDIR*. + +*--check-free-disk-space-kerneloutputdir*=:: +When set to a non-zero value, genkernel will check early on start for +specified amount of free disk space in megabyte in *KERNEL_OUTPUTDIR*. + *--*[*no-*]*clear-cachedir*:: Clears or skips clearing all files in cache location on genkernel start. diff --git a/gen_cmdline.sh b/gen_cmdline.sh index a05e277..c93cffd 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -168,6 +168,12 @@ longusage() { echo " --real-root= Specify a default for real_root=" echo " Internals" echo " --cachedir=Override the default cache location" + echo " --check-free-disk-space-bootdir=" + echo " Check for specified amount of free disk space in MB in BOOTDIR" + echo " at genkernel start" + echo " --check-free-disk-space-kerneloutputdir=" + echo " Check for specified amount of free disk space in MB in" + echo " kernel outputdir at genkernel start" echo " --clear-cachedirClear genkernel's cache location on start. Useful" echo " if you want to force rebuild of included tools" echo " like BusyBox, DMRAID, GnuPG, LVM, MDADM ..." @@ -601,6 +607,14 @@ parse_cmdline() { CMD_POSTCLEAR=$(parse_optbool "$*") print_info 3 "CMD_POSTCLEAR: ${CMD_POSTCLEAR}" ;; + --check-free-disk-space-bootdir=*) + CMD_CHECK_FREE_DISK_SPACE_BOOTDIR="${*#*=}" + print_info 3 "CMD_CHECK_FREE_DISK_SPACE_BOOTDIR: ${CMD_CHECK_FREE_DISK_SPACE_BOOTDIR}" + ;; + --check-free-disk-space-kerneloutputdir=*) + CMD_CHECK_FREE_DISK_SPACE_KERNELOUTPUTDIR="${*#*=}" + print_info 3 "CMD_CHECK_FREE_DISK_SPACE_KERNELOUTPUTDIR: ${CMD_CHECK_FREE_DISK_SPACE_KERNELOUTPUTDIR}" + ;; --color|--no-color) CMD_COLOR=$(parse_optbool "$*") if isTrue "${CMD_COLOR}" diff --git a/gen_determineargs.sh b/gen_determineargs.sh index eb0cd74..69a6ee7 100755 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -95,100 +95,103 @@ determine_real_args() { print_info 4 "Resolving config file, command line, and arch default settings." - # Dest / Config File Command Line Arch Default - # -- - set_config_with_override STRING TMPDIR CMD_TMPDIR "/var/tmp/genkernel" - set_config_with_override STRING LOGFILE CMD_LOGFILE "/var/log/genkernel.conf" - set_config_with_override STRING KERNEL_DIR CMD_KERNEL_DIR "${DEFAULT_KERNEL_SOURCE}" - set_config_with_override BOOL KERNEL_SOURCES CMD_KERNEL_SOURCES "yes" - set_config_with_override STRING KNAMECMD_KERNNAME "genkernel" - - set_config_with_override STRING COMPRESS_INITRD CMD_COMPRESS_INITRD "$DEFAULT_COMPRESS_INITRD" - set_config_with_override STRING COMPRESS_INITRD_TYPE CMD_COMPRESS_INITRD_TYPE
[gentoo-commits] proj/genkernel:master commit in: doc/
commit: b73e710fc1531e5ac33eeec744b052f88c135a1f Author: Thomas Deutschmann gentoo org> AuthorDate: Sun Jul 21 18:24:29 2019 + Commit: Thomas Deutschmann gentoo org> CommitDate: Sun Jul 21 18:24:29 2019 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=b73e710f manpage: Add missing --utils-cflags option Signed-off-by: Thomas Deutschmann gentoo.org> doc/genkernel.8.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index 15beee6..e741a72 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -244,6 +244,9 @@ LOW-LEVEL COMPILATION OPTIONS *--utils-as*=:: Assembler to use for utilities. +*--utils-cflags*=:: +C compiler flags used to compile utilities. + *--utils-cc*=:: Compiler to use for utilities.
[gentoo-commits] proj/genkernel:master commit in: doc/, /
commit: 47462f4dc4a9164cd546d6e2be953f38a450996d Author: Thomas Deutschmann gentoo org> AuthorDate: Sun Jul 21 18:28:51 2019 + Commit: Thomas Deutschmann gentoo org> CommitDate: Sun Jul 21 18:31:50 2019 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=47462f4d Rename --tempdir option to --tmpdir to match used variable name Signed-off-by: Thomas Deutschmann gentoo.org> doc/genkernel.8.txt | 2 +- gen_cmdline.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index e741a72..72029d6 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -398,7 +398,7 @@ INTERNALS *--*[*no-*]*clear-cachedir*:: Clears or skips clearing all files in cache location on genkernel start. -*--tempdir*=:: +*--tmpdir*=:: Sets genkernel's temporary working directory to . *--*[*no-*]*postclear*:: diff --git a/gen_cmdline.sh b/gen_cmdline.sh index 247a674..a05e277 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -172,7 +172,7 @@ longusage() { echo " if you want to force rebuild of included tools" echo " like BusyBox, DMRAID, GnuPG, LVM, MDADM ..." echo " --no-clear-cachedir Do not clean up on genkernel start" - echo " --tempdir= Location of genkernel's temporary directory" + echo " --tmpdir= Location of genkernel's temporary directory" echo " --postclear Clear all tmp files and caches after genkernel has run" echo " --no-postclear Do not clean up after genkernel has run" echo " Output Settings" @@ -593,7 +593,7 @@ parse_cmdline() { CMD_STATIC=$(parse_optbool "$*") print_info 3 "CMD_STATIC: ${CMD_STATIC}" ;; - --tempdir=*) + --tmpdir=*) CMD_TMPDIR="${*#*=}" print_info 3 "CMD_TMPDIR: ${CMD_TMPDIR}" ;;
[gentoo-commits] proj/genkernel:master commit in: doc/, /
commit: b0ca48130c96f34e61a8bb2ea4c169f5efd89c94 Author: Thomas Deutschmann gentoo org> AuthorDate: Sat Jul 20 22:11:31 2019 + Commit: Thomas Deutschmann gentoo org> CommitDate: Sun Jul 21 16:09:35 2019 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=b0ca4813 Add --no-sandbox option 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 gentoo.org> doc/genkernel.8.txt | 3 + gen_cmdline.sh | 6 ++ gen_determineargs.sh | 11 +++ gen_funcs.sh | 192 +++ genkernel| 16 + genkernel.conf | 3 + 6 files changed, 141 insertions(+), 90 deletions(-) diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index 3b96d8e..e04e800 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -327,6 +327,9 @@ INITIALIZATION *--*[*no-*]*iscsi*:: Includes or excludes iSCSI support. +*--*[*no-*]*sandbox*:: +Enables or disables sandbox-ing when building initramfs. + *--*[*no-*]*ssh*:: Includes or excludes SSH (dropbear) support for remote LUKS keys. diff --git a/gen_cmdline.sh b/gen_cmdline.sh index b17e35c..a8700cd 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -133,6 +133,8 @@ longusage() { echo " --no-multipath Exclude Multipath support" echo " --iscsi Include iSCSI support" echo " --no-iscsi Exclude iSCSI support" + echo " --sandbox Enable sandbox-ing when building initramfs" + echo " --no-sandboxDisable sandbox-ing when building initramfs" echo " --ssh Include SSH (dropbear) support" echo " --no-sshExclude SSH (dropbear) support" echo " --ssh-authorized-keys-file=" @@ -440,6 +442,10 @@ parse_cmdline() { CMD_HYPERV=$(parse_optbool "$*") print_info 3 "CMD_HYPERV: ${CMD_HYPERV}" ;; + --sandbox|--no-sandbox) + CMD_SANDBOX=$(parse_optbool "$*") + print_info 3 "CMD_SANDBOX: ${CMD_SANDBOX}" + ;; --ssh|--no-ssh) CMD_SSH=$(parse_optbool "$*") print_info 3 "CMD_SSH: ${CMD_SSH}" diff --git a/gen_determineargs.sh b/gen_determineargs.sh index 52de7a3..e2eafbb 100755 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -145,6 +145,7 @@ determine_real_args() { set_config_with_override BOOL SYMLINK CMD_SYMLINK "no" set_config_with_override STRING INSTALL_MOD_PATH CMD_INSTALL_MOD_PATH set_config_with_override BOOL OLDCONFIGCMD_OLDCONFIG "yes" + set_config_with_override BOOL SANDBOX CMD_SANDBOX "yes" set_config_with_override BOOL SSH CMD_SSH "no" set_config_with_override STRING SSH_AUTHORIZED_KEYS_FILE CMD_SSH_AUTHORIZED_KEYS_FILE "/etc/dropbear/authorized_keys" set_config_with_override STRING SSH_HOST_KEYS CMD_SSH_HOST_KEYS"create" @@ -527,6 +528,16 @@ determine_real_args() { then gen_die "'lddtree -l ${lddtree_testfile}' failed -- cannot generate initramfs without working lddtree!" fi + + SANDBOX_COMMAND= + if isTrue "${SANDBOX}" + then + SANDBOX_COMMAND="$(which sandbox)" + if [ -z "${SANDBOX_COMMAND}" ] + then + gen_die "Sandbox not found. Is sys-apps/sandbox installed?" + fi + fi fi MICROCODE=${MICROCODE,,} diff --git a/gen_funcs.sh b/gen_funcs.sh index 9aa4e24..33b05b7 100755 --- a/gen_funcs.sh +++ b/gen_funcs.sh @@ -543,38 +543,41 @@ dropbear_create_key() { [[ ${#} -ne 2 ]] \ && gen_die "$(get_useful_function_stack "${FUNCNAME}")Invalid usage of ${FUNCNAME}(): Function takes exactly two arguments (${#} given)!" - if ! hash sandbox &>/dev/null - then - gen_die "Sandbox not found. Please install sys-apps/sandbox!" - fi - local key_file=${1} local command=${2} local key_type=$(dropbear_get_key_type_from_filename "${key_file}") local -a envvars=( - GK_SHARE="${GK_SHARE}" - LOGLEVEL="${LOGLEVEL}" - LOGFILE="${LOGFILE}" - NOCOLOR="${NOCOLOR}" - TEMP="${TEMP}" - SANDBOX_WRITE="${LOGFILE}:${TEMP}" + "GK_SHARE='${GK_SHARE}'" + "LOGLEVEL='${LOGLEVEL}'" + "LOGFILE='${LOGFILE}'" +
[gentoo-commits] proj/genkernel:master commit in: doc/, /
commit: c85901916e603cac8f92f176a84fbb03d0f0bc6d Author: Thomas Deutschmann gentoo org> AuthorDate: Sun Jul 21 13:03:19 2019 + Commit: Thomas Deutschmann gentoo org> CommitDate: Sun Jul 21 16:09:45 2019 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=c8590191 Add --kernel-localversion option This option will set/unset kernel option CONFIG_LOCALVERSION. Closes: https://bugs.gentoo.org/521774 Signed-off-by: Thomas Deutschmann gentoo.org> doc/genkernel.8.txt | 4 gen_cmdline.sh | 7 +++ gen_configkernel.sh | 19 +++ gen_determineargs.sh | 19 +++ genkernel.conf | 4 5 files changed, 53 insertions(+) diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index e04e800..15beee6 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -124,6 +124,10 @@ KERNEL CONFIGURATION *--*[*no-*]*virtio*:: Adds, or skip adding VirtIO support to kernel configuration. +*--kernel-localversion*=<...>:: +Set kernel option CONFIG_LOCALVERSION. Use special value "UNSET" to +unset any already set LOCALVERSION. + KERNEL COMPILATION ~~ diff --git a/gen_cmdline.sh b/gen_cmdline.sh index a8700cd..17d66d2 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -75,6 +75,9 @@ longusage() { echo " Kernel configuration file to use for compilation; Use" echo " 'default' to explicitly start from scratch using" echo " genkernel defaults" + echo " --kernel-localversion=<...>" + echo " Set kernel CONFIG_LOCALVERSION, use special value" + echo " 'UNSET' to unset any set LOCALVERSION" echo " --module-prefix= Prefix to kernel module destination, modules" echo " will be installed in /lib/modules" echo " Low-Level Compile settings" @@ -625,6 +628,10 @@ parse_cmdline() { CMD_KERNEL_CONFIG="${*#*=}" print_info 3 "CMD_KERNEL_CONFIG: ${CMD_KERNEL_CONFIG}" ;; + --kernel-localversion=*) + CMD_KERNEL_LOCALVERSION="${*#*=}" + print_info 3 "CMD_KERNEL_LOCALVERSION: ${CMD_KERNEL_LOCALVERSION}" + ;; --module-prefix=*) CMD_INSTALL_MOD_PATH="${*#*=}" print_info 3 "CMD_INSTALL_MOD_PATH: ${CMD_INSTALL_MOD_PATH}" diff --git a/gen_configkernel.sh b/gen_configkernel.sh index 503812c..a5ad953 100755 --- a/gen_configkernel.sh +++ b/gen_configkernel.sh @@ -193,6 +193,25 @@ config_kernel() { fi fi + # --kernel-localversion handling + if [ -n "${KERNEL_LOCALVERSION}" ] + then + local cfg_CONFIG_LOCALVERSION=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_LOCALVERSION") + case "${KERNEL_LOCALVERSION}" in + UNSET) + print_info 2 "$(get_indent 1)>> Ensure that CONFIG_LOCALVERSION is unset ..." + if [ -n "${cfg_CONFIG_LOCALVERSION}" ] + then + kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_LOCALVERSION" "" + fi + ;; + *) + print_info 2 "$(get_indent 1)>> Ensure that CONFIG_LOCALVERSION is set ..." + kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_LOCALVERSION" "\"${KERNEL_LOCALVERSION}\"" + ;; + esac + fi + # Do we support modules at all? local cfg_CONFIG_MODULES=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_MODULES") if isTrue "${cfg_CONFIG_MODULES}" diff --git a/gen_determineargs.sh b/gen_determineargs.sh index e2eafbb..a82fb0a 100755 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -120,6 +120,7 @@ determine_real_args() { set_config_with_override STRING CROSS_COMPILE CMD_CROSS_COMPILE set_config_with_override STRING BOOTDIR CMD_BOOTDIR "/boot" set_config_with_override STRING KERNEL_OUTPUTDIR CMD_KERNEL_OUTPUTDIR "${KERNEL_DIR}" + set_config_with_override STRING KERNEL_LOCALVERSION CMD_KERNEL_LOCALVERSION set_config_with_override STRING MODPROBEDIR CMD_MODPROBEDIR "/etc/modprobe.d" set_config_with_override BOOL SPLASH CMD_SPLASH "no" @@ -456,6 +457,24 @@ determine_real_args() { fi fi + if isTrue "${BUILD_KERNEL}" + then + if [ -n "${KERNEL_LOCALVERSION}" ] + then +
[gentoo-commits] proj/genkernel:master commit in: doc/, defaults/
commit: b3889e9bf7d486f83db3c182844b1217ce75d472 Author: Thomas Deutschmann gentoo org> AuthorDate: Thu Jul 18 20:08:23 2019 + Commit: Thomas Deutschmann gentoo org> CommitDate: Thu Jul 18 20:08:23 2019 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=b3889e9b linuxrc: Load network modules only when needed To avoid problems related to drivers requiring special firmware which might be not available when loading the module because the user don't really need that module but it was added based on genkernel's module_load file, we will no longer load network modules on boot. Instead we will only load network modules when needed, for example when dosshd is set or NFS is used. Signed-off-by: Thomas Deutschmann gentoo.org> defaults/initrd.defaults | 5 +-- defaults/initrd.scripts | 83 +--- doc/genkernel.8.txt | 3 ++ 3 files changed, 78 insertions(+), 13 deletions(-) diff --git a/defaults/initrd.defaults b/defaults/initrd.defaults index fbbd214..c617064 100644 --- a/defaults/initrd.defaults +++ b/defaults/initrd.defaults @@ -80,6 +80,7 @@ GK_NET_ROUTES= GK_NET_TIMEOUT_DAD=10 GK_NET_TIMEOUT_DECONFIGURATION=10 GK_NET_TIMEOUT_DHCP=10 +GK_NET_TIMEOUT_INTERFACE=10 GK_SHELL_LOCKFILE='/var/run/rescueshell.pid' GK_SSHD_LOCKFILE='/tmp/remote-rescueshell.lock' GK_SSHD_PIDFILE='/var/run/dropbear.pid' @@ -119,8 +120,8 @@ DEFAULT_NFSOPTIONS="ro,nolock" # - modules HWOPTS_BLK='nvme pata sata scsi usb firewire waitscan' HWOPTS_OBSOLETE='pcmcia ataraid' # Obsolete stuff that might be useful on old hardware, do$X only. -HWOPTS="keymap cache modules virtio hyperv ${HWOPTS_BLK} bcache lvm dmraid multipath mdadm zfs fs net iscsi crypto" +HWOPTS="keymap cache modules virtio hyperv ${HWOPTS_BLK} bcache lvm dmraid multipath mdadm zfs fs iscsi crypto" # This is the set of default HWOPTS, in the order that they are loaded. # This is whitespace aligned with HWOPTS above. -MY_HWOPTS=" modules virtio hyperv ${HWOPTS_BLK} bcache lvm dmraid mdadm fs net crypto" +MY_HWOPTS=" modules virtio hyperv ${HWOPTS_BLK} bcache lvm dmraid mdadm fs crypto" diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts index bc19fff..61ae534 100644 --- a/defaults/initrd.scripts +++ b/defaults/initrd.scripts @@ -1597,6 +1597,10 @@ iface_name() { } start_network() { + # Load network modules only when we need them to avoid possible + # firmware problems for people not using network that early + MY_HWOPTS=net load_modules + # At least gk.net.iface can only be processed after sysfs was # mounted. local x= @@ -1620,17 +1624,21 @@ start_network() { GK_NET_GW=${x#*=} ;; gk.net.iface=*) - local tmp_iface=$(iface_name "${x#*=}") - if [ -z "${tmp_iface}" ] - then - warn_msg "Interface specified by '${x}' not found, falling back to genkernel defaults ..." - else - GK_NET_IFACE=${tmp_iface} - fi + GK_NET_IFACE=${x#*=} ;; gk.net.routes=*) GK_NET_ROUTES=${x#*=} ;; + gk.net.timeout.interface=*) + local tmp_interface_timeout=${x#*=} + if is_int "${tmp_interface_timeout}" + then + GK_NET_TIMEOUT_INTERFACE=${tmp_interface_timeout} + else + warn_msg "'${x}' does not look like a valid number -- will keep using default value ${GK_NET_TIMEOUT_INTERFACE}!" + fi + unset tmp_interface_timeout + ;; gk.net.timeout.dad=*) local tmp_dad_timeout=${x#*=} if is_int "${tmp_dad_timeout}" @@ -1664,10 +1672,63 @@ start_network() { esac done - if [ ! -d "/sys/class/net/${GK_NET_IFACE}" ] + local interface_identifier=device + if echo "${GK_NET_IFACE}" | grep -qE ':|-' then - warn_msg "Interface ${GK_NET_IFACE} not found; Will not try to start network ..." - return + interface_identifier=mac + good_msg_n "Waiting for interface with MAC address ${GK_NET_IFACE} ..." + else + good_msg_n "Waiting for interface ${GK_NET_IFACE} ..." + fi + + local tmp_interface= + local have_interface=0 + local
[gentoo-commits] proj/genkernel:master commit in: doc/
commit: 70d1cdeede8d4524eb6c70df509f664af0367c99 Author: Thomas Deutschmann gentoo org> AuthorDate: Thu Jul 18 20:06:48 2019 + Commit: Thomas Deutschmann gentoo org> CommitDate: Thu Jul 18 20:06:48 2019 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=70d1cdee manpage: Fix gk.net.dhcp.retries entry Signed-off-by: Thomas Deutschmann gentoo.org> doc/genkernel.8.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index 177be51..da0f44e 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -544,14 +544,14 @@ recognized by the kernel itself. By default, dhcp will be used. You can set a specific IP address using addr/CIDR notation, i.e. '1.2.3.4/24'. +*gk.net.dhcp.retries*=<...>:: +By default we will send up to 3 DHCP discovery requests. + *gk.net.iface*=:: By default we will use the interface named eth0. Use this kernel parameter to specify another interface. You can also specify a MAC address (00:00:00:00:00:00 format) instead of an interface name. -*gk.net.timeout.dhcp*=<...>:: -By default we will send up to 3 DHCP discovery requests. - *gk.net.gw*=<...>:: Optional gateway. If *ip* is set to dhcp, this kernel parameter will be ignored.
[gentoo-commits] proj/genkernel:master commit in: doc/, /
commit: a3d49067e775c640a146514d68755dc0a4c6c613 Author: Thomas Deutschmann gentoo org> AuthorDate: Mon Jul 15 17:59:44 2019 + Commit: Thomas Deutschmann gentoo org> CommitDate: Mon Jul 15 17:59:44 2019 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=a3d49067 Add "--module-rebuild" parameter MODULEREBUILD option will be enabled by default. When enabled and we are building a non-static kernel for the same host (no cross-compile!), also building modules and install into into a non-custom location, we will now call `emerge @module-rebuild`. Closes: https://bugs.gentoo.org/453372 Signed-off-by: Thomas Deutschmann gentoo.org> doc/genkernel.8.txt | 6 ++ gen_cmdline.sh | 7 +++ gen_compile.sh | 53 gen_determineargs.sh | 1 + genkernel| 1 + genkernel.conf | 6 +- 6 files changed, 73 insertions(+), 1 deletion(-) diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index 8b38279..177be51 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -170,6 +170,12 @@ KERNEL COMPILATION *--*[*no-*]*all-ramdisk-modules*:: Copies or does not copy all kernel modules to the initrd. +*--*[*no-*]*module-rebuild*:: +Runs, or does not run "emerge @module-rebuild" to build out-of-tree +modules when possible, i.e. when non-static kernel and modules will be +build, installed, no custom INSTALL_MOD_PATH is set, +'/var/lib/module-rebuild/moduledb' exists and is not empty. + *--callback*=<...>:: Run the specified arguments in the current environment after the kernel and modules have been compiled. diff --git a/gen_cmdline.sh b/gen_cmdline.sh index 098e3d4..9f1b7cf 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -62,6 +62,9 @@ longusage() { echo " --ramdisk-modules Copy required modules to the initramfs" echo " --no-ramdisk-modulesDon't copy any modules to the initramfs" echo " --all-ramdisk-modules Copy all kernel modules to the initramfs" + echo " --module-rebuildAutomatically run 'emerge @module-rebuild' when" + echo " necessary (and possible)" + echo " --no-module-rebuild Don't automatically run 'emerge @module-rebuild'" echo " --callback=<...>Run the specified arguments after the" echo " kernel and modules have been compiled" echo " --staticBuild a static (monolithic kernel)" @@ -569,6 +572,10 @@ parse_cmdline() { CMD_ALLRAMDISKMODULES=$(parse_optbool "$*") print_info 2 "CMD_ALLRAMDISKMODULES: ${CMD_ALLRAMDISKMODULES}" ;; + --module-rebuild|--no-module-rebuild) + CMD_MODULEREBUILD=$(parse_optbool "$*") + print_info 2 "CMD_MODULEREBUILD: ${CMD_MODULEREBUILD}" + ;; --callback=*) CMD_CALLBACK="${*#*=}" print_info 2 "CMD_CALLBACK: ${CMD_CALLBACK}/$*" diff --git a/gen_compile.sh b/gen_compile.sh index f62d80d..cc7b1aa 100755 --- a/gen_compile.sh +++ b/gen_compile.sh @@ -1,6 +1,59 @@ #!/bin/bash # $Id$ +compile_external_modules() { + local command="emerge --quiet @module-rebuild 2>&1" + + if ! isTrue "${CMD_MODULEREBUILD}" + then + print_info 3 "$(get_indent 1)>> --no-module-rebuild set; Skipping 'emerge @module-rebuild' ..." + return + fi + + if isTrue "$(tc-is-cross-compiler)" + then + print_info 3 "$(get_indent 1)>> Cross-compilation detected; Skipping 'emerge @module-rebuild' ..." + return + fi + + if ! isTrue "${CMD_INSTALL}" + then + print_info 3 "$(get_indent 1)>> --no-install set; Skipping 'emerge @module-rebuild' ..." + return + fi + + if [ -n "${INSTALL_MOD_PATH}" ] + then + # emerge would install to a different location + print_warning 1 "$(get_indent 1)>> INSTALL_MOD_PATH set; Skipping 'emerge @module-rebuild' ..." + return + fi + + local modulesdb_file="/var/lib/module-rebuild/moduledb" + if [ ! -s "${modulesdb_file}" ] + then + print_info 2 "$(get_indent 1)>> '${modulesdb_file}' does not exist or is empty; Skipping 'emerge @module-rebuild' ..." + return + fi + + print_info 1 "$(get_indent 1)>> Compiling out-of-tree module(s) ..." + print_info 2 "COMMAND: ${command}" 1 0 1 + + if [ "${LOGLEVEL}" -gt 3 ] + then + # Output to stdout and logfile + eval ${command} | tee -a "${LOGFILE}" + RET=${PIPESTATUS[0]} + else + # Output to logfile only + eval ${command} >> "${LOGFILE}" +
[gentoo-commits] proj/genkernel:master commit in: doc/
commit: bbf4f7f9470845deeb8569f656cc69f03017a36b Author: Thomas Deutschmann gentoo org> AuthorDate: Sun Jul 14 12:59:08 2019 + Commit: Thomas Deutschmann gentoo org> CommitDate: Sun Jul 14 12:59:08 2019 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=bbf4f7f9 manpage: Add Gentoo developer "whissi" as author Signed-off-by: Thomas Deutschmann gentoo.org> doc/genkernel.8.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index 14b5edb..8b38279 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -773,6 +773,7 @@ AUTHORS - Chris Gianelloni - Sebastian Pipping - Robin H. Johnson +- Thomas Deutschmann - NFS Support by Thomas Seiler - GnuPG 1.x integration by dacook - MDADM integration by Matthias Dahl
[gentoo-commits] proj/genkernel:master commit in: doc/, arch/um/, arch/x86_64/, arch/sparc64/, arch/mips/, arch/ppc64/, arch/ia64/, ...
commit: 3764e9c41cf80d2ba3a391bb7ea014241ab34170 Author: Thomas Deutschmann gentoo org> AuthorDate: Sun Jul 14 10:48:01 2019 + Commit: Thomas Deutschmann gentoo org> CommitDate: Sun Jul 14 11:58:18 2019 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=3764e9c4 Add bcache support Kernel command-line argument only, adds "dobcache". Bug: https://bugs.gentoo.org/605094 Signed-off-by: Thomas Deutschmann gentoo.org> arch/alpha/modules_load| 2 +- arch/arm/modules_load | 2 +- arch/ia64/modules_load | 2 +- arch/mips/modules_load | 2 +- arch/parisc/modules_load | 2 +- arch/parisc64/modules_load | 2 +- arch/ppc/modules_load | 2 +- arch/ppc64/modules_load| 2 +- arch/ppc64le/modules_load | 2 +- arch/s390/modules_load | 2 +- arch/sparc/modules_load| 2 +- arch/sparc64/modules_load | 2 +- arch/um/modules_load | 2 +- arch/x86/modules_load | 2 +- arch/x86_64/modules_load | 2 +- defaults/initrd.defaults | 4 ++-- defaults/initrd.scripts| 21 + defaults/linuxrc | 3 +++ defaults/modules_load | 2 +- doc/genkernel.8.txt| 4 gen_cmdline.sh | 6 ++ gen_configkernel.sh| 9 + gen_determineargs.sh | 1 + genkernel | 1 + genkernel.conf | 3 +++ 25 files changed, 66 insertions(+), 18 deletions(-) diff --git a/arch/alpha/modules_load b/arch/alpha/modules_load index 5bcd5d9..0ee8173 100644 --- a/arch/alpha/modules_load +++ b/arch/alpha/modules_load @@ -27,7 +27,7 @@ MODULES_PCMCIA="pcmcia pcmcia_core yenta_socket pd6729 i82092 i82365 tcic ds ide MODULES_USB="ehci-pci ehci-hcd uhci usb-ohci hid usb-storage uas uhci-hcd ohci-hcd xhci-hcd xhci-pci xhci-plat usbhid hid-generic sl811-hcd hid-a4tech hid-apple hid-belkin hid-cherry hid-chicony hid-cypress hid-dummy hid-ezkey hid-gyration hid-logitech hid-logitech-dj hid-microsoft hid-monterey hid-petalynx hid-pl hid-samsung hid-sony hid-sunplus" # Filesystems -MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs zfs f2fs fuse loop squashfs aufs overlay cramfs configfs fscrypto efivarfs msdos qemu_fw_cfg" +MODULES_FS="ext2 ext3 ext4 bcache btrfs reiserfs jfs nfs xfs zfs f2fs fuse loop squashfs aufs overlay cramfs configfs fscrypto efivarfs msdos qemu_fw_cfg" # Crypto MODULES_CRYPTO="sha256_generic cbc crc32c crc32c_generic crc32 crc32_generic aes_generic xts" diff --git a/arch/arm/modules_load b/arch/arm/modules_load index 5bcd5d9..0ee8173 100644 --- a/arch/arm/modules_load +++ b/arch/arm/modules_load @@ -27,7 +27,7 @@ MODULES_PCMCIA="pcmcia pcmcia_core yenta_socket pd6729 i82092 i82365 tcic ds ide MODULES_USB="ehci-pci ehci-hcd uhci usb-ohci hid usb-storage uas uhci-hcd ohci-hcd xhci-hcd xhci-pci xhci-plat usbhid hid-generic sl811-hcd hid-a4tech hid-apple hid-belkin hid-cherry hid-chicony hid-cypress hid-dummy hid-ezkey hid-gyration hid-logitech hid-logitech-dj hid-microsoft hid-monterey hid-petalynx hid-pl hid-samsung hid-sony hid-sunplus" # Filesystems -MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs zfs f2fs fuse loop squashfs aufs overlay cramfs configfs fscrypto efivarfs msdos qemu_fw_cfg" +MODULES_FS="ext2 ext3 ext4 bcache btrfs reiserfs jfs nfs xfs zfs f2fs fuse loop squashfs aufs overlay cramfs configfs fscrypto efivarfs msdos qemu_fw_cfg" # Crypto MODULES_CRYPTO="sha256_generic cbc crc32c crc32c_generic crc32 crc32_generic aes_generic xts" diff --git a/arch/ia64/modules_load b/arch/ia64/modules_load index 6cbc6a9..b9ccaf2 100644 --- a/arch/ia64/modules_load +++ b/arch/ia64/modules_load @@ -27,7 +27,7 @@ MODULES_PCMCIA="pcmcia pcmcia_core yenta_socket pd6729 i82092 i82365 tcic ds ide MODULES_USB="ehci-pci ehci-hcd uhci usb-ohci hid usb-storage uas uhci-hcd ohci-hcd xhci-hcd xhci-pci xhci-plat usbhid hid-generic sl811-hcd hid-a4tech hid-apple hid-belkin hid-cherry hid-chicony hid-cypress hid-dummy hid-ezkey hid-gyration hid-logitech hid-logitech-dj hid-microsoft hid-monterey hid-petalynx hid-pl hid-samsung hid-sony hid-sunplus" # Filesystems -MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs zfs f2fs fuse loop squashfs aufs overlay cramfs configfs fscrypto efivarfs msdos qemu_fw_cfg" +MODULES_FS="ext2 ext3 ext4 bcache btrfs reiserfs jfs nfs xfs zfs f2fs fuse loop squashfs aufs overlay cramfs configfs fscrypto efivarfs msdos qemu_fw_cfg" # Crypto MODULES_CRYPTO="sha256_generic cbc crc32c crc32c_generic crc32 crc32_generic aes_generic xts" diff --git a/arch/mips/modules_load b/arch/mips/modules_load index dcdef55..cbc6774 100644 --- a/arch/mips/modules_load +++ b/arch/mips/modules_load @@ -27,7 +27,7 @@ MODULES_PCMCIA="pcmcia pcmcia_core yenta_socket pd6729 i82092 i82365 tcic ds ide MODULES_USB="ehci-pci ehci-hcd uhci usb-ohci hid usb-storage uas uhci-hcd ohci-hcd xhci-hcd xhci-pci xhci-plat usbhid hid-generic sl811-hcd hid-a4tech hid-apple hid-belkin hid-cherry
[gentoo-commits] proj/genkernel:master commit in: doc/, /
commit: 66be1d9d8f1fc241de0e8d033f616735e5cb5d1e Author: Thomas Deutschmann gentoo org> AuthorDate: Fri Mar 29 04:03:57 2019 + Commit: Thomas Deutschmann gentoo org> CommitDate: Fri Mar 29 04:13:05 2019 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=66be1d9d Add special value "default" for --kernel-config parameter --kernel-config=default will make genkernel to ignoring all user kernel configurations so that genkernel will use default kernel configuration shipped with genkernel to build a kernel. Useful to start from scratch if needed or for debugging. Signed-off-by: Thomas Deutschmann gentoo.org> doc/genkernel.8.txt | 4 +++- gen_cmdline.sh | 5 - gen_configkernel.sh | 38 +++--- 3 files changed, 34 insertions(+), 13 deletions(-) diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index 04633cf..15d5454 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -181,11 +181,13 @@ KERNEL LOCATIONS This specifies the location of the kernel sources; the default is '/usr/src/linux'. -*--kernel-config*=:: +*--kernel-config*=:: This specifies a kernel configuration file to use for compilation; by default genkernel uses the config from the previous build of the same kernel version or a default kernel config if there isn't a previous config. +Use the special value 'default' to force usage of default kernel +config. *--module-prefix*=:: Prefix to kernel module destination, modules will be installed in diff --git a/gen_cmdline.sh b/gen_cmdline.sh index 8971c51..795c2c6 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -63,7 +63,10 @@ longusage() { echo " --no-static Do not build a static (monolithic kernel)." echo " Kernel settings" echo " --kerneldir= Location of the kernel sources" - echo " --kernel-config= Kernel configuration file to use for compilation" + echo " --kernel-config=" + echo " Kernel configuration file to use for compilation." + echo " Use 'default' to explicitly start from scratch" + echo " using genkernel defaults." echo " --module-prefix= Prefix to kernel module destination, modules" echo " will be installed in /lib/modules" echo " Low-Level Compile settings" diff --git a/gen_configkernel.sh b/gen_configkernel.sh index 34fdbe1..063c9ac 100755 --- a/gen_configkernel.sh +++ b/gen_configkernel.sh @@ -4,7 +4,8 @@ # Fills variable KERNEL_CONFIG determine_config_file() { print_info 2 "Checking for suitable kernel configuration..." - if [ -n "${CMD_KERNEL_CONFIG}" ] + + if [ -n "${CMD_KERNEL_CONFIG}" -a "${CMD_KERNEL_CONFIG}" != "default" ] then KERNEL_CONFIG=$(expand_file "${CMD_KERNEL_CONFIG}") if [ -z "${KERNEL_CONFIG}" ] @@ -15,13 +16,21 @@ determine_config_file() { gen_die "${error_msg}" fi else - for f in \ - "/etc/kernels/kernel-config-${ARCH}-${KV}" \ - "${GK_SHARE}/arch/${ARCH}/kernel-config-${KV}" \ - "${GK_SHARE}/arch/${ARCH}/kernel-config-${VER}.${PAT}" \ - "${GK_SHARE}/arch/${ARCH}/generated-config" \ - "${GK_SHARE}/arch/${ARCH}/kernel-config" \ - "${DEFAULT_KERNEL_CONFIG}" + local -a kconfig_candidates + kconfig_candidates+=( "${GK_SHARE}/arch/${ARCH}/kernel-config-${KV}" ) + kconfig_candidates+=( "${GK_SHARE}/arch/${ARCH}/kernel-config-${VER}.${PAT}" ) + kconfig_candidates+=( "${GK_SHARE}/arch/${ARCH}/generated-config" ) + kconfig_candidates+=( "${GK_SHARE}/arch/${ARCH}/kernel-config" ) + kconfig_candidates+=( "${DEFAULT_KERNEL_CONFIG}" ) + + if [ -n "${CMD_KERNEL_CONFIG}" -a "${CMD_KERNEL_CONFIG}" = "default" ] + then + print_info 1 "Default configuration was forced. Will ignore any user kernel configuration!" + else + kconfig_candidates=( "/etc/kernels/kernel-config-${ARCH}-${KV}" ${kconfig_candidates[@]} ) + fi + + for f in "${kconfig_candidates[@]}" do [ -z "${f}" ] && continue @@ -49,7 +58,7 @@ determine_config_file() { # Validate the symlink result if any if [ -z "${KERNEL_CONFIG}" -o ! -f "${KERNEL_CONFIG}" ] then - if [ -n "${CMD_KERNEL_CONFIG}" ] + if [ -n "${CMD_KERNEL_CONFIG}" -a "${CMD_KERNEL_CONFIG}" != "default" ] then error_msg="No kernel .config: File '${CMD_KERNEL_CONFIG}' not found! " error_msg+="Check
[gentoo-commits] proj/genkernel:master commit in: doc/, /
commit: 74252498f3c8e7b788df0eb24676a0e936391bde Author: Thomas Deutschmann gentoo org> AuthorDate: Thu Mar 28 23:22:07 2019 + Commit: Thomas Deutschmann gentoo org> CommitDate: Thu Mar 28 23:22:07 2019 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=74252498 documentation: remove notes regarding static builds - sys-fs/cryptsetup[static] is not required, follow up of commit b79bf458363f70195715111468f445144e96b7e0 - Since commit 265363f79df5a545dc47547dbee76972b387e9b7, we always build our own static sys-fs/lvm2 to help dmraid users. Signed-off-by: Thomas Deutschmann gentoo.org> doc/genkernel.8.txt | 4 ++-- gen_cmdline.sh | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index d77b6ef..04633cf 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -278,8 +278,8 @@ INITIALIZATION Enables or disables keymap selection at boot. *--*[*no-*]*lvm*:: -Adds or skips in LVM support from static binaries if they exist on the -system, or compile static LVM binaries if static ones do not exist. +Includes or excludes LVM support. +When enabled, this will compile LVM for you. *--*[*no-*]*mdadm*:: Includes or excludes mdadm/mdmon support. diff --git a/gen_cmdline.sh b/gen_cmdline.sh index 5b7aafa..8971c51 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -135,7 +135,6 @@ longusage() { echo " --disklabel Include disk label and uuid support in your ramdisk" echo " --no-disklabel Exclude disk label and uuid support in your ramdisk" echo " --luks Include LUKS support" - echo " --> 'emerge cryptsetup' with USE=static" echo " --no-luks Exclude LUKS support" echo " --gpg Include GPG-armored LUKS key support" echo " --no-gpgExclude GPG-armored LUKS key support"
[gentoo-commits] proj/genkernel:master commit in: doc/, /
commit: 0994a48e690b48bd4f9da0e35c585dd2b78214be Author: Thomas Deutschmann gentoo org> AuthorDate: Thu Mar 28 23:19:56 2019 + Commit: Thomas Deutschmann gentoo org> CommitDate: Thu Mar 28 23:19:56 2019 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=0994a48e documentation: mark --[no-]compress-initrd as deprecated Let's move user to --[no-]compress-initramfs for more consistency. Signed-off-by: Thomas Deutschmann gentoo.org> doc/genkernel.8.txt | 5 - gen_cmdline.sh | 12 +--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index 54ea00a..d77b6ef 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -425,9 +425,12 @@ OUTPUT SETTINGS Wrap initramfs using mkimage for u-boot boots. Please note that only certain compression types are supported by mkimage (see manpage). -*--*[*no-*]*compress-initramfs*, *--*[*no-*]*compress-initrd*:: +*--*[*no-*]*compress-initramfs*:: Compresses or does not compress the generated initramfs. +*--*[*no-*]*compress-initrd*:: +Deprecated alias for *--*[*no-*]*compress-initramfs*. + *--compress-initramfs-type*=:: Compression type for initramfs (best, xz, lzma, bzip2, gzip, lzop). "Best" causes selection of the best available algorithm that is selected diff --git a/gen_cmdline.sh b/gen_cmdline.sh index 86150fa..5b7aafa 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -196,8 +196,8 @@ longusage() { echo " Compress initramfs" echo " --no-compress-initramfs" echo " Do not compress initramfs" - echo " --compress-initrd Compress initrd" - echo " --no-compress-initrdDo not compress initrd" + echo " --compress-initrd Deprecated alias for --compress-initramfs" + echo " --no-compress-initrdDeprecated alias for --no-compress-initramfs" echo " --compress-initramfs-type=" echo " Compression type for initramfs (best, xz, lzma, bzip2, gzip, lzop)" echo " --strip=(all|kernel|modules|none)" @@ -717,10 +717,16 @@ parse_cmdline() { CMD_WRAP_INITRD=`parse_optbool "$*"` print_info 2 "CMD_WRAP_INITRD=${CMD_WRAP_INITRD}" ;; - --compress-initramfs|--no-compress-initramfs|--compress-initrd|--no-compress-initrd) + --compress-initramfs|--no-compress-initramfs) CMD_COMPRESS_INITRD=`parse_optbool "$*"` print_info 2 "CMD_COMPRESS_INITRD=${CMD_COMPRESS_INITRD}" ;; + --compress-initrd|--no-compress-initrd) + CMD_COMPRESS_INITRD=`parse_optbool "$*"` + print_info 2 "CMD_COMPRESS_INITRD=${CMD_COMPRESS_INITRD}" + echo + print_warning 1 "Please use --[no-]compress-initramfs, as --[no-]compress-initrd is deprecated." + ;; --compress-initramfs-type=*|--compress-initrd-type=*) CMD_COMPRESS_INITRD_TYPE="${*#*=}" print_info 2 "CMD_COMPRESS_INITRD_TYPE: ${CMD_COMPRESS_INITRD_TYPE}"
[gentoo-commits] proj/genkernel:master commit in: doc/, /
commit: b79bf458363f70195715111468f445144e96b7e0 Author: Thomas Deutschmann gentoo org> AuthorDate: Mon Mar 25 02:06:12 2019 + Commit: Thomas Deutschmann gentoo org> CommitDate: Mon Mar 25 02:06:12 2019 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=b79bf458 sys-fs/cryptsetup[static] isn't required since 2012 anymore ... Signed-off-by: Thomas Deutschmann gentoo.org> doc/genkernel.8.txt | 9 - gen_initramfs.sh| 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index 26196db..54ea00a 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -335,8 +335,7 @@ INITIALIZATION Includes or excludes disk label and uuid support in your initrd. *--*[*no-*]*luks*:: -Includes or excludes Luks support from static binaries if they exist on -the system. +Includes or excludes LUKS support. *--*[*no-*]*gpg*:: Includes or excludes support for GnuPG 1.x, the portable standalone branch @@ -461,11 +460,11 @@ recognized by the kernel itself. Does the same as *root*=, which should be used in its place. *crypt_root*=<...>:: -This specifies the device encrypted by Luks, which contains the +This specifies the device encrypted by LUKS, which contains the root filesystem to mount. *crypt_swap*=<...>:: -This specifies the swap device encrypted by Luks. +This specifies the swap device encrypted by LUKS. *root_key*=<...>:: In case your root is encrypted with a key, you can use a device @@ -478,7 +477,7 @@ recognized by the kernel itself. look for the device in every boot. *root_trim*=(yes|no):: -Enables TRIM support for a Luks-based root device. Only useful +Enables TRIM support for a LUKS-based root device. Only useful with SSD setups. Have a look at 'https://en.wikipedia.org/wiki/TRIM' for more information. diff --git a/gen_initramfs.sh b/gen_initramfs.sh index d684844..1469aaa 100755 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -649,7 +649,7 @@ append_overlay(){ } append_luks() { - local _luks_error_format="LUKS support cannot be included: %s. Please emerge sys-fs/cryptsetup[static]." + local _luks_error_format="LUKS support cannot be included: %s. Please emerge sys-fs/cryptsetup." local _luks_source=/sbin/cryptsetup local _luks_dest=/sbin/cryptsetup
[gentoo-commits] proj/genkernel:master commit in: doc/
commit: 8de84b46dbd7c012c5f3c69b7b8b22e692b89c76 Author: Thomas Deutschmann gentoo org> AuthorDate: Mon Mar 25 00:59:47 2019 + Commit: Thomas Deutschmann gentoo org> CommitDate: Mon Mar 25 01:34:04 2019 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=8de84b46 man page: Update Signed-off-by: Thomas Deutschmann gentoo.org> doc/genkernel.8.txt | 93 ++--- 1 file changed, 53 insertions(+), 40 deletions(-) diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index ca84816..26196db 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -68,7 +68,7 @@ You can specify your options in any order. CONFIGURATION OPTIONS ~ *--config*=:: -Genkernel configuration file to use +Genkernel configuration file to use. DEBUGGING OPTIONS @@ -97,18 +97,28 @@ KERNEL CONFIGURATION *--*[*no-*]*nconfig*:: Runs, or does not run "make nconfig" after running "make oldconfig". +*--*[*no-*]*gconfig*:: +Runs, or does not run "make gconfig" after "make oldconfig". + +*--*[*no-*]*xconfig*:: +Runs, or does not run "make xconfig" after "make oldconfig". + *--*[*no-*]*save-config*:: Saves, or does not save the kernel configuration to '/etc/kernels' if the kernel is successfully compiled. -*--virtio*:: -Adds Virtio support to kernel configuration. +*--*[*no-*]*hyperv*:: +Adds, or skip adding Microsoft Hyper-V support to kernel configuration. -*--*[*no-*]*gconfig*:: -Runs, or does not run "make gconfig" after "make oldconfig". +*--microcode*[=]:: +Adds early microcode loading support for all, only AMD or Intel processors +to kernel configuration. -*--*[*no-*]*xconfig*:: -Runs, or does not run "make xconfig" after "make oldconfig". +*--no-microcode*:: +Do not add early microcode loading support to kernel configuration. + +*--*[*no-*]*virtio*:: +Adds, or skip adding VirtIO support to kernel configuration. KERNEL COMPILATION @@ -202,10 +212,10 @@ LOW-LEVEL COMPILATION OPTIONS *--kernel-target*=:: Override default make target (bzImage), note that values like *--kernel-target=* are also valid (useful for Xen -based kernel sources) +based kernel sources). *--kernel-binary*=:: -Override default kernel binary path (arch/foo/boot/bar) +Override default kernel binary path (arch/foo/boot/bar). *--kernel-outputdir*=:: Save output files outside the source tree. This should be used rather than @@ -231,6 +241,9 @@ LOW-LEVEL COMPILATION OPTIONS *--utils-arch*=:: Force to arch for utils only instead of autodetect. +*--makeopts*=:: +GNU Make options such as -j2, etc. + *--*[*no-*]*mountboot*:: Mount, or not, BOOTDIR automatically if mountable. @@ -240,13 +253,11 @@ LOW-LEVEL COMPILATION OPTIONS *--modprobedir*=:: Set the location of the modprobe.d-directory, default is '/etc/modprobe.d'. -*--makeopts*=:: -GNU Make options such as -j2, etc. - *--*[*no-*]*nice*[=]:: Runs the kernel make at the default niceness (reduction in priority) of 10, or in the case of --no-nice, runs the kernel make at normal priority. + INITIALIZATION ~~ *--splash*=:: @@ -279,15 +290,17 @@ INITIALIZATION By default the ramdisk will be built *without* an mdadm.conf and will auto-detect arrays during boot-up. +*--*[*no-*]*microcode-initramfs*:: +Prepends, or do not prepend ucode(s) to the initramfs. +But only when kernel configuration does support early microcode loading. +See *--microcode* option to auto-update kernel configuration. + *--*[*no-*]*dmraid*:: Includes or excludes DMRAID support. *--*[*no-*]*nfs*:: Includes or excludes NFS support. -*--*[*no-*]*microcode*:: -Includes or excludes early microcode support. - *--*[*no-*]*e2fsprogs*:: Includes or excludes e2fsprogs. @@ -298,19 +311,16 @@ INITIALIZATION Includes or excludes Btrfs support. *--*[*no-*]*multipath*:: -Includes or excludes Multipath support +Includes or excludes Multipath support. *--*[*no-*]*iscsi*:: -Includes or excludes iSCSI support - -*--*[*no-*]*hyperv*:: -Includes or excludes Microsoft Hyper-V support +Includes or excludes iSCSI support. *--*[*no-*]*ssh*:: Includes or excludes SSH (dropbear) support for remote LUKS keys. -*--bootloader*=*grub*:: -Add new kernel to GRUB configuration. +*--bootloader*=:: +Add new kernel to GRUB or GRUB2 configuration. *--linuxrc*=:: Use for the linuxrc instead of the genkernel linuxrc. @@ -338,10 +348,10 @@ INITIALIZATION Includes or excludes busybox in the initrd or initramfs. *--*[*no-*]*unionfs*:: -Includes or excludes support for unionfs +Includes or excludes support for unionfs. *--*[*no-*]*netboot*:: -Creates or does not create a self-contained env in the initramfs +Creates or does not create a self-contained env in the initramfs.
[gentoo-commits] proj/genkernel:master commit in: doc/, defaults/
commit: 5c5c32aa7261a29a3ac48035086bb59449d3804d Author: Georgy Yakovlev sysdump net> AuthorDate: Wed Jun 6 02:33:07 2018 + Commit: Robin H. Johnson gentoo org> CommitDate: Wed Jun 6 06:02:35 2018 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=5c5c32aa Add option to force importing zpool using cache Add simple option to pass to kernel via loader. dozfs=cache will use /etc/zfs/zpool.cache avoiding 30+ second wait for udev in zpool import Also it's possible to use both cache and force at the same time: dozfs=force,cache (order is not important) will force import and use cache. Closes: https://bugs.gentoo.org/627320 Signed-off-by: Georgy Yakovlev sysdump.net> defaults/initrd.scripts | 6 +++--- defaults/linuxrc| 19 +++ doc/genkernel.8.txt | 6 +++--- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts index 2fb0eb4..f8f9825 100644 --- a/defaults/initrd.scripts +++ b/defaults/initrd.scripts @@ -1181,7 +1181,7 @@ startVolumes() { then good_msg "Importing ZFS pools" - /sbin/zpool import -N -a ${ZPOOL_FORCE} + /sbin/zpool import -N -a ${ZPOOL_CACHE} ${ZPOOL_FORCE} if [ "$?" = '0' ] then @@ -1199,12 +1199,12 @@ startVolumes() { then good_msg "LUKS detected. Reimporting ${ZFS_POOL}" /sbin/zpool export -f "${ZFS_POOL}" - /sbin/zpool import -N ${ZPOOL_FORCE} "${ZFS_POOL}" + /sbin/zpool import -N ${ZPOOL_CACHE} ${ZPOOL_FORCE} "${ZFS_POOL}" fi else good_msg "Importing ZFS pool ${ZFS_POOL}" - /sbin/zpool import -N ${ZPOOL_FORCE} "${ZFS_POOL}" + /sbin/zpool import -N ${ZPOOL_CACHE} ${ZPOOL_FORCE} "${ZFS_POOL}" if [ "$?" = '0' ] then diff --git a/defaults/linuxrc b/defaults/linuxrc index d58ef06..81e7799 100644 --- a/defaults/linuxrc +++ b/defaults/linuxrc @@ -111,10 +111,21 @@ do dozfs*) USE_ZFS=1 - if [ "${x#*=}" = 'force' ] - then - ZPOOL_FORCE=-f - fi + case "${x#*=}" in + *force*) + ZPOOL_FORCE=-f + ;; + esac + + case "${x#*=}" in + *cache*) + if [ -s "/etc/zfs/zpool.cache" ]; then + ZPOOL_CACHE="-c /etc/zfs/zpool.cache" + else + bad_msg "zpool.cache not found or empty, zpool import will be slow" + fi + ;; + esac ;; dobtrfs*) USE_BTRFS=1 diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index 908212e..ca84816 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -522,9 +522,9 @@ recognized by the kernel itself. *domdadm*:: Scan for RAID arrays on bootup -*dozfs*[=force]:: -Scan for bootable ZFS pools on bootup. Optionally force import if -necessary. +*dozfs*[=cache,force]:: +Scan for bootable ZFS pools on bootup. Optionally use cachefile or force import if +necessary or perform both actions. *dobtrfs*:: Scan for attached Btrfs devices on bootup.
[gentoo-commits] proj/genkernel:master commit in: doc/
commit: c2d8348dd25e003da64bfc4ec9f18be480366755 Author: Rick Farina (Zero_Chaos) gentoo org> AuthorDate: Wed Apr 4 19:45:08 2018 + Commit: Richard Farina gentoo org> CommitDate: Wed Apr 4 19:45:08 2018 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=c2d8348d document overlayfs branch, and a tiny bit more doc/genkernel.8.txt | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index 7c653eb..908212e 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -610,7 +610,18 @@ recognized by the kernel itself. Enables/disables UnionFS. *aufs*:: -Enables support for AUFS2 (if available in the kernel). +Enables support for AUFS (if available in the kernel). + +*aufs.modules*=<...>:: +Use an alternate location for filesystem overlays to be added on top of +the livecd and below the writable tmpfs. Default is /modules/ + +*overlayfs*:: +Enables support for Overlayfs (if available in the kernel). + +*overlayfs.modules*=<...>:: +Use an alternate location for filesystem overlays to be added on top of +the livecd and below the writable tmpfs. Default is /modules/ *rootflags*=<...>:: Additional flags to mount the real root system with. @@ -696,6 +707,7 @@ AUTHORS - GnuPG 1.x integration by dacook- MDADM integration by Matthias Dahl - ZFS integration by Richard Yao +- AUFS/Overlayfs by Zero_Chaos and likewhoa SEE ALSO
[gentoo-commits] proj/genkernel:master commit in: /, doc/
commit: fd38ac4fb57ca9bc95ab9511c6948d326bdf48de Author: Daniel Robbins funtoo org> AuthorDate: Sun Nov 12 03:24:10 2017 + Commit: Robin H. Johnson gentoo org> CommitDate: Wed Nov 15 03:05:17 2017 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=fd38ac4f Add --hyperv option for Microsoft Hyper-V. Enable within kernel image to ensure modules are available early at boot. doc/genkernel.8.txt | 3 +++ gen_cmdline.sh | 8 +++- gen_configkernel.sh | 15 +++ gen_determineargs.sh | 1 + 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index a0c638e..7c653eb 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -303,6 +303,9 @@ INITIALIZATION *--*[*no-*]*iscsi*:: Includes or excludes iSCSI support +*--*[*no-*]*hyperv*:: +Includes or excludes Microsoft Hyper-V support + *--*[*no-*]*ssh*:: Includes or excludes SSH (dropbear) support for remote LUKS keys. diff --git a/gen_cmdline.sh b/gen_cmdline.sh index 83b3829..1091d4d 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -114,7 +114,9 @@ longusage() { echo " --no-multipath Exclude Multipath support" echo " --iscsi Include iSCSI support" echo " --no-iscsi Exclude iSCSI support" - echo " --ssh Include SSH (dropbear) support" + echo " --hypervInclude Microsoft Hyper-V support" + echo " --no-hyperv Exclude Microsoft Hyper-V support" + echo " --ssh Include SSH (dropbear) support" echo " --no-sshExclude SSH (dropbear) support" echo " --bootloader=grub Add new kernel to GRUB configuration" echo " --linuxrc=Specifies a user created linuxrc" @@ -404,6 +406,10 @@ parse_cmdline() { CMD_ISCSI=`parse_optbool "$*"` print_info 2 "CMD_ISCSI: ${CMD_ISCSI}" ;; + --hyperv|--no-hyperv) + CMD_ISCSI=`parse_optbool "$*"` + print_info 2 "CMD_HYPERV: ${CMD_HYPERV}" + ;; --ssh|--no-ssh) CMD_SSH=`parse_optbool "$*"` print_info 2 "CMD_SSH: ${CMD_SSH}" diff --git a/gen_configkernel.sh b/gen_configkernel.sh index 26e4610..697c478 100755 --- a/gen_configkernel.sh +++ b/gen_configkernel.sh @@ -219,6 +219,21 @@ config_kernel() { kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_SCSI_ISCSI_ATTRS" "${cfg_CONFIG_SCSI_ISCSI_ATTRS}" fi + # Make sure HyperV modules are enabled in the kernel, if --hyperv + if isTrue ${CMD_HYPERV} + then + kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_HYPERV" "y" + kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_HYPERV_UTILS" "y" + kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_HYPERV_BALLOON" "y" + kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_HYPERV_STORAGE" "y" + kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_HYPERV_NET" "y" + kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_HYPERV_KEYBOARD" "y" + kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_PCI_HYPERV" "y" + kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_FB_HYPERV" "y" + kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_HID_HYPERV_MOUSE" "y" + kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_UIO_HV_GENERIC" "y" + fi + if isTrue ${SPLASH} then kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_FB_SPLASH" "y" diff --git a/gen_determineargs.sh b/gen_determineargs.sh index fe9f85b..b686fca 100755 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -118,6 +118,7 @@ determine_real_args() { set_config_with_override BOOL LVM CMD_LVM set_config_with_override BOOL DMRAID CMD_DMRAID set_config_with_override BOOL ISCSICMD_ISCSI + set_config_with_override BOOL HYPERV CMD_HYPERV set_config_with_override BOOL BUSYBOX CMD_BUSYBOX "yes" set_config_with_override BOOL NFS CMD_NFS "yes" set_config_with_override BOOL MICROCODECMD_MICROCODE
[gentoo-commits] proj/genkernel:master commit in: /, doc/
commit: fa341ebe57929d6f971359d3446fbcaa78301d11 Author: Robin H. Johnson gentoo org> AuthorDate: Fri Jul 14 18:48:45 2017 + Commit: Robin H. Johnson gentoo org> CommitDate: Fri Jul 14 18:48:45 2017 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=fa341ebe Fix unbootable kernels due to overzealous strip. Manually stripping the kernel is obsolete, use kernel targets for it, and only pass in argument for Kernel to strip modules itself. Bug introduced in c2525c65b9f3d5849963bab6beb40817d7720218. Fixes: https://bugs.gentoo.org/show_bug.cgi?id=622716 Signed-off-by: Robin H. Johnson gentoo.org> doc/genkernel.8.txt | 4 ++-- gen_cmdline.sh | 4 ++-- gen_determineargs.sh | 2 +- gen_funcs.sh | 6 -- 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index 944d596..a0c638e 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -388,8 +388,8 @@ OUTPUT SETTINGS on >=2.6 kernels *--strip*=:: -Strip debug symbols from the installed kernel, modules, all -(default) or none. +Strip debug symbols from none, all, installed kernel (obsolete) or +modules (default). *--no-strip*:: Alias for *--strip=none*. diff --git a/gen_cmdline.sh b/gen_cmdline.sh index 7e8853b..83b3829 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -181,8 +181,8 @@ longusage() { echo " --compress-initramfs-type=" echo " Compression type for initramfs (best, xz, lzma, bzip2, gzip, lzop)" echo " --strip=(all|kernel|modules|none)" - echo " Strip debug symbols from the installed kernel, modules," - echo " all (default) or none" + echo " Strip debug symbols from none, all, installed kernel (obsolete) or" + echo " modules (default)." echo " --no-strip" echo " Don't strip installed kernel or modules, alias for --strip=none" echo diff --git a/gen_determineargs.sh b/gen_determineargs.sh index 23084a1..41fbe63 100755 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -144,7 +144,7 @@ determine_real_args() { set_config_with_override BOOL KEYMAP CMD_KEYMAP "yes" set_config_with_override BOOL DOKEYMAPAUTO CMD_DOKEYMAPAUTO set_config_with_override STRING BUSYBOX_CONFIG CMD_BUSYBOX_CONFIG - set_config_with_override STRING STRIP_TYPE CMD_STRIP_TYPE "all" + set_config_with_override STRING STRIP_TYPE CMD_STRIP_TYPE "modules" set_config_with_override BOOL INSTALL CMD_INSTALL "yes" set_config_with_override BOOL DEBUGCLEANUP CMD_DEBUGCLEANUP "yes" diff --git a/gen_funcs.sh b/gen_funcs.sh index 0e22a86..6234189 100755 --- a/gen_funcs.sh +++ b/gen_funcs.sh @@ -388,12 +388,6 @@ copy_image_with_preserve() { cp "${newSrceImage}" "${BOOTDIR}/${currDestImage}" || gen_die "Could not copy the ${symlinkName} image to ${BOOTDIR}!" - if [ "${CMD_STRIP_TYPE}" = "all" -o "${CMD_STRIP_TYPE}" = "kernel" ] - then - print_info 5 " Stripping ${BOOTDIR}/${currDestImage}" - strip --strip-debug "${BOOTDIR}/${currDestImage}" >/dev/null 2>&1 - fi - if [ "${SYMLINK}" = '1' ] then print_info 5 " Make new symlink(s) (from ${BOOTDIR}):"
[gentoo-commits] proj/genkernel:master commit in: doc/, /
commit: 1e94aa54a07defecaf20729914726318aa4f42c4 Author: Robin H. Johnson gentoo org> AuthorDate: Sat Jan 7 23:53:07 2017 + Commit: Robin H. Johnson gentoo org> CommitDate: Sat Jan 7 23:53:07 2017 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=1e94aa54 Document --ssh option. Signed-off-by: Robin H. Johnson gentoo.org> doc/genkernel.8.txt | 3 +++ gen_cmdline.sh | 2 ++ 2 files changed, 5 insertions(+) diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index dafa25b..944d596 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -303,6 +303,9 @@ INITIALIZATION *--*[*no-*]*iscsi*:: Includes or excludes iSCSI support +*--*[*no-*]*ssh*:: +Includes or excludes SSH (dropbear) support for remote LUKS keys. + *--bootloader*=*grub*:: Add new kernel to GRUB configuration. diff --git a/gen_cmdline.sh b/gen_cmdline.sh index 64ea1ab..b4df913 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -114,6 +114,8 @@ longusage() { echo " --no-multipath Exclude Multipath support" echo " --iscsi Include iSCSI support" echo " --no-iscsi Exclude iSCSI support" + echo " --ssh Include SSH (dropbear) support" + echo " --no-sshExclude SSH (dropbear) support" echo " --bootloader=grub Add new kernel to GRUB configuration" echo " --linuxrc=Specifies a user created linuxrc" echo " --busybox-config= Specifies a user created busybox config"
[gentoo-commits] proj/genkernel:master commit in: doc/, /
commit: c2525c65b9f3d5849963bab6beb40817d7720218 Author: Robert Trace farcaster org> AuthorDate: Tue Jan 3 05:15:46 2017 + Commit: Robin H. Johnson gentoo org> CommitDate: Tue Jan 3 05:15:46 2017 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=c2525c65 Strip kernel & modules Rebased and tweaked to apply since the original patch was ~7 years old. Signed-off-by: Robin H. Johnson gentoo.org> doc/genkernel.8.txt | 7 +++ gen_cmdline.sh | 13 + gen_compile.sh | 9 + gen_determineargs.sh | 1 + gen_funcs.sh | 6 ++ 5 files changed, 36 insertions(+) diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index a2d3c22..ca8eff0 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -384,6 +384,13 @@ OUTPUT SETTINGS Directory structure to include in the initramfs, only available on >=2.6 kernels +*--strip*=:: +Strip debug symbols from the installed kernel, modules, all +(default) or none. + +*--no-strip*:: +Alias for *--strip=none*. + *--*[*no-*]*firmware*:: Enable or disables copying of firmware into initramfs. diff --git a/gen_cmdline.sh b/gen_cmdline.sh index 0e1e7ef..37d1b5c 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -174,6 +174,11 @@ longusage() { echo " Compress or do not compress the generated initramfs" echo " --compress-initramfs-type=" echo " Compression type for initramfs (best, xz, lzma, bzip2, gzip, lzop)" + echo " --strip=(all|kernel|modules|none)" + echo " Strip debug symbols from the installed kernel, modules," + echo " all (default) or none" + echo " --no-strip" + echo " Don't strip installed kernel or modules (alias for --strip=none)" echo echo "For a detailed list of supported initramfs options and flags; issue:" echo " man 8 genkernel" @@ -669,6 +674,14 @@ parse_cmdline() { CMD_NICE=0 print_info 2 "CMD_NICE: ${CMD_NICE}" ;; + --strip=*) + CMD_STRIP_TYPE=`parse_opt "$*"` + print_info 2 "CMD_STRIP_TYPE: ${CMD_STRIP_TYPE}" + ;; + --no-strip) + CMD_STRIP_TYPE=none + print_info 2 "CMD_STRIP_TYPE: ${CMD_STRIP_TYPE}" + ;; all) BUILD_KERNEL=1 BUILD_MODULES=1 diff --git a/gen_compile.sh b/gen_compile.sh index 7cc4733..ef72a23 100755 --- a/gen_compile.sh +++ b/gen_compile.sh @@ -306,6 +306,14 @@ compile_modules() { compile_generic modules kernel export UNAME_MACHINE="${ARCH}" [ "${INSTALL_MOD_PATH}" != '' ] && export INSTALL_MOD_PATH + if [ "${CMD_STRIP_TYPE}" == "all" -o "${CMD_STRIP_TYPE}" == "modules" ] + then + print_info 1 ">> Installing ${KV} modules (and stripping)" + INSTALL_MOD_STRIP=1 + export INSTALL_MOD_STRIP + else + print_info 1 ">> Installing ${KV} modules" + fi MAKEOPTS="${MAKEOPTS} -j1" compile_generic "modules_install" kernel print_info 1 ">> Generating module dependency data..." if [ "${INSTALL_MOD_PATH}" != '' ] @@ -315,6 +323,7 @@ compile_modules() { depmod -a -e -F "${KERNEL_OUTPUTDIR}"/System.map ${KV} fi unset UNAME_MACHINE + unset INSTALL_MOD_STRIP } compile_kernel() { diff --git a/gen_determineargs.sh b/gen_determineargs.sh index 313dbd0..5f77c07 100755 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -142,6 +142,7 @@ determine_real_args() { set_config_with_override BOOL KEYMAP CMD_KEYMAP "yes" set_config_with_override BOOL DOKEYMAPAUTO CMD_DOKEYMAPAUTO set_config_with_override STRING BUSYBOX_CONFIG CMD_BUSYBOX_CONFIG + set_config_with_override STRING STRIP_TYPE CMD_STRIP_TYPE "all" set_config_with_override BOOL INSTALL CMD_INSTALL "yes" set_config_with_override BOOL DEBUGCLEANUP CMD_DEBUGCLEANUP "yes" diff --git a/gen_funcs.sh b/gen_funcs.sh index 6234189..0e22a86 100755 --- a/gen_funcs.sh +++ b/gen_funcs.sh @@ -388,6 +388,12 @@ copy_image_with_preserve() { cp "${newSrceImage}" "${BOOTDIR}/${currDestImage}" || gen_die "Could not copy the ${symlinkName} image to ${BOOTDIR}!" + if [ "${CMD_STRIP_TYPE}" = "all" -o "${CMD_STRIP_TYPE}" = "kernel" ] + then + print_info 5 " Stripping ${BOOTDIR}/${currDestImage}" + strip --strip-debug "${BOOTDIR}/${currDestImage}" >/dev/null 2>&1 + fi +
[gentoo-commits] proj/genkernel:master commit in: doc/
commit: 5b36ad3da40e4e01f45b3eec56642f20ef7e7217 Author: Robin H. Johnson gentoo org> AuthorDate: Tue Jan 3 04:38:02 2017 + Commit: Robin H. Johnson gentoo org> CommitDate: Tue Jan 3 04:38:02 2017 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=5b36ad3d doc: cleanup manpage Cleanup the manpage formatting, and include some minor wording improvements as suggested by gmail.com>. Fixes: https://bugs.gentoo.org/show_bug.cgi?id=452746 Signed-off-by: Robin H. Johnson gentoo.org> doc/genkernel.8.txt | 93 ++--- 1 file changed, 52 insertions(+), 41 deletions(-) diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index d39c3ca..a2d3c22 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -144,7 +144,8 @@ KERNEL COMPILATION *--install* is also specified. *--oldconfig*:: -Implies *--no-clean*, and thus *--no-mrproper*, running a "make oldconfig". +Implies *--no-clean*, and thus *--no-mrproper*, running a +"make oldconfig". *--*[*no-*]*splash*:: Installs, or not, framebuffer splash support into initramfs. @@ -160,8 +161,8 @@ KERNEL COMPILATION kernel and modules have been compiled. *--*[*no-*]*static*:: - Builds, or does not build a monolithic kernel without any modules on any - initial ramdisks. +Builds, or does not build a monolithic kernel without any modules on +any initial ramdisks. KERNEL LOCATIONS @@ -206,11 +207,11 @@ LOW-LEVEL COMPILATION OPTIONS *--kernel-binary*=:: Override default kernel binary path (arch/foo/boot/bar) -*--kernel-outputdir=:: - Save output files outside the source tree. This should be used rather than - KBUILD_OUTPUT when you wish to place kernel objects outside of the source - tree (eg because cannot write to that directory as the user genkernel is - running as). +*--kernel-outputdir*=:: +Save output files outside the source tree. This should be used rather than +KBUILD_OUTPUT when you wish to place kernel objects outside of the source +tree (eg because cannot write to that directory as the user genkernel is +running as). *--utils-cc*=:: Compiler to use for utilities. @@ -243,8 +244,8 @@ LOW-LEVEL COMPILATION OPTIONS GNU Make options such as -j2, etc. *--*[*no-*]*nice*[=]:: - Runs the kernel make at the default niceness (reduction in priority) of - 10, or in the case of --no-nice, runs the kernel make at normal priority. +Runs the kernel make at the default niceness (reduction in priority) of +10, or in the case of --no-nice, runs the kernel make at normal priority. INITIALIZATION ~~ @@ -266,8 +267,8 @@ INITIALIZATION Enables or disables keymap selection at boot. *--*[*no-*]*lvm*:: - Adds or skips in LVM support from static binaries if they exist on the - system, or compile static LVM binaries if static ones do not exist. +Adds or skips in LVM support from static binaries if they exist on the +system, or compile static LVM binaries if static ones do not exist. *--*[*no-*]*mdadm*:: Includes or excludes mdadm/mdmon support. @@ -312,18 +313,18 @@ INITIALIZATION Specifies a user created busybox config. *--genzimage*:: - Make and install kernelz image from 'arch/powerpc/boot/zImage.initrd'. +Make and install kernelz image from 'arch/powerpc/boot/zImage.initrd'. *--*[*no-*]*disklabel*:: Includes or excludes disk label and uuid support in your initrd. *--*[*no-*]*luks*:: - Includes or excludes Luks support from static binaries if they exist on - the system. +Includes or excludes Luks support from static binaries if they exist on +the system. *--*[*no-*]*gpg*:: - Includes or excludes support for GnuPG 1.x, the portable standalone branch - of GnuPG. A key can be made from +Includes or excludes support for GnuPG 1.x, the portable standalone branch +of GnuPG. A key can be made from `gpg --symmetric -o /path/to/LUKS-key.gpg /path/to/LUKS-key` . After that, re-point the *root_key* argument to the new .gpg file. @@ -353,7 +354,7 @@ INTERNALS Sets genkernel's temporary working directory to . *--*[*no-*]*postclear*:: - Clears or skips clearing all tmp files and caches after genkernel has run. +Clears or skips clearing all tmp files and caches after genkernel has run. OUTPUT SETTINGS @@ -395,30 +396,36 @@ OUTPUT SETTINGS *--*[*no-*]*firmware-install*:: Enable or disables installation of firmware onto root filesystem. - Installing sys-kernel/linux-firmware should be preferred instead. +Please note this is deprecated, and installing +*sys-kernel/linux-firmware* should be preferred instead. *--*[*no-*]*integrated-initramfs*:: - Builds or does not build the generated initramfs into the kernel instead - of keeping it as a separate file. +Builds or
[gentoo-commits] proj/genkernel:master commit in: doc/
commit: 670bbf697b9cbef6bb68bde717e41313102a5bb7 Author: Robin H. Johnson gentoo org> AuthorDate: Mon Jan 2 23:45:15 2017 + Commit: Robin H. Johnson gentoo org> CommitDate: Mon Jan 2 23:45:15 2017 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=670bbf69 Update docs. Signed-off-by: Robin H. Johnson gentoo.org> doc/genkernel.8.txt | 9 + 1 file changed, 9 insertions(+) diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index 071eecc..d39c3ca 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -94,6 +94,9 @@ KERNEL CONFIGURATION *--*[*no-*]*menuconfig*:: Runs, or does not run "make menuconfig" after running "make oldconfig". +*--*[*no-*]*nconfig*:: +Runs, or does not run "make nconfig" after running "make oldconfig". + *--*[*no-*]*save-config*:: Saves, or does not save the kernel configuration to '/etc/kernels' if the kernel is successfully compiled. @@ -278,6 +281,12 @@ INITIALIZATION *--*[*no-*]*dmraid*:: Includes or excludes DMRAID support. +*--*[*no-*]*nfs*:: +Includes or excludes NFS support. + +*--*[*no-*]*microcode*:: +Includes or excludes early microcode support. + *--*[*no-*]*e2fsprogs*:: Includes or excludes e2fsprogs.
[gentoo-commits] proj/genkernel:master commit in: /, doc/
commit: c9855842ac422b8d3a6e7265b6a3c00efe3891e7 Author: Robin H. Johnson gentoo org> AuthorDate: Wed Oct 12 13:48:30 2016 + Commit: Robin H. Johnson gentoo org> CommitDate: Wed Oct 12 13:48:30 2016 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=c9855842 FIRMWARE_INSTALL control option. Prefer sys-kernel/linux-firmware to be installed and used rather than always running firmware_install and overwriting the root copy. Defaults to FIRMWARE_INSTALL=no, with ebuild updated to RDEPEND on sys-kernel/linux-firmware, via IUSE='+firmware' Signed-off-by: Robin H. Johnson gentoo.org> doc/genkernel.8.txt | 4 gen_cmdline.sh | 6 ++ gen_compile.sh | 20 gen_determineargs.sh | 1 + genkernel.conf | 4 5 files changed, 27 insertions(+), 8 deletions(-) diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index bab1034..071eecc 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -384,6 +384,10 @@ OUTPUT SETTINGS Specifies specific firmware files to copy. This overrides *--firmware-dir*. For multiple files, separate the filenames with a comma. +*--*[*no-*]*firmware-install*:: +Enable or disables installation of firmware onto root filesystem. + Installing sys-kernel/linux-firmware should be preferred instead. + *--*[*no-*]*integrated-initramfs*:: Builds or does not build the generated initramfs into the kernel instead of keeping it as a separate file. diff --git a/gen_cmdline.sh b/gen_cmdline.sh index 94ff68c..e9f323c 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -160,6 +160,8 @@ longusage() { echo " Specifies specific firmware files to copy. This" echo " overrides --firmware-dir. For multiple files," echo " separate the filenames with a comma" + echo " --firmware-install" + echo " Enable installation firmware onto root filesystem." echo " --integrated-initramfs, --no-integrated-initramfs" echo " Include/exclude the generated initramfs in the kernel" echo " instead of keeping it as a separate file" @@ -600,6 +602,10 @@ parse_cmdline() { CMD_FIRMWARE=1 print_info 2 "CMD_FIRMWARE_FILES: ${CMD_FIRMWARE_FILES}" ;; + --firmware-install|--no-firmware-install) + CMD_FIRMWARE_INSTALL=`parse_optbool "$*"` + print_info 2 "CMD_FIRMWARE_INSTALL: ${CMD_FIRMWARE_INSTALL}" + ;; --integrated-initramfs|--no-integrated-initramfs) CMD_INTEGRATED_INITRAMFS=`parse_optbool "$*"` print_info 2 "CMD_INTEGRATED_INITRAMFS=${CMD_INTEGRATED_INITRAMFS}" diff --git a/gen_compile.sh b/gen_compile.sh index 0bb1399..3a77a75 100755 --- a/gen_compile.sh +++ b/gen_compile.sh @@ -333,15 +333,19 @@ compile_kernel() { compile_generic "${KERNEL_MAKE_DIRECTIVE_2}" kernel fi - local firmware_in_kernel_line=`fgrep CONFIG_FIRMWARE_IN_KERNEL "${KERNEL_OUTPUTDIR}"/.config` - if [ -n "${firmware_in_kernel_line}" -a "${firmware_in_kernel_line}" != CONFIG_FIRMWARE_IN_KERNEL=y ] - then - print_info 1 ">> Installing firmware ('make firmware_install') due to CONFIG_FIRMWARE_IN_KERNEL != y..." - [ "${INSTALL_MOD_PATH}" != '' ] && export INSTALL_MOD_PATH - [ "${INSTALL_FW_PATH}" != '' ] && export INSTALL_FW_PATH - MAKEOPTS="${MAKEOPTS} -j1" compile_generic "firmware_install" kernel + if isTrue "${FIRMWARE_INSTALL}" ; then + local firmware_in_kernel_line=`fgrep CONFIG_FIRMWARE_IN_KERNEL "${KERNEL_OUTPUTDIR}"/.config` + if [ -n "${firmware_in_kernel_line}" -a "${firmware_in_kernel_line}" != CONFIG_FIRMWARE_IN_KERNEL=y ] + then + print_info 1 ">> Installing firmware ('make firmware_install') due to CONFIG_FIRMWARE_IN_KERNEL != y..." + [ "${INSTALL_MOD_PATH}" != '' ] && export INSTALL_MOD_PATH + [ "${INSTALL_FW_PATH}" != '' ] && export INSTALL_FW_PATH + MAKEOPTS="${MAKEOPTS} -j1" compile_generic "firmware_install" kernel + else + print_info 1 ">> Not installing firmware as it's included in the kernel already (CONFIG_FIRMWARE_IN_KERNEL=y)..." + fi else - print_info 1 ">> Not installing firmware as it's included in the kernel already (CONFIG_FIRMWARE_IN_KERNEL=y)..." + print_info 1 ">> Not installing firmware as requested by configuration FIRMWARE_INSTALL=no..." fi local
[gentoo-commits] proj/genkernel:master commit in: doc/, defaults/
commit: 67893b749b83fd716e55fa7c865f4c924454ee24 Author: Robin H. Johnson gentoo org> AuthorDate: Mon May 16 06:40:43 2016 + Commit: Robin H. Johnson gentoo org> CommitDate: Mon May 16 06:49:04 2016 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=67893b74 defaults/linuxrc: bug #232733: implement rootwait. Based on patch from John Klug gmail.com>. Signed-off-by: Robin H. Johnson gentoo.org> defaults/initrd.defaults | 1 + defaults/linuxrc | 15 +++ doc/genkernel.8.txt | 5 + 3 files changed, 21 insertions(+) diff --git a/defaults/initrd.defaults b/defaults/initrd.defaults index a5eb3ba..b63ebd0 100755 --- a/defaults/initrd.defaults +++ b/defaults/initrd.defaults @@ -60,6 +60,7 @@ REAL_ROOT='' CONSOLE='/dev/console' NEW_ROOT='/newroot' no_umounts='/newroot|/mnt/aufs-dev|/mnt/aufs-rw-branch|/mnt/livecd|/mnt/cdrom|/.unions/memory|/.unions/memory/xino' +ROOTDELAY=1 CDROOT='0' CDROOT_DEV='' CDROOT_TYPE='auto' diff --git a/defaults/linuxrc b/defaults/linuxrc index ac8f215..72e1543 100644 --- a/defaults/linuxrc +++ b/defaults/linuxrc @@ -133,6 +133,12 @@ do scandelay) SDELAY=3 ;; + rootdelay=*|rootwait=*) + ROOTDELAY=${x#*=} + ;; + rootdelay|rootwait) + ROOTDELAY=5 + ;; # Module no-loads doload=*) MDOLIST=${x#*=} @@ -485,10 +491,14 @@ fi # Determine root device good_msg 'Determining root device ...' +ROOTDELAY_100MSEC=1 +[ -n "${ROOTDELAY}" ] && ROOTDELAY_100MSEC=$(($ROOTDELAY * 10)) while true do while [ "${got_good_root}" != '1' ] do + # Start of sleep loop waiting on root + while [ ${ROOTDELAY_100MSEC} -ge 0 -a "${got_good_root}" != '1' ] ; do case "${REAL_ROOT}" in LABEL=*|UUID=*) @@ -574,6 +584,11 @@ do ;; esac + if [ "${got_good_root}" != '1' ] ; then + let ROOTDELAY_100MSEC=${ROOTDELAY_100MSEC}-1 + usleep 100 + fi + done # End of sleep loop waiting on root if [ "${REAL_ROOT}" = '' ] then # No REAL_ROOT determined/specified. Prompt user for root block device. diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index ab534cd..bab1034 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -464,6 +464,11 @@ which the ramdisk & initramfs scripts would recognize. Pauses for 10 seconds before running devfsd if no argument is specified; otherwise pauses for the number of specified seconds. +*rootdelay*[=<...>]:: +*rootwait*[=<...>]:: + Pauses for up to 3 seconds (or specified number of seconds) while + waiting for root device to appear during initramfs root scanning. + *ip*=<...>:: Normally used to tell the kernel that it should start a network interface. If present, the initrd will try to mount a livecd
[gentoo-commits] proj/genkernel:master commit in: doc/
commit: 9a8f6f84aeba0807df3dac2fc95462a0e96ec7f5 Author: Robin H. Johnson gentoo org> AuthorDate: Fri Feb 5 23:28:16 2016 + Commit: Robin H. Johnson gentoo org> CommitDate: Fri Feb 5 23:45:53 2016 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=9a8f6f84 doc: add --kernel-outputdir to documentation. Signed-off-by: Robin H. Johnson gentoo.org> doc/genkernel.8.txt | 6 ++ 1 file changed, 6 insertions(+) diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index ef0aa1e..ab534cd 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -203,6 +203,12 @@ LOW-LEVEL COMPILATION OPTIONS *--kernel-binary*=:: Override default kernel binary path (arch/foo/boot/bar) +*--kernel-outputdir=:: + Save output files outside the source tree. This should be used rather than + KBUILD_OUTPUT when you wish to place kernel objects outside of the source + tree (eg because cannot write to that directory as the user genkernel is + running as). + *--utils-cc*=:: Compiler to use for utilities.
[gentoo-commits] proj/genkernel:master commit in: /, doc/
commit: 92cb275526ce94fb6118cb715622b4dd9a136444 Author: Robin H. Johnson gentoo org> AuthorDate: Sun Jan 24 05:49:13 2016 + Commit: Robin H. Johnson gentoo org> CommitDate: Sun Jan 24 05:49:13 2016 + URL:https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=92cb2755 Support nice(1) to affect the scheduling of the make invocations. Signed-off-by: Robin H. Johnson gentoo.org> doc/genkernel.8.txt | 3 +++ gen_cmdline.sh | 20 gen_compile.sh | 19 +-- gen_determineargs.sh | 1 + genkernel.conf | 3 +++ 5 files changed, 40 insertions(+), 6 deletions(-) diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index 45af60e..ef0aa1e 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -233,6 +233,9 @@ LOW-LEVEL COMPILATION OPTIONS *--makeopts*=:: GNU Make options such as -j2, etc. +*--*[*no-*]*nice*[=]:: + Runs the kernel make at the default niceness (reduction in priority) of + 10, or in the case of --no-nice, runs the kernel make at normal priority. INITIALIZATION ~~ diff --git a/gen_cmdline.sh b/gen_cmdline.sh index c4f027a..01adfdd 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -80,6 +80,9 @@ longusage() { echo " --no-mountboot Don't mount BOOTDIR automatically" echo " --bootdir= Set the location of the boot-directory, default is /boot" echo " --modprobedir= Set the location of the modprobe.d-directory, default is /etc/modprobe.d" + echo " --nice Run the kernel make at the default nice level (10)." + echo " --nice=<0-19> Run the kernel make at the selected nice level." + echo " --no-nice Don't be nice while running the kernel make." echo " Initialization" echo " --splash=Enable framebuffer splash using " echo " --splash-res= Select splash theme resolutions to install" @@ -598,6 +601,23 @@ parse_cmdline() { --config=*) print_info 2 "CMD_GK_CONFIG: `parse_opt "$*"`" ;; + --nice) + CMD_NICE=10 + print_info 2 "CMD_NICE: ${CMD_NICE}" + ;; + --nice=*) + CMD_NICE=`parse_opt "$*"` + if [ ${CMD_NICE} -lt 0 -o ${CMD_NICE} -gt 19 ] + then + echo "Error: Illegal value specified for --nice= parameter." + exit 1 + fi + print_info 2 "CMD_NICE: ${CMD_NICE}" + ;; + --no-nice) + CMD_NICE=0 + print_info 2 "CMD_NICE: ${CMD_NICE}" + ;; all) BUILD_KERNEL=1 BUILD_MODULES=1 diff --git a/gen_compile.sh b/gen_compile.sh index 99cf37c..c26a652 100755 --- a/gen_compile.sh +++ b/gen_compile.sh @@ -261,25 +261,32 @@ compile_generic() { esac shift 2 + if [ ${NICE} -ne 0 ] + then + NICEOPTS="nice -n${NICE} " + else + NICEOPTS="" + fi + # the eval usage is needed in the next set of code # as ARGS can contain spaces and quotes, eg: # ARGS='CC="ccache gcc"' if [ "${argstype}" == 'kernelruntask' ] then # Silent operation, forced -j1 - print_info 2 "COMMAND: ${MAKE} ${MAKEOPTS} -j1 ${ARGS} ${target} $*" 1 0 1 - eval ${MAKE} -s ${MAKEOPTS} -j1 "${ARGS}" ${target} $* + print_info 2 "COMMAND: ${NICEOPTS}${MAKE} ${MAKEOPTS} -j1 ${ARGS} ${target} $*" 1 0 1 + eval ${NICEOPTS}${MAKE} -s ${MAKEOPTS} -j1 "${ARGS}" ${target} $* RET=$? elif [ "${LOGLEVEL}" -gt "1" ] then # Output to stdout and logfile - print_info 2 "COMMAND: ${MAKE} ${MAKEOPTS} ${ARGS} ${target} $*" 1 0 1 - eval ${MAKE} ${MAKEOPTS} ${ARGS} ${target} $* 2>&1 | tee -a ${LOGFILE} + print_info 2 "COMMAND: ${NICEOPTS}${MAKE} ${MAKEOPTS} ${ARGS} ${target} $*" 1 0 1 + eval ${NICEOPTS}${MAKE} ${MAKEOPTS} ${ARGS} ${target} $* 2>&1 | tee -a ${LOGFILE} RET=${PIPESTATUS[0]} else # Output to logfile only - print_info 2 "COMMAND: ${MAKE} ${MAKEOPTS} ${ARGS} ${target} $*" 1 0 1 - eval ${MAKE} ${MAKEOPTS} ${ARGS} ${target} $* >> ${LOGFILE} 2>&1 + print_info 2 "COMMAND: ${NICEOPTS}${MAKE} ${MAKEOPTS} ${ARGS} ${target} $*" 1 0 1 + eval ${NICEOPTS}${MAKE} ${MAKEOPTS} ${ARGS} ${target} $* >> ${LOGFILE} 2>&1 RET=$? fi [ ${RET} -ne 0 ] && diff --git a/gen_determineargs.sh b/gen_determineargs.sh index
[gentoo-commits] proj/genkernel:master commit in: /, doc/
commit: c13e972b79864db27742fd9cdbd96be27d4f3462 Author: Christoph Junghans ottxor AT gentoo DOT org AuthorDate: Sun Jan 18 00:57:55 2015 + Commit: Christoph Junghans ottxor AT gentoo DOT org CommitDate: Sun Jan 18 16:57:18 2015 + URL: http://sources.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=c13e972b Added --wrap-initrd option This is useful in combination the u-boot bootloader which can only load wrap initramfs. Signed-off-by: Christoph Junghans ottxor AT gentoo.org --- doc/genkernel.8.txt | 5 + gen_cmdline.sh | 6 ++ gen_determineargs.sh | 1 + gen_initramfs.sh | 10 ++ genkernel.conf | 2 ++ 5 files changed, 24 insertions(+) diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index b36b78d..f8d7a10 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -376,6 +376,11 @@ OUTPUT SETTINGS Builds or does not build the generated initramfs into the kernel instead of keeping it as a separate file. +*--*[*no-*]*wrap-initrd*:: + Wrap initramfs using mkimage for u-boot boots. Please note that only + certain compression types are supported by mkimage (see manpage). + + *--*[*no-*]*compress-initramfs*, *--*[*no-*]*compress-initrd*:: Compresses or does not compress the generated initramfs. diff --git a/gen_cmdline.sh b/gen_cmdline.sh index 6ef6ae0..baa58fa 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -158,6 +158,8 @@ longusage() { echo--integrated-initramfs, --no-integrated-initramfs echoInclude/exclude the generated initramfs in the kernel echoinstead of keeping it as a separate file + echo--wrap-initrd, --no-wrap-initrd + echoWrap initramfs using mkimage for u-boot boots echo--compress-initramfs, --no-compress-initramfs, echo--compress-initrd, --no-compress-initrd echoCompress or do not compress the generated initramfs @@ -575,6 +577,10 @@ parse_cmdline() { CMD_INTEGRATED_INITRAMFS=`parse_optbool $*` print_info 2 CMD_INTEGRATED_INITRAMFS=${CMD_INTEGRATED_INITRAMFS} ;; + --wrap-initrd|--no-wrap-initrd) + CMD_WRAP_INITRD=`parse_optbool $*` + print_info 2 CMD_WRAP_INITRD=${CMD_WRAP_INITRD} + ;; --compress-initramfs|--no-compress-initramfs|--compress-initrd|--no-compress-initrd) CMD_COMPRESS_INITRD=`parse_optbool $*` print_info 2 CMD_COMPRESS_INITRD=${CMD_COMPRESS_INITRD} diff --git a/gen_determineargs.sh b/gen_determineargs.sh index dc6b2c4..59af78b 100755 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -131,6 +131,7 @@ determine_real_args() { set_config_with_override STRING FIRMWARE_DIR CMD_FIRMWARE_DIR /lib/firmware set_config_with_override STRING FIRMWARE_FILES CMD_FIRMWARE_FILES set_config_with_override BOOL INTEGRATED_INITRAMFS CMD_INTEGRATED_INITRAMFS + set_config_with_override BOOL WRAP_INITRD CMD_WRAP_INITRD set_config_with_override BOOL GENZIMAGECMD_GENZIMAGE set_config_with_override BOOL KEYMAP CMD_KEYMAP yes set_config_with_override BOOL DOKEYMAPAUTO CMD_DOKEYMAPAUTO diff --git a/gen_initramfs.sh b/gen_initramfs.sh index b9ff518..254f21a 100755 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -958,6 +958,16 @@ create_initramfs() { print_info 1 Not compressing cpio data ... fi fi + if isTrue ${WRAP_INITRD} + then + local mkimage_cmd=$(type -p mkimage) + [[ -z ${mkimage_cmd} ]] gen_die mkimage is not available. Please install package 'dev-embedded/u-boot-tools'. + local mkimage_args=-A ${ARCH} -O linux -T ramdisk -C ${compression:-none} -a 0x -e 0x + print_info 1 Wrapping initramfs using mkimage... + print_info 2 ${mkimage_cmd} ${mkimage_args} -n initramfs-${KV} -d ${CPIO} ${CPIO}.uboot + ${mkimage_cmd} ${mkimage_args} -n initramfs-${KV} -d ${CPIO} ${CPIO}.uboot ${LOGFILE} 21 || gen_die Wrapping initramfs using mkimage failed + mv -f ${CPIO}.uboot ${CPIO} || gen_die Rename failed + fi fi if isTrue ${CMD_INSTALL} diff --git a/genkernel.conf b/genkernel.conf index 0c3955c..7f42b05 100644 --- a/genkernel.conf +++ b/genkernel.conf @@ -296,6 +296,8 @@ DEFAULT_KERNEL_SOURCE=/usr/src/linux # fastest selects the fastest available compression method #COMPRESS_INITRD_TYPE=best +# wrap initramfs using
[gentoo-commits] proj/genkernel:master commit in: doc/
commit: 37897db6fa5908497eadcb515cc5312a6c0e Author: Robin H. Johnson robbat2 AT gentoo DOT org AuthorDate: Mon Apr 14 01:29:07 2014 + Commit: Robin H. Johnson robbat2 AT gentoo DOT org CommitDate: Mon Apr 14 01:29:07 2014 + URL: http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=37897db6 Document --no-debug-cleanup. Signed-off-by: Robin H. Johnson robbat2 AT gentoo.org --- doc/genkernel.8.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index 8d890eb..b36b78d 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -85,6 +85,9 @@ DEBUGGING OPTIONS *--*[*no-*]*color*:: Turns on, or off, output in color using escape sequences. +*--*[*no-*]*debug-cleanup*:: +Turns on or off the full post-run cleanup for debug purposes. + KERNEL CONFIGURATION