Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/genkernel:master commit in: /
Date: Thu, 16 Jul 2020 15:03:29
Message-Id: 1594909755.550341ce8adf4fed720939050f36a53d6044227d.whissi@gentoo
1 commit: 550341ce8adf4fed720939050f36a53d6044227d
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jul 14 14:42:53 2020 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Thu Jul 16 14:29:15 2020 +0000
6 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=550341ce
7
8 gen_configkernel.sh: config_kernel(): Re-order config checks
9
10 Re-order config checks for better logical grouping.
11
12 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
13
14 gen_configkernel.sh | 47 +++++++++++++++++++++++------------------------
15 1 file changed, 23 insertions(+), 24 deletions(-)
16
17 diff --git a/gen_configkernel.sh b/gen_configkernel.sh
18 index 6ee57ed..b76d1b7 100755
19 --- a/gen_configkernel.sh
20 +++ b/gen_configkernel.sh
21 @@ -333,25 +333,35 @@ config_kernel() {
22 local -a required_kernel_options
23 [ -f "${KCONFIG_MODIFIED_MARKER}" ] && rm "${KCONFIG_MODIFIED_MARKER}"
24
25 - # Ensure kernel supports initramfs
26 if isTrue "${BUILD_RAMDISK}"
27 then
28 + # We really need this or we will fail to boot
29 + print_info 2 "$(get_indent 1)>> Ensure that required kernel options for genkernel's initramfs usage are set ..."
30 +
31 + # Ensure kernel supports initramfs
32 kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_BLK_DEV_INITRD" "y"
33 - fi
34
35 - # --integrated-initramfs handling
36 - if isTrue "${INTEGRATED_INITRAMFS}"
37 - then
38 - local cfg_CONFIG_INITRAMFS_SOURCE=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_INITRAMFS_SOURCE")
39 - if [[ -n "${cfg_CONFIG_INITRAMFS_SOURCE}" && ${#cfg_CONFIG_INITRAMFS_SOURCE} -gt 2 ]]
40 + # Stuff required by init script
41 + kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_TTY" "y" \
42 + && required_kernel_options+=( 'CONFIG_TTY' )
43 +
44 + kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_UNIX98_PTYS" "y" \
45 + && required_kernel_options+=( 'CONFIG_UNIX98_PTYS' )
46 +
47 + # --integrated-initramfs handling
48 + if isTrue "${INTEGRATED_INITRAMFS}"
49 + then
50 + local cfg_CONFIG_INITRAMFS_SOURCE=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_INITRAMFS_SOURCE")
51 + if [[ -n "${cfg_CONFIG_INITRAMFS_SOURCE}" && ${#cfg_CONFIG_INITRAMFS_SOURCE} -gt 2 ]]
52 + then
53 + # Checking value length to allow 'CONFIG_INITRAMFS_SOURCE=' and 'CONFIG_INITRAMFS_SOURCE=""'
54 + print_info 2 "$(get_indent 1)>> CONFIG_INITRAMFS_SOURCE is already set; Unsetting to avoid clashing with --integrated-initramfs ..."
55 + kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_INITRAMFS_SOURCE" ""
56 + fi
57 + elif isTrue "${COMPRESS_INITRD}"
58 then
59 - # Checking value length to allow 'CONFIG_INITRAMFS_SOURCE=' and 'CONFIG_INITRAMFS_SOURCE=""'
60 - print_info 2 "$(get_indent 1)>> CONFIG_INITRAMFS_SOURCE is already set; Unsetting to avoid clashing with --integrated-initramfs ..."
61 - kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_INITRAMFS_SOURCE" ""
62 + set_initramfs_compression_method "${KERNEL_OUTPUTDIR}/.config"
63 fi
64 - elif isTrue "${COMPRESS_INITRD}"
65 - then
66 - set_initramfs_compression_method "${KERNEL_OUTPUTDIR}/.config"
67 fi
68
69 # Force this on if we are using --genzimage
70 @@ -443,17 +453,6 @@ config_kernel() {
71 fi
72 fi
73
74 - if isTrue "${BUILD_RAMDISK}"
75 - then
76 - # We really need this or we will fail to boot
77 - print_info 2 "$(get_indent 1)>> Ensure that required kernel options for genkernel's initramfs usage are set ..."
78 - kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_TTY" "y" \
79 - && required_kernel_options+=( 'CONFIG_TTY' )
80 -
81 - kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_UNIX98_PTYS" "y" \
82 - && required_kernel_options+=( 'CONFIG_UNIX98_PTYS' )
83 - fi
84 -
85 # If the user has configured DM as built-in, we need to respect that.
86 local cfg_CONFIG_BLK_DEV_DM=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_BLK_DEV_DM")
87 case "${cfg_CONFIG_BLK_DEV_DM}" in