From e8b74c03b188fcfe8d7c87a1c6e4b5a285db24ee Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Sun, 22 Dec 2024 19:11:54 +0100 Subject: [PATCH] Add check for '_reuse_file' --- PKGBUILD | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 29bc34c..f56610e 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -422,6 +422,7 @@ prepare() { if [ -n "${_reuse_current}" ]; then # Use config from running kernel + _msg " Using configuration file from running kernel" local "_cur_major_ver=$(zcat /proc/config.gz | grep Linux | grep -o '[0-9]*[0-9]\.[0-9]*[0-9]')" [ "${_cur_major_ver}" != "${_kernel_major}" ] && @@ -431,15 +432,19 @@ prepare() { zcat /proc/config.gz > ./.config make ${BUILD_FLAGS[*]} olddefconfig else - _warn "WARNING: Your kernel was not compiled with 'IKCONFIG_PROC'. - Unable to read kernel configuration, aborting." + _error "Your kernel was not compiled with 'IKCONFIG_PROC'.\nUnable to read kernel configuration, aborting." exit 1 fi - elif [ -f "${startdir}/kconfig" ]; then + elif [ -n "${_reuse_file}" ]; then # Use ./kconfig - _msg " Using configuration file \"${startdir}/kconfig\"" - cp -Tf "${startdir}/kconfig" ./.config + if [ -f "${startdir}/kconfig" ]; then + _msg " Using configuration file \"${startdir}/kconfig\"" + cp -Tf "${startdir}/kconfig" ./.config + else + _error "Could not find a kernel configuration at '${startdir}/kconfig'.\nUnable to read kernel configuration, aborting." + exit 1 + fi else # Use builtin