Iso-scan/filename not working?

To be clear I was talking about multi-booting from a flash drive not booting from an ISO file. Sorry if I wasn’t clear. To me those are not the same thing. And bear in mind that I’m not a technical expert. Most people connected with OpenMandriva have more technical knowledge than I possess.

Edit: Except if I think more both require ability to boot from ISO file.

1 Like

Just to give you some background. I am the author of Easy2Boot which is a free multiboot USB solution. One of the major features is that you just copy all your ISOs directly onto the USB drive and then boot to it (no application required). Then you can directly boot from any of the linux ISOs which are automatically listed in the menu (menu is dynamically built each time you boot).
This ‘just works’ with 99% of linux distros - EXCEPT OpenMandriva!
It works by writing a new partition table entry into the MBR of the USB drive which points to the start of the linux ISO file. Then we boot via grub4dos to the ISO file and when the kernel loads, it ‘sees’ the partition table entry and mounts the ‘volume’ as a iso9660 filesystem - thus the 2nd stage (squashfs, etc.) just works and no cheat code (iso-scan/filename= or boot-from etc.) is required.
You get the full and original ISO boot menu - it is not altered in anyway. You can simply delete or add ISOs at will.
The problem with OpenMandriva not working, seems to be that it does see the partition but does not recognise the file system in that partition as a valid ISO9660 fs. This is odd, because most other linux liveCD ISOs just work.
See here for a list of over 300 ISOs that just work. Note that no cheat codes are used, so it is a ‘generic’ solution for Legacy booting linux ISOs.
Hence I tried using cheat codes with OpenMandriva and had problems (which it turns out was not OM’s fault, but mine!).
cheers
Steve

OK, so now the plot both thickens and gets more interesting. Whether this is ‘officially’ supported (and remembering I said “to my knowledge”) I suspect there are OpenMandriva contributors that would be interested and willing to help with this.

And in pointing this out you may well have identified something that has caused other issues with our grub2 script and osprober/grub2 support. So thanks.

menuentry "OpenMandrivaLx" {
set iso_path="/OpenMandrivaLx.3.01-PLASMA.x86_64.iso"
loopback loop ${iso_path}
set boot_locale='locale.lang=en_US'
set boot_default='rootfstype=auto ro rd.luks=0 rd.lvm=0 rd.md=0 rd.dm=0 rd.live.image acpi_osi=Linux acpi_osi='!Windows 2012' acpi_backlight=vendor audit=0 logo.nologo'
probe -u -s isouuid (loop)
linux	(loop)/boot/vmlinuz0 ${boot_default} root=live:UUID=${isouuid} iso-scan/filename=${iso_path} ${boot_locale} quiet rhgb splash=silent
initrd	(loop)/boot/liveinitrd.img
loopback -d loop
}

This is a grub2 menu that has been tested and reported as working.
It is similar to the grub4dos one I posted earlier.

Here is a screenshot of the situation I described where it does not recognise the ISO file when written as a partition table entry (no cheat codes used - just normal boot menu in ISO). It should mount the partition as a ISO9660 file system and then find the squashfs, but it does not seem to like something about the structure of the ISO (I guess?).

Well it is an interesting approach.

It sounds strange because the isofs is in list:
https://github.com/OpenMandrivaAssociation/omdv-build-iso/blob/master/dracut/dracut.conf.d/60-dracut-isobuild.conf#L13
Could you mount the ISO from the emergency shell?

Sorry, I don’t know how to do that.
It is probably easiest if you make an Easy2Boot USB drive, copy an OM ISO to _ISO\MAINMENU and then boot to the flash drive and run the OM iso.
Then you can play with it yourself.
partition 4 of the USB drive will be the new partition entry for the ISO file, e.g. sdb4 or sdc4 etc.
I am afraid I am not very familiar with linux…

Well, I’ll try ASAP.

Hi @SteveSi, I didn’t forgot your question but I haven’t found the time to make some test until now. The good news is I think I found the bug :slight_smile::

openmandriva dracut-initqueue[350]: ++ echo /dev/sdb4
openmandriva dracut-initqueue[350]: ++ sed 's,\(/dev/sd[a-z]\)[1-9],\1,g'
openmandriva dracut-initqueue[350]: + realdev=/dev/sdb
ppenmandriva dracut-initqueue[350]: + getargbool 0 UEFI
openmandriva dracut-initqueue[350]: + local _b
openmandriva dracut-initqueue[350]: + unset _b
openmandriva dracut-initqueue[350]: + local _default
openmandriva dracut-initqueue[350]: + _default=0
openmandriva dracut-initqueue[350]: + shift
openmandriva dracut-initqueue[350]: ++ getarg UEFI
openmandriva dracut-initqueue[350]: ++ debug_off
openmandriva dracut-initqueue[350]: ++ set +x
openmandriva dracut-initqueue[350]: ++ return 1
openmandriva dracut-initqueue[350]: + _b=
openmandriva dracut-initqueue[350]: + '[' 1 -ne 0 -a -z '' ']'
openmandriva dracut-initqueue[350]: + _b=0
openmandriva dracut-initqueue[350]: + '[' -n 0 ']'
openmandriva dracut-initqueue[350]: + '[' 0 = 0 ']'
openmandriva dracut-initqueue[350]: + return 1
openmandriva dracut-initqueue[350]: + '[' -n '' ']'
openmandriva dracut-initqueue[350]: + mount -n -t iso9660 -o ro /dev/sdb /run/initramfs/omdv
openmandriva dracut-initqueue[350]: mount: wrong fs type, bad option, bad superblock on /dev/sdb,
openmandriva dracut-initqueue[350]:        missing codepage or helper program, or other error
openmandriva dracut-initqueue[350]:        In some cases useful info is found in syslog - try
openmandriva dracut-initqueue[350]:        dmesg | tail or so.
openmandriva kernel: ISOFS: Unable to identify CD-ROM format.
openmandriva dracut-initqueue[350]: ++ losetup -f
openmandriva dracut-initqueue[350]: + LOOPDEV=/dev/loop0
openmandriva dracut-initqueue[350]: + losetup -r /dev/loop0 /run/initramfs/omdv/LiveOS/squashfs.img
openmandriva dracut-initqueue[350]: losetup: /run/initramfs/omdv/LiveOS/squashfs.img: failed to set up loop device: No such file or directory
openmandriva dracut-initqueue[350]: + mount -n -t squashfs -o ro /dev/loop0 /run/initramfs/image

As you can read it detects the right partition (/dev/sda4) but then it tries to mount the disk (dev/sdb) instead of the partition. It it due to /sbin/live-iso-root script of initial ramdisk (it is inside the liveinitrd.img into the iso). I report here lines from 18 to 29:

# fix udev isohybrid LABEL issues (mga #3334)
# by reading the device we get, stripping away partition number,
# and mount the resulting device
realdev=$(echo $livedev |sed 's,\(/dev/sd[a-z]\)[1-9],\1,g')

# mount the live media
getargbool 0 UEFI && liveuefi="yes"
if [ -n "$liveuefi" ]; then
    mount -n -t vfat -o ro $livedev /run/initramfs/omdv
else
    mount -n -t iso9660 -o ro $realdev /run/initramfs/omdv
fi

IMO you may file a bug on bugzilla about this because developers are needed to fix this.

btw Mageia isos are working?

PS. Maybe you can be interested in the latest release on grbu2 because on April upstream released a pre-compiled binary version of grub2.

@TPG is the above hack still needed?

Hard to say. We should run some tests ISO without that hack.

1 Like

Mageia-5.1-LiveDVD-KDE4-x86_64-DVD.iso works fine if you just copy the .iso file to an Easy2Boot USB drive.
OpenMandrivaLx.3.02-PLASMA.x86_64.iso does not work when copied to an Easy2Boot USB drive.

Here is the original bug on Mageia bugzilla. Because some time is past and OpenMandriva ISO actually uses UUID instead of LABEL this issue may be gone but it is hard to say because is a bug it only happens sometimes. In any case I guess it may be realted to the partition only while during my tests with Easy2Boot it used the fourth partition. So it may be try to remove it at all or to modify it to let it acts only on first partition

realdev=$(echo $livedev |sed 's,\(/dev/sd[a-z]\)1,\1,g')

@TPG please could you build an ISO with hack modified/removed?

Here is the same hack from the file /usr/sbin/mgalive-root into the initrd.gz_ I extracted from the Mageia 5.1 Live DVD:

# fix udev isohybrid LABEL issues (mga #3334)
# by reading the device we get, stripping away partition number,
# and mount the resulting device
realdev=$(echo $livedev |sed 's,\(/dev/sd[a-z]\)1,\1,g')

ISO is building https://abf.openmandriva.org/platforms/3.0/products/38/product_build_lists/1420

1 Like

Thank you! I’ll try ASAP!

@SteveSi please could you too?

1 Like

:grinning: Build #1420 from an Easy2Boot USB drive works here! :grinning:

1 Like

Ok, all next ISO build will carry this fix. Thanks. Closing this thread.

1 Like