[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

multiboot usb stick



Hi,

my goal is to have a usb stick with multiple debian live bootable systems on
it. It thus should be able to combine the multiple options for downloadable
isos from live.debian.net (different suite, different arch, different desktop)
into a bootable usb stick which allows to select which iso to boot in the main
screen. The use case would be that I could give such a usb stick to a friend
(either using i386 or amd64) who could then easily try out different desktop
environments (kde, gnome, xfce) and debian releases (stable, testing, unstable)
without going through multiple iterations of downloading the image and dd-ing
it to the usb drive over and over again.

I'm aware that the web is full of software which allows something like this:

 - YUMI for Linux http://www.pendrivelinux.com/yumi-multiboot-usb-creator/
 - multisytem http://liveusb.info/dotclear/index.php?pages/install
 - multibootusb http://multibootusb.org/features/

But they all have the same disadvantages:

 - not available in Debian main
 - only graphical user interface and non-scriptable
 - need knowledge about the to-be-booted iso

The last part means that they can only add an iso to the multiboot mix which
the tool knows of. This is because it needs to know the distribution specific
boot parameters.

My idea was to partition a usb stick with one primary partition and N logical
partitions for N iso images and format all these partitions with ext2. I would
then use extlinux to boot from the first partition and chainload another
extlinux from any of the other partitions which each contain the directory
layout of a live CD.

The following script does all of the above:

https://gist.github.com/josch/9412079

It takes all *.iso files in the current directory and creates a disk image
which can be dd-ed to a usb stick with the following result upon booting it:

https://mister-muffin.de/p/ARV2.png

Once either of these entries is selected, extlinux will chainload the menu from
the respective CD:

https://mister-muffin.de/p/ysUH.png

The only thing that does not work is that the correct rootfs is found by the
kernel and initrd. No matter what option is chosen, the rootfs will be selected
from the first partition on the USB stick that contains one. It is already
great that it finds one at all and does not give up after not finding it on the
first partition. So right now, even if I select kde, the gnome desktop will be
loaded because it comes first in the partition order.

To make such kind of setup work, it would be necessary for the initrd (I guess
it's the initrd?) to successfully find the partition with the live rootfs it is
supposed to boot. I saw that after dd-ing a live iso to a usb stick, the
partition had a label so maybe that label could be used to find the correct
partition to load the rootfs from? Maybe there are other possibilities? I dont
mind writing a patch if you could hint me at the general direction of where to
look.

The advantage of this approach over the one taken by existing tools (have a
main isolinux.cfg which has knowledge about the proper boot parameters for each
distribution it supports) is that the tool would not have to be changed no
matter what changes are implemented in the debian live isos. Furthermore, this
setup is able to take advantage of the existing menu structure present on every
live iso without having to recreate it. The only disadvantage I see would be
that after selecting an "iso" to boot, one would have to restart to go back to
the selection screen.

But maybe I also overlooked an existing way which allows to combine multiple
debian live isos onto one usb stick?

What do you think?

cheers, josch


Reply to: