Hi there!
I use Artix as the main distro in my multiboot machines, meaning that GRUB is installed under Artix.
I am now adding iso files to Artix's partition so they can be loaded via GRUB, something that has been working fine except for the fact that I often have problem with 40_custom. So far I have been circumventing this by editing grub.cfg, but today I decided that I must find a more elegant solution and after my searching did not yield anything useful I am asking for your kind advice.
Here my 40_custom:
#!/bin/sh
exec tail -n +3 $0
# !!! redigerat juni 12, 2024 !!!
# 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.
#
### BEGIN /etc/grub.d/40_custom ###
# 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 'Slackware 15.0 x86_64 (on /dev/sda6)' --class slackware --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-be286b94-f51d-4e7f-9b78-0bc55c85c5f0' {
insmod part_msdos
insmod ext2
set root='hd0,msdos6'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6 be286b94-f51d-4e7f-9b78-0bc55c85c5f0
else
search --no-floppy --fs-uuid --set=root be286b94-f51d-4e7f-9b78-0bc55c85c5f0
fi
linux /boot/vmlinuz-generic-5.15.145 root=uuid=be286b94-f51d-4e7f-9b78-0bc55c85c5f0
initrd /boot/initrd-generic-5.15.145.gz
}
menuentry 'Slackware 15.0 x86_64 (on /dev/sda6)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-huge-5.15.117--881297f9-271c-4ec0-8d7b-57bb0832f14d' {
insmod part_msdos
insmod ext2
set root='hd0,msdos6'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6 881297f9-271c-4ec0-8d7b-57bb0832f14d
else
search --no-floppy --fs-uuid --set=root 881297f9-271c-4ec0-8d7b-57bb0832f14d
fi
linux /boot/vmlinuz-huge-5.15.145 root=uuid=be286b94-f51d-4e7f-9b78-0bc55c85c5f0
initrd /boot/initrd-generic-5.15.145.gz
}
menuentry 'EndeavourOS_Cassini_22_12 by Manoel, modified> uuid>label' {
set root=(hd0,gpt2)
set isofile="/EndeavourOS_Cassini_22_12.iso"
search --no-floppy --set=root --file $isofile
probe --label $root --set=label
loopback loop $isofile
# Add your linux and initrd lines.
# For reference here's the parameters I have been using:
linux (loop)/arch/boot/x86_64/vmlinuz-linux img_dev=/dev/disk/by-label/$label img_loop=$isofile
initrd (loop)/arch/boot/intel-ucode.img (loop)/arch/boot/x86_64/initramfs-linux.img
}
menuentry '[loopback] vipnix-livecd-20240410-cdroot' {
insmod search_fs_uuid
isouuid=0487743c-9bc8-4ca4-9630-d0d2f73e3420
isopartuuid=490cb987-09
search --no-floppy --set=isopart --fs-uuid $isouuid
insmod loopback
set imgdevpath="/dev/disk/by-uuid/$isouuid"
set root=(hd0,gpt9)
set isofile='/Vipnix_sumverf/vipnix-livecd-20240410-1358.iso'
loopback loop $isofile
linux /kernel-funtoo root=UUID=0487743c-9bc8-4ca4-9630-d0d2f73e3420 init=/linuxrc dokeymap looptype=squashfs loop=/image.squashfs cdroot modprobe.blacklist=pcspkr modprobe.blacklist=matroxfb_base nodhcp overlayfs=1
initrd /funtoo.igz
}
menuentry "Reboot"{
reboot
}
menuentry "Shutdown"{
halt
}
and this is the output of mkconfig:
# grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/initramfs-linux.img
Found fallback initrd image(s) in /boot: initramfs-linux-fallback.img
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Found Artix Linux (rolling) on /dev/sda10
Found Void Linux on /dev/sda11
Found Funtoo Linux on /dev/sda12
Found Linux Mint 21 Vanessa (21) on /dev/sda5
Found Slackware 15.0 x86_64 on /dev/sda6
Adding boot menu entry for UEFI Firmware Settings ...
done
Resulting grub.cfg content enclosed.
If I know myself someone may find a silly typo.