[OpenWrt-Devel] [PATCH] dropbear: fix forever hanging startup when jffs2 fails to mount

Bastian Bittorf bittorf at bluebottle.com
Tue Feb 16 06:13:27 EST 2016


if something goes wrong while mounting jffs2 (e.g. full flash
and the mount is readonly) the dropbear-init script will hang
forever (and so the startup-procedure) asking:

root at OpenWrt:~ /etc/init.d/dropbear boot
mv: overwrite '/etc/dropbear/dropbear_rsa_host_key'? <cursor blinking>

fix that by using 'mv -f' which omits the interactive question:

root at OpenWrt:~ mv -f /tmp/dropbear/dropbear_* /etc/dropbear/
mv: can't remove '/etc/dropbear/dropbear_rsa_host_key': Read-only file system

so the startup can continue.

Signed-off-by: Bastian Bittorf <bittorf at bluebottle.com>
---
 package/network/services/dropbear/files/dropbear.init | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/network/services/dropbear/files/dropbear.init b/package/network/services/dropbear/files/dropbear.init
index 03745c9..56565bd 100755
--- a/package/network/services/dropbear/files/dropbear.init
+++ b/package/network/services/dropbear/files/dropbear.init
@@ -100,7 +100,7 @@ keygen()
 
 	lock /tmp/.switch2jffs
 	mkdir -p /etc/dropbear
-	mv /tmp/dropbear/dropbear_* /etc/dropbear/
+	mv -f /tmp/dropbear/dropbear_* /etc/dropbear/
 	lock -u /tmp/.switch2jffs
 	chown root /etc/dropbear
 	chmod 0700 /etc/dropbear
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list