From owner-freebsd-hackers Sat Oct 13 9:25:17 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from newsguy.com (smtp.newsguy.com [209.155.56.71]) by hub.freebsd.org (Postfix) with ESMTP id C78DE37B410 for ; Sat, 13 Oct 2001 09:21:12 -0700 (PDT) Received: from newsguy.com (ppp232-bsace7002.telebrasilia.net.br [200.181.81.232]) by newsguy.com (8.9.1a/8.9.1) with ESMTP id JAA78785; Sat, 13 Oct 2001 09:20:22 -0700 (PDT) Message-ID: <3BC86AF9.BB1CF2E8@newsguy.com> Date: Sat, 13 Oct 2001 13:25:29 -0300 From: "Daniel C. Sobral" X-Mailer: Mozilla 4.77 [en] (Win98; U) X-Accept-Language: en,pt-BR,pt,en-GB,en-US,ja MIME-Version: 1.0 To: Vadim Vygonets Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: loader.conf conditional assignment References: <20011013174339.A21230@cs.huji.ac.il> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Vadim Vygonets wrote: > > We are working on integration of network-booted FreeBSD system to > our envoronment. Naturally, different machines need different > kernels, so we pass the kernel paramater in DHCP response. > However, it gets overwritten in /boot/defaults/loader.conf. We > decided that commenting out the assignment of 'kernel' and > 'kernel_options' is not what we want, because we want both to use > the default value and to be able to override it via DHCP. > > After taking some time to learn Forth (interesting language, I > must say) and a false start (involving saving environment > variables (names and values) in a linked list and restoring them > after the assignment), I decided to use the Makefile syntax of ?= > to set an environment variable if it's not set yet, so it will be > possible to say: > > kernel?="/kernel" > > In this case, if kernel is set via DHCP, the value is not > changed, but if it's not, it becomes "/kernel". Attached is the > patch for /boot/support.4th against the version in FreeBSD 4.4. Loader.conf's syntax was designed to be such that the files could be processed by sh(1). I rather prefer to keep faithful to that by using the shell expansions tricks sh(1) has. OTOH, that wouldn't be a trivial task to undertake, and I don't have time to do it. Add to that, being able to sh-process loader.conf files is of dubious usefulness. So I do not object to such a change, as long as more people weight in first on this matter. -- Daniel C. Sobral (8-DCS) dcs@newsguy.com dcs@freebsd.org capo@the.secret.bsdconspiracy.net wow regex humor... I'm a geek To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message