Configuring ELILO with a generic kernel on Slackware 14.2
Configuring and using a generic kernel on EFI-based platforms with ELILO is pretty much an identical exercise to using LILO with legacy systems. Slackware provides you with a mkinitrd generator script to assist in making an initrd image to boot your system.
As an example, on my system the generator script suggests the following mkinitrd command to build an initrd (initial ramdisk).
root@slackdom:~# /usr/share/mkinitrd/mkinitrd_command_generator.sh # A suitable 'mkinitrd' command will be: mkinitrd -c -k 4.4.15 -f ext4 -r /dev/sda6 -m xhci-pci:ohci-pci:ehci-pci:xhci-hcd:uhci-hcd:ehci-hcd:hid:usbhid:i2c-hid:hid_generic:hid-cherry:hid-logitech:hid-logitech-dj:hid-logitech-hidpp:hid-lenovo:hid-microsoft:hid_multitouch:jbd2:mbcache:ext4 -u -o /boot/initrd.gz
The rather excessive list of modules I got in return was a result of having a USB keyboard attached. I checked the script since it didn’t make any sense to me (based on the drivers I was using), and I noticed that the script will return a hard coded list of drivers if it detects an attached USB keyboard. Anyhow, since I didn’t need those drivers I simply used the following command to add support for the ext4 filsystem:
mkinitrd -c -k 4.4.15 -f ext4 -r /dev/sda6 -m jbd2:mbcache:ext4 -u -o /boot/initrd.gz
Please be aware that if you have an encrypted root partition you will have to add support for your USB keyboard. However, the ELILO menu still works without the drivers as it’s managed by the UEFI firmware at that point.
The next step is moving the initrd image and the generic kernel to the EFI partition. On my system the path is /boot/efi/EFI/Slackware/
cp /boot/initrd.gz /boot/efi/EFI/Slackware/ cp /boot/vmlinuz-generic-4.4.15 /boot/efi/EFI/Slackware/
Lastly, I’ll configure ELILO with the option to boot either the generic or the huge kernel. I’ll stick with the generic kernel as default.
# /boot/efi/EFI/Slackware/elilo.conf default = generic prompt chooser = simple delay = 100 timeout = 100 # huge kernel image = vmlinuz root = /dev/sda6 read-only append = "resume=/dev/sdb4" label = huge description = "Slackware 64 huge 4.4.15" # generic kernel image = vmlinuz-generic-4.4.15 root = /dev/sda6 read-only append = "resume=/dev/sdb4" initrd = initrd.gz label = generic description = "Slackware 64 generic-4.4.15"
See ELILO: EFI Linux Boot for config options.