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

John Crispin blogic at openwrt.org
Tue Feb 16 12:12:21 EST 2016



On 16/02/2016 12:13, Bastian Bittorf wrote:
> 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
> 

this is really only fighting the symptoms. we dont really want to have
all scripts be aware of and handle full flash. i am not sure this is the
right approach to use.

	John

> 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
> 
_______________________________________________
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