From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on atuin.qyliss.net X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.6 Received: from atuin.qyliss.net (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id 5152981213; Thu, 29 Sep 2022 10:32:44 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 496) id 55FB181180; Thu, 29 Sep 2022 10:32:41 +0000 (UTC) Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by atuin.qyliss.net (Postfix) with ESMTPS id D5391810FA for ; Thu, 29 Sep 2022 10:32:38 +0000 (UTC) Received: by mail-lj1-x22c.google.com with SMTP id c7so1027858ljm.12 for ; Thu, 29 Sep 2022 03:32:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unikie.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=nmPK+W1Z73vEHbuRBMTSZ+jPgRp5kEs/1pBoy68rqxY=; b=FW95/ntSIqpPEshSVtXSsIWxDMxzBrxV3/10UYQl/roX0EAETdEI/jxiZk8+psHfks bcUqc3FZblWhMHfMzsUgikQP2lHnLAVR2/pC9Gi8A27b1JSACjfSz2UMz99dmiTzyp+H 7GXGZ3dflnxip+7G8DT63/CXvX3Fs9oYGfUST/mXe++9sBpcdJvxlJSIt6hCpmUsHE21 xChi9r8xooSubyfnl8sMCyYvKvwQGD8Q/KoDwVHGjKN6QB/lnHGgtGF+d77Jq1UQqnSs 6p9cvaV6/i7jJmu2kOr8aM2s1b6ApppoDUYkXy+TEkfUUdvWCnSILevT65wjxZ/DFpqU TS9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=nmPK+W1Z73vEHbuRBMTSZ+jPgRp5kEs/1pBoy68rqxY=; b=zO6MJ5WpvepQwl/1wHgeh06yPCAEzHMhiZRWPlqqeCNLWZjS4Mm+W4zvec9IbmksHa rCG2H4IYsR8yAGDEiyJM+6nSyTFx/ANqTrZYj5XZifEe+4cj3mk01au86kcE0jGPQHX+ CGkIgZjJe9e9aHgd0W59uuCE6GbHhKZPCtWOSUgoOlnITXdIbmd2EuN7wr+F7gKiqWQ0 hhCm1fijlwbdhvxLePU9T44xHxLZSwxpgkutPwf6k7SMw9p1kK6aN75IHFs/vkQkKtGz qd9HUnhMVIdgVXC5Mjhq7KyWp+yfQvDvO6mbQtqS7S/LlOAhsLvHw2DCpbIUDBK7nwew E24g== X-Gm-Message-State: ACrzQf2hWWoKPI9lwMKr/ghxPP4VaXspOvsPL6c71Y+M+S6lZQieafHQ Z2PWS1juoVpOc7JJITZbTkiX1dNCmiCi/CtT X-Google-Smtp-Source: AMsMyM6uTS3trWZF4Xv2Yq6V2isrotuiIQYG8noNfCbH4oWPTa8MT6QGgEyoveubhIMbcboYx7yM0Q== X-Received: by 2002:a2e:b016:0:b0:26b:f00b:a8cf with SMTP id y22-20020a2eb016000000b0026bf00ba8cfmr879752ljk.24.1664447557656; Thu, 29 Sep 2022 03:32:37 -0700 (PDT) Received: from localhost.localdomain ([109.204.204.138]) by smtp.gmail.com with ESMTPSA id s2-20020a056512214200b00498fc3d4d15sm746587lfr.190.2022.09.29.03.32.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Sep 2022 03:32:37 -0700 (PDT) From: Ivan Nikolaenko To: devel@spectrum-os.org Subject: [PATCH v2] EFI Loader: use correct arch suffix Date: Thu, 29 Sep 2022 13:32:34 +0300 Message-Id: <20220929103234.2460828-1-ivan.nikolaenko@unikie.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: RBG6XBVFHUXIPA5224Q6SOII7MGVYUVS X-Message-ID-Hash: RBG6XBVFHUXIPA5224Q6SOII7MGVYUVS X-MailFrom: ivan.nikolaenko@unikie.com X-Mailman-Rule-Hits: header-match-devel.spectrum-os.org-0 X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1 CC: Ivan Nikolaenko X-Mailman-Version: 3.3.5 Precedence: list List-Id: Patches and low-level development discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Previously there were hardcoded "x64" in EFI loaders' filenames. Signed-off-by: Ivan Nikolaenko --- img/combined/default.nix | 8 +++++--- img/live/Makefile | 2 +- img/live/default.nix | 6 ++++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/img/combined/default.nix b/img/combined/default.nix index 3989d55..f65f619 100644 --- a/img/combined/default.nix +++ b/img/combined/default.nix @@ -6,7 +6,7 @@ let inherit (builtins) storeDir; - inherit (pkgs.lib) removePrefix; + inherit (pkgs.lib) removePrefix toUpper; eosimages = import ./eosimages.nix { inherit config; }; @@ -31,6 +31,8 @@ let --owner 0 --group 0 | tar2sqfs $out ''; + efiArch = stdenv.hostPlatform.efiArch; + grub = grub2_efi; grubCfg = substituteAll { @@ -74,8 +76,8 @@ let done mcopy -i $out ${grub}/share/grub/unicode.pf2 ::/grub/fonts - grub-mkimage -o grubx64.efi -p "(hd0,gpt1)/grub" -O ${grub.grubTarget} part_gpt fat - mcopy -i $out grubx64.efi ::/EFI/BOOT/BOOTX64.EFI + grub-mkimage -o grub${efiArch}.efi -p "(hd0,gpt1)/grub" -O ${grub.grubTarget} part_gpt fat + mcopy -i $out grub${efiArch}.efi ::/EFI/BOOT/BOOT${toUpper efiArch}.EFI fsck.vfat -n $out ''; diff --git a/img/live/Makefile b/img/live/Makefile index 9815c88..e63c598 100644 --- a/img/live/Makefile +++ b/img/live/Makefile @@ -36,7 +36,7 @@ build/boot.fat: $(KERNEL) $(INITRAMFS) $(SYSTEMD_BOOT_EFI) build/spectrum.conf $(MCOPY) -i $@ build/spectrum.conf ::/loader/entries $(MCOPY) -i $@ $(KERNEL) ::/spectrum/linux $(MCOPY) -i $@ $(INITRAMFS) ::/spectrum/initrd - $(MCOPY) -i $@ $(SYSTEMD_BOOT_EFI) ::/EFI/BOOT/BOOTX64.EFI + $(MCOPY) -i $@ $(SYSTEMD_BOOT_EFI) ::/EFI/BOOT/$(EFINAME) # veritysetup format produces two files, but Make only (portably) # supports one output per rule, so we combine the two outputs then diff --git a/img/live/default.nix b/img/live/default.nix index 1fa8da3..4301ccc 100644 --- a/img/live/default.nix +++ b/img/live/default.nix @@ -9,7 +9,7 @@ let inherit (config) pkgs; - inherit (pkgs.lib) cleanSource cleanSourceWith hasSuffix; + inherit (pkgs.lib) cleanSource cleanSourceWith hasSuffix toUpper; extfs = pkgs.pkgsStatic.callPackage ../../host/initramfs/extfs.nix { inherit config; @@ -17,6 +17,7 @@ let rootfs = import ../../host/rootfs { inherit config; }; scripts = import ../../scripts { inherit config; }; initramfs = import ../../host/initramfs { inherit config rootfs; }; + efiArch = stdenv.hostPlatform.efiArch; in stdenvNoCC.mkDerivation { @@ -35,7 +36,8 @@ stdenvNoCC.mkDerivation { INITRAMFS = initramfs; KERNEL = "${rootfs.kernel}/${stdenv.hostPlatform.linux-kernel.target}"; ROOT_FS = rootfs; - SYSTEMD_BOOT_EFI = "${systemd}/lib/systemd/boot/efi/systemd-bootx64.efi"; + SYSTEMD_BOOT_EFI = "${systemd}/lib/systemd/boot/efi/systemd-boot${efiArch}.efi"; + EFINAME = "BOOT${toUpper efiArch}.EFI"; buildFlags = [ "build/live.img" ]; makeFlags = [ "SCRIPTS=${scripts}" ]; -- 2.25.1