]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(dracut.sh): use DRACUT_ARCH instead of `uname -m`
authorAntonio Alvarez Feijoo <antonio.feijoo@suse.com>
Wed, 30 Nov 2022 10:20:29 +0000 (11:20 +0100)
committerJóhann B. Guðmundsson <johannbg@gmail.com>
Sat, 3 Dec 2022 11:33:50 +0000 (11:33 +0000)
DRACUT_ARCH overrides `uname -m` since
https://github.com/dracutdevs/dracut/commit/a0120420

dracut.sh

index 5b10b5a6ecf526cc3d200f98c456038ec162fe8a..0381985e0920a9a1aece3fcdaeb3f337a684b4a9 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -1434,7 +1434,7 @@ if [[ ! $print_cmdline ]]; then
         fi
         unset EFI_MACHINE_TYPE_NAME
         EFI_SECTION_VMA_INITRD=0x3000000
-        case $(uname -m) in
+        case "${DRACUT_ARCH:-$(uname -m)}" in
             x86_64)
                 EFI_MACHINE_TYPE_NAME=x64
                 ;;
@@ -1447,7 +1447,7 @@ if [[ ! $print_cmdline ]]; then
                 EFI_SECTION_VMA_INITRD=0x4000000
                 ;;
             *)
-                dfatal "Architecture '$(uname -m)' not supported to create a UEFI executable"
+                dfatal "Architecture '${DRACUT_ARCH:-$(uname -m)}' not supported to create a UEFI executable"
                 exit 1
                 ;;
         esac
@@ -1494,7 +1494,7 @@ if [[ $early_microcode == yes ]]; then
             && unset early_microcode
     fi
     # Do not complain on non-x86 architectures as it makes no sense
-    case $(uname -m) in
+    case "${DRACUT_ARCH:-$(uname -m)}" in
         x86_64 | i?86)
             [[ $early_microcode != yes ]] \
                 && dwarn "Disabling early microcode, because kernel does not support it. CONFIG_MICROCODE_[AMD|INTEL]!=y"