kernel: add whitelist for config options we expect to fail

Experimental kernel is much newer, and many configuration options have
dropped since 4.19. Let's use a whitelist to itemize what we expect to
be dropped in the final config if experimental kernel us utilized.

Signed-off-by: Eric Ernst <eric.ernst@intel.com>
This commit is contained in:
Eric Ernst 2019-09-04 16:03:14 -07:00
parent b00b0d9e7d
commit e828fa953c
2 changed files with 28 additions and 5 deletions

View File

@ -37,6 +37,7 @@ readonly default_patches_dir="${patches_repo_dir}/kernel/patches/"
readonly default_kernel_config_dir="${GOPATH}/src/${kernel_config_repo}/kernel/configs" readonly default_kernel_config_dir="${GOPATH}/src/${kernel_config_repo}/kernel/configs"
# Default path to search for kernel config fragments # Default path to search for kernel config fragments
readonly default_config_frags_dir="${GOPATH}/src/${kernel_config_repo}/kernel/configs/fragments" readonly default_config_frags_dir="${GOPATH}/src/${kernel_config_repo}/kernel/configs/fragments"
readonly default_config_whitelist="${GOPATH}/src/${kernel_config_repo}/kernel/configs/fragments/whitelist.conf"
#Path to kernel directory #Path to kernel directory
kernel_path="" kernel_path=""
#Experimental kernel support. Pull from virtio-fs GitLab instead of kernel.org #Experimental kernel support. Pull from virtio-fs GitLab instead of kernel.org
@ -109,7 +110,7 @@ get_kernel() {
if [[ ${experimental_kernel} == "true" ]]; then if [[ ${experimental_kernel} == "true" ]]; then
kernel_tarball="linux-${version}.tar.gz" kernel_tarball="linux-${version}.tar.gz"
curl --fail -OL "https://gitlab.com/virtio-fs/linux/-/archive/${version}/${kernel_tarball}" curl --fail -OL "https://gitlab.com/virtio-fs/linux/-/archive/${version}/${kernel_tarball}"
tar xvf "${kernel_tarball}" tar xf "${kernel_tarball}"
mv "linux-${version}" "${kernel_path}" mv "linux-${version}" "${kernel_path}"
else else
@ -182,9 +183,20 @@ get_kernel_frag_path() {
fi fi
info "Constructing config from fragments: ${config_path}" info "Constructing config from fragments: ${config_path}"
local results=$(export KCONFIG_CONFIG=${config_path}; \
export ARCH=${arch_target}; \
cd ${kernel_path}; ${cmdpath} -r -n ${all_configs}) export KCONFIG_CONFIG=${config_path}
export ARCH=${arch_target}
cd ${kernel_path}
local results
results=$( ${cmdpath} -r -n ${all_configs} )
# Only consider results highlighting "not in final"
results=$(grep "${not_in_string}" <<< "$results")
# Do not care about options that are in whitelist if using experimental kernel
if [[ ${experimental_kernel} == "true" ]]; then
results=$(grep -v -f ${default_config_whitelist} <<< "$results")
fi
# Did we request any entries that did not make it? # Did we request any entries that did not make it?
local missing=$(echo $results | grep -v -q "${not_in_string}"; echo $?) local missing=$(echo $results | grep -v -q "${not_in_string}"; echo $?)
@ -268,6 +280,7 @@ get_config_version() {
setup_kernel() { setup_kernel() {
local kernel_path=${1:-} local kernel_path=${1:-}
[ -n "${kernel_path}" ] || die "kernel_path not provided" [ -n "${kernel_path}" ] || die "kernel_path not provided"
if [ -d "$kernel_path" ]; then if [ -d "$kernel_path" ]; then
info "${kernel_path} already exist" info "${kernel_path} already exist"
return return
@ -295,7 +308,6 @@ setup_kernel() {
kernel_patches=$(find "${patches_dir_for_version}" -name '*.patch' -type f) kernel_patches=$(find "${patches_dir_for_version}" -name '*.patch' -type f)
else else
info "kernel patches directory does not exit" info "kernel patches directory does not exit"
fi fi
[ -n "${arch_target}" ] || arch_target="$(uname -m)" [ -n "${arch_target}" ] || arch_target="$(uname -m)"

View File

@ -0,0 +1,11 @@
# configuration options which may dropped in newer kernels
# without generating an error in fragment merging
CONFIG_INET6_XFRM_MODE_BEET
CONFIG_INET6_XFRM_MODE_TRANSPORT
CONFIG_INET6_XFRM_MODE_TUNNEL
CONFIG_NF_NAT_IPV4
CONFIG_NF_NAT_NEEDED
CONFIG_NF_NAT_PROTO_DCCP
CONFIG_NF_NAT_PROTO_GRE
CONFIG_NF_NAT_PROTO_SCTP
CONFIG_NF_NAT_PROTO_UDPLITE