unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* boot multiple Gnu/Linux Distributions from one USB key
@ 2019-03-11 21:00 gnuforever
  2019-03-12 10:34 ` Tobias Geerinckx-Rice
  2019-03-12 13:05 ` Ricardo Wurmus
  0 siblings, 2 replies; 6+ messages in thread
From: gnuforever @ 2019-03-11 21:00 UTC (permalink / raw)
  To: guix-devel

Hello,

I configured a usb stick to boot multiple Gnu/Linux Distributions by 
following this tutorial: 
https://community.linuxmint.com/tutorial/view/1846
It works for Tails, PureOS, Trisquel and Parabola

I am trying to add GuixSD.

For the menuentry, I always start from the grub.cfg embedded in the iso 
file.
I add or remove options if needed.

For GuixSD, I came up with this configuration:
I used label instead of uuid.

     ## GUIXSD
     menuentry "GUIXSD - Gnu/Linux" {
         set isofile="/boot-isos/guixsd-install-0.16.0.x86_64-linux.iso"
         loopback loop (hd0,1)$isofile
         search --label --set GUIXSD_IMAGE
         linux 
(loop)/gnu/store/0zajbn9q39yva4l0zzrcshlll8qikzba-linux-libre-4.19.6/bzImage9 
--root=GUIXSD_IMAGE 
--system=(loop)/gnu/store/l4hgd4l7acrqwi3imav9akcvv4sbj85j-system 
--load=(loop)/gnu/store/l4hgd4l7acrqwi3imav9akcvv4sbj85j-system/boot
         initrd 
(loop)/gnu/store/9nqaksx40zh5d6cg5rim3f3spy56bfb9-raw-initrd/initrd.cpio.gz
     }

It doesn't work. I get the following error message:

waiting for partition 'GUIXSD_IMAGE' to appear...

Any help is welcome.

Is there any other way to configure multiple Gnu/Linux distros to boot 
from one usb?

gnuforever

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

* Re: boot multiple Gnu/Linux Distributions from one USB key
  2019-03-11 21:00 boot multiple Gnu/Linux Distributions from one USB key gnuforever
@ 2019-03-12 10:34 ` Tobias Geerinckx-Rice
  2019-03-12 13:05 ` Ricardo Wurmus
  1 sibling, 0 replies; 6+ messages in thread
From: Tobias Geerinckx-Rice @ 2019-03-12 10:34 UTC (permalink / raw)
  To: gnuforever; +Cc: guix-devel

gnuforever (yay!),

gnuforever wrote:
> I configured a usb stick to boot multiple Gnu/Linux 
> Distributions by
> following this tutorial:
> https://community.linuxmint.com/tutorial/view/1846
> It works for Tails, PureOS, Trisquel and Parabola

It works because these distributions have specific support for 
loopback booting, which is a non-trivial amount of work.  You'll 
note the following in the GRUB menu entry for ‘pclinuxos’:

  linux … bootfromiso=/boot-isos/pclinuxos64-kde-2014.05.iso …

This tells the pclinuxos early user space (initramfs) that it 
should do some loop mounting and other magic before mounting the 
root partition.  You'll also note that Debian-based distributions 
use a completely different magic word:

  linux … iso-scan/filename=$isofile …

because none of this is standardised or transparent.  It's an 
explicit distro feature that needs to be implemented somewhere in 
the init code.

> I am trying to add GuixSD.

Unfortunately, the Guix System doesn't implement anything like 
that yet.

> For the menuentry, I always start from the grub.cfg embedded in 
> the
> iso file.
> I add or remove options if needed.
>
> For GuixSD, I came up with this configuration:
> I used label instead of uuid.
>
>     ## GUIXSD
>     menuentry "GUIXSD - Gnu/Linux" {
>         set 
>         isofile="/boot-isos/guixsd-install-0.16.0.x86_64-linux.iso"
>         loopback loop (hd0,1)$isofile
>         search --label --set GUIXSD_IMAGE
>         linux
> (loop)/gnu/store/0zajbn9q39yva4l0zzrcshlll8qikzba-linux-libre-4.19.6/bzImage9
> --root=GUIXSD_IMAGE
> --system=(loop)/gnu/store/l4hgd4l7acrqwi3imav9akcvv4sbj85j-system
> --load=(loop)/gnu/store/l4hgd4l7acrqwi3imav9akcvv4sbj85j-system/boot
>         initrd
> (loop)/gnu/store/9nqaksx40zh5d6cg5rim3f3spy56bfb9-raw-initrd/initrd.cpio.gz
>     }
>
> It doesn't work.

Well, it works up to and including booting the kernel, which is 
still pretty cool when you think about it :-)

