Browse Source

add the ability to add a ssh pubkey via menu

Waldemar Brodkorb 15 years ago
parent
commit
cd5672bc34
3 changed files with 27 additions and 2 deletions
  1. 13 0
      Config.in
  2. 7 1
      package/dropbear/Makefile
  3. 7 1
      package/openssh/Makefile

+ 13 - 0
Config.in

@@ -23,6 +23,19 @@ config ADK_HOST
 	help
 	  Configure host for IPKG package management
 
+config ADK_SSH_PUBKEY
+	string "SSH public key (root user only)"
+	default ""
+	help
+	  Paste your generated SSH public key here and it will be embedded into
+	  the built image, so you can use it to login instantly.
+
+#config ADK_PASSWORD
+#	string "root password for the embedded system"
+#	default "linux123"
+#	help
+#	  Predefine the root password enabled in the the built image.
+
 config ADK_DEVELSYSTEM
 	bool "Compile a ADK development system"
 	default n

+ 7 - 1
package/dropbear/Makefile

@@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=		dropbear
 PKG_VERSION:=		0.52
-PKG_RELEASE:=		2
+PKG_RELEASE:=		3
 PKG_MD5SUM:=		1c69ec674481d7745452f68f2ea5597e
 PKG_DESCR:=		SSH 2 server/client designed for embedded systems 
 PKG_SECTION:=		net
@@ -62,5 +62,11 @@ do-install:
 	$(INSTALL_DIR) $(IDIR_DBCONVERT)/usr/bin
 	$(INSTALL_BIN) $(WRKBUILD)/dropbearconvert \
 		$(IDIR_DBCONVERT)/usr/bin/dropbearconvert
+	# ssh pubkey
+	test -z $(ADK_SSH_PUBKEY) || ( \
+		mkdir -p $(IDIR_DROPBEAR)/etc/dropbear; \
+		echo $(ADK_SSH_PUBKEY) \
+		>$(IDIR_DROPBEAR)/etc/dropbear/authorized_keys; \
+        )
 
 include ${TOPDIR}/mk/pkg-bottom.mk

+ 7 - 1
package/openssh/Makefile

@@ -5,7 +5,7 @@ include ${TOPDIR}/rules.mk
 
 PKG_NAME:=		openssh
 PKG_VERSION:=		5.5p1
-PKG_RELEASE:=		1
+PKG_RELEASE:=		2
 PKG_MD5SUM:=		88633408f4cb1eb11ec7e2ec58b519eb
 PKG_DESCR:=		OpenSSH server
 PKG_SECTION:=		net
@@ -85,5 +85,11 @@ post-install:
 	${INSTALL_BIN} ${WRKINST}/usr/libexec/sftp-server \
 		${IDIR_OPENSSH_SFTP_SERVER}/usr/libexec
 	chmod 0700 {${IDIR_OPENSSH_CLIENT},${IDIR_OPENSSH_SERVER}}/etc/ssh
+	# ssh pubkey
+	test -z $(ADK_SSH_PUBKEY) || ( \
+		mkdir -p $(IDIR_OPENSSH_SERVER)/etc/ssh; \
+		echo $(ADK_SSH_PUBKEY) \
+		>$(IDIR_OPENSSH_SERVER)/etc/ssh/authorized_keys; \
+        )
 
 include ${TOPDIR}/mk/pkg-bottom.mk