[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.

Welcome to the Slackware Documentation Project

This is an old revision of the document!


How to switch from Kernel Huge to Generic?

At the end of this recipe the user will be able to switch from Kernel Huge to Kernel Generic on Slackware, and enjoy its benefits. You may be wondering what benefit you get from this change. The benefits of switching from Huge to Generic are:

  • More fluidity and faster boot, due to Generic loading only the modules your machine needs.
  • The modules are not embedded, thus giving better flexibility.

So what is Kernel Huge for? Simple, because it has huge support for many drivers, it is ideal for use in installing the system. Thus allowing to support a larger number of machine types. After installation Huge is no longer needed, which is why we should make the switch.

Starting the recipe

Login as root, every process will be done by the superuser, after that we will execute the command 'mkinitrd_command_generator.sh' which is present in /usr/share/mkinitrd

/usr/share/mkinitrd/mkinitrd_command_generator.sh

The output will be an examplemkinitrd command-line with the all the modules necessary for booting your machine. Example:

/usr/share/mkinitrd/mkinitrd_command_generator.sh
#
# mkinitrd_command_generator.sh revision 1.45
#
# This script will now make a recommendation about the command to use
# in case you require an initrd image to boot a kernel that does not
# have support for your storage or root filesystem built in
# (such as the Slackware 'generic' kernels').
# A suitable 'mkinitrd' command will be:

mkinitrd -c -k 4.4.172 -f ext4 -r /dev/sda1 -m 
usb-storage:ehci-hcd:ehci-pci:xhci-pci:ohci-pci:xhci-hcd:uhci-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

Copy the entire line where it starts with the command 'mkinitrd -c -k …' and right after that paste it into your terminal. The mkinitrd command will be executed and will have output in this format:

mkinitrd -c -k 4.4.172 -f ext4 -r /dev/sda1 -m usb-storage:ehci-hcd:ehci-pci:xhci-pci:ohci-pci:xhci-hcd:uhci-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

OK: /lib/modules/4.4.172/kernel/drivers/usb/storage/usb-storage.ko added.
OK: /lib/modules/4.4.172/kernel/drivers/usb/host/ehci-hcd.ko added.
OK: /lib/modules/4.4.172/kernel/drivers/usb/host/ehci-hcd.ko added.
OK: /lib/modules/4.4.172/kernel/drivers/usb/host/ehci-pci.ko added.
...
38432 blocks
/boot/initrd.gz created.
Be sure to run lilo again if you use it.
Tip: the following command will automatically execute the mkinitrd commandline so that you do not have to copy and paste it yourself:
$(/usr/share/mkinitrd/mkinitrd_command_generator.sh -r)

After that we will enter in lilo the information needed for Kernel Generic to be able to load, you can do this manually or you can simply run the command: '/usr/share/mkinitrd/mkinitrd_command_generator.sh' with the “-l” option then pass the full path to the location of vmlinuz-generic.

/usr/share/mkinitrd/mkinitrd_command_generator.sh -l \ /boot/vmlinuz-generic-4.4.172

image = /boot/vmlinuz-generic-4.4.172
  initrd = /boot/initrd.gz
  root = /dev/sda1
  label = 4.4.172
  read-only
# Linux bootable partition config ends

Now let's add this information to “/etc/lilo.conf”. Add the block of text above (starting with “image =”) at the end of lilo.conf. It is extremely important that you do NOT delete the Kernel Huge call, always leave it in case of tragedy with your system. . This for a possible rescue.

Change the label to a better name like “Generic” or something. This label will be appearing on the Lilo screen. With a better name it is easier for you to identify your new boot selection. After you have done the whole process you need to run 'lilo' for the new configuration to be saved:

lilo

Warning: LBA32 addressing assumed
Added Linux  *
Added Generic  +
One warning was issued.

Ready! Now just reboot your machine and select Kernel Generic.

Sources

 howtos:slackware:kernel_huge_for_generic ()