From: Michael Tremer Date: Sat, 29 Dec 2018 11:32:54 +0000 (+0000) Subject: kernel: Automatically detect kernel source X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a91f6da9a8378b247407970e29ad2bbce3d09064;p=ipfire-3.x.git kernel: Automatically detect kernel source This was a bit useless to make this a parameter because the script can just automatically detect this... Signed-off-by: Michael Tremer --- diff --git a/kernel/scripts/configure b/kernel/scripts/configure index 11954c8f4..b339909b8 100755 --- a/kernel/scripts/configure +++ b/kernel/scripts/configure @@ -22,6 +22,16 @@ SUBPLATFORMS=( [arm]="arm64 arm32" ) +search_kernel_dir() { + local dir + for dir in /builddir/source/linux-*; do + if [ -d "${dir}" ]; then + echo "${dir}" + break + fi + done +} + function get_platform() { local arch="${1}" @@ -296,22 +306,17 @@ function diff_configs() { rm -rf ${tmpdir} } -KERNEL_DIR= +KERNEL_DIR="$(search_kernel_dir)" # Parse commandline. while [ $# -gt 0 ]; do arg=${1}; shift case "${arg}" in - --kernel-dir=*) - KERNEL_DIR=${arg#--kernel-dir=} - ;; help|"") echo "${0} - available commands:" echo " * merge " echo " * update ..." echo " * oldconfig" - echo "" - echo " You must always set --kernel-dir=..." exit 0 ;; merge|oldconfig|update) @@ -322,7 +327,7 @@ while [ $# -gt 0 ]; do done if [ -z "${KERNEL_DIR}" ]; then - echo >&2 "--kernel-dir=... was not set!" + echo >&2 "KERNEL_DIR was not set!" exit 2 fi