Date: Wed, 20 Jan 2021 10:37:44 GMT From: Alex Richardson <arichardson@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 7e99c034f788 - main - Emit uprintf() output for initproc if there is no controlling terminal Message-ID: <202101201037.10KAbiCb093426@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=7e99c034f788128c7d168eaf27af9a3acaa06163 commit 7e99c034f788128c7d168eaf27af9a3acaa06163 Author: Alex Richardson <arichardson@FreeBSD.org> AuthorDate: 2021-01-20 09:54:46 +0000 Commit: Alex Richardson <arichardson@FreeBSD.org> CommitDate: 2021-01-20 09:54:46 +0000 Emit uprintf() output for initproc if there is no controlling terminal This patch helped me debug why /sbin/init was not being loaded after making changes to the image activator in CheriBSD. Reviewed By: jhb (earlier version), kib Differential Revision: https://reviews.freebsd.org/D28121 --- sys/kern/subr_prf.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c index 31117c4e3415..b51213a25d0d 100644 --- a/sys/kern/subr_prf.c +++ b/sys/kern/subr_prf.c @@ -179,6 +179,14 @@ uprintf(const char *fmt, ...) if (TD_IS_IDLETHREAD(td)) return (0); + if (td->td_proc == initproc) { + /* Produce output when we fail to load /sbin/init: */ + va_start(ap, fmt); + retval = vprintf(fmt, ap); + va_end(ap); + return (retval); + } + sx_slock(&proctree_lock); p = td->td_proc; PROC_LOCK(p);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202101201037.10KAbiCb093426>