From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mediacenter.hi.pengutronix.de ([2001:6f8:1178:2::65]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1SCp9W-0001Ol-L9 for ptxdist@pengutronix.de; Wed, 28 Mar 2012 11:26:50 +0200 Received: from mol by mediacenter.hi.pengutronix.de with local (Exim 4.72) (envelope-from ) id 1SCp9W-00018m-Jr for ptxdist@pengutronix.de; Wed, 28 Mar 2012 11:26:50 +0200 Date: Wed, 28 Mar 2012 11:26:50 +0200 From: Michael Olbrich Message-ID: <20120328092650.GZ27119@pengutronix.de> References: <71d8b34cb98b8c7d5ae38819cafcfe13@idefix.lespocky.dyndns.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <71d8b34cb98b8c7d5ae38819cafcfe13@idefix.lespocky.dyndns.org> Subject: Re: [ptxdist] console_name for systemd based systems Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de Hi, On Wed, Mar 28, 2012 at 11:09:55AM +0200, Alexander Dahl wrote: > moving along with systemd integration I came across an issue where I'm > not sure how to integrate this nicely into ptxdist. Let me explain how > this works for busysbox init at the moment: > > There's PTXCONF_CONSOLE_NAME in platformconfig. For our project it has > the value /dev/ttyS0 because the target has no graphics system but just > a serial console. For busybox this is put to /etc/inittab around line 41 > of rules/initmethod-bbinit.make: > > 40 @$(call install_replace, initmethod-bbinit, /etc/inittab, \ > 41 @CONSOLE@, $(PTXCONF_CONSOLE_NAME)) > > The resulting line in /etc/inittab: > > console::respawn:/sbin/getty -L 115200 /dev/ttyS0 vt100 > > Now systemd has no inittab anymore. There are two services for getty: > > # ls /lib/systemd/system/*tty* > /lib/systemd/system/getty@.service > /lib/systemd/system/serial-getty@.service > > The first one is used for /dev/tty*, the second for /dev/ttyS* or any > other serial console (/dev/ttyUSB0 would be possible as well). These are > activated by setting a symlink at the appropriate place, a quick 'n > dirty solution ignoring PTXCONF_CONSOLE_NAME looks like this: > > 255 # FIXME there's $(PTXCONF_CONSOLE_NAME) in platformconfig. > Would be > 256 # nice to get this by some magic > 257 @$(call install_link, myrootfs, \ > 258 /lib/systemd/system/serial-getty@.service, \ > 259 > /etc/systemd/system/getty.target.wants/serial-getty@ttyS0.service) > > For integrating this into ptxdist, especially in > rules/initmethod-systemd.*, there would be some magic needed guessing > which service to pick based on which device is configured in > PTXCONF_CONSOLE_NAME. Any ideas on this? I've never needed that with systemd. By default systemd will add such a dependency for the tty the kernel uses for it's output. So if you boot with "console=/dev/ttyS0" in the kernel commandline you should get a getty on ttyS0. Michael -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -- ptxdist mailing list ptxdist@pengutronix.de