Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Nov 2024 07:23:49 GMT
From:      Jose Luis Duran <jlduran@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 0f7b0db5dd07 - main - nanobsd: Fix cust_comconsole search patterns
Message-ID:  <202411160723.4AG7NnnO018583@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by jlduran:

URL: https://cgit.FreeBSD.org/src/commit/?id=0f7b0db5dd07e7c48285db4cac19e15fc9a42622

commit 0f7b0db5dd07e7c48285db4cac19e15fc9a42622
Author:     Jose Luis Duran <jlduran@FreeBSD.org>
AuthorDate: 2024-11-15 04:28:01 +0000
Commit:     Jose Luis Duran <jlduran@FreeBSD.org>
CommitDate: 2024-11-16 07:08:24 +0000

    nanobsd: Fix cust_comconsole search patterns
    
    The current patterns are outdated, and may produce "offifexists", after
    e310437971b8 ("For video consoles, only launch a getty if the device
    exists.").
    
    Fix the expressions to:
    
    1. Disable getty(8) on the virtual syscons(4) or vt(4) terminals
       (/dev/ttyv*).
    2. Enable the use of the first serial port as the system console.
    
    Reviewed by:    imp
    Approved by:    emaste (mentor)
    MFC after:      1 month
    Differential Revision:  https://reviews.freebsd.org/D47586
---
 tools/tools/nanobsd/defaults.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/tools/nanobsd/defaults.sh b/tools/tools/nanobsd/defaults.sh
index 1e38a07337c7..5cb137a1db94 100755
--- a/tools/tools/nanobsd/defaults.sh
+++ b/tools/tools/nanobsd/defaults.sh
@@ -742,10 +742,10 @@ UsbDevice ( ) {
 
 cust_comconsole ( ) (
 	# Enable getty on console
-	sed -i "" -e /tty[du]0/s/off/on/ ${NANO_WORLDDIR}/etc/ttys
+	sed -i "" -e '/^tty[du]0/s/off/onifconsole/' ${NANO_WORLDDIR}/etc/ttys
 
-	# Disable getty on syscons devices
-	sed -i "" -e '/^ttyv[0-8]/s/	on/	off/' ${NANO_WORLDDIR}/etc/ttys
+	# Disable getty on syscons or vt devices
+	sed -i "" -E '/^ttyv[0-8]/s/\ton(ifexists)?/\toff/' ${NANO_WORLDDIR}/etc/ttys
 
 	# Tell loader to use serial console early.
 	echo "${NANO_BOOT2CFG}" > ${NANO_WORLDDIR}/boot.config



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202411160723.4AG7NnnO018583>