all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Dualbooting with guixsd not handling grub installation
@ 2017-12-09 23:35 Martin Castillo
  2017-12-10  1:11 ` Jelle Licht
  0 siblings, 1 reply; 13+ messages in thread
From: Martin Castillo @ 2017-12-09 23:35 UTC (permalink / raw)
  To: guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 1489 bytes --]

Hi guixers,

I want to dualboot into GuixSD. My main os is currently NixOS.
Currently, I don't want to let guixsd control my grub setup. So my
situation is similar to [1].

One solution is to use the unreliable chainloading with blocklists by
invoking grub-install --force /dev/sda3 after every guix system
reconfigure config.scm. (The config.scm has sda3 as grub target.)

The second (and IMHO the right) solution I am aware of is adding the
following in the grub.cfg which is handled by nix:
   menuentry "GuixSD - Configloader" {
     configfile (hd0,gpt3)/boot/grub/grub.cfg
   }

This way, grub loads the newest grub config file created from GuixSD.
There is only a minor annoyance:
guix system reconfigure config.scm returns non-zero and spits out an
error (because grub-install wants --force to use blocklists). But it
succeeds in everything else, especially in creating a new
/boot/grub/grub.cfg.
The alternative (guix system reconfigure --no-bootloader config.scm)
doesn't update /boot/grub/grub.cfg.
I'd like to have a way to have /boot/grub/grub.cfg updated without
reinstalling grub on the disk/partition and without having a command
return non-zero.

This could be done by adding a cli argument for reconfigure or allowing
an empty string in (grub-configuration (target "")).

WDYT?

Martin Castillo


[1]: https://lists.gnu.org/archive/html/guix-devel/2014-12/msg00046.html
-- 
GPG: 7FDE 7190 2F73 2C50 236E  403D CC13 48F1 E644 08EC


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: Dualbooting with guixsd not handling grub installation
  2017-12-09 23:35 Dualbooting with guixsd not handling grub installation Martin Castillo
@ 2017-12-10  1:11 ` Jelle Licht
  2017-12-10 11:41   ` Mathieu Othacehe
  0 siblings, 1 reply; 13+ messages in thread
From: Jelle Licht @ 2017-12-10  1:11 UTC (permalink / raw)
  To: Martin Castillo; +Cc: guix-devel

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

2017-12-10 0:35 GMT+01:00 Martin Castillo <castilma@uni-bremen.de>:

> Hi guixers,
>
> I want to dualboot into GuixSD. My main os is currently NixOS.
> Currently, I don't want to let guixsd control my grub setup. So my
> situation is similar to [1].
>
> One solution is to use the unreliable chainloading with blocklists by
> invoking grub-install --force /dev/sda3 after every guix system
> reconfigure config.scm. (The config.scm has sda3 as grub target.)
>
> The second (and IMHO the right) solution I am aware of is adding the
> following in the grub.cfg which is handled by nix:
>    menuentry "GuixSD - Configloader" {
>      configfile (hd0,gpt3)/boot/grub/grub.cfg
>    }
>
> This way, grub loads the newest grub config file created from GuixSD.
> There is only a minor annoyance:
> guix system reconfigure config.scm returns non-zero and spits out an
> error (because grub-install wants --force to use blocklists). But it
> succeeds in everything else, especially in creating a new
> /boot/grub/grub.cfg.
> The alternative (guix system reconfigure --no-bootloader config.scm)
> doesn't update /boot/grub/grub.cfg.
> I'd like to have a way to have /boot/grub/grub.cfg updated without
> reinstalling grub on the disk/partition and without having a command
> return non-zero.
>
> This could be done by adding a cli argument for reconfigure or allowing
> an empty string in (grub-configuration (target "")).
>
> WDYT?
>
> Martin Castillo
>
>
> [1]: https://lists.gnu.org/archive/html/guix-devel/2014-12/msg00046.html
> --
> GPG: 7FDE 7190 2F73 2C50 236E  403D CC13 48F1 E644 08EC
>

This seems like a useful change. I am currently running into a similar issue
using GuixSD on a laptop /w libreboot, in a way similar to what is done at
[2].
Reading your email just now reminded me that living in mediocrity is
something that can be changed when you run only/mostly free software :-).

Maybe the orphaned patch at [3] can be ad{o,a}pted to address both of these
use-cases?

- Jelle

[2]: https://lists.gnu.org/archive/html/help-guix/2017-04/msg00083.html
[3]: https://lists.gnu.org/archive/html/guix-devel/2016-02/msg00116.html

[-- Attachment #2: Type: text/html, Size: 3147 bytes --]

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

* Re: Dualbooting with guixsd not handling grub installation
  2017-12-10  1:11 ` Jelle Licht
