From: Leo Famulari <leo@famulari.name>
To: guix-devel@gnu.org
Subject: Re: [PATCH 1/1] services: Add agetty service.
Date: Tue, 14 Feb 2017 19:24:17 -0500 [thread overview]
Message-ID: <20170215002417.GA19546@jasmine> (raw)
In-Reply-To: <8b9a83141665a7a86aa3d3c9ba6363c1ba2e93cd.1487117562.git.leo@famulari.name>
[-- Attachment #1.1: Type: text/plain, Size: 2013 bytes --]
On Tue, Feb 14, 2017 at 07:12:44PM -0500, Leo Famulari wrote:
> * gnu/services/base.scm (<agetty-configuration>): 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>
> + agetty-configuration make-agetty-configuration
> + agetty-configuration?
> + (agetty agetty-configuration-agetty ;<package>
> + (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?
[-- Attachment #1.2: testing.diff --]
[-- Type: text/plain, Size: 1392 bytes --]
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
- terminal_output gfxterm
+ ;; Use the ncurses-type GRUB interface
+ terminal_output console
"
""))
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")))
+ (agetty-service (agetty-configuration
+ (tty "ttyS0")
+ (term "vt100")
+ (extra "-L")
+ (baud-rate "115200")))
+
(login-service (login-configuration
(motd motd)))
@@ -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=ttyS0,115200n8 gfxpayload=text earlyprintk=serial,ttyS0,115200"))
(bootloader (grub-configuration
(device "/dev/sda")))
(file-systems
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2017-02-15 0:24 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-15 0:12 [PATCH 1/1] services: Add agetty service Leo Famulari
2017-02-15 0:24 ` Leo Famulari [this message]
2017-02-15 15:21 ` myglc2
2017-02-15 19:38 ` Leo Famulari
2017-02-16 7:06 ` [V2 PATCH " Leo Famulari
2017-02-17 7:48 ` Ricardo Wurmus
2017-02-17 14:24 ` Leo Famulari
2017-02-17 18:35 ` myglc2
2017-02-17 22:59 ` Leo Famulari
2017-02-18 1:23 ` myglc2
2017-03-07 14:43 ` Ludovic Courtès
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
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170215002417.GA19546@jasmine \
--to=leo@famulari.name \
--cc=guix-devel@gnu.org \
/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.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).