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?
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: signature.asc
Description: PGP signature

Reply via email to