aboutsummaryrefslogtreecommitdiffstats
path: root/src/fripost-postinst-udeb/finish-install.d/07fripost
diff options
context:
space:
mode:
Diffstat (limited to 'src/fripost-postinst-udeb/finish-install.d/07fripost')
-rwxr-xr-xsrc/fripost-postinst-udeb/finish-install.d/07fripost26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/fripost-postinst-udeb/finish-install.d/07fripost b/src/fripost-postinst-udeb/finish-install.d/07fripost
index bacb910..d4e05bb 100755
--- a/src/fripost-postinst-udeb/finish-install.d/07fripost
+++ b/src/fripost-postinst-udeb/finish-install.d/07fripost
@@ -48,6 +48,17 @@ progress "Generating public/private rsa key pair (OpenSSH)"
#######################################################################
+# Change initramfs defaults
+
+sed -ri -e 's/^#?\s*MODULES=.*/MODULES=dep/' \
+ -e 's/^#?\s*COMPRESS=.*/COMPRESS=xz/' \
+ /target/etc/initramfs-tools/initramfs.conf
+
+sed -nr '/^\s*(\S+)\s+\S+\s+swap\s.*/ {s//RESUME=\1/p;q}' /target/etc/fstab \
+ >> /target/etc/initramfs-tools/conf.d/resume
+
+
+#######################################################################
# Put dropbear in the initrd if full disk encryption is desired.
# Get username of the first user
@@ -175,11 +186,6 @@ cat > "$dpkg_remove" <<- EOF
wamerican
wbritish
EOF
-# XXX: the dummy package 'module-init-tools' is a dependency for 'acpid'.
-#/usr/sbin/chroot /target /usr/bin/dpkg-query \
-# --show --showformat='${binary:Package} ${binary:Summary}\n' \
-# | sed -rn 's/^(\S+)\s.*\btransitional dummy package\b.*/\1/p' \
-# >> "$dpkg_remove"
/bin/in-target /usr/bin/xargs -a"${dpkg_remove#/target}" \
debconf-apt-progress --no-progress -- apt-get -y autoremove --purge
rm -f "$dpkg_remove"
@@ -225,16 +231,16 @@ else
db_subst "$template" PORT "$port"
# Convert the key to OpenSSH format, so we can use ssh-keygen
- sshHostKey2=$(mktemp)
+ sshPubKey2=$(mktemp)
/usr/sbin/chroot /target /usr/bin/dropbearkey -y \
-f /etc/initramfs-tools/etc/dropbear/dropbear_rsa_host_key \
- | grep -E '^(ssh-(dss|rsa)|ecdsa-sha2-nistp(256|384|521))' > "$sshHostKey2"
- db_subst "$template" SSHFPR_INITRD "$(/usr/bin/ssh-keygen -lf $sshHostKey2)"
- rm -f "$sshHostKey2"
+ | grep -E '^(ssh-(dss|rsa|ed25519)|ecdsa-sha2-nistp(256|384|521))' > "$sshPubKey2"
+ db_subst "$template" SSHFPR_INITRD "$(sshfprs $sshPubKey2)"
+ rm -f "$sshPubKey2"
fi
db_subst "$template" USER "$user"
db_subst "$template" IPv4 "$(getIPv4)"
-db_subst "$template" SSHFPR_SERVER "$(/usr/bin/ssh-keygen -lf $sshHostKey)"
+db_subst "$template" SSHFPR_SERVER "$(sshfprs ${sshHostKey}.pub)"
db_subst "$template" SSHFPR_AUTHORIZED "$(sshfprs $import/authorized_keys ' - ')"
db_get fripost/final-notice