Skip to contentSkip to conversation

dropbear: fix missing directory with systemd

PATCH Superseded Maxime Hadjinlian 3 participants 4 messages May 28, 2014

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 dropbear: fix missing directory with systemd

The current SysV startup script create a directory which is necessary for dropbear to correctly work.
This creation is not done with systemd.

Instead of both init creating the directory, we add the creation of this directory to the INSTALL_TARGET_CMDS to make sure it's present.

---
 package/dropbear/S50dropbear | 4 ----
 package/dropbear/dropbear.mk | 1 +
 2 files changed, 1 insertion(+), 4 deletions(-)
package/dropbear/S50dropbear +0 -4
index a343b9e..f36165a 100644
@@ -10,10 +10,6 @@ start() {
 	DROPBEAR_ARGS="$DROPBEAR_ARGS -R"
 
 	echo -n "Starting dropbear sshd: "
-	# Make sure dropbear directory exists
-	if [ ! -d /etc/dropbear ] ; then
-		mkdir -p /etc/dropbear
-	fi
 	umask 077
 	start-stop-daemon -S -q -p /var/run/dropbear.pid \
 		--exec /usr/sbin/dropbear -- $DROPBEAR_ARGS
package/dropbear/dropbear.mk +1 -0
index 2ac6211..6f860e5 100644
@@ -85,6 +85,7 @@ define DROPBEAR_INSTALL_TARGET_CMDS
 	for f in $(DROPBEAR_TARGET_BINS); do \
 		ln -snf ../sbin/dropbear $(TARGET_DIR)/usr/bin/$$f ; \
 	done
+	mkdir -p ${TARGET_DIR}/etc/dropbear
 endef
 
 $(eval $(autotools-package))
Signature · 1 line
2.0.0.rc0
#1 lore raw

PATCH v2 1/1 dropbear: fix missing directory with systemd

Dear Maxime Hadjinlian,

package/dropbear/dropbear.mk define DROPBEAR_INSTALL_TARGET_CMDS · line 88

Quoted 1 line · Maxime Hadjinlian
package/dropbear/dropbear.mk +1 -0
+	mkdir -p ${TARGET_DIR}/etc/dropbear
	$(TARGET_DIR)

i.e, with parenthesis and not curly braces.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#2 lore raw

PATCH v2 1/1 dropbear: fix missing directory with systemd

In reply to Maxime Hadjinlian
Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Maxime" == Maxime Hadjinlian <[email protected]> writes:

The current SysV startup script create a directory which is necessary for dropbear to correctly work.
This creation is not done with systemd.

Instead of both init creating the directory, we add the creation of this directory to the INSTALL_TARGET_CMDS to make sure it's present.

Committed with the TARGET_DIR reference fixed as pointed out by Thomas, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#3 lore raw

PATCH v2 1/1 dropbear: fix missing directory with systemd

Hi all,

Thanks, doing too much shell scripting currently :(

Quoted 16 lines · Peter Korsgaard
Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Maxime" == Maxime Hadjinlian <[email protected]> writes:

The current SysV startup script create a directory which is necessary for dropbear to correctly work.
This creation is not done with systemd.

Instead of both init creating the directory, we add the creation of this directory to the INSTALL_TARGET_CMDS to make sure it's present.

Committed with the TARGET_DIR reference fixed as pointed out by Thomas, thanks.

--
Bye, Peter Korsgaard