kernel-config: don't leak grep stuff to stdout; mention Armbian and defconfig in rewritten .config comment

This commit is contained in:
Ricardo Pardini 2025-11-08 12:43:50 +01:00
parent 97924fb11e
commit efdfb11328
2 changed files with 4 additions and 4 deletions

View File

@ -491,9 +491,9 @@ function armbian_kernel_config_apply_opts_from_arrays() {
actual_opt_value='m'
# NOTE: this isn't perfect, there may be something already
# in defconfig, but we can't see it from here.
if egrep "(CONFIG_)?${opt_m}=m" "${kernel_config_source_filename}"; then
if egrep -q "(CONFIG_)?${opt_m}=m" "${kernel_config_source_filename}"; then
: # do nothing
elif egrep "(CONFIG_)?${opt_m}=y" "${kernel_config_source_filename}"; then
elif egrep -q "(CONFIG_)?${opt_m}=y" "${kernel_config_source_filename}"; then
actual_opt_value='y'
fi
kernel_config_modifying_hashes+=("${opt_m}=${actual_opt_value}")
@ -516,7 +516,7 @@ function armbian_kernel_config_apply_opts_from_arrays() {
for opt_m in "${opts_m[@]}"; do
actual_opt_value='m'
if egrep "(CONFIG_)?${opt_m}=y" "${kernel_config_source_filename}" .config; then
if egrep -q "(CONFIG_)?${opt_m}=y" "${kernel_config_source_filename}" .config; then
actual_opt_value='y'
kernel_config_set_y "${opt_m}"
else

View File

@ -146,7 +146,7 @@ function kernel_config_export() {
# store kernel defconfig in easily reachable place (output dir)
mkdir -p "${DEST}"/config
display_alert "Exporting new kernel defconfig" "$DEST/config/$LINUXCONFIG.config" "info"
echo "# File generated with ${KERNEL_MAJOR_MINOR}" > "${DEST}/config/${LINUXCONFIG}.config"
echo "# Armbian defconfig generated with ${KERNEL_MAJOR_MINOR}" > "${DEST}/config/${LINUXCONFIG}.config"
run_host_command_logged cat defconfig >> "${DEST}/config/${LINUXCONFIG}.config"
# store back into original LINUXCONFIG too, if it came from there, so it's pending commits when done.