From owner-freebsd-current@FreeBSD.ORG Tue Feb 3 12:31:32 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 17CBA16A4CE for ; Tue, 3 Feb 2004 12:31:32 -0800 (PST) Received: from root.org (root.org [67.118.192.226]) by mx1.FreeBSD.org (Postfix) with SMTP id 0FDBD43D1F for ; Tue, 3 Feb 2004 12:31:28 -0800 (PST) (envelope-from nate@root.org) Received: (qmail 32600 invoked by uid 1000); 3 Feb 2004 20:31:29 -0000 Date: Tue, 3 Feb 2004 12:31:29 -0800 (PST) From: Nate Lawson To: Ruslan Ermilov In-Reply-To: <20040129135141.GD19899@FreeBSD.org.ua> Message-ID: <20040203122911.E32526@root.org> References: <20040126213228.D31623@root.org> <200401271328.29574.jhb@FreeBSD.org> <20040127222750.P77555@root.org> <200401281245.12012.jhb@FreeBSD.org> <20040129135141.GD19899@FreeBSD.org.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: current@freebsd.org Subject: Re: getenv_string broken? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 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: Tue, 03 Feb 2004 20:31:32 -0000 On Thu, 29 Jan 2004, Ruslan Ermilov wrote: > On Wed, Jan 28, 2004 at 10:47:00AM -0800, Nate Lawson wrote: > > On Wed, 28 Jan 2004, John Baldwin wrote: > > > On Wednesday 28 January 2004 01:28 am, Nate Lawson wrote: > > > > On Tue, 27 Jan 2004, John Baldwin wrote: > > > > > On Tuesday 27 January 2004 12:42 am, Nate Lawson wrote: > > > > > > I have a getenv_string() that is never being evaluated. I declared it > > > > > > as follows: > > > > > > > > > > > > static char acpi_os_name[128]; > > > > > > TUNABLE_STR("hw.acpi.os_name", acpi_os_name, sizeof(acpi_os_name)); > > > > > > > > > > > > The contents of acpi_os_name are never filled in from the variable I > > > > > > declared in /boot/loader.conf. Just to be sure, I made a loop that > > > > > > prints out the contents of kenvp. It does not have hw.acpi.os_name. > > > > > > > > > > > > Here is a snippet of the kenvp array, right where my tunable should be > > > > > > (os2 is from a test below): > > > > > > > > > > > > name: hint.vt.0.disabled=1 > > > > > > name: hw.acpi.os2=8 > > > > > > name: hw.acpi.reset_video=0 > > > > > > name: hw.acpi.verbose=1 > > > > > > name: hw.cbb.start_memory=0xc0203000 > > > > > > How did you dump this? If os_name isn't in the list, then that is going to be > > > a problem of course. :) That would indicate that a bug in the loader though > > > and not in getenv_string(). > > > > I added a loop that prints out the entire kenv each time getenv_string is > > called. This is possibly a loader bug although I'm very curious how > > surrounding variables make it into the list but not hw.acpi.os_name. It's > > possible they're all ints while mine is a string. The only other string > > is module_path, so perhaps I should try overloading that in loader.conf > > and see if it also fails. > > What's wrong with just using kenv(1)? Yeah, that shows the bug too. Something in the loader is not picking up my TUNABLE_STR declaration. It may be related to acpi.ko being a module since the only other string is module_path, which is defined in the kernel. But tunable ints in acpi work. Anyone care to help debug this? -Nate