aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Deutschmann <whissi@gentoo.org>2019-03-21 23:41:06 +0100
committerThomas Deutschmann <whissi@gentoo.org>2019-03-21 23:41:06 +0100
commit919cbc4b10215b54fb7b1c74b11ea25534243608 (patch)
tree17f4ebb0aedf88c641b9c8791c81072198624bd0
parentBump mdadm to v4.1 (diff)
downloadgenkernel-919cbc4b10215b54fb7b1c74b11ea25534243608.tar.gz
genkernel-919cbc4b10215b54fb7b1c74b11ea25534243608.tar.bz2
genkernel-919cbc4b10215b54fb7b1c74b11ea25534243608.zip
create_initramfs(): Move ACTUAL_KERNEL_CONFIG block
This will allow us to do additional kernel config checks. Bug: https://bugs.gentoo.org/673590 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
-rwxr-xr-xgen_initramfs.sh31
1 files changed, 16 insertions, 15 deletions
diff --git a/gen_initramfs.sh b/gen_initramfs.sh
index 175ccc5c..a0c76017 100755
--- a/gen_initramfs.sh
+++ b/gen_initramfs.sh
@@ -1065,6 +1065,21 @@ create_initramfs() {
cd "${TEMP}"
+ # NOTE: We do not work with ${KERNEL_CONFIG} here, since things like
+ # "make oldconfig" or --noclean could be in effect.
+ if [ -f "${KERNEL_OUTPUTDIR}"/.config ]; then
+ local ACTUAL_KERNEL_CONFIG="${KERNEL_OUTPUTDIR}"/.config
+ else
+ local ACTUAL_KERNEL_CONFIG="${KERNEL_CONFIG}"
+ fi
+
+ if [[ "$(file --brief --mime-type "${ACTUAL_KERNEL_CONFIG}")" == application/x-gzip ]]; then
+ # Support --kernel-config=/proc/config.gz, mainly
+ local CONFGREP=zgrep
+ else
+ local CONFGREP=grep
+ fi
+
if isTrue "${INTEGRATED_INITRAMFS}"
then
# Explicitly do not compress if we are integrating into the kernel.
@@ -1099,21 +1114,6 @@ create_initramfs() {
else
if isTrue "${COMPRESS_INITRD}"
then
- # NOTE: We do not work with ${KERNEL_CONFIG} here, since things like
- # "make oldconfig" or --noclean could be in effect.
- if [ -f "${KERNEL_OUTPUTDIR}"/.config ]; then
- local ACTUAL_KERNEL_CONFIG="${KERNEL_OUTPUTDIR}"/.config
- else
- local ACTUAL_KERNEL_CONFIG="${KERNEL_CONFIG}"
- fi
-
- if [[ "$(file --brief --mime-type "${ACTUAL_KERNEL_CONFIG}")" == application/x-gzip ]]; then
- # Support --kernel-config=/proc/config.gz, mainly
- local CONFGREP=zgrep
- else
- local CONFGREP=grep
- fi
-
cmd_xz=$(type -p xz)
cmd_lzma=$(type -p lzma)
cmd_bzip2=$(type -p bzip2)
@@ -1177,6 +1177,7 @@ create_initramfs() {
print_info 1 "$(getIndent 1)>> Not compressing cpio data ..."
fi
fi
+
## To early load microcode we need to follow some pretty specific steps
## mostly laid out in linux/Documentation/x86/early-microcode.txt
## It only loads monolithic ucode from an uncompressed cpio, which MUST