unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#20067: fix interpretation of grub configuration
@ 2015-03-09 20:34 Tomáš Čech
  2016-02-23 13:45 ` Ludovic Courtès
  0 siblings, 1 reply; 5+ messages in thread
From: Tomáš Čech @ 2015-03-09 20:34 UTC (permalink / raw)
  To: 20067

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

Grub configuration interpretes `linux' as directory where is located
bzImage. If I enter file name instead, result configuration will be
wrong.


Example of system configuration:
(bootloader (grub-configuration
	      (device "/dev/sda")
	      (menu-entries
	       (list
		(menu-entry
		 (label "Gentoo")
		 (linux "/vmlinuz-gentoo") ; vmlinuz-gentoo is file
		 (linux-arguments (list
				   "root=/dev/venom/gentoo"
				   "init=/usr/lib/systemd/systemd"))
		 (initrd "/initramfs-gentoo")
		 )))))



Result part of grub.cfg:
menuentry "Gentoo" {
  # Set 'root' to the partition that contains the kernel.
  search --file --set /vmlinuz-gentoo/bzImage


  linux /vmlinuz-gentoo/bzImage root=/dev/venom/gentoo init=/usr/lib/systemd/systemd
  initrd /initramfs-gentoo
}



It would be nice if the the string would be simply copied into
grub.cfg, so I could use even `(hd0,msdos1)/vmlinuz'.

[-- Attachment #2: Type: application/pgp-signature, Size: 181 bytes --]

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

* bug#20067: fix interpretation of grub configuration
  2015-03-09 20:34 bug#20067: fix interpretation of grub configuration Tomáš Čech
@ 2016-02-23 13:45 ` Ludovic Courtès
  2016-09-09 22:03   ` Ludovic Courtès
  0 siblings, 1 reply; 5+ messages in thread
From: Ludovic Courtès @ 2016-02-23 13:45 UTC (permalink / raw)
  To: 20067

Tomáš Čech <sleep_walker@suse.cz> skribis:

> Grub configuration interpretes `linux' as directory where is located
> bzImage. If I enter file name instead, result configuration will be
> wrong.

The solution will be to not automatically append “/bzImage” (and
likewise for the initrd.)

We could change places where ‘menu-entry’ is instantiated to:

  #~(string-append #$kernel "/bzImage")

However, there’s the problem that the image name appears in the
‘parameters’ file of the system (as seen in the output of ‘guix system
build foo.scm’), where it is unevaluated.  If we use ‘string-append’ as
above, a raw (string-append …) sexp will appear in there, which is not
nice.

To address this, an idea is to add “expanders” for gexps: gexps already
have “compilers”, and expanders would be similar except that they would
produce something possibly different from just the derivation’s output
file name.  For instance, we could write:

  (file-append kernel "/bzImage")

and that would expand directly to:

  "/gnu/store/…/bzImage"

Ludo’.

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

* bug#20067: fix interpretation of grub configuration
  2016-02-23 13:45 ` Ludovic Courtès
@ 2016-09-09 22:03   ` Ludovic Courtès
  2016-09-14 16:16     ` Tomáš Čech
  0 siblings, 1 reply; 5+ messages in thread
From: Ludovic Courtès @ 2016-09-09 22:03 UTC (permalink / raw)
  To: 20067

Good news!

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

> Tomáš Čech <sleep_walker@suse.cz> skribis:
>
>> Grub configuration interpretes `linux' as directory where is located
>> bzImage. If I enter file name instead, result configuration will be
>> wrong.
>
> The solution will be to not automatically append “/bzImage” (and
> likewise for the initrd.)
>
> We could change places where ‘menu-entry’ is instantiated to:
>
>   #~(string-append #$kernel "/bzImage")
>
> However, there’s the problem that the image name appears in the
> ‘parameters’ file of the system (as seen in the output of ‘guix system
> build foo.scm’), where it is unevaluated.  If we use ‘string-append’ as
> above, a raw (string-append …) sexp will appear in there, which is not
> nice.
>
> To address this, an idea is to add “expanders” for gexps: gexps already
> have “compilers”, and expanders would be similar except that they would
> produce something possibly different from just the derivation’s output
> file name.  For instance, we could write:
>
>   (file-append kernel "/bzImage")
>
> and that would expand directly to:
>
>   "/gnu/store/…/bzImage"

AFAICS this is finally fixed!

  expanders in commit ebdfd776f4504c456d383ee8afa59fc6fdfc6756
  ‘file-append’ in commit a9e5e92f940381e3a4ee828c6d8ff22a73067e17
  kernel file name in commit 44d5f54e31039d78f156bd9562dca293124eaa76

Please let me know how it goes!  In particular, does it work for the
dual-boot scenario you were interested in?

Thanks,
Ludo’.

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

