aboutsummaryrefslogtreecommitdiffstats
path: root/src/fripost-partman-udeb
diff options
context:
space:
mode:
Diffstat (limited to 'src/fripost-partman-udeb')
-rw-r--r--src/fripost-partman-udeb/base.sh14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/fripost-partman-udeb/base.sh b/src/fripost-partman-udeb/base.sh
index 23fcdeb..0155569 100644
--- a/src/fripost-partman-udeb/base.sh
+++ b/src/fripost-partman-udeb/base.sh
@@ -364,16 +364,14 @@ fripost_encrypt() {
rm -f "$keyfile" # We are on a ramdisk, so it's good enough to unlink(2)
# Add an entry to the crypttab
- printf "%-15s %-41s %-15s %s\n" \
- "$name" UUID=$(/bin/block-attr --uuid "$device") none luks \
- >> /tmp/crypttab
+ fripost_crypttab_addentry "$name" "$device" none luks
local m _
[ -d /var/lib/fripost ] || mkdir /var/lib/fripost
# The modules required to fire up dropbear and start cryptsetup in the ramdisk.
- echo dm_crypt > /tmp/initramfs-modules
+ echo dm_crypt >> /var/lib/fripost/initrd-modules
while read m _; do /sbin/modinfo -F filename "$m"; done < /proc/modules \
- | sed -nr "s@^/lib/modules/`uname -r`/kernel/((arch/[^/]+/)?crypto|drivers/(ata|scsi))(/.*)?/([^/]+)\.ko\$@\5@p" \
+ | sed -nr "s@^/lib/modules/`uname -r`/kernel/((arch/[^/]+/)?crypto|drivers/(ata|scsi|net))(/.*)?/([^/]+)\.ko\$@\5@p" \
>> /var/lib/fripost/initrd-modules
/bin/apt-install busybox cryptsetup || true
@@ -381,6 +379,12 @@ fripost_encrypt() {
}
+fripost_crypttab_addentry() {
+ local name="$1" uuid=$(/bin/block-attr --uuid "$2") keyfile="$3" options="$4"
+ printf "%-15s %-41s %-15s %s\n" "$name" "UUID=$uuid" "$keyfile" "$options" >>/tmp/crypttab
+}
+
+
# Like ssh-keygen -lf, but for a file such as authorized_keys, which
# may contain multiple keys. Also, use the comment associated with the
# key rather than the filename.