Add check for '_reuse_file'

This commit is contained in:
JeremyStar™ 2024-12-22 19:11:54 +01:00
parent 5f6ce75201
commit e8b74c03b1
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D

View file

@ -422,6 +422,7 @@ prepare() {
if [ -n "${_reuse_current}" ]; then if [ -n "${_reuse_current}" ]; then
# Use config from running kernel # 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]')" 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}" ] && [ "${_cur_major_ver}" != "${_kernel_major}" ] &&
@ -431,15 +432,19 @@ prepare() {
zcat /proc/config.gz > ./.config zcat /proc/config.gz > ./.config
make ${BUILD_FLAGS[*]} olddefconfig make ${BUILD_FLAGS[*]} olddefconfig
else else
_warn "WARNING: Your kernel was not compiled with 'IKCONFIG_PROC'. _error "Your kernel was not compiled with 'IKCONFIG_PROC'.\nUnable to read kernel configuration, aborting."
Unable to read kernel configuration, aborting."
exit 1 exit 1
fi fi
elif [ -f "${startdir}/kconfig" ]; then elif [ -n "${_reuse_file}" ]; then
# Use ./kconfig # Use ./kconfig
_msg " Using configuration file \"${startdir}/kconfig\"" if [ -f "${startdir}/kconfig" ]; then
cp -Tf "${startdir}/kconfig" ./.config _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 else
# Use builtin # Use builtin