I'm using an initramfs for a long time. I need it for Easy backups and snapshots of a running system with LVM to load the lvm driver before mounting the root partition. But it is a little bit dangerous because automatic updating a initramfs isn't supported by Raspbian. The trigger of installing software packages to update-initramfs
simply does not work. You have always to take attention on updates for kernel packages, drivers and modules that may be needed for booting and then you have to create the initramfs by hand. I had a look at the trigger function but have given up after a short time. If you find a way to adapt it to Raspbian, that would be great.
For now I have attention if one of these packages are updated:
rpi ~$ apt list *raspberrypi*
Listing... Done
libraspberrypi-bin/stable,now 1.20180924-1 armhf [installed]
libraspberrypi-dev/stable,now 1.20180924-1 armhf [installed]
libraspberrypi-doc/stable,now 1.20180924-1 armhf [installed]
libraspberrypi0/stable,now 1.20180924-1 armhf [installed]
raspberrypi-archive-keyring/stable 2016.10.31 all
raspberrypi-artwork/stable 20150921 all
raspberrypi-bootloader/stable,now 1.20180924-1 armhf [installed]
raspberrypi-kernel/stable,now 1.20180924-1 armhf [installed]
raspberrypi-kernel-headers/stable 1.20180924-1 armhf
raspberrypi-net-mods/stable,now 1.2.7 all [installed]
raspberrypi-sys-mods/stable,now 20180328+1 armhf [installed]
raspberrypi-ui-mods/stable 1.20180706 all
Another important indicator is:
rpi ~$ uname -r
4.14.70-v7+
and
rpi ~$ ls /lib/modules
4.14.71+ 4.14.71-v7+
If this differ then the modules where updated but the old kernel is still running. If you boot now with your old initramfs.gz
then you are lost. To make a new initramfs I execute:
rpi ~$ sudo mkinitramfs -o /boot/initramfs.gz -v 4.14.71-v7+
If you are unsure that you have updated the initramfs you can look with lsinitramfs /boot/initramfs.gz
what modules are in it. And yes, only for the completeness for other readers: you have to insert a line with initramfs initramfs.gz
(without =
) into /boot/config.txt
to use it.