From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leo Famulari Subject: Re: [PATCH 1/1] services: Add agetty service. Date: Tue, 14 Feb 2017 19:24:17 -0500 Message-ID: <20170215002417.GA19546@jasmine> References: <8b9a83141665a7a86aa3d3c9ba6363c1ba2e93cd.1487117562.git.leo@famulari.name> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="JYK4vJDZwFMowpUq" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59673) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cdnOS-0003Sk-Bn for guix-devel@gnu.org; Tue, 14 Feb 2017 19:24:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cdnOP-00019j-5f for guix-devel@gnu.org; Tue, 14 Feb 2017 19:24:24 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:47207) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cdnOO-00017t-S3 for guix-devel@gnu.org; Tue, 14 Feb 2017 19:24:21 -0500 Received: from localhost (c-73-188-17-148.hsd1.pa.comcast.net [73.188.17.148]) by mail.messagingengine.com (Postfix) with ESMTPA id E0CB02423E for ; Tue, 14 Feb 2017 19:24:18 -0500 (EST) Content-Disposition: inline In-Reply-To: <8b9a83141665a7a86aa3d3c9ba6363c1ba2e93cd.1487117562.git.leo@famulari.name> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org --JYK4vJDZwFMowpUq Content-Type: multipart/mixed; boundary="T4sUOijqQbZv57TR" Content-Disposition: inline --T4sUOijqQbZv57TR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Feb 14, 2017 at 07:12:44PM -0500, Leo Famulari wrote: > * gnu/services/base.scm (): New record type. > (agetty-shepherd-service, agetty-service): New procedures. > (agetty-service-type): New variable. My intention is to get a serial tty, for example /dev/ttyS0, so that I can install GuixSD on a device that lacks any graphical display interfaces: http://pcengines.ch/apu2b4.htm > +(define-record-type* > + agetty-configuration make-agetty-configuration > + agetty-configuration? > + (agetty agetty-configuration-agetty ; > + (default util-linux)) > + (tty agetty-configuration-tty) ;string > + (term agetty-term ;string > + (default #f)) > + (extra agetty-extra ;string > + (default #f)) This 'extra' is a time-saving kludge. I'll add fields for all of agetty's configuration options once I'm satisfied that the service works on GuixSD. For now, I can apply the attached diff and connect to a QEMU VM over an emulated serial device. Apply the diff and build a new installer image: $ ./pre-inst-env guix system disk-image --image-size=1.5G \ gnu/system/install.scm Copy the image out of your store, make it writable, and then boot it with QEMU: $ qemu-system-x86_64 -enable-kvm -m 3072 -net user -net nic,model=virtio \ -boot menu=on -drive file=/home/leo/tmp/test-image -serial pty QEMU will tell you which pts device it's using, and then you can use screen to connect to the correct device and log in: $ screen -t 'test' /dev/pts/N 115200,-ixoff,-ixon However, it doesn't work when I boot my physical device with the same installer image. When I connect to my physical device using the Keyspan USA-19H serial-to-USB converter, I can watch the system boot, but Shepherd never reports that the 'term-ttyS0' service has started, and I never see the MOTD or login prompt. Any advice or debugging ideas? --T4sUOijqQbZv57TR Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="testing.diff" Content-Transfer-Encoding: quoted-printable diff --git a/gnu/system/grub.scm b/gnu/system/grub.scm index b18b8be6d..b04d9d346 100644 --- a/gnu/system/grub.scm +++ b/gnu/system/grub.scm @@ -197,7 +197,8 @@ system string---e.g., \"x86_64-linux\"." insmod efi_uga fi =20 - terminal_output gfxterm + ;; Use the ncurses-type GRUB interface + terminal_output console " "")) =20 diff --git a/gnu/system/install.scm b/gnu/system/install.scm index 3ec343570..301b7b98f 100644 --- a/gnu/system/install.scm +++ b/gnu/system/install.scm @@ -275,6 +275,12 @@ You have been warned. Thanks for being so brave. (tty "tty1") (auto-login "root"))) =20 + (agetty-service (agetty-configuration + (tty "ttyS0") + (term "vt100") + (extra "-L") + (baud-rate "115200"))) + (login-service (login-configuration (motd motd))) =20 @@ -340,6 +346,9 @@ Use Alt-F2 for documentation. (host-name "gnu") (timezone "Europe/Paris") (locale "en_US.utf8") + (kernel linux-libre-4.1) + (kernel-arguments + '("console=3DttyS0,115200n8 gfxpayload=3Dtext earlyprintk=3Dserial,tt= yS0,115200")) (bootloader (grub-configuration (device "/dev/sda"))) (file-systems --T4sUOijqQbZv57TR-- --JYK4vJDZwFMowpUq Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEsFFZSPHn08G5gDigJkb6MLrKfwgFAlijn64ACgkQJkb6MLrK fwgvrQ//eL/hkDhtcAa7ODsZfp6rlCu1Mnr567xkT2UBM5HcRlvQetx/2NwskEhg crSuALSZJxceXmi6Se6UmSKeqfnBg96YJzU9SPrRMinvpJph8/gcGJ1izyeGYtDi oUjvOonrI9G0MsZnGX3Jc0maIU8s9xjH1ZPskH8KMXJxFCgaprcTcOxpam1qoVz6 /V6l50U5zzZxmS/uWifLvKLdowWC0BCcW2KVP1o0PdDc1do/5z5sRw2y/bU8VuIm 8nzCTNkm1+17fgHVElFhhr0iyOKbTlDul72Froqgq5hWsmxjo3JhlyGnarz5/6zT fI2qXi+0NcVYJsy3pdx+h+9VDYJbT/YJaXkmFNRO5azwutvBQ8aPmGtVkvdgakvE eYKe1ctgIFOG+u4WncbPvHaZQHYmx5Zagif9I223Ldql47cO0V/udizLgv3hVqeJ YZYopvoB3UwE28pPdZMrhXm+EfBl71wmdnTgPov/amqGF0S+sFQOCP4G8EUPIxaa E+aCBVaXSkyRgwN8QjaWWPKW2mvejqJwQQ0WLkdGfKG2PHT9o9NbLhEvPS5HZn2d wwTmheoR2+4HFwfT9ch0YAhyO3Gm9dmk9+HqYSrUUNOOwWqSwsLQGPVsDksZXr8w AZKwVJIG/ctdckKLdjJTqNrUFdcVtouwM3EqtiBf9pisZcsTClY= =f5Mm -----END PGP SIGNATURE----- --JYK4vJDZwFMowpUq--