From owner-freebsd-arch Wed Jan 31 16:25:41 2001 Delivered-To: freebsd-arch@freebsd.org Received: from meow.osd.bsdi.com (meow.osd.bsdi.com [204.216.28.88]) by hub.freebsd.org (Postfix) with ESMTP id 5FA5537B491 for ; Wed, 31 Jan 2001 16:25:23 -0800 (PST) Received: from laptop.baldwin.cx (john@jhb-laptop.osd.bsdi.com [204.216.28.241]) by meow.osd.bsdi.com (8.11.1/8.9.3) with ESMTP id f110Ja325567; Wed, 31 Jan 2001 16:19:36 -0800 (PST) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <200102010008.f1108O926986@harmony.village.org> Date: Wed, 31 Jan 2001 16:25:06 -0800 (PST) From: John Baldwin To: Warner Losh Subject: Re: cvs commit: src/sys/dev/ata ata-disk.c Cc: arch@FreeBSD.org Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 01-Feb-01 Warner Losh wrote: > In message John Baldwin writes: >: during boot. One thing that Mike Smith would like to do (or so he has >: told me) is to have aa env top-level sysctl node that mapped any names >: below it to equivalent kernel environment variables, which would require >: some subtle changes to the way sysctl works, but nothing too drastic. > > I'd like to see that as well. I'd also like to see the hints settable > after boot so that you can tweak things. But they are close to > sysctls in many ways (except for the API for getting the data). > > One problem is that sysctl is readable by the whole world and root can > write anything. This is both too permissive and too strict. This is why I think ACL's for sysctl's that are administered via a sysctlfs wouldn't be such a bad thing. However, sysctl(9) already allows for dynamic addition, removal, setting, etc. of nodes already, so simply importing the kernel environment into the sysctl tree at boot might be the easiest thing to do. However, I think that, say, hw.snd.pcm0.hwvol_mixer, is more of a hardware attribute then a kernel environment attribute, which env.hint.pcm.0.hwvol_mixer kind of implies. I don't see env as being a good dumping ground for hardware configuration, so I'd almost rather have devices export any important information via a sysctl that lives in the proper part of the sysctl tree rather than just stuck under env. Also, for dynamic sysctl's, it is easier to use 'pcm0' for a node than a '0' node under a 'pcm' tree. This is because device_get_nameunit() gives us a string we can just pass to sysctl_add_oid(), whereas device_get_unit() returns an integer that we'd have to malloc a string for and sprintf() into or something. (I guess we could do _really_ evil things where we return a pointer into the nameunit string that starts with the unit number). > Warner -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message