mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
cli: add command to rewrite/refresh kernel configs
This commit is contained in:
@@ -244,7 +244,7 @@ function artifact_kernel_cli_adapter_pre_run() {
|
||||
function artifact_kernel_cli_adapter_config_prep() {
|
||||
# Sanity check / cattle guard
|
||||
# If KERNEL_CONFIGURE=yes, or CREATE_PATCHES=yes, user must have used the correct CLI commands, and only add those params.
|
||||
if [[ "${KERNEL_CONFIGURE}" == "yes" && "${ARMBIAN_COMMAND}" != "kernel-config" ]]; then
|
||||
if [[ "${KERNEL_CONFIGURE}" == "yes" && "${ARMBIAN_COMMAND}" != *kernel-config ]]; then
|
||||
exit_with_error "KERNEL_CONFIGURE=yes is not supported anymore. Please use the new 'kernel-config' CLI command. Current command: '${ARMBIAN_COMMAND}'"
|
||||
fi
|
||||
|
||||
|
||||
@@ -59,6 +59,7 @@ function armbian_register_commands() {
|
||||
["kernel"]="artifact"
|
||||
["kernel-patch"]="artifact"
|
||||
["kernel-config"]="artifact"
|
||||
["rewrite-kernel-config"]="artifact"
|
||||
|
||||
["uboot"]="artifact"
|
||||
["uboot-patch"]="artifact"
|
||||
@@ -110,6 +111,7 @@ function armbian_register_commands() {
|
||||
|
||||
["kernel"]="WHAT='kernel' ${common_cli_artifact_vars}"
|
||||
["kernel-config"]="WHAT='kernel' KERNEL_CONFIGURE='yes' ${common_cli_artifact_interactive_vars} ${common_cli_artifact_vars}"
|
||||
["rewrite-kernel-config"]="WHAT='kernel' KERNEL_CONFIGURE='yes' ARTIFACT_WILL_NOT_BUILD='yes' ARTIFACT_IGNORE_CACHE='yes' ${common_cli_artifact_vars}"
|
||||
["kernel-patch"]="WHAT='kernel' CREATE_PATCHES='yes' ${common_cli_artifact_interactive_vars} ${common_cli_artifact_vars}"
|
||||
|
||||
["uboot"]="WHAT='uboot' ${common_cli_artifact_vars}"
|
||||
|
||||
@@ -33,9 +33,11 @@ function kernel_config() {
|
||||
LOG_SECTION="kernel_config_initialize" do_with_logging do_with_hooks kernel_config_initialize
|
||||
|
||||
if [[ "${KERNEL_CONFIGURE}" == "yes" ]]; then
|
||||
# This piece is interactive, no logging
|
||||
display_alert "Starting (interactive) kernel ${KERNEL_MENUCONFIG:-menuconfig}" "${LINUXCONFIG}" "debug"
|
||||
run_kernel_make_dialog "${KERNEL_MENUCONFIG:-menuconfig}"
|
||||
if [[ "${ARMBIAN_COMMAND}" == "kernel-config" ]]; then
|
||||
# This piece is interactive, no logging
|
||||
display_alert "Starting (interactive) kernel ${KERNEL_MENUCONFIG:-menuconfig}" "${LINUXCONFIG}" "debug"
|
||||
run_kernel_make_dialog "${KERNEL_MENUCONFIG:-menuconfig}"
|
||||
fi
|
||||
|
||||
# Export, but log about it too.
|
||||
LOG_SECTION="kernel_config_export" do_with_logging do_with_hooks kernel_config_export
|
||||
|
||||
@@ -77,7 +77,7 @@ function compile_kernel() {
|
||||
|
||||
# Stop after configuring kernel, but only if using a specific CLI command ("kernel-config").
|
||||
# Normal "KERNEL_CONFIGURE=yes" (during image build) is still allowed.
|
||||
if [[ "${KERNEL_CONFIGURE}" == yes && "${ARMBIAN_COMMAND}" == "kernel-config" ]]; then
|
||||
if [[ "${KERNEL_CONFIGURE}" == yes && "${ARMBIAN_COMMAND}" == *kernel-config ]]; then
|
||||
display_alert "Stopping after configuring kernel" "" "cachehit"
|
||||
return 0
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user