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

1 Answer 1

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)
    prereqs
    exit 0;;
esac

# this is crucial
source /usr/share/initramfs-tools/hook-functions

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.