(name . Ricardo Wurmus)(address . ricardo.wurmus@mdc-berlin.de)
Mark H Weaver <mhw@netris.org> writes:
Toggle quote (9 lines)
> Hi Ricardo,
>
> Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> writes:
>> Okay, I’ve added “--target=i386-pc” to the list of arguments.
>
> This change breaks my mips64el-linux GuixSD system, which is supported
> by GRUB, but where "--target=i386-pc" is obviously not appropriate. On
> my system I need a different 'target' setting.
Maybe we can make it conditional on EFI for now. Ricardo, are you able
to test the attached patch? I suspect we might get problems on POWER
and some ARM systems down the road, but it should at least fix this
immediate issue.
Note: I haven't tested this patch myself.
From ce5d6089aff0cf6c31260ac2bbe0aeb2803eb8a0 Mon Sep 17 00:00:00 2001
From: Marius Bakke <mbakke@fastmail.com>
Date: Tue, 20 Feb 2018 04:02:23 +0100
Subject: [PATCH] gnu: Pass "--target" to EFI-less GRUB only when EFI variables
are present.
Fixes https://bugs.gnu.org/30311.
* gnu/bootloader/grub.scm (install-grub): Make "--target" argument
conditional on the presence of "/sys/firmware/efi".
---
gnu/bootloader/grub.scm | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
Toggle diff (21 lines)
diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm
index 3b01125c7..2b8458161 100644
--- a/gnu/bootloader/grub.scm
+++ b/gnu/bootloader/grub.scm
@@ -386,8 +386,13 @@ submenu \"GNU system, old configurations...\" {~%")
;; root partition.
(setenv "GRUB_ENABLE_CRYPTODISK" "y")
- (unless (zero? (system* grub "--no-floppy" "--target=i386-pc"
+ (unless (zero? (system* grub "--no-floppy"
"--boot-directory" install-dir
+ ;; Explicitly pass target if the non-EFI
+ ;; GRUB is requested on an EFI system.
+ ;; See <https://bugs.gnu.org/30311>.
+ ,@(if (file-exists? "/sys/firmware/efi")
+ "--target=i386-pc")
device))
(error "failed to install GRUB (BIOS)")))))
--
2.16.2
-----BEGIN PGP SIGNATURE-----
iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAlqLlFUACgkQoqBt8qM6
VPr4tgf/USpnc+DLJxUw12BYHs8BJhh3hX7I37pcNa+w8+wm1oD7WjjpJ6MGV5vB
pp2J3l21xlvss9gkOraxtzw4UA15D2KvfyB76E2y4e6ez5QA3xr9/d0Ske0guqQd
pu2Kdr0nEP7o5uLIU3Hyzu+G3wNUZQpipMJ8Q3UxaQU6jeFiGlJo8A+Mf9mi7/U4
oKgqFQk3rBFHQNnH53cuMNLkQ/9HTlt7Wk5liUIPWalwdgq75g9eWW6/QGCYRtoK
tkVn8qy4tV6ANXTtCmLWvGG+HmVe312Uf6mB8a9m6x1DSmVK9+O4sn6pflrWgb6X
Fxh5kMabo3I1EJRv08tzkBHZRg63ow==
=ozrx
-----END PGP SIGNATURE-----