I keep several Linux distros on a USB stick and manage them by simply writing grub.cfg entries for each distro. The other distros I keep on the stick boot and run just fine, but I (and others, it seems) started having problems with Debian Jessie (8.x). Debian Netinst will boot to the debian-installer curses interface, but then tries to search for the correct debian iso file, even when the iso path is given in the kernel line in grub.cfg.
I've been partially successful trying to boot "debian-8.2.0-amd64-i386-netinst.iso" from a USB stick. I first setup my USB stick using the USB multiboot instructions found on the ArchWiki.
Here's a simplified file and folder structure of the USB stick, followed by the relevant grub.cfg entries.
USBROOT/
----boot/
----grub/
----grub.cfg
----(other grub paraphernalia)
----iso/
----debian/
----debian-8.2.0-amd64-i386-netinst.iso
----initrd.gz (special initrd)
While there is an initramfs within the iso, it won't allow debian to boot properly for reasons I don't really understand; it is explained briefly in the two links I've given so far.
Now my grub.cfg entries. I know this is an i386/amd64 multiarch iso, but I will just focus on the 64 bit part for simplicity. If we can figure out the 64 bit part, I should be able to easily make another entry for i386:
probe -u $root --set=rootuuid
set imgdevpath="/dev/disk/by-uuid/$rootuuid"
menuentry 'Debian 8.2 Multiarch' {
set isoname='debian-8.2.0-amd64-i386-netinst.iso'
set isopath='/boot/iso/debian'
set isofile=${isopath}/${isoname}
set initrdfile=${isopath}/initrd.gz
loopback loop $isofile
linux (loop)/install.amd/vmlinuz iso-scan/ask_second_pass=true iso-scan/filename=${imgdevpath}/${isofile} config quiet
initrd ${initrdfile}/initrd.gz
}
As an aside: changing the initrd line to
initrd ${initrdfile}
makes grub (I think) throw an error. Grub pauses for a few moments, then Debian tries to boot and immediately has a kernel panic--as expected, because it can't find an initramfs. However, this doesn't happen when I fully write out the path as shown in the block code example. Why would it throw an error when I specify the path with set variables, and not when just writing out the full path by hand? But my main question is:
What kernel boot parameters must I supply so that no search is performed and the iso is located at the path I specify. The installer does eventually find the correct iso by searching, but why did it have to search?
I am almost certain it has everything to do with the linux line:
linux (loop)/install.amd/vmlinuz iso-scan/ask_second_pass=true iso-scan/filename=${imgdevpath}/${isofile} config quiet
I've tried at least 20 variations on the theme, such as changing:
iso-scan/filename=${isofile}
findiso=${imgdevpath}/${isofile}
findiso=${isofile}
EDIT: I fixed the initrd problem: I had single quotes when defining $initrdfile. The findiso/iso-scan/whatever problem still remains.