mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
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"
This commit is contained in:
23
extensions/lsmod.sh
Normal file
23
extensions/lsmod.sh
Normal file
@@ -0,0 +1,23 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user