help-grub
[Top][All Lists]
Advanced

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

Chainloading isolinux.bin from GRUB2


From: josep lladonosa capell
Subject: Chainloading isolinux.bin from GRUB2
Date: Sat, 25 Apr 2020 11:38:46 +0200

Hello,

I found your question in the archive [1]. You wanted to chain isolinux
from GRUB2.

I have grub in a laptop and wanted to boot some live linux iso images
(with isolinux and grub on them) directly from the grub menu.

I also tried to chain to the isolinux.bin in iso image from grub2 but
with no luck but found an alternative.

The .iso Debian live images are in /boot/iso/.
I added a file: /etc/grub.d/50_debian to add them into the grub menu:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#!/bin/sh
exec tail -n +3 $0
# Custom boot file for:
# ISO
# Debian all
menuentry "Boot from First HD (default)" {
  chainloader +1
}

insmod regexp

for isofile in /boot/iso/debian-live-*-amd64-*.iso; do
  regexp --set=isoname "/boot/iso/(.*)" "$isofile"
  menuentry "$isoname to its grub" "$isofile" {
          iso_path="$2"
          export iso_path
          search --set=root --file $iso_path
          loopback loop $iso_path
          root=(loop)
          configfile /boot/grub/loopback.cfg
          loopback --delete loop
  }
done
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
This creates a menuentry for each Debian live iso files in /boot/iso/.

After that, the "sudo update-grub" to update grub.

As you can see, grub goes to loopback.cfg (which for Debian loads its
grub menu).
I have checked an Ubuntu live iso image and the same loopback.cfg
exists, so this configuration would work for them, too. Maybe this
.cfg is becoming standarized.

To try new iso images, I just add them to the /boot/iso/ directory.

If you need to boot into images with different names, you could adapt
the "for" parameter to accept them.

I haven't a separated small partition for /boot/, so in my case image
space is not a limitation (be aware of that).

Regards,
Josep


[1]:
https://lists.gnu.org/archive/html/help-grub/2016-02/msg00006.html
--
--
Salutacions...Josep
--



reply via email to

[Prev in Thread] Current Thread [Next in Thread]