Ricardo Pardini 36c97b8220
armbian-next: extensions: rename kernel-localmodconfig to just lsmod
- rename `KERNEL_CONFIG_FROM_LSMOD` to just `LSMOD` too
- default `LSMOD` to `${BOARD}`
- and make it "better"
2023-02-18 07:43:20 -03:00

24 lines
1.2 KiB
Bash

function extension_prepare_config__prepare_localmodconfig() {
# If defined, ${LSMOD} can contain a lsmod to apply to the kernel configuration.
# to get a file for this run 'lsmod > my_machine.lsmod' and then put it in userpatches/lsmod/
declare -g -r LSMOD="${LSMOD:-"${BOARD}"}" # default to the board name
display_alert "${EXTENSION}: lsmod enabled" "${LSMOD}" "warn"
# If there, make sure it exists
declare -g -r lsmod_file="${SRC}/userpatches/lsmod/${LSMOD}.lsmod"
if [[ ! -f "${lsmod_file}" ]]; then
exit_with_error "Can't find lsmod file ${lsmod_file}, create it by running lsmod on target HW or configure with LSMOD=xxx"
fi
}
# This needs much more love than this. can be used to make "light" versions of kernels, that compile 3x-5x faster or more
function custom_kernel_config_post_defconfig__apply_localmodconfig() {
if [[ -f "${lsmod_file}" ]]; then
display_alert "${EXTENSION}: running localmodconfig on Kernel tree" "${LSMOD}" "warn"
run_kernel_make "LSMOD=${lsmod_file}" localmodconfig "> /dev/null" # quoted redirect to hide output even from logfile, it's way too long. stderr still shows
else
display_alert "${EXTENSION}: lsmod file disappeared?" "${lsmod_file}" "err"
return 1 # exit with an error; this is not what the user expected
fi
}