View Full Version : Cannot shutdown when booting from ISO file (bug?)

2021-05-11, 11:47
Kali Linux supports the findiso= kernel parameter. This makes it possible to boot to grub2 from a USB drive which contains the ISO file and then use a simple menu such as

loopback loop "${grubfm_file}"
set root=(loop)
linux (loop)/live/vmlinuz boot=live components quiet splash noeject noprompt findiso=${ISO}
initrd (loop)/live/initrd.img

or, because the Kali grub.cfg already has the findiso= parameter, we can use it's own menu:

set iso_path=${ISO}
loopback loop "${grubfm_file}"
set root=(loop)
#grub.cfg contains 'findiso=' parameter
configfile /boot/grub/grub.cfg
The problem is that when you try to shutdown or reboot, it just loops after 'Power-Off' and will not shutdown or reset.

However, if I set the START position of partition 4 of the USB drive to start at beginning of the ISO file (using a1ive's grub2 and the partnew command), then the findiso= parameter can be removed because the kernel finds the 'iso' on partition 4.
This is a standard way to boot to most Linux ISOs without needing a cheat code such as iso-scan/filename=, findiso=, fromiso=, etc.
So in this case, there is no shutdown or restart problem.
My conclusion is that the findiso= parameter is preventing a successful shutdown (if the ISO file is actually present and mounted by the kernel startup script).

Is there way to fix this?