During the Ubuntu Server setup, I was given a choice to install a 'targeted' initrd with only the modules my computer needs. I chose the other option, 'generic'. How can I install a 'targeted' initrd now that I've already installed my system?
3 Answers
Edit /etc/initramfs-tools/initramfs.conf
and change
MODULES=most
to
MODULES=dep
then run
update-initramfs -u
-
For reference (couldn't find this elsewhere), my initrd went from 13M to 3.5M by doing this and, on a slow system, pretty significantly improved boot speed.– LucJul 17, 2014 at 23:12
Switching initrd type
As you correctly pointed out yourself, change the initramfs-tools MODULE=
setting from most
to dep
or the other way around, depending on your wishes.
Note, however, that hooks in /etc/initramfs-tools/conf.d
overrule the setting from /etc/initramfs-tools/initramfs.conf
. A file driver-policy
is created there when choosing a targeted initrd, at least on Debian (Jessie), that has MODULES=dep
.
Reasons for generic initrd
You might be interested in going the other way around (towards generic initrd) if you miss USB keyboard support for your LUKS password on boot. It seems the dep
option fails to detect the necessity for keyboard support.
Report examples:
- https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=771623
- https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=701681
If you like your lean targeted initrd, you might want to include modules hid_generic
and usbhid
in /etc/initramfs-tools/modules
for USB keyboards to work in initrd. Might be xhci_hcd
is also required if you use a USB3.0 controller to connect your keyboard
You probably want to install the linux-image-server
package.
-
-
I am not aware of any other kernel flavor, never heard of a "targeted" kernel. Both the generic and server kernels contain the core drivers built-in, drivers for additional hardware is available from modules which are only loaded if required. Dec 3, 2010 at 10:30
-
The option to choose between a 'generic' and 'targeted' kernel is given only if 'Export mode' is enabled in the setup. Dec 3, 2010 at 10:31