From owner-freebsd-current@FreeBSD.ORG Fri Oct 10 15:40:05 2008 Return-Path: Delivered-To: current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4AA9810656A1 for ; Fri, 10 Oct 2008 15:40:05 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 0901E8FC0C for ; Fri, 10 Oct 2008 15:40:04 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id m9AFavT5076083; Fri, 10 Oct 2008 09:36:57 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Fri, 10 Oct 2008 09:38:02 -0600 (MDT) Message-Id: <20081010.093802.1338308573.imp@bsdimp.com> To: rizzo@iet.unipi.it From: "M. Warner Losh" In-Reply-To: <20081010151456.GA27576@onelab2.iet.unipi.it> References: <20081010151456.GA27576@onelab2.iet.unipi.it> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: current@FreeBSD.org Subject: Re: setting bootverbose (or boothowto) from the kernel config file ? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Oct 2008 15:40:05 -0000 In message: <20081010151456.GA27576@onelab2.iet.unipi.it> Luigi Rizzo writes: : In a diskless setting which does not use /boot/loader, i need to : control the value of 'bootverbose' to print extra debugging messages. : : I just learned that using this line in the kernel config file : : env "my_kenv_settings" : : and providing a list of var.name=value in the file my_kenv_settings, : these values get dumped to compile/MYKERNEL/env.c and become accessible : from the kernel through getenv() (e.g. i used this for machdep.bios.pnp). : : However i haven't found a way to set 'bootverbose', which is a sysctl : variable (debug.bootverbose) so it seems to be in a different namespace. : : Any ideas ? : : Also, what is exactly the relation between the two variables : 'boothowto' (apparently set through the loader and containing : various flags) and 'bootverbose' (which is a sysctl) ? : Different parts of the kernel use one or the other to control : verbose output, and i am not sure if, e.g. setting RB_VERBOSE : in 'boothowto' also sets bootverbose... bootverbose is set based on boothowto. The sysctl thing is just an afterthought: static void set_boot_verbose(void *data __unused) { if (boothowto & RB_VERBOSE) bootverbose++; } SYSINIT(boot_verbose, SI_SUB_TUNABLES, SI_ORDER_ANY, set_boot_verbose, NULL); We likely at this stage could convert it to a tunable as well... Warner