mirror of
https://github.com/linuxboot/heads.git
synced 2024-12-18 20:47:55 +00:00
shell scripts to help rewrite Qubes initrd /etc/crypttab (issue #29)
This commit is contained in:
parent
8ce1309102
commit
ccea67e8b4
11
initrd/bin/generate-crypttab
Executable file
11
initrd/bin/generate-crypttab
Executable file
@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
# Generate a crypttab file for all the devices that are
|
||||
# present on the system. This is a total hack since the
|
||||
# rd.luks.key=/secret.key should be sufficient.
|
||||
|
||||
keyfile=/secret.key
|
||||
|
||||
for dev in /dev/sd*; do
|
||||
uuid=`cryptsetup luksUUID "$dev" 2>/dev/null` || continue
|
||||
echo "luks-$uuid /dev/disk/by-uuid/$uuid $keyfile luks"
|
||||
done
|
21
initrd/bin/wrap-cpio
Executable file
21
initrd/bin/wrap-cpio
Executable file
@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
# Add additional files to the initrd cpio so that we can pass
|
||||
# new keys to the Qubes startup routines.
|
||||
# Usage:
|
||||
# wrap-cpio /boot/initrd.blah /tmp/root/ > /tmp/new.cpio
|
||||
|
||||
die() { echo >&2 "$@"; exit 1; }
|
||||
warn() { echo >&2 "$@"; }
|
||||
|
||||
cpio_file="$1"
|
||||
if [ -z "$cpio_file" ]; then
|
||||
die "Initial cpio must be specified"
|
||||
fi
|
||||
|
||||
new_dir="$2"
|
||||
if [ -z "$new_dir" ]; then
|
||||
die "Additional directory must be specified"
|
||||
fi
|
||||
|
||||
( cd "$new_dir" ; find . | cpio -H newc -ov )
|
||||
cat "$cpio_file"
|
Loading…
Reference in New Issue
Block a user