public
Last active

Patch for encrypt to enable dropbear ssh unlocking support

  • Download Gist
encryptssh.patch
Diff
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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
--- encryptssh 2012-11-20 13:36:06.543242127 +0000
+++ encryptssh 2012-11-20 14:31:29.943244577 +0000
@@ -44,6 +44,9 @@
cryptname="root"
fi
+ echo ${cryptdev} > /.cryptdev
+ echo ${cryptname} > /.cryptname
+
warn_deprecated() {
echo "The syntax 'root=${root}' where '${root}' is an encrypted volume is deprecated"
echo "Use 'cryptdevice=${root}:root root=/dev/mapper/root' instead."
@@ -79,8 +82,39 @@
#loop until we get a real password
while ! eval cryptsetup luksOpen ${resolved} ${cryptname} ${cryptargs} ${CSQUIET}; do
- sleep 2;
+ if [ -f /.done ]; then
+ break
+ fi
+ sleep 2;
done
+
+ killall dropbear
+ . /ip_opts
+ /sbin/ip addr flush dev "$device"
+ /sbin/ip link set down "$device"
+
+ if [ -f /.done ]; then
+ rm /.done
+ fi
+
+ if [ -f /.cryptdev ]; then
+ rm /.cryptdev
+ fi
+
+ if [ -f /.cryptname ]; then
+ rm /.cryptname
+ fi
+
+ umount /dev/pts
+ rm -R /dev/pts
+
+ if [ -f /var/log/lastlog ]; then
+ rm /var/log/lastlog
+ fi
+
+ if [ -f /var/run/dropbear.pid ]; then
+ rm /var/run/dropbear.pid
+ fi
fi
if [ -e "/dev/mapper/${cryptname}" ]; then
if [ ${DEPRECATED_CRYPT} -eq 1 ]; then

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.