Initramfs

Initramfs are archives that the kernel uses to get to its root file system.

Scripts
You can add your custom scripts in /etc/initramfs-tools/scripts/. Note that their names must be alphanumeric or "_". If you have any other characters, the script will be silently ignored. Also note that the initramfs does not have bash, so you must use /bin/sh.