From 0df21f12f9117648c68b6aa788b3a819ee371e7a Mon Sep 17 00:00:00 2001 From: Pratham Patel Date: Sun, 1 Oct 2023 08:39:43 +0530 Subject: [PATCH] "improve" the way non-defconfig configs are enabled --- configure-linux.sh | 32 -------------------------------- extra-configs/r8169.sh | 2 +- master.inc | 13 +++++-------- 3 files changed, 6 insertions(+), 41 deletions(-) diff --git a/configure-linux.sh b/configure-linux.sh index d28fa9d..081cc42 100644 --- a/configure-linux.sh +++ b/configure-linux.sh @@ -2,38 +2,6 @@ set -xeu -export EXTRA_LINUX_MODULES=() -export EXTRA_LINUX_BUILTIN=() -EXTRA_LINUX_CONFIG=() - for FILE in ./extra-configs/*.sh; do source "${FILE}" done - -if [[ "${EXTRA_LINUX_MODULES[*]}" != "" ]]; then - for CONFIG_MODULE in "${EXTRA_LINUX_MODULES[@]}"; do - EXTRA_LINUX_CONFIG+=("${CONFIG_MODULE}"'=m') - done -fi - -if [[ "${EXTRA_LINUX_BUILTIN[*]}" != "" ]]; then - for CONFIG_BUILTIN in "${EXTRA_LINUX_BUILTIN[@]}"; do - EXTRA_LINUX_CONFIG+=("${CONFIG_BUILTIN}"'=y') - done -fi - -function verify_config { - [[ "${EXTRA_LINUX_CONFIG[*]}" == "" ]] && >&2 echo '**** WARNING: List of extra config options to check is empty, doing nothing.' - - if [[ ! -f .config ]]; then - >&2 echo '**** ERROR: The config file could not be found.' - exit 1 - fi - - for CONFIG_OPTION in "${EXTRA_LINUX_CONFIG[@]}"; do - if ! grep "${CONFIG_OPTION}" .config 2>&1 /dev/null; then - >&2 echo "**** ERROR: Config option '${CONFIG_OPTION}' not found in the config file." - exit 1 - fi - done -} diff --git a/extra-configs/r8169.sh b/extra-configs/r8169.sh index 1ff93d3..9385e75 100644 --- a/extra-configs/r8169.sh +++ b/extra-configs/r8169.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -EXTRA_LINUX_MODULES+=('CONFIG_R8169') +./scripts/config --file .config --set-str R8169 'm' # Q: What requires this option to be enabled? # A: Enabling this option adds support for the Realtek RTL8125 2.5GbE Controller # that is present on the Radxa Rock 5 Model B SBC, connected via the PCIe bus. diff --git a/master.inc b/master.inc index 65b8cb9..a1d4cc5 100644 --- a/master.inc +++ b/master.inc @@ -86,22 +86,19 @@ pathfix.py -i "%{__python3} %{py3_shbang_opts}" -n -p \ Documentation \ drivers -tar -xf %{SOURCE2} -C . -cp -vr kernel-tfg/{configure-linux.sh,extra-configs} . -rm -rf kernel-tfg/ - -source ./configure-linux.sh - [ -f .config ] && rm -vf .config* %{make} distclean %{make} "${EXTRA_LINUX_CONFIG[@]}" %{target_config} -verify_config + +tar -xf %{SOURCE2} -C . +cp -vr kernel-tfg/{configure-linux.sh,extra-configs} . +rm -rf kernel-tfg/ +./configure-linux.sh %build source ./configure-linux.sh %{make} %{?_smp_mflags} PYTHON=%{__python3} %{make_targets} -verify_config %install rm -rf $RPM_BUILD_ROOT