From 690c369cbe16dd01c3b74fcaefc3eac2435aa5d2 Mon Sep 17 00:00:00 2001 From: Benjamin Gilbert Date: Thu, 9 Mar 2017 22:19:50 -0800 Subject: [PATCH] eclass/coreos-kernel.eclass: Verify enablement of kconfig options If any kconfig options are set to "y" or "m" in the defconfig or commonconfig, but are set to "n" after "make olddefconfig" runs, fail the build. --- .../coreos-overlay/eclass/coreos-kernel.eclass | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/sdk_container/src/third_party/coreos-overlay/eclass/coreos-kernel.eclass b/sdk_container/src/third_party/coreos-overlay/eclass/coreos-kernel.eclass index f722573bf5..a6d5542081 100644 --- a/sdk_container/src/third_party/coreos-overlay/eclass/coreos-kernel.eclass +++ b/sdk_container/src/third_party/coreos-overlay/eclass/coreos-kernel.eclass @@ -214,6 +214,23 @@ coreos-kernel_src_configure() { # Use default for any options not explitly set in defconfig kmake olddefconfig + # Verify that olddefconfig has not converted any y or m options to n + # (implying a new, disabled dependency). Allow options to be converted + # from m to y. + # + # generate regexes from enabled boolean/tristate options | + # filter them out of the defconfig | + # filter for boolean/tristate options, and format | + # sort (why not) + local missing=$( \ + gawk -F = '/=[ym]$/ {print "^" $1 "="}' "${S}/build/.config" | \ + grep -vf - "${S}/build/.config.old" | \ + gawk -F = '/=[ym]$/ {print " " $1}' | \ + sort) + if [[ -n "${missing}" ]]; then + die "Requested options not enabled in build:\n${missing}" + fi + # For convenience, generate a minimal defconfig of the build kmake savedefconfig }