Update-initramfs -u stalls when bind_vfio.sh script is in initramfs-tools

I recently had to reinstall my system. So I’m redoing all the gpu passthrough stuff. Following the guide I created the /etc/initramfs-tools/scripts/init-top/bind_vfio.sh script.

But that seems to make update-initramfs hang.

root@monolith:/boot/efi/loader/entries# mv /etc/initramfs-tools/scripts/init-top/bind_vfio.sh /root/bind_vfio.sh
root@monolith:/boot/efi/loader/entries# update-initramfs -u
update-initramfs: Generating /boot/initrd.img-5.4.0-7634-generic
cryptsetup: WARNING: Resume target cryptswap uses a key file
kernelstub.Config    : INFO     Looking for configuration...
kernelstub           : INFO     System information: 

    OS:..................Pop!_OS 20.04
    Root partition:....../dev/nvme0n1p3
    Root FS UUID:........e9a839d8-e38d-406b-a03d-337fcd7f154f
    ESP Path:............/boot/efi
    ESP Partition:......./dev/nvme0n1p1
    ESP Partition #:.....1
    NVRAM entry #:.......-1
    Boot Variable #:.....0000
    Kernel Boot Options:.quiet loglevel=0 systemd.show_status=false splash
    Kernel Image Path:.../boot/vmlinuz-5.4.0-7634-generic
    Initrd Image Path:.../boot/initrd.img-5.4.0-7634-generic
    Force-overwrite:.....False

kernelstub.Installer : INFO     Copying Kernel into ESP
kernelstub.Installer : INFO     Copying initrd.img into ESP
kernelstub.Installer : INFO     Setting up loader.conf configuration
kernelstub.Installer : INFO     Making entry file for Pop!_OS
kernelstub.Installer : INFO     Backing up old kernel
kernelstub.Installer : INFO     No old kernel found, skipping
root@monolith:/boot/efi/loader/entries# mv /root/bind_vfio.sh /etc/initramfs-tools/scripts/init-top/bind_vfio.sh
root@monolith:/boot/efi/loader/entries# update-initramfs -u
update-initramfs: Generating /boot/initrd.img-5.4.0-7634-generic
cryptsetup: WARNING: Resume target cryptswap uses a key file


This is all from today. But I had the update-initramfs -u running all night long…

When I look at other files in /etc/initramfs-tools/scripts, I see /etc/initramfs-tools/scripts/local-top/lvm-workaround has permissions of -rwxr-xr-t.

I tried setting the script to those permissions, but it didn’t help.

I also tried the 755 permissions mentioned in the guide first.

Using the -v flag gives a LOT of output. It stalls here:

Calling hook dmsetup
Calling hook klibc-utils
/usr/share/initramfs-tools/scripts/local-bottom/ORDER ignored: not executable
/usr/share/initramfs-tools/scripts/local-premount/ORDER ignored: not executable
/usr/share/initramfs-tools/scripts/local-block/ORDER ignored: not executable
/usr/share/initramfs-tools/scripts/init-top/ORDER ignored: not executable
/usr/share/initramfs-tools/scripts/init-top/brltty ignored: not executable

I’m assuming that’s about where it would grab the scripts out of etc.

I tried placing bind_vfio.sh in the /usr dir, but it didn’t help.

Any ideas?

A reboot fixed it. ???

root@monolith:~# lsinitramfs /boot/initrd.img-5.4.0-7634-generic | grep vfio
scripts/init-top/bind_vfio.sh
usr/lib/modules/5.4.0-7634-generic/kernel/drivers/vfio
usr/lib/modules/5.4.0-7634-generic/kernel/drivers/vfio/mdev
usr/lib/modules/5.4.0-7634-generic/kernel/drivers/vfio/mdev/mdev.ko
usr/lib/modules/5.4.0-7634-generic/kernel/drivers/vfio/mdev/vfio_mdev.ko

If it was a different kernel I could sorta get it, but it isn’t…

Sheesh.