aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* gen_configkernel.sh: add priority kernel config in ↵Dmitriy Baranov2024-05-201-0/+1
| | | | | | | | | | determine_kernel_config_file() This is useful for building an image with sys-kernel/gentoo-kernel. Signed-off-by: Dmitriy Baranov <reagentoo@gmail.com> Closes: https://github.com/gentoo/genkernel/pull/57 Signed-off-by: Ben Kohler <bkohler@gentoo.org>
* gen_configkernel.sh: use PATH to find depmodBen Kohler2024-05-061-2/+2
| | | | | Bug: https://bugs.gentoo.org/931324 Signed-off-by: Ben Kohler <bkohler@gentoo.org>
* gen_configkernel: Prepare for kernel-6.64.3.9Michal Privoznik2024-01-191-6/+10
| | | | | | | | | | | | | | | | The microcode related config options were removed in [1] and microcode loading is enabled when support for corresponding CPU is enabled. Basically, this is equivalent to renaming options: CONFIG_MICROCODE_AMD -> CONFIG_CPU_SUP_AMD CONFIG_MICROCODE_INTEL -> CONFIG_CPU_SUP_INTEL Reflect this change in gen_configkernel.sh. Bug: https://bugs.gentoo.org/913659 1: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e6bcfdd75d53390a67f67237f4eafc77d9772056 Signed-off-by: Michal Privoznik <michal.privoznik@gmail.com> Signed-off-by: Ben Kohler <bkohler@gentoo.org>
* firmware: copy only the necessary firmware(s) into initramfsDmitry Baranov2023-08-301-7/+0
| | | | | | | | | | | | | | | | | | | FIRMWARE=yes behavior is changed: Only the minimum number of firmware files will be copied. The list is generated using the `modinfo -F firmware [modules]...` command. The ability to copy all firmware(s) is also available with a new ALLFIRMWARE setting (see the modified genkernel.conf for more details). As for changes in the source code: gen_moddeps.sh: Significantly redesigned module list generation. To get a list of modules, use the `mod_dep_list()` function instead of `gen_dep_list()`. Modules that are not in the kernel (=n or invalid) will be filtered out. Aliases will be replaced with real names (including dependencies). Signed-off-by: Dmitry Baranov <reagentoo@gmail.com> Closes: https://github.com/gentoo/genkernel/pull/40 Signed-off-by: Sam James <sam@gentoo.org>
* Fix build->builtSam James2023-08-081-1/+1
| | | | Signed-off-by: Sam James <sam@gentoo.org>
* Replace use of `which`Sam James2023-07-271-1/+1
| | | | | | | We're trying to phase it out as it's non-portable. Use bash's `type -P` where available (preferable as it avoids user functions) or `command -v` if POSIX. Signed-off-by: Sam James <sam@gentoo.org>
* Refactor (compressed) kernel module handlingThomas Deutschmann2021-09-091-0/+7
| | | | | | | | | | | | | | | | | | | | | | To support a specific module compression algorithm, two things are needed: Used depmod utility on host system building the kernel must support chosen module compression algorithm to generate proper modules.dep file or genkernel would be unable to read module dependencies when copying modules to initramfs. At runtime, used modprobe utility must be able to handle chosen module compression algorithm or modules would be unloadable. To address the first requirement, genkernel will now check if used kmod utility on host system supports chosen module compression algorithm. To address the runtime requirement, this commit will switch from BusyBox's modutils implementation to kmod because BusyBox does not support ZSTD compression (yet). Bug: https://bugs.gentoo.org/809344 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_configkernel.sh: config_kernel(): Warn when kernel config did not changeThomas Deutschmann2021-03-191-0/+9
| | | | | | | | | | | | When user requests to modify kernel config, i.e. `genkernel --menuconfig` but kernel config did not change, show a warning to allow user to notice. This can happen for example when user loaded a different kernel config in dialog but forgot to save to $KERNEL_OUTPUTDIR/.config which is required in that case. Link 1: https://forums.gentoo.org/viewtopic-p-8588232.html#8588232 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_configkernel.sh: config_kernel(): don't set ↵Thomas Deutschmann2021-02-181-1/+1
| | | | | | | | | CONFIG_MICROCODE_OLD_INTERFACE for $KV > 4.3 anymore sys-apps/microcode-ctl which uses this interface was already removed from repository in 2018. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_configkernel.sh: config_kernel(): Ensure kernel supports TMPFSThomas Deutschmann2020-08-281-0/+5
| | | | | | This is required for UDEV support. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* --luks: Add support for Serpent cipherThomas Deutschmann2020-08-211-0/+14
| | | | | Link: https://forums.gentoo.org/viewtopic-t-1117806.html Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_configkernel.sh: config_kernel(): Set CONFIG_CRYPTO_AES_586 only for X86Thomas Deutschmann2020-08-211-5/+5
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_configkernel.sh: set_initramfs_compression_method(): Ensure that set ↵Thomas Deutschmann2020-08-011-1/+15
| | | | | | | | | compression method is supported by the kernel When we didn't build kernel we have to be sure that kernel can actually decompress chosen initramfs compression type. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Unify 'confgrep' handling via new get_grep_cmd_for_file() functionThomas Deutschmann2020-08-011-8/+2
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_configkernel.sh: config_kernel(): Ensure that CONFIG_INITRAMFS_SOURCE is ↵Thomas Deutschmann2020-07-161-10/+10
| | | | | | | | | | | | | always unset config_kernel() runs only once. For this run, even when --integrated-initramfs is set, the kernel option CONFIG_INITRAMFS_SOURCE should be unset *when* we are also tasked to create an initramfs. Otherwise, functions like set_initramfs_compression_method() can fail when used kernel config had integrated initramfs but new kernel doesn't. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_configkernel.sh: config_kernel(): Re-order config checksThomas Deutschmann2020-07-161-24/+23
| | | | | | Re-order config checks for better logical grouping. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_configkernel.sh: set_initramfs_compression_method() refactoredThomas Deutschmann2020-07-161-40/+88
| | | | | | | | | | | | | - Add handling for compression method "best" and "fastest". - Make use of new get_initramfs_compression_method_by_{compression,speed} functions. - Set CONFIG_RD_<TYPE>=n or CONFIG_INITRAMFS_COMPRESSION_<TYPE>=n only when required to avoid second `make oldconfig` call due to changed .config file. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_configkernel.sh: config_kernel(): Don't set ↵Thomas Deutschmann2020-07-161-2/+9
| | | | | | | | | | | CONFIG_CRYPTO_AES_{X86_64,586} for >=linux-5.4 Options were removed in linux-5.4 [Link 1]. Link 1: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=1d2c3279311e4f03fcf164e1366f2fda9f4bfccf Signed-off-by: Thomas Deutschmann <whissi@gentoo.org> merge
* Make kernel config filename customizableThomas Deutschmann2020-03-041-1/+1
| | | | | | | | This commit will make kernel config filename used by --save-config feature customizable like previous commit 769a07fd3e947 did for initramfs and kernel image. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_configkernel.sh: config_kernel(): Make sure kernel supports initramfsThomas Deutschmann2020-01-121-0/+6
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_configkernel.sh: config_kernel(): Make sure kernel supports set ↵Thomas Deutschmann2020-01-121-0/+3
| | | | | | initramfs compression method Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_initramfs.sh: create_initramfs(): Outsource compression method handling ↵Thomas Deutschmann2020-01-121-0/+67
| | | | | | into set_initramfs_compression_method() Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Style fix: Use curly bracesThomas Deutschmann2020-01-111-4/+4
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_configkernel.sh: config_kernel(): Make sure that CONFIG_INITRAMFS_SOURCE ↵Thomas Deutschmann2019-12-291-0/+12
| | | | | | | | is unset Ensure that CONFIG_INITRAMFS_SOURCE is unset to avoid clashing with --integrated-initramfs. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_configkernel.sh: config_kernel(): Add virtiofs supportThomas Deutschmann2019-11-261-0/+12
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_configkernel.sh: config_kernel(): Ensure that required kernel options ↵Thomas Deutschmann2019-11-241-0/+23
| | | | | | for --mdadm are set Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* kernel-generic-config: Disable Virtio by default, use --virtioThomas Deutschmann2019-11-241-0/+3
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_configkernel.sh: determine_kernel_config_file(): clarify $KERNEL_CONFIG ↵Thomas Deutschmann2019-11-211-4/+16
| | | | | | errors Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_configkernel.sh: determine_kernel_config_file(): Don't check same config ↵Thomas Deutschmann2019-11-191-1/+7
| | | | | | file multiple times Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_configkernel.sh: config_kernel(): Show change of used kernel config ↵Thomas Deutschmann2019-11-191-3/+3
| | | | | | already at loglevel 1 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_configkernel.sh: config_kernel(): Use global KV_NUMERIC variableThomas Deutschmann2019-09-291-11/+11
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_configkernel.sh: config_kernel(): Update --microcode kernel options handlingThomas Deutschmann2019-09-291-9/+30
| | | | | | | | - Don't try to set CONFIG_MICROCODE_*EARLY for >= linux-4.4 - Check for CONFIG_MICROCODE_{AMD,INTEL} in sanity check Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_configkernel.sh: determine_kernel_config_file(): Add kconfig containing ↵Thomas Deutschmann2019-08-101-6/+30
| | | | | | | | | | | | | | | | | | KERNEL_LOCALVERSION to kconfig candidate list Since we added $ARCH to KERNEL_LOCALVERSION by default, $KV from fresh kernel sources won't match with saved kernel config file anymore which will break kernel upgrades when saved kernel config file was just copied to new kernel version without removing LOV part. WIth this commit we still prefer extracted $KV when looking for kernel config file, however, we will also look for kernel config file where $KV contains KERNEL_LOCALVERSION we are going to use in addition. Bug: https://bugs.gentoo.org/691852 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Change kernel and initramfs default filename in $BOOTDIRThomas Deutschmann2019-07-291-1/+1
| | | | | | | | | | | | | | | | | | This commit will change default kernel and initramfs filename: kernel-genkernel-%%ARCH%%-%%KV%% -> vmlinuz-%%KV%% System.map-genkernel--%%ARCH%%-%%KV%% -> System.map-%%KV%% initramfs-genkernel-%%ARCH%%-%%KV%% -> initramfs-%%KV%%.img The new naming will be consistent with kernel's "make install" and will allow to match files in /lib/modules with actual kernel. In addition, $ARCH value was moved to kernel's LOCALVERSION. This will ensure that this information is still present and when you do cross-compilation, that /lib/modules content don't get mixed. Bug: https://bugs.gentoo.org/390407 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Make initramfs and kernel filename customizableThomas Deutschmann2019-07-291-1/+1
| | | | | | | | | | | | | New options like --initramfs-filename or --kernel-filename will allow user to customize filenames used when installing initramfs or kernel into $BOOTDIR. Therefore --kernelname (KNAME) option was removed. Filename can contain placeholders like '%%ARCH%%' which will get replaced at runtime. Man page contains more information. Bug: https://bugs.gentoo.org/395095 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Make use of new is_gzipped() functionThomas Deutschmann2019-07-261-1/+1
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_configkernel.sh: Refactor kernel config handling in config_kernel()Thomas Deutschmann2019-07-231-15/+29
| | | | | | | Make sure that we always end up with set kernel config when no kernel config exists in kernel outputdir. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Add --kernel-localversion optionThomas Deutschmann2019-07-211-0/+19
| | | | | | | This option will set/unset kernel option CONFIG_LOCALVERSION. Closes: https://bugs.gentoo.org/521774 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_configkernel.sh: config_kernel(): Ensure that CONFIG_TTY & ↵Thomas Deutschmann2019-07-161-0/+11
| | | | | | | | CONFIG_UNIX98_PTYS is set ...when building initramfs. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_configkernel.sh: config_kernel(): Fix code styleThomas Deutschmann2019-07-161-16/+16
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_configkernel.sh: config_kernel(): No need to re-check required kernel ↵Thomas Deutschmann2019-07-161-13/+13
| | | | | | options when config wasn't modified Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_configkernel.sh: config_kernel(): Don't check kernelruntask's return ↵Thomas Deutschmann2019-07-151-1/+0
| | | | | | | | | | value anymore When compile_generic() was refactored via commit 7b3103c0856dd9ad0652bf2ac27d0d907250ea4e, error checking was added directly to that function. Bug: https://bugs.gentoo.org/689890 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Add bcache supportThomas Deutschmann2019-07-141-0/+9
| | | | | | | Kernel command-line argument only, adds "dobcache". Bug: https://bugs.gentoo.org/605094 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Rework --luks supportThomas Deutschmann2019-07-141-0/+65
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_configkernel.sh: Refactor config_kernel()Thomas Deutschmann2019-07-141-155/+160
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_configkernel.sh: config_kernel(): Make use of KCONFIG_MODIFIED_MARKERThomas Deutschmann2019-07-141-2/+2
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* gen_configkernel.sh: Refactor determine_config_file()Thomas Deutschmann2019-07-141-3/+4
| | | | | | - Rename to determine_kernel_config_file(). Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Normalize "..." outputThomas Deutschmann2019-07-141-21/+21
| | | | | | | When "..." is used to indicate that genkernel will be doing something, use " ..." notation. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Replace backticksThomas Deutschmann2019-07-141-1/+1
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* config_kernel(): Clarify output regarding skipped 'make clean'Thomas Deutschmann2019-07-141-1/+1
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>