Você precisa usar as entradas em /usr/share/initramfs-tools/hooks
. Esses arquivos são executados quando você digita update-initramfs
. Crie seu próprio script de gancho ou remova scripts.
Outra pasta é /etc/initramfs-tools/hook
De man initramfs-tools
Hooks can be found in two places: /usr/share/initramfs-tools/hooks and
/etc/initramfs-tools/hooks. They are executed during generation of the
initramfs-image and are responsible for including all the necessary
components in the image itself. No guarantees are made as to the order
in which the different scripts are executed unless the prereqs are
setup in the script.
Note que os scripts de gancho fazem parte dos pacotes, por ex. %código%. O pacote cria o arquivo kmod
em kmod
.
Script de exemplo
#!/bin/sh -e
# Copy the compatibility symlinks until initramfs-tools will be converted
# to use the kmod program.
if [ "" = "prereqs" ]; then exit 0; fi
. /usr/share/initramfs-tools/hook-functions
copy_exec /bin/kmod
cp -a /sbin/modprobe /sbin/rmmod $DESTDIR/sbin/
mkdir -p $DESTDIR/lib/modprobe.d/
if [ "$(echo /lib/modprobe.d/*)" != "/lib/modprobe.d/*" ]; then
cp -a /lib/modprobe.d/* $DESTDIR/lib/modprobe.d/
fi
Como você pode ver, o script de gancho copia todos os arquivos em /usr/share/initramfs-tools/hooks
em /lib/modprobe.d/
cp -a /lib/modprobe.d/* $DESTDIR/lib/modprobe.d/
e initramfs/lib/modprobe.d/
em modprobe
cp -a /sbin/modprobe /sbin/rmmod $DESTDIR/sbin/
Seu próprio initramfs/sbin
com um arquivo initrd.img
cd
mkdir initrd
cd initrd
touch foo # an example file
find . | cpio -o -H newc > ../initrd.img
cd ..
gzip initrd.img
cp initrd.img.gz initrd.img
Verifique o conteúdo do seu foo
cd
mkdir initrd_out
cd initrd_out
cpio -i < ../initrd.img
E com initrd.img
você deve ver um arquivo
% ls
foo