Supporting Multiboot USB Thumb drives
Projects like GLIM enable users to create a MultiBoot USB stick which boot into any one of several distros chosen by the user.
It work by having the user place one or more Bootable ISOs in a special directory. Then, GRUB2 scripts provided (by GLIM for example) dynamically generate menus for the available ISO files. It's extremely convenient for creating rescue thumb drives, or just keeping all the distros you care about easily accessible.
Practically all major distros are supported by such projects, including Ubuntu, Debian, Fedora, Mint, and Arch, etc'. Alpine Linux is currently missing some simple pieces needed to support it.
To be supported, a distro must expose some basic boot param so that grub can tell the init process where the ISO file is located. The init script of course also has to handle this case when the boot param is provided.
I've created a customized init script which implements this. The changes are
quite small. I've tested it by replacing the init script inside
alpine-standard-3.12.0-x86.iso
and adding a grub script to GLIM which adds
support for Alpine.
The changes from the alpine side cinsist of two new boo params img_dev
and img_file
(same as Arch). When passed by grub on the kernel command line, th e init scripts mounts img_dev
and then loop
mount the img_file
iso file on it. So, for example, I have
img_dev=/dev/usbdisk
and img_file=/boot/iso/alpine/alpine-standard-3.12.0-x86.iso
.
Included are:
- The modified init script. Changed are marked by
XXX
(3 locations). - The grub2 script, for use with GLIM
- A .png icon for use with GLIM's theme.
only (1) is relevant to Alpine developers, but since users may be interested in reproducing this immediately, I've included the GLIM files as well.
Attached: