Created
November 20, 2012 14:50
-
-
Save cianmcgovern/4118375 to your computer and use it in GitHub Desktop.
Patch for encrypt to enable dropbear ssh unlocking support
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment