GRUB2 ISO Live Entry for Salix 15.0 Xfce 64 Bits

You have a problem with Salix? Post here and we'll do what we can to help.
Post Reply
inukaze
Posts: 38
Joined: 24. Nov 2024, 18:42

GRUB2 ISO Live Entry for Salix 15.0 Xfce 64 Bits

Post by inukaze »

Hi there, i had a customized GRUB2 on a USB Pedrive. and i had wrote the follow entry :

Code: Select all

menuentry 'Salix OS 15.0 - Xfce (64 Bits)'	{
			load_video
 			search --set root -u a9cec8d3-2770-4cb9-acbb-55479a5370f8
 			search.fs_uuid a9cec8d3-2770-4cb9-acbb-55479a5370f8
 			set isofile='ISO/salixlive64-xfce-15.0.iso'
 			set gfxpayload=keep
 			loopback loop (hd0,msdos3)/$isofile
 			parametros="max_loop=255 vga=791 locale=es_ES.utf8 keymap=es useswap=yes copy2ram=no tz=America/Caracas hwc=localtime runlevel=4"
 			linux (loop)/boot/vmlinuz $parametros fromiso=$isofile
 			initrd (loop)/boot/initrd.gz
 		}
Well when i try to boot it i got the follow message :

***** Live System Error - Live media not detected - exiting * * ***
The thing is not booting to Live Session.

What i can change to boot correctly the iso in live mode from GRUB2 using just the iso file ?
djemos
Salix Warrior
Posts: 1466
Joined: 29. Dec 2009, 13:45
Location: Greece

Re: GRUB2 ISO Live Entry for Salix 15.0 Xfce 64 Bits

Post by djemos »

boot from iso file is not supported.
init file in initrd.gz has to be updated for the iso file to be found.
Download this initrd.gz i have modified. Open salixlive64-xfce-15.0.iso with iso master application and replace the initrd.gz file in boot and in EFI/BOOT folders.
Then save the new salixlive64-xfce-15.0.iso.

Edit the grub menuentry like this.

Code: Select all

menuentry 'Salix OS 15.0 - Xfce (64 Bits)'	{
			load_video
 			search --set root -u a9cec8d3-2770-4cb9-acbb-55479a5370f8
 			search.fs_uuid a9cec8d3-2770-4cb9-acbb-55479a5370f8
 			set isofile='/ISO/salixlive64-xfce-15.0.iso'
 			set gfxpayload=keep
 			loopback loop (hd0,msdos3)/$isofile
 			parametros="max_loop=255 vga=791 locale=es_ES.utf8 keymap=es useswap=yes copy2ram=no tz=America/Caracas hwc=localtime runlevel=4"
 			linux (loop)/boot/vmlinuz $parametros isodevice=/dev/sda3 fromiso=$isofile
 			initrd (loop)/boot/initrd.gz
 		}
The partition which contain the iso file is /dev/sda3 but in any case
replace /dev/sda3 with the partition with has the UUID=a9cec8d3-2770-4cb9-acbb-55479a5370f8 which contain the path /ISO/salixlive64-xfce-15.0.iso
Change set isofile='ISO/salixlive64-xfce-15.0.iso' with set isofile='/ISO/salixlive64-xfce-15.0.iso'
The only problem was the LibreOffice. I had to type in terminal export MESA_LOADER_DRIVER_OVERRIDE=i965 to run LibreOffice. This not happened when run from a live usb.
This has been tested and it is working.
Future salix-live editions will have this ability booting from iso file.
inukaze
Posts: 38
Joined: 24. Nov 2024, 18:42

Re: GRUB2 ISO Live Entry for Salix 15.0 Xfce 64 Bits

Post by inukaze »

Hi there, by the moment i had not test yet, but thinking on how improve the grub2 menutry well i prefer change to something like

