Add Serial consoles

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
This commit is contained in:
Denis 'GNUtoo' Carikli 2023-09-12 23:41:38 +02:00
parent f7de8414a3
commit 31da868705
Signed by: GNUtoo
GPG Key ID: 5F5DFCC14177E263
2 changed files with 31 additions and 2 deletions

View File

@ -86,7 +86,9 @@ the services after that.")
(operating-system (operating-system
(bootloader (bootloader-configuration (bootloader (bootloader-configuration
(bootloader grub-minimal-bootloader) (bootloader grub-minimal-bootloader)
(targets '("/dev/vda")))) (targets '("/dev/vda"))
(terminal-outputs '(serial_0))))
(kernel-arguments (append '("console=ttyS0")))
;; TODO: Does Mumble have some data? Is BTRFS safer than using ext4 ;; TODO: Does Mumble have some data? Is BTRFS safer than using ext4
;; without doing many fsck? ;; without doing many fsck?
(file-systems (cons (file-system (file-systems (cons (file-system
@ -110,6 +112,19 @@ the services after that.")
(services (services
(append (append
(list (list
;; Agetty
;; ttyS0 is already setup automatically due to the console=ttyS0
;; kernel argument
(service agetty-service-type
(agetty-configuration (term "xterm-256color")
(tty "ttyS1")))
(service agetty-service-type
(agetty-configuration (term "xterm-256color")
(tty "ttyS2")))
(service agetty-service-type
(agetty-configuration (term "xterm-256color")
(tty "ttyS3")))
;; Certbot ;; Certbot
(service (service
certbot-service-type certbot-service-type

View File

@ -61,6 +61,21 @@
<model name="isa-serial"/> <model name="isa-serial"/>
</target> </target>
</serial> </serial>
<serial type="pty">
<target type="isa-serial" port="1">
<model name="isa-serial"/>
</target>
</serial>
<serial type="pty">
<target type="isa-serial" port="2">
<model name="isa-serial"/>
</target>
</serial>
<serial type="pty">
<target type="isa-serial" port="3">
<model name="isa-serial"/>
</target>
</serial>
<console type="pty"> <console type="pty">
<target type="serial" port="0"/> <target type="serial" port="0"/>
</console> </console>
@ -87,4 +102,3 @@
</devices> </devices>
<seclabel type="dynamic" model="dac" relabel="yes"/> <seclabel type="dynamic" model="dac" relabel="yes"/>
</domain> </domain>