From 9757a33bf96731c76d2bce81f154fccfdeed71e2 Mon Sep 17 00:00:00 2001 From: Tycho Andersen Date: Fri, 26 May 2017 17:12:46 -0600 Subject: [PATCH] kernel config project: makeconfig.sh takes config as args Instead of figuring out which config files to use inside of makeconfig.sh, let's figure that out in the Dockerfile and pass them into the script. Signed-off-by: Tycho Andersen --- projects/kernel-config/Dockerfile | 9 ++++++++- projects/kernel-config/makeconfig.sh | 23 +++++++---------------- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/projects/kernel-config/Dockerfile b/projects/kernel-config/Dockerfile index 346a29443..e6f8a6d70 100644 --- a/projects/kernel-config/Dockerfile +++ b/projects/kernel-config/Dockerfile @@ -23,7 +23,14 @@ RUN set -e && for patch in /patches/*.patch; do \ patch -p1 < "$patch"; \ done -RUN /config/makeconfig.sh ${ARCH} ${KERNEL_SERIES} +RUN \ + if [ -n "${DEBUG}" ]; then dbg=kernel_config.debug; else dbg=; fi && \ + /config/makeconfig.sh \ + kernel_config.base \ + "kernel_config.${ARCH}" \ + "kernel_config.${ARCH}.${KERNEL_SERIES}" \ + "kernel_config.${KERNEL_SERIES}" \ + "$dbg" RUN /config/check-kernel-config.sh /linux/.config RUN mkdir /out diff --git a/projects/kernel-config/makeconfig.sh b/projects/kernel-config/makeconfig.sh index 86c940181..671d15a08 100755 --- a/projects/kernel-config/makeconfig.sh +++ b/projects/kernel-config/makeconfig.sh @@ -2,10 +2,6 @@ set -e -ARCH=$1 -KERNEL_SERIES=$2 -DEBUG=$3 - cd /linux && make defconfig function merge_config() @@ -32,10 +28,9 @@ function merge_config() cd /linux && make defconfig && make oldconfig -merge_config "/config/kernel_config.base" -merge_config "/config/kernel_config.${ARCH}" -merge_config "/config/kernel_config.${KERNEL_SERIES}" -merge_config "/config/kernel_config.${ARCH}.${KERNEL_SERIES}" +for config in "$@"; do + merge_config "$config" +done cd /linux && make oldconfig @@ -48,7 +43,7 @@ function check_config() while read line; do # CONFIG_PANIC_ON_OOPS is special, and set both ways, depending on # whether DEBUG is set or not. - if [ -n "${DEBUG}" ] && [ "$line" == "CONFIG_PANIC_ON_OOPS=y" ]; then continue; fi + if [ "$line" == *"CONFIG_PANIC_ON_OOPS"* ]; then continue; fi value="$(grep "^${line}$" /linux/.config || true)" # It's okay to for the merging script to have simply not listed values we @@ -64,10 +59,6 @@ function check_config() done < $1 } -check_config "/config/kernel_config.base" -check_config "/config/kernel_config.${ARCH}" -check_config "/config/kernel_config.${KERNEL_SERIES}" -check_config "/config/kernel_config.${ARCH}.${KERNEL_SERIES}" -if [ -n "${DEBUG}" ]; then - check_config "/config/kernel_config.debug" -fi +for config in "$@"; do + check_config "$config" +done