mirror of
https://github.com/libretro/Lakka-LibreELEC.git
synced 2024-11-23 08:20:00 +00:00
scripts: add adjust_kernel_config to help adjust kernel options
This commit is contained in:
parent
c1054355a1
commit
d33beeefed
40
tools/adjust_kernel_config
Executable file
40
tools/adjust_kernel_config
Executable file
@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2021-present Team LibreELEC (https://libreelec.tv)
|
||||
|
||||
if [ -z "${1}" -o "${1}" == "help" -o "${1}" == "--help" -o "${1}" == "h" -o "${1}" == "-h" ]; then
|
||||
echo -e "A kernel config command must be specified:\n"
|
||||
echo -e "${0} menuconfig"
|
||||
echo -e ""
|
||||
echo -e "To see all available config commands use:\n"
|
||||
echo -e "${0} commands"
|
||||
exit
|
||||
fi
|
||||
|
||||
KERNEL_CONFIG_COMMAND="$1"
|
||||
|
||||
. config/options linux
|
||||
|
||||
${SCRIPTS}/unpack linux
|
||||
|
||||
AVAILABLE_KERNEL_CONFIG_COMMANDS="$(kernel_make -C ${PKG_BUILD} help | sed -n '/Configuration targets:/,/Other generic targets:/p' | sed -n -E 's/^ ([a-z0-9]+)[ -]*.*/\1/p')"
|
||||
|
||||
print_config_commands() {
|
||||
echo -e "Available kernel config commands are:\n\n${AVAILABLE_KERNEL_CONFIG_COMMANDS}"
|
||||
}
|
||||
|
||||
if [ "${1}" == "commands" ]; then
|
||||
print_config_commands
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ -z "$(echo ${AVAILABLE_KERNEL_CONFIG_COMMANDS} | grep ${KERNEL_CONFIG_COMMAND})" ]; then
|
||||
echo -e "\"${KERNEL_CONFIG_COMMAND}\" is not an available kernel config command\n"
|
||||
print_config_commands
|
||||
exit
|
||||
fi
|
||||
|
||||
tools/check_kernel_config
|
||||
|
||||
kernel_make KCONFIG_CONFIG=${PKG_KERNEL_CFG_FILE} -C ${PKG_BUILD} ${KERNEL_CONFIG_COMMAND}
|
Loading…
Reference in New Issue
Block a user