summaryrefslogtreecommitdiff
path: root/debian/tmp/usr/share/initramfs-tools/hooks/overlayroot
blob: 406ccac24fd10c77ee19bbd16e719e254f2f7ac7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh
set -e

PREREQS="cryptsetup"
case $1 in
	prereqs) echo "${PREREQS}"; exit 0;;
esac

. /usr/share/initramfs-tools/hook-functions

##
copy_exec /usr/bin/head /bin
copy_exec /usr/bin/sha512sum /bin
copy_exec /sbin/wipefs /sbin
copy_exec /sbin/cryptsetup /sbin
copy_exec /sbin/mke2fs /sbin

# this is '||' only in case aesni_intel module isn't built (or others are built in)
manual_add_modules overlayfs overlay dm_mod dm_crypt aesni_intel || true

# Grab as much true random data as possible, up to 4KB, and stash it into a
# random seed in the initramfs
dd if=/dev/random of="${DESTDIR}/.random-seed" bs=1 count=4096 iflag=nonblock >/dev/null 2>&1 || true

# vi: ts=4 noexpandtab