0

I'm currently trying to include cryptsetup into my initramfs so i can boot after having encrypted the root partition.

I created a hook-script in /usr/share/initramfs-tools/hooks/my_hook

With the following content

copy_exec /sbin/cryptsetup /sbin

But everytime i try to execute (in chroot)

update-initramfs -u -k all

It fails with:

root@ubuntu update-initramfs -u -k all
/usr/share/initramfs-tools/hooks/my_hook 
:1 /usr/share/initramfs- tools/hooks/my_hook copy_exec: not found

E: /usr/share/initramfs-tools/hooks/my_hook failed with return 127
KoKlA
  • 101
  • 2

1 Answers1

0

Make sure to rewrite my_hook to fit the standard calling convention AND to include the hook-functions (this is the important part)

#!/bin/sh -e

PREREQ=""

#Output prequisites
prereqs()
{
    echo "$PREREQ"
}

case $1 in prereqs)
    preqres
    exit 0;;
esac

. /usr/share/initramfs-tools/hook-functions # this is crucial
KoKlA
  • 101
  • 2