Quote:
Originally Posted by Didier Spaier
An example of /etc/grub.d/40_custom below:
Code:
#!/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 'Slint ISO' {
insmod part_gpt
insmod part_msdos
search --no-floppy --fs-uuid --set=root 163f42f7-bf65-4290-a93f-761b8bb38bc6
set isofile='slint64-15.0-3.iso'
loopback loop /repo/x86_64/slint-15.0/iso/$isofile
linux (loop)/linux quiet vga=normal load_ramdisk=1 prompt_ramdisk=0 ro printk.time=0 LANG=en_US.utf8
initrd (loop)/initrd
}
This can be handy to boot an installer without writing the ISO on an optical disk or USB stick, just storing it an existing partition (if GRUB is installed, of course).
I also use it to test a new installer in bare metal (not in a VM), thus with access to all files in the machine. This allows me to correct the installer's scripts "on the fly" when I find mistakes, without rewriting an ISO and burning it again on an installation media. As I make a lot of mistakes this saves me a lot of time.
Automatize kernel upgrades is not difficult: what Didier can do, Patrick can do way better, it's just not The Slackware Way so far.
|
Ah yes, this brings back so many fun memories. When GRUB2 first came out, I had a lot of time to play with it.
Check out this forum post from Linux Mint where we fleshed out using search with labels for partitions.
https://forums.linuxmint.com/viewtop...222330#p222330
Also, you can make any number of entries, not just 40_custom. I would make whatever number.
I was really excited about the loopback feature:
https://forums.linuxmint.com/viewtop...220639#p220639
I don't bother with the variable using set isofile just to keep it looking simple.
Certainly these are usually needed these days - insmod part_gpt insmod part_msdos
Now that EFI and GPT are used.
It is fun to boot into grub and drop to the command line. It is a good exercise to learn to boot a system by typing commands, loading modules, etc. It has saved me more than once when a system would not boot.