]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
kernel: configure: Allow passing --arch= to edit a certain configuration
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 30 Dec 2018 00:06:39 +0000 (00:06 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 30 Dec 2018 00:06:39 +0000 (00:06 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
kernel/README.md
kernel/scripts/configure

index 5c629f8246c2da7131b2220db413a529e2246a0b..26a3f79a7a90475e0e430a9437dff2a109c3bd1e 100644 (file)
@@ -35,13 +35,15 @@ Like oldconfig, but automatically answers all options with the default value.
 
 #### menuconfig
 
-If you want to edit the configuration using the kernel's config editor, you can
-do it for the main architecture (which is x86_64 right now). All other configuration
-files will be updated afterwards and potentially prompted for options that diverge
-for other architectures.
+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.
+
 #### listnewconfig
 
 This will list all unset options.
index c06a0b4d528306ecabf9fdf9f59bb9b236839695..2d45dd16edd72824e9aeee9c71aa72068a9125eb 100755 (executable)
@@ -164,8 +164,11 @@ function merge_config() {
 
 # This function runs an interactive "make oldconfig".
 function make_config() {
-       local arch="x86_64"
-       local kernel_arch="x86"
+       local arch="${1}"
+       shift
+
+       # Detect kernel arch
+       local kernel_arch="$(get_kernel_arch "${arch}")"
        local flavour="default"
 
        local config_in=$(mktemp)
@@ -293,6 +296,7 @@ function diff_configs() {
        rm -rf ${tmpdir}
 }
 
+ARCH="x86_64"
 KERNEL_DIR="$(search_kernel_dir)"
 
 # Parse commandline.
@@ -309,7 +313,16 @@ while [ $# -gt 0 ]; do
                        ;;
                listnewconfig|menuconfig|merge|oldconfig|olddefconfig)
                        action=${arg}
-                       break
+                       ;;
+
+               # Parse switches
+               --arch=*)
+                       ARCH="${arg#*=}"
+
+                       if ! get_platform "${ARCH}" &>/dev/null; then
+                               echo "Unknown architecture: ${ARCH}" >&2
+                               exit 2
+                       fi
                        ;;
        esac
 done
@@ -330,7 +343,7 @@ case "${action}" in
                exit $?
                ;;
        listnewconfig|menuconfig|oldconfig|olddefconfig)
-               make_config "${action}"
+               make_config "${ARCH}" "${action}"
                exit $?
                ;;
 esac