git: 9c6454fe7048 - stable/14 - init_main: Use TUNABLE_INT_FETCH to initialize verbose_sysinit

From: Zhenlei Huang <zlei_at_FreeBSD.org>
Date: Sun, 15 Dec 2024 02:21:28 UTC
The branch stable/14 has been updated by zlei:

URL: https://cgit.FreeBSD.org/src/commit/?id=9c6454fe7048ade86faa1a864b04c7b250a660ec

commit 9c6454fe7048ade86faa1a864b04c7b250a660ec
Author:     Zhenlei Huang <zlei@FreeBSD.org>
AuthorDate: 2024-12-06 13:46:55 +0000
Commit:     Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2024-12-15 02:20:52 +0000

    init_main: Use TUNABLE_INT_FETCH to initialize verbose_sysinit
    
    It is too late to initialize verbose_sysinit via TUNABLE_INT, as
    TUNABLE_INT runs at the order of SI_SUB_TUNABLES, thus any subsystems
    those have order prior or equal to SI_SUB_TUNABLES are not logged.
    
    Reviewed by:    kevans
    Fixes:  c7962400c9a7 Add debug.verbose_sysinit tunable for VERBOSE_SYSINIT
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D47907
    
    (cherry picked from commit a7cfcb26451219d6f4e60c486c855adeea288397)
---
 sys/kern/init_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index 1575287716ee..3c907da945b2 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -141,7 +141,6 @@ SYSCTL_INT(_debug, OID_AUTO, bootverbose, CTLFLAG_RW, &bootverbose, 0,
  * - 1, 'compiled in but verbose by default' (default)
  */
 int	verbose_sysinit = VERBOSE_SYSINIT;
-TUNABLE_INT("debug.verbose_sysinit", &verbose_sysinit);
 #endif
 
 #ifdef INVARIANTS
@@ -274,8 +273,9 @@ mi_startup(void)
 	/* Construct and sort sysinit list. */
 	sysinit_mklist(&sysinit_list, SET_BEGIN(sysinit_set), SET_LIMIT(sysinit_set));
 
-	last = SI_SUB_COPYRIGHT;
+	last = SI_SUB_DUMMY;
 #if defined(VERBOSE_SYSINIT)
+	TUNABLE_INT_FETCH("debug.verbose_sysinit", &verbose_sysinit);
 	verbose = 0;
 #if !defined(DDB)
 	printf("VERBOSE_SYSINIT: DDB not enabled, symbol lookups disabled.\n");