Unfortunately, all off GRUB's loopback magic is local to GRUB. 
You can't use it to make virtual drives appear in other operating 
systems.  (Well, maybe DOS, but that's more D than OS anyway.)

> I get the following error message:
>
> waiting for partition 'GUIXSD_IMAGE' to appear...

Once the kernel boots, Guix's early userspace only looks for real 
partititions.  It won't peek inside random files to see if they 
contain a file system.  And there's currently no way to tell it 
to.

I wonder if MAPPED-DEVICES could be a solution here, with a bit 
(heh) of extra code…

> Is there any other way to configure multiple Gnu/Linux distros 
> to boot
> from one usb?

TL;DR: there is no one reliable way, only distro-specific support.

Kind regards,

T G-R

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

* Re: boot multiple Gnu/Linux Distributions from one USB key
  2019-03-11 21:00 boot multiple Gnu/Linux Distributions from one USB key gnuforever
  2019-03-12 10:34 ` Tobias Geerinckx-Rice
@ 2019-03-12 13:05 ` Ricardo Wurmus
  2019-03-12 18:56   ` Vagrant Cascadian
  1 sibling, 1 reply; 6+ messages in thread
From: Ricardo Wurmus @ 2019-03-12 13:05 UTC (permalink / raw)
  To: gnuforever; +Cc: guix-devel


gnuforever <help@tuyizere.org> writes:

> I configured a usb stick to boot multiple Gnu/Linux Distributions by
> following this tutorial:
> https://community.linuxmint.com/tutorial/view/1846
> It works for Tails, PureOS, Trisquel and Parabola
>
> I am trying to add GuixSD.
>
> For the menuentry, I always start from the grub.cfg embedded in the
> iso file.
> I add or remove options if needed.
>
> For GuixSD, I came up with this configuration:
> I used label instead of uuid.
>
>     ## GUIXSD
>     menuentry "GUIXSD - Gnu/Linux" {
>         set isofile="/boot-isos/guixsd-install-0.16.0.x86_64-linux.iso"
>         loopback loop (hd0,1)$isofile
>         search --label --set GUIXSD_IMAGE
>         linux
> (loop)/gnu/store/0zajbn9q39yva4l0zzrcshlll8qikzba-linux-libre-4.19.6/bzImage9
> --root=GUIXSD_IMAGE
> --system=(loop)/gnu/store/l4hgd4l7acrqwi3imav9akcvv4sbj85j-system
> --load=(loop)/gnu/store/l4hgd4l7acrqwi3imav9akcvv4sbj85j-system/boot
>         initrd
> (loop)/gnu/store/9nqaksx40zh5d6cg5rim3f3spy56bfb9-raw-initrd/initrd.cpio.gz
>     }
>
> It doesn't work. I get the following error message:
>
> waiting for partition 'GUIXSD_IMAGE' to appear...

Does a partition with this label exist?


-- 
Ricardo

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

* Re: boot multiple Gnu/Linux Distributions from one USB key
  2019-03-12 13:05 ` Ricardo Wurmus
@ 2019-03-12 18:56   ` Vagrant Cascadian
  2019-03-13  5:24     ` gnuforever
  2019-03-23 16:57     ` Tobias Geerinckx-Rice
  0 siblings, 2 replies; 6+ messages in thread
From: Vagrant Cascadian @ 2019-03-12 18:56 UTC (permalink / raw)
  To: Ricardo Wurmus, gnuforever; +Cc: guix-devel

On 2019-03-12, Ricardo Wurmus wrote:
> gnuforever <help@tuyizere.org> writes:
>> For GuixSD, I came up with this configuration:
>> I used label instead of uuid.
>>
>>     ## GUIXSD
>>     menuentry "GUIXSD - Gnu/Linux" {
>>         set isofile="/boot-isos/guixsd-install-0.16.0.x86_64-linux.iso"
>>         loopback loop (hd0,1)$isofile
>>         search --label --set GUIXSD_IMAGE
>>         linux
>> (loop)/gnu/store/0zajbn9q39yva4l0zzrcshlll8qikzba-linux-libre-4.19.6/bzImage9
>> --root=GUIXSD_IMAGE
>> --system=(loop)/gnu/store/l4hgd4l7acrqwi3imav9akcvv4sbj85j-system
>> --load=(loop)/gnu/store/l4hgd4l7acrqwi3imav9akcvv4sbj85j-system/boot
>>         initrd
>> (loop)/gnu/store/9nqaksx40zh5d6cg5rim3f3spy56bfb9-raw-initrd/initrd.cpio.gz
>>     }
>>
>> It doesn't work. I get the following error message:
>>
>> waiting for partition 'GUIXSD_IMAGE' to appear...
>
> Does a partition with this label exist?

From the Guix initramfs you would need to run:

  losetup /path/to/file

If the image was in a partitioned loopback file:

  losetup --partscan /path/to/file

Then I suspect the labels would get populated. You may also need to add
losetup to the initramfs, since it probably isn't yet present.

I'm guessing you would also remove the (loop) from these arguments,
which are passed to the Guix initramfs, not loaded from grub:

  --system=/gnu/store...-system
  --load=/gnu/store...-boot


live well,
  vagrant

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

* Re: boot multiple Gnu/Linux Distributions from one USB key
  2019-03-12 18:56   ` Vagrant Cascadian
@ 2019-03-13  5:24     ` gnuforever
  2019-03-23 16:57     ` Tobias Geerinckx-Rice
  1 sibling, 0 replies; 6+ messages in thread
From: gnuforever @ 2019-03-13  5:24 UTC (permalink / raw)
  To: Vagrant Cascadian; +Cc: guix-devel

On 12.03.2019 11:34, Tobias Geerinckx-Rice wrote:
> You'll also note that Debian-based distributions use a completely 
> different magic word:
> 
>  linux … iso-scan/filename=$isofile …

Indeed. For Trisquel, libreboot, I have this:

        ## TRISQUEL
        menuentry "Trisquel 7.0 - Gnu/Linux" {
            set isofile="/boot-isos/trisquel_7.0_amd64.iso"
            loopback loop (usb0,msdos1)$isofile
            linux (loop)/casper/vmlinuz boot=casper 
iso-scan/filename=$isofile noprompt noeject timezone=Europe/Brussels
            initrd (loop)/casper/initrd
        }

> I wonder if MAPPED-DEVICES could be a solution here, with a bit (heh) 
> of extra code…

Unfortunately, I am not a lisp programmer. Not a programmer at all :-)
I do some lisp in my emacs config files but just for emacs 
customization.
Code I found from other emacs users or sometimes with the emacs 
customization wizard.

