1 |
commit: 6b2ad24605d0bd6320cdd006e9ca78fdcbaa7a27 |
2 |
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Aug 1 18:11:48 2020 +0000 |
4 |
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Aug 1 20:35:00 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=6b2ad246 |
7 |
|
8 |
gen_configkernel.sh: set_initramfs_compression_method(): Ensure that set compression method is supported by the kernel |
9 |
|
10 |
When we didn't build kernel we have to be sure that kernel can actually |
11 |
decompress chosen initramfs compression type. |
12 |
|
13 |
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org> |
14 |
|
15 |
gen_configkernel.sh | 16 +++++++++++++++- |
16 |
1 file changed, 15 insertions(+), 1 deletion(-) |
17 |
|
18 |
diff --git a/gen_configkernel.sh b/gen_configkernel.sh |
19 |
index 666f525..b30d079 100755 |
20 |
--- a/gen_configkernel.sh |
21 |
+++ b/gen_configkernel.sh |
22 |
@@ -119,7 +119,7 @@ set_initramfs_compression_method() { |
23 |
|
24 |
if [[ "${COMPRESS_INITRD_TYPE}" =~ ^(BEST|FASTEST)$ ]] |
25 |
then |
26 |
- print_info 5 "Determining '${COMPRESS_INITRD_TYPE}' compression method for initramfs ..." |
27 |
+ print_info 5 "Determining '${COMPRESS_INITRD_TYPE}' compression method for initramfs using kernel config '${kernel_config}' ..." |
28 |
local ranked_methods |
29 |
if [[ "${COMPRESS_INITRD_TYPE}" == "BEST" ]] |
30 |
then |
31 |
@@ -162,6 +162,20 @@ set_initramfs_compression_method() { |
32 |
fi |
33 |
fi |
34 |
|
35 |
+ if ! isTrue "${BUILD_KERNEL}" |
36 |
+ then |
37 |
+ local cfg_DECOMPRESS_SUPPORT=$(kconfig_get_opt "${kernel_config}" "CONFIG_RD_${COMPRESS_INITRD_TYPE}") |
38 |
+ if [[ "${cfg_DECOMPRESS_SUPPORT}" != "y" ]] |
39 |
+ then |
40 |
+ gen_die "The kernel config '${kernel_config}' this initramfs will be build for cannot decompress set --compress-initrd-type '${COMPRESS_INITRD_TYPE}'!" |
41 |
+ fi |
42 |
+ |
43 |
+ # If we are not building kernel, there is no point in |
44 |
+ # changing kernel config file at all so exit function |
45 |
+ # here. |
46 |
+ return |
47 |
+ fi |
48 |
+ |
49 |
local KOPTION_PREFIX=CONFIG_RD_ |
50 |
[ ${KV_NUMERIC} -ge 4010 ] && KOPTION_PREFIX=CONFIG_INITRAMFS_COMPRESSION_ |