@ 2017-12-10 11:41   ` Mathieu Othacehe
  2017-12-11  9:39     ` Ludovic Courtès
  0 siblings, 1 reply; 13+ messages in thread
From: Mathieu Othacehe @ 2017-12-10 11:41 UTC (permalink / raw)
  To: Martin Castillo, Jelle Licht; +Cc: guix-devel


Hi Martin and Jelle,

>> This could be done by adding a cli argument for reconfigure or allowing
>> an empty string in (grub-configuration (target "")).
>>
>> WDYT?
>>

An already available option would be to override the grub-installer like
this :

--8<---------------cut here---------------start------------->8---
(define no-op-installer
  #~(lambda (bootloader device mount)
      (display "no op")))

(bootloader (bootloader
             (inherit grub-bootloader)
             (installer no-op-installer))
--8<---------------cut here---------------end--------------->8---

I admit this is not ideal, so I would propose two options :

* Allow for target field to be #f and do not call the installer when
this happends.
* Precise the --no-bootloader parameter of guix system to deal with
multiple cases, for example :

--bootloader=[default|no-config-file|no-install|...]

WDYT ?

Mathieu

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

* Re: Dualbooting with guixsd not handling grub installation
  2017-12-10 11:41   ` Mathieu Othacehe
@ 2017-12-11  9:39     ` Ludovic Courtès
  2017-12-14  2:27       ` Martin Castillo
  0 siblings, 1 reply; 13+ messages in thread
From: Ludovic Courtès @ 2017-12-11  9:39 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: guix-devel

Hello,

Mathieu Othacehe <m.othacehe@gmail.com> skribis:

>>> This could be done by adding a cli argument for reconfigure or allowing
>>> an empty string in (grub-configuration (target "")).
>>>
>>> WDYT?
>>>
>
> An already available option would be to override the grub-installer like
> this :
>
> (define no-op-installer
>   #~(lambda (bootloader device mount)
>       (display "no op")))
>
> (bootloader (bootloader
>              (inherit grub-bootloader)
>              (installer no-op-installer))

We could even define and document it as ‘no-bootloader’ or something
like that.

> I admit this is not ideal, so I would propose two options :
>
> * Allow for target field to be #f and do not call the installer when
> this happends.

Sounds reasonable.

> * Precise the --no-bootloader parameter of guix system to deal with
> multiple cases, for example :
>
> --bootloader=[default|no-config-file|no-install|...]
>
> WDYT ?

What would it do in the ‘no-config-file’ case?  Run ‘grub-install’ (or
similar) without regenerating ‘grub.cfg’?  Does that make sense?

Thanks,
Ludo’.

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

* Re: Dualbooting with guixsd not handling grub installation
  2017-12-11  9:39     ` Ludovic Courtès
@ 2017-12-14  2:27       ` Martin Castillo
  2017-12-15 14:53         ` Ludovic Courtès
  0 siblings, 1 reply; 13+ messages in thread
From: Martin Castillo @ 2017-12-14  2:27 UTC (permalink / raw)
  To: Ludovic Courtès, Mathieu Othacehe; +Cc: guix-devel

Hi

On 11.12.2017 10:39, Ludovic Courtès wrote:
> Hello,
> 
> Mathieu Othacehe <m.othacehe@gmail.com> skribis:
> 
>>>> This could be done by adding a cli argument for reconfigure or allowing
>>>> an empty string in (grub-configuration (target "")).
>>>>
>>>> WDYT?
>>>>
>>
>> An already available option would be to override the grub-installer like
>> this :
>>
>> (define no-op-installer
>>   #~(lambda (bootloader device mount)
>>       (display "no op")))
>>
>> (bootloader (bootloader
>>              (inherit grub-bootloader)
>>              (installer no-op-installer))
> 
> We could even define and document it as ‘no-bootloader’ or something
> like that.
> 
>> I admit this is not ideal, so I would propose two options :
>>
>> * Allow for target field to be #f and do not call the installer when
>> this happends.
> 
> Sounds reasonable.

+1

> 
>> * Precise the --no-bootloader parameter of guix system to deal with
>> multiple cases, for example :
>>
>> --bootloader=[default|no-config-file|no-install|...]
>>
>> WDYT ?
> 
> What would it do in the ‘no-config-file’ case?  Run ‘grub-install’ (or
> similar) without regenerating ‘grub.cfg’?  Does that make sense?

I realised a third option for dualbooting:
menuentry "GuixSD - grub core.img loader" {
  search --set root --label guix-root --hint hd0,gpt3
  multiboot /boot/grub/i386-pc/core.img
}

This loads the guixsd grub image from the filesystem instead of relying
on blocklists. If someone uses different bootloader for the main system
and for guixsd, where the later is multiboot compatible, this would be a
good way to do it. no-install should not forget to create core.img and
other files besides grub.cfg.
I think useful is 'default' (install new bootconfig or, if target is #f,
create it only), 'no-install' (like default with target == #f) and 'no'
(do nothing related to booting).

Martin

-- 
GPG: 7FDE 7190 2F73 2C50 236E  403D CC13 48F1 E644 08EC

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

* Re: Dualbooting with guixsd not handling grub installation
  2017-12-14  2:27       ` Martin Castillo
@ 2017-12-15 14:53         ` Ludovic Courtès
  2017-12-17 12:29           ` Oleg Pykhalov
  0 siblings, 1 reply; 13+ messages in thread
From: Ludovic Courtès @ 2017-12-15 14:53 UTC (permalink / raw)
  To: Martin Castillo; +Cc: guix-devel

Hello,

Martin Castillo <castilma@uni-bremen.de> skribis:

> I realised a third option for dualbooting:
> menuentry "GuixSD - grub core.img loader" {
>   search --set root --label guix-root --hint hd0,gpt3
>   multiboot /boot/grub/i386-pc/core.img
> }

Indeed, that should always work.

Note that if all you want is dual-boot, this should already be possible
by defining new menu entries in the GuixSD config:

  https://www.gnu.org/software/guix/manual/html_node/Bootloader-Configuration.html#index-dual-boot

HTH,
Ludo’.

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

* Re: Dualbooting with guixsd not handling grub installation
  2017-12-15 14:53         ` Ludovic Courtès
@ 2017-12-17 12:29           ` Oleg Pykhalov
  2017-12-18  9:21             ` Ludovic Courtès
  0 siblings, 1 reply; 13+ messages in thread
From: Oleg Pykhalov @ 2017-12-17 12:29 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

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

ludo@gnu.org (Ludovic Courtès) writes:

> Note that if all you want is dual-boot, this should already be possible
> by defining new menu entries in the GuixSD config:
>
>   https://www.gnu.org/software/guix/manual/html_node/Bootloader-Configuration.html#index-dual-boot

Are linux linux-arguments initrd in menu-entry required?

Maybe we could have configfile field?
https://www.gnu.org/software/grub/manual/grub/html_node/configfile.html

Oleg.

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

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

* Re: Dualbooting with guixsd not handling grub installation
  2017-12-17 12:29           ` Oleg Pykhalov
@ 2017-12-18  9:21             ` Ludovic Courtès
  2018-02-01  6:14               ` Oleg Pykhalov
  0 siblings, 1 reply; 13+ messages in thread
From: Ludovic Courtès @ 2017-12-18  9:21 UTC (permalink / raw)
  To: Oleg Pykhalov; +Cc: guix-devel

Oleg Pykhalov <go.wigust@gmail.com> skribis:

> ludo@gnu.org (Ludovic Courtès) writes:
>
>> Note that if all you want is dual-boot, this should already be possible
>> by defining new menu entries in the GuixSD config:
>>
>>   https://www.gnu.org/software/guix/manual/html_node/Bootloader-Configuration.html#index-dual-boot
>
> Are linux linux-arguments initrd in menu-entry required?

Currently yes: this is how you tell GRUB what to boot.

> Maybe we could have configfile field?
> https://www.gnu.org/software/grub/manual/grub/html_node/configfile.html

Yes, we could do that.  One question is how to integrated properly since
‘menu-entry’ is now bootloader-independent.  Perhaps Mathieu or Danny
have ideas?

Thanks,
Ludo’.

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

* Re: Dualbooting with guixsd not handling grub installation
  2017-12-18  9:21             ` Ludovic Courtès
@ 2018-02-01  6:14               ` Oleg Pykhalov
  2018-02-01  8:06                 ` Félicien Pillot
  2018-02-05 13:15                 ` Ludovic Courtès
  0 siblings, 2 replies; 13+ messages in thread
From: Oleg Pykhalov @ 2018-02-01  6:14 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 731 bytes --]

Hello Ludovic,

ludo@gnu.org (Ludovic Courtès) writes:

> Oleg Pykhalov <go.wigust@gmail.com> skribis:

[...]

>> Are linux linux-arguments initrd in menu-entry required?
>
> Currently yes: this is how you tell GRUB what to boot.

I see an issue with it, because not always you want them.

>> Maybe we could have configfile field?
>> https://www.gnu.org/software/grub/manual/grub/html_node/configfile.html
>
> Yes, we could do that.  One question is how to integrated properly since
> ‘menu-entry’ is now bootloader-independent.  Perhaps Mathieu or Danny
> have ideas?

We could start by adding a way to add anything.  Here is a patch.
Probably ugly, but as a draft and idea about additional-options.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: bootloader: Add additional-options to menu-entry. --]
[-- Type: text/x-patch, Size: 4241 bytes --]

From 7d7162a8ec78c84e7eba3ae9f7c4fbf07703617e Mon Sep 17 00:00:00 2001
From: Oleg Pykhalov <go.wigust@gmail.com>
Date: Thu, 1 Feb 2018 08:59:30 +0300
Subject: [PATCH] bootloader: Add additional-options to menu-entry.

* gnu/bootloader.scm (<menu-entry>)[additional-options]: New field.
* gnu/bootloader/grub.scm (grub-configuration-file): Handle this.
---
 gnu/bootloader.scm      | 19 +++++++++++--------
 gnu/bootloader/grub.scm | 27 +++++++++++++++++++--------
 2 files changed, 30 insertions(+), 16 deletions(-)

diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm
index 736f11952..9a3c29a88 100644
--- a/gnu/bootloader.scm
+++ b/gnu/bootloader.scm
@@ -31,6 +31,7 @@
             menu-entry-linux-arguments
             menu-entry-initrd
             menu-entry-device-mount-point
+            menu-entry-additional-options
 
             bootloader
             bootloader?
@@ -65,15 +66,17 @@
 (define-record-type* <menu-entry>
   menu-entry make-menu-entry
   menu-entry?
-  (label           menu-entry-label)
-  (device          menu-entry-device       ; file system uuid, label, or #f
-                   (default #f))
+  (label              menu-entry-label)
+  (device             menu-entry-device      ; file system uuid, label, or #f
+                      (default #f))
   (device-mount-point menu-entry-device-mount-point
-                   (default #f))
-  (linux           menu-entry-linux)
-  (linux-arguments menu-entry-linux-arguments
-                   (default '()))          ; list of string-valued gexps
-  (initrd          menu-entry-initrd))     ; file name of the initrd as a gexp
+                      (default #f))
+  (linux              menu-entry-linux)
+  (linux-arguments    menu-entry-linux-arguments
+                      (default '()))         ; list of string-valued gexps
+  (initrd             menu-entry-initrd)     ; file name of the initrd as a gexp
+  (additional-options menu-entry-additional-options
+                      (default '())))        ; list of string-valued gexps
 
 \f
 ;;;
diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm
index 96e53c5c2..7613c2a84 100644
--- a/gnu/bootloader/grub.scm
+++ b/gnu/bootloader/grub.scm
@@ -324,22 +324,33 @@ entries corresponding to old generations of the system."
           (label (menu-entry-label entry))
           (kernel (menu-entry-linux entry))
           (arguments (menu-entry-linux-arguments entry))
-          (initrd (menu-entry-initrd entry)))
+          (initrd (menu-entry-initrd entry))
+          (additional-options (menu-entry-additional-options entry)))
       ;; Here DEVICE is the store and DEVICE-MOUNT-POINT is its mount point.
       ;; Use the right file names for KERNEL and INITRD in case
       ;; DEVICE-MOUNT-POINT is not "/", meaning that the store is on a
       ;; separate partition.
-      (let ((kernel  (strip-mount-point device-mount-point kernel))
-            (initrd  (strip-mount-point device-mount-point initrd)))
-        #~(format port "menuentry ~s {
+      (if (and (file-append? kernel) (file-append? initrd))
+          (let ((kernel  (strip-mount-point device-mount-point kernel))
+                (initrd  (strip-mount-point device-mount-point initrd)))
+            #~(format port "menuentry ~s {
   ~a
   linux ~a ~a
   initrd ~a
+  ~a
+}~%"
+                      #$label
+                      #$(grub-root-search device kernel)
+                      #$kernel (string-join (list #$@arguments))
+                      #$initrd
+                      (string-join (list #$@additional-options) "\n")))
+          #~(format port "menuentry ~s {
+  ~a
+  ~a
 }~%"
-                  #$label
-                  #$(grub-root-search device kernel)
-                  #$kernel (string-join (list #$@arguments))
-                  #$initrd))))
+                    #$label
+                    #$(grub-root-search device kernel)
+                    (string-join (list #$@additional-options) "\n")))))
   (mlet %store-monad ((sugar (eye-candy config
                                         (menu-entry-device
                                          (first all-entries))
-- 
2.15.1


[-- Attachment #1.3: Type: text/plain, Size: 969 bytes --]


Which allows to use additional-options in menu-entry:
--8<---------------cut here---------------start------------->8---
(operating-system
…
 (bootloader
  (bootloader-configuration
   (bootloader grub-efi-bootloader)
   (target "/boot/efi")
   (menu-entries
    (list (menu-entry
           (label "Another distro")
           (linux "")
           (initrd "")
           (additional-options '("search --label --set another-disk-label"
                                 "configfile /boot/grub/grub.cfg")))))))
…)
--8<---------------cut here---------------end--------------->8---

Will produce the following Grub menuentry:
--8<---------------cut here---------------start------------->8---
menuentry "Another distro" {
  
  search --label --set another-disk-label
configfile /boot/grub/grub.cfg
}
--8<---------------cut here---------------end--------------->8---

I successfully reconfigured and dualbooted with attached patch.

Oleg.

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

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

* Re: Dualbooting with guixsd not handling grub installation
  2018-02-01  6:14               ` Oleg Pykhalov
@ 2018-02-01  8:06                 ` Félicien Pillot
  2018-02-02 22:34                   ` Oleg Pykhalov
  2018-02-05 13:15                 ` Ludovic Courtès
  1 sibling, 1 reply; 13+ messages in thread
From: Félicien Pillot @ 2018-02-01  8:06 UTC (permalink / raw)
  To: guix-devel

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

Hi Oleg,

Le Thu, 01 Feb 2018 09:14:54 +0300,
Oleg Pykhalov <go.wigust@gmail.com> a écrit :
> We could start by adding a way to add anything.  Here is a patch.
> Probably ugly, but as a draft and idea about additional-options.
> 

When I try your patch (to solve the dualboot problem I have too) I
get this error:

/etc/config.scm:17:10 : error: extraneous field initializers (additional-options)

Why me and not you?

--
Félicien Pillot
2C7C ACC0 FBDB ADBA E7BC 50D9 043C D143 6C87 9372
felicien@gnu.org - felicien.pillot@riseup.net

[-- Attachment #2: Signature digitale OpenPGP --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: Dualbooting with guixsd not handling grub installation
  2018-02-01  8:06                 ` Félicien Pillot
@ 2018-02-02 22:34                   ` Oleg Pykhalov
  0 siblings, 0 replies; 13+ messages in thread
From: Oleg Pykhalov @ 2018-02-02 22:34 UTC (permalink / raw)
  To: Félicien Pillot; +Cc: guix-devel

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

Hello Félicien,

Thank you for the report!

>>>>> "Félicien" == Félicien Pillot <felicien@gnu.org> writes:

    > Le Thu, 01 Feb 2018 09:14:54 +0300, Oleg Pykhalov
    > <go.wigust@gmail.com> a écrit :
    >> We could start by adding a way to add anything.  Here is a patch.
    >> Probably ugly, but as a draft and idea about additional-options.

    > When I try your patch (to solve the dualboot problem I have too) I
    > get this error:

    > /etc/config.scm:17:10 : error: extraneous field initializers
    > (additional-options)

What will “sudo guix --version” say?

Please, show a “(bootloader …)” record field from your config.scm.

    > Why me and not you?

:-)

Oleg.

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

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

* Re: Dualbooting with guixsd not handling grub installation
  2018-02-01  6:14               ` Oleg Pykhalov
  2018-02-01  8:06                 ` Félicien Pillot
@ 2018-02-05 13:15                 ` Ludovic Courtès
  2018-02-06 12:25                   ` Oleg Pykhalov
  1 sibling, 1 reply; 13+ messages in thread
From: Ludovic Courtès @ 2018-02-05 13:15 UTC (permalink / raw)
  To: Oleg Pykhalov; +Cc: guix-devel

Hi,

Oleg Pykhalov <go.wigust@gmail.com> skribis:

> ludo@gnu.org (Ludovic Courtès) writes:
>
>> Oleg Pykhalov <go.wigust@gmail.com> skribis:
>
> [...]
>
>>> Are linux linux-arguments initrd in menu-entry required?
>>
>> Currently yes: this is how you tell GRUB what to boot.
>
> I see an issue with it, because not always you want them.
>
>>> Maybe we could have configfile field?
>>> https://www.gnu.org/software/grub/manual/grub/html_node/configfile.html
>>
>> Yes, we could do that.  One question is how to integrated properly since
>> ‘menu-entry’ is now bootloader-independent.  Perhaps Mathieu or Danny
>> have ideas?
>
> We could start by adding a way to add anything.  Here is a patch.
> Probably ugly, but as a draft and idea about additional-options.
>
> From 7d7162a8ec78c84e7eba3ae9f7c4fbf07703617e Mon Sep 17 00:00:00 2001
> From: Oleg Pykhalov <go.wigust@gmail.com>
> Date: Thu, 1 Feb 2018 08:59:30 +0300
> Subject: [PATCH] bootloader: Add additional-options to menu-entry.
>
> * gnu/bootloader.scm (<menu-entry>)[additional-options]: New field.
> * gnu/bootloader/grub.scm (grub-configuration-file): Handle this.

[...]

> Which allows to use additional-options in menu-entry:
> 
> (operating-system
> …
>  (bootloader
>   (bootloader-configuration
>    (bootloader grub-efi-bootloader)
>    (target "/boot/efi")
>    (menu-entries
>     (list (menu-entry
>            (label "Another distro")
>            (linux "")
>            (initrd "")
>            (additional-options '("search --label --set another-disk-label"
>                                  "configfile /boot/grub/grub.cfg")))))))
> …)

I think we should keep ‘menu-entry’ bootloader-independent.  I’m
actually not sure what problem we’re trying to solve: is it that the
‘root’ variable in GRUB gets set to the wrong partition when you try to
dual-boot?

In that case, perhaps a solution would be to add a ‘root’ field to
<menu-entry>, that could default to 'auto to obtain the current
behavior?

Ludo’.

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

* Re: Dualbooting with guixsd not handling grub installation
  2018-02-05 13:15                 ` Ludovic Courtès
@ 2018-02-06 12:25                   ` Oleg Pykhalov
  0 siblings, 0 replies; 13+ messages in thread
From: Oleg Pykhalov @ 2018-02-06 12:25 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

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

ludo@gnu.org (Ludovic Courtès) writes:
 
  > I think we should keep ‘menu-entry’ bootloader-independent.

What does mean “independent”?  Do you mean that it's working only for
Grub now?  I guess others bootloaders could have this if they need to
generate a configuration file like “/boot/grub/grub.cfg”.

  > I’m actually not sure what problem we’re trying to solve: is it that
  > the ‘root’ variable in GRUB gets set to the wrong partition when you
  > try to dual-boot?

The problem is I cannot get a Grub “menu-entry” in “/boot/grub/grub.cfg”
which should look like:
--8<---------------cut here---------------start------------->8---
menuentry "Another distro" {
  search --label --set another-disk-label
  configfile /boot/grub/grub.cfg
}
--8<---------------cut here---------------end--------------->8---

Also “linux” and “initrd” fields of “menu-entry” are required to be
defined which prevents from generating the snippet above.

Thoughts?

Oleg.

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

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

end of thread, other threads:[~2018-02-06 12:25 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-09 23:35 Dualbooting with guixsd not handling grub installation Martin Castillo
2017-12-10  1:11 ` Jelle Licht
2017-12-10 11:41   ` Mathieu Othacehe
2017-12-11  9:39     ` Ludovic Courtès
2017-12-14  2:27       ` Martin Castillo
2017-12-15 14:53         ` Ludovic Courtès
2017-12-17 12:29           ` Oleg Pykhalov
2017-12-18  9:21             ` Ludovic Courtès
2018-02-01  6:14               ` Oleg Pykhalov
2018-02-01  8:06                 ` Félicien Pillot
2018-02-02 22:34                   ` Oleg Pykhalov
2018-02-05 13:15                 ` Ludovic Courtès
2018-02-06 12:25                   ` Oleg Pykhalov

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.