> TL;DR: there is no one reliable way, only distro-specific support.
Does this mean that ,for the moment, I can not add Guix to my multiple 
boot usb key?


On 12.03.2019 14:05, Ricardo Wurmus wrote:
> Does a partition with this label exist?

Yes, it exists. If I dd the guix install iso into a usb and boot from 
it, the /dev/sr0 which is the is it booted from has "GUIXSD_IMAGE" as 
label
In fact, the default embeded grub.cfg in the guix iso looks like this, 
but it uses uuid

         search --fs-uuid --set 1970-01-01-19-16-18-78
         linux 
/gnu/store/0zajbn9q39yva4l0zzrcshlll8qikzba-linux-libre-4.19.6/bzImage9 
--system=/gnu/store/l4hgd4l7acrqwi3imav9akcvv4sbj85j-system 
--load=/gnu/store/l4hgd4l7acrqwi3imav9akcvv4sbj85j-system/boot
         initrd 
/gnu/store/9nqaksx40zh5d6cg5rim3f3spy56bfb9-raw-initrd/initrd.cpio.gz


On 12.03.2019 19:56, Vagrant Cascadian wrote:
> From the Guix initramfs you would need to run:
> 
>   losetup /path/to/file
> 
> If the image was in a partitioned loopback file:
> 
>   losetup --partscan /path/to/file
> 
> Then I suspect the labels would get populated. You may also need to add
> losetup to the initramfs, since it probably isn't yet present.
> 
> I'm guessing you would also remove the (loop) from these arguments,
> which are passed to the Guix initramfs, not loaded from grub:
> 
>   --system=/gnu/store...-system
>   --load=/gnu/store...-boot

I will give a try.

Happy Gnu!
gnuforever

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

* Re: boot multiple Gnu/Linux Distributions from one USB key
  2019-03-12 18:56   ` Vagrant Cascadian
  2019-03-13  5:24     ` gnuforever
@ 2019-03-23 16:57     ` Tobias Geerinckx-Rice
  1 sibling, 0 replies; 6+ messages in thread
From: Tobias Geerinckx-Rice @ 2019-03-23 16:57 UTC (permalink / raw)
  To: gnuforever; +Cc: guix-devel

gnuforever,

I missed this question, sorry.  Had any luck?

March 13, 2019 6:24 AM, "gnuforever" <help@tuyizere.org> wrote:
>> TL;DR: there is no one reliable way, only distro-specific support.
> 
> Does this mean that ,for the moment, I can not add Guix to my multiple
> boot usb key?

Not out of the box, no, but there's already work being done[1] to change that.  Until then, you'll have to manually set up the necessary loopiness.

Kind regards,

T G-R

[1]: https://issues.guix.info/issue/34863

Sent from a Web browser.  Excuse or enjoy my brevity.

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

end of thread, other threads:[~2019-03-23 16:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-11 21:00 boot multiple Gnu/Linux Distributions from one USB key gnuforever
2019-03-12 10:34 ` Tobias Geerinckx-Rice
2019-03-12 13:05 ` Ricardo Wurmus
2019-03-12 18:56   ` Vagrant Cascadian
2019-03-13  5:24     ` gnuforever
2019-03-23 16:57     ` Tobias Geerinckx-Rice

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).