[OpenWrt-Devel] [PATCHv2] dropbear: Install to /(s)bin instead of /usr so OpenSSH can coexist

Rosen Penev rosenp at gmail.com
Thu Jun 21 14:52:30 EDT 2018


If you run opkg install openssh-client and then remove it, the ssh client
symlink that was initially there goes away. This avoids that problem.

Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
v2: Fixed new key generation
 package/network/services/dropbear/Makefile     | 18 +++++++++---------
 .../services/dropbear/files/dropbear.init      |  6 +++---
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/package/network/services/dropbear/Makefile b/package/network/services/dropbear/Makefile
index 21ac09f724..41f51b284b 100644
--- a/package/network/services/dropbear/Makefile
+++ b/package/network/services/dropbear/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dropbear
 PKG_VERSION:=2017.75
-PKG_RELEASE:=5
+PKG_RELEASE:=6
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:= \
@@ -57,7 +57,7 @@ endef
 
 define Package/dropbear/conffiles
 /etc/dropbear/dropbear_rsa_host_key
-/etc/config/dropbear 
+/etc/config/dropbear
 endef
 
 define Package/dropbearconvert
@@ -128,13 +128,13 @@ define Build/Compile
 endef
 
 define Package/dropbear/install
-	$(INSTALL_DIR) $(1)/usr/sbin
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/dropbearmulti $(1)/usr/sbin/dropbear
-	$(INSTALL_DIR) $(1)/usr/bin
-	$(LN) ../sbin/dropbear $(1)/usr/bin/scp
-	$(LN) ../sbin/dropbear $(1)/usr/bin/ssh
-	$(LN) ../sbin/dropbear $(1)/usr/bin/dbclient
-	$(LN) ../sbin/dropbear $(1)/usr/bin/dropbearkey
+	$(INSTALL_DIR) $(1)/sbin
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/dropbearmulti $(1)/sbin/dropbear
+	$(INSTALL_DIR) $(1)/bin
+	$(LN) ../sbin/dropbear $(1)/bin/scp
+	$(LN) ../sbin/dropbear $(1)/bin/ssh
+	$(LN) ../sbin/dropbear $(1)/bin/dbclient
+	$(LN) ../sbin/dropbear $(1)/bin/dropbearkey
 	$(INSTALL_DIR) $(1)/etc/config
 	$(INSTALL_DATA) ./files/dropbear.config $(1)/etc/config/dropbear
 	$(INSTALL_DIR) $(1)/etc/init.d
diff --git a/package/network/services/dropbear/files/dropbear.init b/package/network/services/dropbear/files/dropbear.init
index 2225113498..e40cdb2bd5 100755
--- a/package/network/services/dropbear/files/dropbear.init
+++ b/package/network/services/dropbear/files/dropbear.init
@@ -6,7 +6,7 @@ START=50
 STOP=50
 
 USE_PROCD=1
-PROG=/usr/sbin/dropbear
+PROG=/sbin/dropbear
 NAME=dropbear
 PIDCOUNT=0
 EXTRA_COMMANDS="killclients"
@@ -96,8 +96,8 @@ keygen()
 		[ -f /tmp/$key -o -s /etc/$key ] || {
 			# generate missing keys
 			mkdir -p /tmp/dropbear
-			[ -x /usr/bin/dropbearkey ] && {
-				/usr/bin/dropbearkey -t $keytype -f /tmp/$key 2>&- >&- && exec /etc/rc.common "$initscript" start
+			[ -x /bin/dropbearkey ] && {
+				/bin/dropbearkey -t $keytype -f /tmp/$key 2>&- >&- && exec /etc/rc.common "$initscript" start
 			} &
 		exit 0
 		}
-- 
2.17.1


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/listinfo/openwrt-devel



More information about the openwrt-devel mailing list