Code: Select all

		menuentry 'Salix OS 15.0 - Xfce (64 Bits)'	{
			load_video
 			search --set root -u a9cec8d3-2770-4cb9-acbb-55479a5370f8
 			search.fs_uuid a9cec8d3-2770-4cb9-acbb-55479a5370f8
			if [ $root==(hd0,msdos3) ; then set isodevice=/dev/sda3 ; fi
			if [ $root==(hd1,msdos3) ; then set isodevice=/dev/sdb3 ; fi
			if [ $root==(hd2,msdos3) ; then set isodevice=/dev/sdc3 ; fi
 			set isofile='ISO/salixlive64-xfce-15.0.iso'
 			set gfxpayload=keep
 			loopback loop ($root)/$isofile
 			parametros="max_loop=255 vga=791 locale=es_ES.utf8 keymap=es useswap=yes copy2ram=no tz=America/Caracas hwc=localtime runlevel=4"
 			linux (loop)/boot/vmlinuz $parametros isodevice=$isodevice fromiso=$isofile
 			initrd (loop)/boot/initrd.gz
		}
i just had a dunno, you know which command from grub2 i can use to set the value for isodevice, becuase search, return values like (hd3,msdos5) but for "isodevice" or "bdev" i need get from commands "/dev/sda3" or "/dev/sda2" or "/dev/sdb6" i try to search in the GRUB2 manual but i not have any command for get that value. devicetree is not on my GRUB2 installed on usb pendrive and anothers commands are miss. but if you want i can wrote all command available on my Custom GRUB2.

Well by the moment i had make a workaround using if, but this is not smart, but i don't know how i should write a function inside grub to assing values like
hd0 = sda
msdos = 1

when found values using "search" i don't which is the most short and smart method to write a function to set value converting the result obtained from search command, because the search command not had option for return result like /dev/sda3 instead hd0,msdos3
djemos
Salix Warrior
Posts: 1466
Joined: 29. Dec 2009, 13:45
Location: Greece

Re: GRUB2 ISO Live Entry for Salix 15.0 Xfce 64 Bits

Post by djemos »

OK. I made it quite simple.

Download this initrd.gz i have further modified. Open salixlive64-xfce-15.0.iso with iso master application and replace the initrd.gz file in boot and in EFI/BOOT folders.
Then save the new salixlive64-xfce-15.0.iso.

Edit the grub menuentry like this exactly.

Code: Select all

menuentry 'Salix OS 15.0 - Xfce (64 Bits)'	{
	probe -u $root --set=rootuuid
        #rootuuid=a9cec8d3-2770-4cb9-acbb-55479a5370f8
	search --set root -u $rootuuid
	set isofile='ISO/salixlive64-xfce-15.0.iso'
	loopback loop ($root)/$isofile
	parametros="max_loop=255 vga=791 locale=es_ES.utf8 keymap=es useswap=yes copy2ram=no tz=America/Caracas hwc=localtime runlevel=4"
	linux (loop)/boot/vmlinuz fromiso=$isofile $parametros
	initrd (loop)/boot/initrd.gz
	}
1. First case
If the iso file exists in the same partition with grub.cfg then do not uncomment the line # rootuuid=a9cec8d3-2770-4cb9-acbb-55479a5370f8

2. Second case
If the iso file exists in a different partition than grub.cfg (e.g. boot with grub using an internal disk or external ssd disk and also have attached another USB ssd or another USB stick where the iso file exists under ISO folder) then uncomment the line rootuuid=a9cec8d3-2770-4cb9-acbb-55479a5370f8 and comment the line # probe -u $root --set=rootuuid
Of course in this case you have to replace rootuuid= with the uuid partition where the iso file exists.
Also if the iso file path is different then have to replace also the isofile= with the path where the iso file exists.

3. In both cases the iso file name will be searched in all partitions and will be found and will be mounted and boot from it

Both cases has been tested and have worked.
I think it can't be simpler.

Note that if you run sudo update-grub then /boot/grub/grub.cfg will be recreated and above menuentry will be lost.
You can add the above menuentry in /etc/grub.d/40_custom.
So menuentry will not be lost after running sudo update-grub. If update the kernel for example.
inukaze
Posts: 38
Joined: 24. Nov 2024, 18:42

Re: GRUB2 ISO Live Entry for Salix 15.0 Xfce 64 Bits

Post by inukaze »

Hi again, thank you very much for the modified initrd.gz

On my case in my custom USB Pendrive (64 GB) with Partitions :

INU05 -> Partition with mayor size -> 31 GB

INU05-Inicio -> Second Partition -> 1.66 GB ( Boot Partition , i ever put a custom "chroot" with various files inside this partition )
i already i had explain what i do with this "chroot" -> Here

INU05-LiGNUx -> Third Partition -> 25 GB -> ( Partition with ISOS, and any thing 100% native i want to use from Live USB Distros like Porteus )

Well the first on my case work the second case :
rootuuid=a9cec8d3-2770-4cb9-acbb-55479a5370f8
Testing on QEMU Screenshots :
ImageImageImageImageImageImageImage

Testing directly from real hardware :
ImageImageImageImage

The unique thing cause my curiosity is when i start from Porteus i can use the third partition, when i boot from salix live this partition is unaccesible, the partition from the ISO of Salix are use, well the Porteus ISO is in the same partition :
Image
djemos
Salix Warrior
Posts: 1466
Joined: 29. Dec 2009, 13:45
Location: Greece

Re: GRUB2 ISO Live Entry for Salix 15.0 Xfce 64 Bits

Post by djemos »

The unique thing cause my curiosity is when i start from Porteus i can use the third partition, when i boot from salix live this partition is unaccesible, the partition from the ISO of Salix are use, well the Porteus ISO is in the same partition :
Because salix live use elilo for UEFI/EFI and syslinux for bios boot. There are no grub menus. There is no grub.cfg

Read again the above 1, 2 cases.
Use exactly the menu entry above.
It is working when boot from real hardware. No qemu or chroot or vmware.
Your iso file exist in a partition with uuid=a9cec8d3-2770-4cb9-acbb-55479a5370f8 under some folder (e.g. ISO) This uuid is unique.
In this partition is installed a distribution you use to boot your system. So grub.cfg exist in the same partiion
Then use the above menuentry. System will boot.
If iso is in a different partition from the partition where grub.cfg exist which is used to boot then use the uuid of the partition where iso file exists and in the above menuentry comment the line #probe -u $root --set=rootuuid
and uncomment the line rootuuid=a9cec8d3-2770-4cb9-acbb-55479a5370f8

The first case is for simplicity so user no need to know the uuid. You have a partition with a distribution and boot this distribution and in grub choose to boot the iso file instead of your installed distribution.

In general case use rootuuid=a9cec8d3-2770-4cb9-acbb-55479a5370f8. The iso file path has to be in the same rootuuid partition.
just remove the line probe -u $root --set=rootuuid and uncomment the line rootuuid=a9cec8d3-2770-4cb9-acbb-55479a5370f8
iso will be found because you identify the partition uuid which is unique.

Code: Select all

menuentry 'Salix OS 15.0 - Xfce (64 Bits)'	{
        rootuuid=a9cec8d3-2770-4cb9-acbb-55479a5370f8
	search --set root -u $rootuuid
	set isofile='ISO/salixlive64-xfce-15.0.iso'
	loopback loop ($root)/$isofile
	parametros="max_loop=255 vga=791 locale=es_ES.utf8 keymap=es useswap=yes copy2ram=no tz=America/Caracas hwc=localtime runlevel=4"
	linux (loop)/boot/vmlinuz fromiso=$isofile $parametros
	initrd (loop)/boot/initrd.gz
	}
From my tests.
1. I have an external ssd disk where there is ubuntu and also the iso file. So i edit /boot/grub/grub.cfg in ubuntu partition and add there the above menuentry with line probe -u $root --set=rootuuid and comment or remove the line #rootuuid=a9cec8d3-2770-4cb9-acbb-55479a5370f8
Iso exists in the same partition where ubuntu is under the ISO folder
then in grub menu i choose Salix OS 15.0 - Xfce (64 Bits)
and system boot.

2. I have a usb stick where slackel openbox 7.7.2 64 bit is installed. I edit /boot/grub/grub.cfg in slackel partition and add there also the above menuentry with line rootuuid=a9cec8d3-2770-4cb9-acbb-55479a5370f8 I remove the line probe -u $root --set=rootuuid
I also plug in both the usb stick and the ssd disk. And reboot. then press fn+F12 keyboard keys in laptop and boot from slackel usb
and in grub menu i choose Salix OS 15.0 - Xfce (64 Bits)
system boot in salix live because iso is found on the partition of the ssd disk because rootuuid=a9cec8d3-2770-4cb9-acbb-55479a5370f8 is unique.
of course rootuuid=a9cec8d3-2770-4cb9-acbb-55479a5370f8 is different in my case.

So use the above menuentry exactly. Just replace rootuuid with the partition uuid where iso file exists. And the real path of the iso in the partition.
inukaze
Posts: 38
Joined: 24. Nov 2024, 18:42

Re: GRUB2 ISO Live Entry for Salix 15.0 Xfce 64 Bits

Post by inukaze »

Don't worry the Salix 15.0 on Live Mode from USB is working perfectly :D

Thank you very much, for all :D
Post Reply