I would like to create an initramfs image for Debian Stretch which includes additional configuration files (say /etc/a.conf
).
What do I have to do prior to running mkinitramfs -o initrd.img
in order for the image to include such files?
I have chosen to do this with an initramfs hook for this ensures (if I understand correctly) that the change will also persist across future kernel upgrades. The hook takes the form of a script /etc/initramfs-tools/hooks/copy_etc
as follows:
#!/bin/sh -e
if [ "$1" = "prereqs" ]; then exit 0; fi
. /usr/share/initramfs-tools/hook-functions
cp /etc/a.conf $DESTDIR/etc/a.conf