From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1keutn-0003zw-T5 for ptxdist@pengutronix.de; Tue, 17 Nov 2020 07:55:31 +0100 Received: from mol by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1keutn-0004sw-KJ for ptxdist@pengutronix.de; Tue, 17 Nov 2020 07:55:31 +0100 Date: Tue, 17 Nov 2020 07:55:31 +0100 From: Michael Olbrich Message-ID: <20201117065531.GI14638@pengutronix.de> References: <20201116103202.GF14638@pengutronix.de> <3a0-5fb29680-83-46e83c80@56044540> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <3a0-5fb29680-83-46e83c80@56044540> Subject: Re: [ptxdist] =?utf-8?b?Pz0gID89PT91dGYtOD9xPyBbUEFUQ0hdPz09P3V0Zi04?= =?utf-8?b?P3E/IERSQUZUOmw=?= List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ptxdist-bounces@pengutronix.de Sender: "ptxdist" To: ptxdist@pengutronix.de On Mon, Nov 16, 2020 at 04:09:58PM +0100, Artur Wiebe wrote: > Doesn't work... :( Hmm, might be a bug in install_script_replace. It's not actually used in any upstream package... I'll have a closer look. Michael > On Monday, November 16, 2020 11:32 CET, Michael Olbrich wrote: > > > On Mon, Nov 16, 2020 at 10:45:07AM +0100, Artur Wiebe wrote: > > > On Monday, November 16, 2020 10:36 CET, Michael Olbrich wrote: > > > > On Sun, Nov 15, 2020 at 06:08:56PM +0100, Roland Hieber wrote: > > > > > On Sun, Nov 15, 2020 at 11:06:12AM +0100, Ladislav Michl wrote: > > > > > > On Sat, Nov 14, 2020 at 09:34:47PM +0100, Roland Hieber wrote: > > > > > > > On Fri, Nov 13, 2020 at 06:46:48PM +0100, Ladislav Michl wrote: > > > > > > > > On Fri, Nov 13, 2020 at 03:19:55PM +0100, Artur Wiebe wrote: > > > > > > > > > How can openssh.postinst be disabled from within the rule files? > > > > > > > > > > > > > > > > The very same could be achieved with symlink in your BSP: > > > > > > > > projectroot/etc/rc.once.d/openssh -> /dev/null > > > > > > > > > > > > > > I don't understand why you want to disable this. The SSH server will not > > > > > > > start without host keys. Or do you want to install a static version of > > > > > > > the host keys generated at build time? > > > > > > > > > > > > Yes, keys are static, generated at build time. Root filesystem is > > > > > > read-only. > > > > > > > > > > > > > If so, there should be an option for this. But for now, in my opinion, > > > > > > > disabling OPENSSH_SSHD_GENKEYS will just lead to a broken SSH server. > > > > > > > > > > > > As this is easy to solve at BSP level I never thought it could > > > > > > be a thing :) > > > > > > > > > > OK, but at least I would mention it in the kconfig help text. The > > > > > > > > Ack. > > > > > > > > > openssh recipe could also just pick up /etc/ssh/ssh_host_*_key via > > > > > install_alternative if this option is disabled. > > > > > > > > No. Shared ssh server keys are a bad idea. That's not something I want to > > > > merge upstream. > > > > > > This was also my concern... > > > > > > > > > > > But there are other use-cases to not use rc-once, e.g. if the server keys > > > > are generated during provisioning. And not selecting rc-once in this case > > > > makes sense, so this is acceptable im general. > > > > > > I still need a way to disable openssh.postinst if OPENSSH_SSHD_GENKEYS is not set. > > > > Hmmm, right. In the BSP, a /dev/null symlinks works for this as well, but > > we currently don't have a way to not install the postinst script. We could > > do something like this (untested): > > > > $(call install_script_replace, openssh, postinst, @RC_ONCE@, \ > > $(call ptx/ifdef, PTXCONF_OPENSSH_SSHD_GENKEYS,,#)) > > ----------------------------- > target: openssh.targetinstall > ----------------------------- > > install_init: preparing for image creation of 'openssh'... > install_init: @ARCH@ -> x86_64 > install_init: @PACKAGE@ -> openssh > install_init: @VERSION@ -> 8.3p1 > install_init: @DEPENDS@ -> openssl, rc-once, zlib > install_init: preinst not available > install_init: postinst packaging: 'root/rules/openssh.postinst' > install_init: prerm not available > install_init: postrm not available > install_fixup: @PRIORITY@ -> optional ... done. > install_fixup: @SECTION@ -> base ... done. > install_fixup: @AUTHOR@ -> "Marc Kleine-Budde " ... done. > install_fixup: @DESCRIPTION@ -> missing ... done. > XPKG=openssh; FILE=postinst; PLACEHOLDER=@RC_ONCE@; VALUE=; CMD="install_script_replace"; if [ ! -f "/tmp/ptxdist.qS1dcP/openssh.targetinstall.$XPKG" ]; then echo; echo "Error: install_init was not called for package '$XPKG'!"; echo "This is probably caused by a typo in the package name of:"; echo "\$(call $CMD, $XPKG, ...)"; echo; exit 1; fi; echo "ptxd_install_script_replace '$FILE' '$PLACEHOLDER' '$VALUE'" >> "/mnt/root/platform-x86/state/$XPKG.cmds" > xpkg_finish: collecting license (BSD AND BSD-2-Clause AND BSD-3-Clause AND MIT AND Beerware AND ISC) ... done. > xpkg_finish: creating opkg package ... > > > ptxdist: error: ptxd_install_script_replace: 'dst' must be an absolute path! > > > xpkg_finish: failed. > > > > > And in rules/openssh.postinst: > > > > #!/bin/sh > > @RC_ONCE@$DESTDIR/usr/sbin/enable-rc-once openssh > > > > This way the script may be installed, but it will do nothing. If > > PTXCONF_OPENSSH_SSHD_GENKEYS is disabled. > > > > Michael > > > > -- > > Pengutronix e.K. | | > > Steuerwalder Str. 21 | http://www.pengutronix.de/ | > > 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | > > Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | > > > > _______________________________________________ > > ptxdist mailing list > > ptxdist@pengutronix.de > > To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de > > > _______________________________________________ > ptxdist mailing list > ptxdist@pengutronix.de > To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de