Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for merging kernel config fragment #76

Merged
merged 1 commit into from
Dec 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions gen_cmdline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ longusage() {
echo " --color Output debug in color"
echo " --no-color Do not output debug in color"
echo " Kernel Configuration settings"
echo " --mergekconfig Run merge_config.sh instead of oldconfig"
echo " --no-mergekconfig Do not run merge_config.sh instead of oldconfig"
echo " --menuconfig Run menuconfig after oldconfig"
echo " --no-menuconfig Do not run menuconfig after oldconfig"
echo " --nconfig Run nconfig after oldconfig"
Expand Down Expand Up @@ -358,6 +360,10 @@ parse_cmdline() {
LOGLEVEL="${CMD_LOGLEVEL}"
print_info 2 "CMD_LOGLEVEL: ${CMD_LOGLEVEL}"
;;
--mergekconfig|--no-mergekconfig)
CMD_MERGE_KCONFIG=`parse_optbool "$*"`
print_info 2 "CMD_MERGE_KCONFIG: ${CMD_MERGE_KCONFIG}"
;;
--menuconfig)
TERM_LINES=`stty -a | head -n 1 | cut -d\ -f5 | cut -d\; -f1`
TERM_COLUMNS=`stty -a | head -n 1 | cut -d\ -f7 | cut -d\; -f1`
Expand Down
14 changes: 14 additions & 0 deletions gen_configkernel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,20 @@ config_kernel() {
fi
fi

# Support kernel config fragment merging.
if isTrue "${MERGE_KCONFIG}"
then
KCONFIG_FRAGMENT=${KCONFIG_FRAGMENT:-/etc/default/genkernel_kconfig_fragment}
local message="Error: Config fragment ${KCONFIG_FRAGMENT} not found!"
print_info 1 "kernel: Merging config with ${KCONFIG_FRAGMENT}"
[[ -f "${KCONFIG_FRAGMENT}" ]] || gen_die "${message}"
KCONFIG_CONFIG="${KERNEL_OUTPUTDIR}/.config" \
"${KERNEL_DIR}"/scripts/kconfig/merge_config.sh \
"${KERNEL_OUTPUTDIR}/.config" \
"${KCONFIG_FRAGMENT[@]}"
[[ "$?" ]] || gen_die "Error: merge_config.sh failed!"
fi

if isTrue "${OLDCONFIG}"
then
print_info 1 ' >> Running oldconfig...'
Expand Down
7 changes: 7 additions & 0 deletions gen_determineargs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ determine_real_args() {
set_config_with_override BOOL PLYMOUTH CMD_PLYMOUTH
set_config_with_override BOOL POSTCLEAR CMD_POSTCLEAR
set_config_with_override BOOL MRPROPER CMD_MRPROPER
set_config_with_override BOOL MERGE_KCONFIG CMD_MERGE_KCONFIG
set_config_with_override BOOL MENUCONFIG CMD_MENUCONFIG
set_config_with_override BOOL NCONFIG CMD_NCONFIG
set_config_with_override BOOL CLEAN CMD_CLEAN
Expand Down Expand Up @@ -187,6 +188,12 @@ determine_real_args() {
fi
fi

# After merging config fragments, make alldefconfig is run by default
if isTrue ${MERGE_KCONFIG}
then
OLDCONFIG=0
fi

# Special case: If --no-clean is specified on the command line,
# imply --no-mrproper.
if [ "${CMD_CLEAN}" != '' ]
Expand Down
5 changes: 5 additions & 0 deletions genkernel.conf
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ MOUNTBOOT="yes"
# Make symlinks in BOOTDIR automatically?
#SYMLINK="no"

# Merge kernel config fragment
#MERGE_KCONFIG="yes"
# Kernel config fragment(s) to merge
#KCONFIG_FRAGMENT=( "/etc/default/genkernel_kconfig_fragment" )

# Save the new configuration in /etc/kernels upon
# successfull compilation
SAVE_CONFIG="yes"
Expand Down