patches and low-level development discussion
 help / color / mirror / code / Atom feed
* [PATCH v2] EFI Loader: use correct arch suffix
@ 2022-09-29 10:32 Ivan Nikolaenko
  2022-09-29 12:24 ` Alyssa Ross
  0 siblings, 1 reply; 3+ messages in thread
From: Ivan Nikolaenko @ 2022-09-29 10:32 UTC (permalink / raw)
  To: devel; +Cc: Ivan Nikolaenko

Previously there were hardcoded "x64" in EFI loaders' filenames.

Signed-off-by: Ivan Nikolaenko <ivan.nikolaenko@unikie.com>
---
 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



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] EFI Loader: use correct arch suffix
  2022-09-29 10:32 [PATCH v2] EFI Loader: use correct arch suffix Ivan Nikolaenko
@ 2022-09-29 12:24 ` Alyssa Ross
  2022-09-29 12:37   ` Alyssa Ross
  0 siblings, 1 reply; 3+ messages in thread
From: Alyssa Ross @ 2022-09-29 12:24 UTC (permalink / raw)
  To: Ivan Nikolaenko, devel; +Cc: Ivan Nikolaenko

This patch has been committed as 5c4f0da3ca58dfc33dc5f8da79cc1c80ef8cc15a,
which can be viewed online at
https://spectrum-os.org/git/spectrum/commit/?id=5c4f0da3ca58dfc33dc5f8da79cc1c80ef8cc15a.

This is an automated message.  Send comments/questions/requests to:
Alyssa Ross <hi@alyssa.is>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] EFI Loader: use correct arch suffix
  2022-09-29 12:24 ` Alyssa Ross
@ 2022-09-29 12:37   ` Alyssa Ross
  0 siblings, 0 replies; 3+ messages in thread
From: Alyssa Ross @ 2022-09-29 12:37 UTC (permalink / raw)
  To: Ivan Nikolaenko; +Cc: devel

[-- Attachment #1: Type: text/plain, Size: 309 bytes --]

> This patch has been committed as 5c4f0da3ca58dfc33dc5f8da79cc1c80ef8cc15a,
> which can be viewed online at
> https://spectrum-os.org/git/spectrum/commit/?id=5c4f0da3ca58dfc33dc5f8da79cc1c80ef8cc15a.

I applied this with one very small change, which was to add a Unikie
copyright in img/combined/default.nix

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-09-29 12:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-29 10:32 [PATCH v2] EFI Loader: use correct arch suffix Ivan Nikolaenko
2022-09-29 12:24 ` Alyssa Ross
2022-09-29 12:37   ` Alyssa Ross

Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/crosvm
	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/nixpkgs
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock
	https://spectrum-os.org/git/www

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).