From fa4b3a6b1ecb03f49f8d53cc7e2ced0ce2df49dc Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sun, 30 Dec 2018 14:20:51 +0000 Subject: [PATCH] kernel: configure: Pass arch as an extra argument Signed-off-by: Michael Tremer --- kernel/README.md | 12 +++++------- kernel/scripts/configure | 25 ++++++++++--------------- 2 files changed, 15 insertions(+), 22 deletions(-) diff --git a/kernel/README.md b/kernel/README.md index 26a3f79a7..90083aaa4 100644 --- a/kernel/README.md +++ b/kernel/README.md @@ -17,7 +17,8 @@ the kernel directory: # pakfire-builder shell kernel.nm (pakfire-shell)> cd /usr/src/packages/kernel-x.y.z... -The following commands are available: +The following commands are available. Appending the argument allows you +to edit a specific architecture. Default is x86_64. #### oldconfig @@ -25,7 +26,7 @@ You can run this when updating the kernel to a new release or after changing any options manually. All unset or updated options will be prompted for and all configuration files for all architectures will be updated. - (pakfire-shell)> scripts/configure oldconfig + (pakfire-shell)> scripts/configure oldconfig #### olddefconfig @@ -39,13 +40,10 @@ If you want to edit the configuration using the kernel's config editor. All configuration files will be updated afterwards and potentially prompted for options that diverge for different architectures. - (pakfire-shell)> scripts/configure menuconfig - -Appending the --arch= argument allows you to edit a specific architecture. -Default is x86_64. + (pakfire-shell)> scripts/configure menuconfig #### listnewconfig This will list all unset options. - (pakfire-shell)> scripts/configure listnewconfig + (pakfire-shell)> scripts/configure listnewconfig diff --git a/kernel/scripts/configure b/kernel/scripts/configure index 2d45dd16e..b2c1fa371 100755 --- a/kernel/scripts/configure +++ b/kernel/scripts/configure @@ -164,8 +164,13 @@ function merge_config() { # This function runs an interactive "make oldconfig". function make_config() { - local arch="${1}" - shift + local action="${1}" + local arch="${2}" + + # Default to x86_64 when no arch is given + if [ -z "${arch}" ]; then + arch="x86_64" + fi # Detect kernel arch local kernel_arch="$(get_kernel_arch "${arch}")" @@ -182,7 +187,7 @@ function make_config() { cat ${config_in} > .config echo "You may now edit the configuration..." - make ARCH=${kernel_arch} "$@" + make ARCH=${kernel_arch} "${action}" cat .config > ${config_out} popd @@ -296,7 +301,6 @@ function diff_configs() { rm -rf ${tmpdir} } -ARCH="x86_64" KERNEL_DIR="$(search_kernel_dir)" # Parse commandline. @@ -313,16 +317,7 @@ while [ $# -gt 0 ]; do ;; listnewconfig|menuconfig|merge|oldconfig|olddefconfig) action=${arg} - ;; - - # Parse switches - --arch=*) - ARCH="${arg#*=}" - - if ! get_platform "${ARCH}" &>/dev/null; then - echo "Unknown architecture: ${ARCH}" >&2 - exit 2 - fi + break ;; esac done @@ -343,7 +338,7 @@ case "${action}" in exit $? ;; listnewconfig|menuconfig|oldconfig|olddefconfig) - make_config "${ARCH}" "${action}" + make_config "${action}" "$@" exit $? ;; esac -- 2.39.2