Hi @Rosika ,
If you go to /etc/grub.d
you will find the following
nevj@mary:/etc/grub.d$ ls
00_header 10_linux 30_os-prober 40_custom orig.40_custom
05_debian_theme 20_linux_xen 30_uefi-firmware 41_custom README
The only file you shoud touch in there is 40_custom
. The other files grub commands which automatically find OS’s on your disk(s) and setup grub boot commands for them .
THe default 40_custom
file looks like this
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
You can add things after these lines to define a custom grub menu entry
Here is one that I did to boot the boot directly from the void distribution .iso file on HD
type or paste code here#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry "Void ISO" {
set isoname="void-live-x86_64-20210930.iso"
set isofile="/home/nevj/Downloads/void-live-x86_64-20210930.iso"
echo "Using ${isoname}..."
loopback loop $isofile
probe --label --set=cd_label (loop)
bootoptions="iso-scan/filename=$isofile findiso=$isofile root=live:CDLABEL=$cd_label init=/sbin/init ro rd.luks=0 rd.md=0 rd.dm=0 loglevel=4 vconsole.unicode=1 vconsole.keymap=us locale.LANG=en_US.UTF-8"
linux (loop)/boot/vmlinuz $bootoptions
initrd (loop)/boot/initrd
}
What it is doing is using griub commands that you would normally type at the grub> prompt to tell grub to loopmount the file void-live-x86_64-20210930.iso
, then setting bootoptions appropriate for Void, then telling it where to find vmlinuz and initrd.
If you did all that at the grub> command prompt you would then say grub> boot
but in a 40_custom file you are defining a grub menu entry so you leave out the boot, that happens when you click on the grub menu entry.
After you have defined a 40_custom file, you just do update-grub
it makes a new grub.cfg
file in `/boot/grub’. Then when you boot you get a grub menu containing the newly defined custom entry.
Now, the problem with all this is is that what I have in that example will only work for Void .iso files. Here are 4-)custom entries for some other linux varieties
menuentry "Ubuntu 10.10 Desktop ISO" {
loopback loop /ubuntu.iso
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/ubuntu.iso noeject noprompt splash --
initrd (loop)/casper/initrd.lz
}
menuentry "Linux Mint 10 Gnome ISO" {
loopback loop /linuxmint10.iso
linux (loop)/casper/vmlinuz file=/cdrom/preseed/mint.seed boot=casper initrd=/casper/initrd.lz iso-scan/filename=/linuxmint10.iso noeject noprompt splash --
initrd (loop)/casper/initrd.lz
}
menuentry "Tinycore ISO" {
loopback loop /tinycore.iso
linux (loop)/boot/bzImage --
initrd (loop)/boot/tinycore.gz
}
menuentry "Memtest 86+" {
linux16 /memtest86+.bin
}
menuentry "SystemRescueCd" {
loopback loop /systemrescuecd.iso
linux (loop)/isolinux/rescuecd isoloop=/systemrescuecd.iso setkmap=us docache dostartx
initrd (loop)/isolinux/initram.igz
}
I got those from the internet, I have never tested them.
So, if you wanted to do this with EasyOS, you would need to get in touch with the maintainers and ask if anyone had defined a 40_custom entry to boot EasyOS from its .img file. It should be possible, but you need the knowledge. Make sure you get 40_custom entry for grub2… a legacy grub entry will not work with grub2
Regards
Neville