* bug#20067: fix interpretation of grub configuration
  2016-09-09 22:03   ` Ludovic Courtès
@ 2016-09-14 16:16     ` Tomáš Čech
  2016-09-25 15:56       ` Ludovic Courtès
  0 siblings, 1 reply; 5+ messages in thread
From: Tomáš Čech @ 2016-09-14 16:16 UTC (permalink / raw)
  To: 20067

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

On Sat, Sep 10, 2016 at 12:03:38AM +0200, Ludovic Courtès wrote:
>Good news!

Good news indeed!

>
>ludo@gnu.org (Ludovic Courtès) skribis:
>
>> Tomáš Čech <sleep_walker@suse.cz> skribis:
>>
>>> Grub configuration interpretes `linux' as directory where is located
>>> bzImage. If I enter file name instead, result configuration will be
>>> wrong.
>>
>> The solution will be to not automatically append “/bzImage” (and
>> likewise for the initrd.)
>>
>> We could change places where ‘menu-entry’ is instantiated to:
>>
>>   #~(string-append #$kernel "/bzImage")
>>
>> However, there’s the problem that the image name appears in the
>> ‘parameters’ file of the system (as seen in the output of ‘guix system
>> build foo.scm’), where it is unevaluated.  If we use ‘string-append’ as
>> above, a raw (string-append …) sexp will appear in there, which is not
>> nice.
>>
>> To address this, an idea is to add “expanders” for gexps: gexps already
>> have “compilers”, and expanders would be similar except that they would
>> produce something possibly different from just the derivation’s output
>> file name.  For instance, we could write:
>>
>>   (file-append kernel "/bzImage")
>>
>> and that would expand directly to:
>>
>>   "/gnu/store/…/bzImage"
>
>AFAICS this is finally fixed!
>
>  expanders in commit ebdfd776f4504c456d383ee8afa59fc6fdfc6756
>  ‘file-append’ in commit a9e5e92f940381e3a4ee828c6d8ff22a73067e17
>  kernel file name in commit 44d5f54e31039d78f156bd9562dca293124eaa76
>
>Please let me know how it goes!  In particular, does it work for the
>dual-boot scenario you were interested in?

It is almost perfect.

Configuration excerpt...

 (bootloader (grub-configuration
              (device "/dev/sda")
              (menu-entries
               (list
                (menu-entry
                 (label "openSUSE")
                 (linux "(hd0,msdos1)/vmlinuz")
                 (linux-arguments (list
                                   "root=/dev/venom/opensuse"
                                   "init=/usr/lib/systemd/systemd"))
                 (initrd "(hd0,msdos1)/initrd"))))))


...transforms into

 menuentry "openSUSE" {
   search --file --set (hd0,msdos1)/vmlinuz
   linux (hd0,msdos1)/vmlinuz root=/dev/venom/opensuse init=/usr/lib/systemd/systemd
   initrd (hd0,msdos1)/initrd
 }

I think that if linux contains prefix '(.*)/', there should be no
search for kernel.

Thank you very much for fixing this bug (especially when I wasn't
able). I believe that fixing this bug is big step in more friendly
behavior to other OS.

Best regards,

S_W

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

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

* bug#20067: fix interpretation of grub configuration
  2016-09-14 16:16     ` Tomáš Čech
@ 2016-09-25 15:56       ` Ludovic Courtès
  0 siblings, 0 replies; 5+ messages in thread
From: Ludovic Courtès @ 2016-09-25 15:56 UTC (permalink / raw)
  To: Tomáš Čech; +Cc: 20067

Hi,

Tomáš Čech <tcech@suse.com> skribis:

> Configuration excerpt...
>
> (bootloader (grub-configuration
>              (device "/dev/sda")
>              (menu-entries
>               (list
>                (menu-entry
>                 (label "openSUSE")
>                 (linux "(hd0,msdos1)/vmlinuz")
>                 (linux-arguments (list
>                                   "root=/dev/venom/opensuse"
>                                   "init=/usr/lib/systemd/systemd"))
>                 (initrd "(hd0,msdos1)/initrd"))))))
>
>
> ...transforms into
>
> menuentry "openSUSE" {
>   search --file --set (hd0,msdos1)/vmlinuz
>   linux (hd0,msdos1)/vmlinuz root=/dev/venom/opensuse init=/usr/lib/systemd/systemd
>   initrd (hd0,msdos1)/initrd
> }
>
> I think that if linux contains prefix '(.*)/', there should be no
> search for kernel.

Oh, right.  I believe this is fixed by
5babe521c8adc722c2411b255cbeeef308339d06.

Please let me know if anything’s missing now.

Thanks!

Ludo’.

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

end of thread, other threads:[~2016-09-25 15:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-09 20:34 bug#20067: fix interpretation of grub configuration Tomáš Čech
2016-02-23 13:45 ` Ludovic Courtès
2016-09-09 22:03   ` Ludovic Courtès
2016-09-14 16:16     ` Tomáš Čech
2016-09-25 15:56       ` Ludovic Courtès

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

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

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 read-only IMAP folder(s) and NNTP newsgroup(s).