From c1054355a13ca47d7c08db342b0eba90c6cebf1e Mon Sep 17 00:00:00 2001 From: Lukas Rusak Date: Mon, 1 Feb 2021 10:29:57 -0800 Subject: [PATCH] scripts: add check_kernel_config to help enable kernel options per distro --- tools/check_kernel_config | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 tools/check_kernel_config diff --git a/tools/check_kernel_config b/tools/check_kernel_config new file mode 100755 index 0000000000..41a52d7117 --- /dev/null +++ b/tools/check_kernel_config @@ -0,0 +1,32 @@ +#!/bin/bash + +# SPDX-License-Identifier: GPL-2.0 +# Copyright (C) 2021-present Team LibreELEC (https://libreelec.tv) + +. config/options linux + +${SCRIPTS}/unpack linux + +if [ -f "${DISTRO_DIR}/${DISTRO}/kernel_options" ]; then + while read OPTION; do + [ -z "$OPTION" -o -n "$(echo "$OPTION" | grep '^#')" ] && continue + + if [ "${OPTION##*=}" == "m" ]; then + echo "[m] ${OPTION%%=*}" + $PKG_BUILD/scripts/config --file $PKG_KERNEL_CFG_FILE --module ${OPTION%%=*} + fi + + if [ "${OPTION##*=}" == "y" ]; then + echo "[y] ${OPTION%%=*}" + $PKG_BUILD/scripts/config --file $PKG_KERNEL_CFG_FILE --enable ${OPTION%%=*} + fi + + if [ "${OPTION##*=}" == "n" ]; then + echo "[n] ${OPTION%%=*}" + $PKG_BUILD/scripts/config --file $PKG_KERNEL_CFG_FILE --disable ${OPTION%%=*} + fi + + done < ${DISTRO_DIR}/${DISTRO}/kernel_options +else + echo "kernel options file doesn't exist: ${DISTRO_DIR}/${DISTRO}/kernel_options" +fi