mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Artur Wiebe <artur@4wiebe.de>
To: ptxdist@pengutronix.de
Cc: Artur Wiebe <artur@4wiebe.de>
Subject: [ptxdist] [PATCH] DRAFT: openssh: make host key generation optional
Date: Fri, 13 Nov 2020 15:19:55 +0100	[thread overview]
Message-ID: <20201113141955.3477005-1-artur@4wiebe.de> (raw)

How can openssh.postinst be disabled from within the rule files?
---
 rules/openssh.in   | 14 ++++++++++----
 rules/openssh.make |  2 ++
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/rules/openssh.in b/rules/openssh.in
index 09f5c5555..f9d1affbd 100644
--- a/rules/openssh.in
+++ b/rules/openssh.in
@@ -6,10 +6,10 @@ menuconfig OPENSSH
 	select OPENSSL
 	select LIBC_CRYPT
 	select LIBC_UTIL
-	select RC_ONCE if OPENSSH_SSHD && RUNTIME
+	select RC_ONCE if OPENSSH_SSHD_GENKEYS && RUNTIME
 	select BUSYBOX_START_STOP_DAEMON if OPENSSH_SSHD_STARTSCRIPT
 	select LIBSELINUX if GLOBAL_SELINUX
-	select OPENSSH_KEYGEN if OPENSSH_SSHD
+	select OPENSSH_KEYGEN if OPENSSH_SSHD_GENKEYS
 	prompt "openssh                       "
 	help
 	  secure shell client/server, an rlogin/rsh/rcp replacement
@@ -40,15 +40,21 @@ config OPENSSH_SSHD
 config OPENSSH_SSHD_STARTSCRIPT
 	bool
 	default y
-	depends on OPENSSH_SSHD
+	depends on OPENSSH_SSHD && INITMETHOD_BBINIT
 	prompt "install /etc/init.d/openssh"
 
 config OPENSSH_SSHD_SYSTEMD_UNIT
 	bool
 	default y
-	depends on OPENSSH_SSHD && SYSTEMD
+	depends on OPENSSH_SSHD && INITMETHOD_SYSTEMD
 	prompt "install systemd unit files for sshd"
 
+config OPENSSH_SSHD_GENKEYS
+	bool
+	default y
+	depends on OPENSSH_SSHD
+	prompt "generate sshd host keys at first boot"
+
 config OPENSSH_SCP
 	bool "scp"
 	help
diff --git a/rules/openssh.make b/rules/openssh.make
index cae04487f..0da2f23cd 100644
--- a/rules/openssh.make
+++ b/rules/openssh.make
@@ -105,8 +105,10 @@ ifdef PTXCONF_OPENSSH_SSHD
 		/etc/ssh/moduli)
 	@$(call install_copy, openssh, 0, 0, 0755, -, \
 		/usr/sbin/sshd)
+ifdef OPENSSH_SSHD_GENKEYS
 	@$(call install_alternative, openssh, 0, 0, 0755, /etc/rc.once.d/openssh)
 endif
+endif
 
 ifdef PTXCONF_INITMETHOD_BBINIT
 ifdef PTXCONF_OPENSSH_SSHD_STARTSCRIPT
-- 
2.29.2


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

             reply	other threads:[~2020-11-13 14:20 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-13 14:19 Artur Wiebe [this message]
2020-11-13 17:46 ` Ladislav Michl
2020-11-14 20:34   ` Roland Hieber
2020-11-15 10:06     ` Ladislav Michl
2020-11-15 17:08       ` Roland Hieber
2020-11-16  9:36         ` Michael Olbrich
2020-11-16  9:45           ` [ptxdist] ?==?utf-8?q? ?==?utf-8?q? [PATCH] DRAFT:?==?utf-8?q? " Artur Wiebe
2020-11-16 10:32             ` [ptxdist] ?= [PATCH] DRAFT:=?utf-8?q? " Michael Olbrich
2020-11-16 15:09               ` [ptxdist] ?==?utf-8?q? ?==?utf-8?q? ?= [PATCH]?==?utf-8?q? DRAFT:l Artur Wiebe
2020-11-17  6:55                 ` [ptxdist] ?= ?==?utf-8?q? " Michael Olbrich
2020-11-16 15:26               ` [ptxdist] ?= [PATCH] DRAFT:=?utf-8?q? openssh: make host key generation optional Denis Osterland-Heim
2020-11-16 19:16               ` [ptxdist] ?==?utf-8?q? ?==?utf-8?q? ?= [PATCH]?==?utf-8?q? DRAFT:l Artur Wiebe
2020-11-17 11:24                 ` [ptxdist] ?= ?==?utf-8?q? " Roland Hieber
2020-11-17 11:29                   ` [ptxdist] ?= " Roland Hieber
2020-11-16  9:36 ` [ptxdist] [PATCH] DRAFT: openssh: make host key generation optional Michael Olbrich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201113141955.3477005-1-artur@4wiebe.de \
    --to=artur@4wiebe.de \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox