From owner-freebsd-hackers Sun Oct 14 3: 7:15 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from ns.morning.ru (ns.morning.ru [195.161.98.5]) by hub.freebsd.org (Postfix) with ESMTP id 8BC6E37B409 for ; Sun, 14 Oct 2001 03:07:06 -0700 (PDT) Received: (from root@localhost) by ns.morning.ru (8.11.5/8.11.5) id f9EA6WO76429; Sun, 14 Oct 2001 18:06:32 +0800 (KRAST) Date: Sun, 14 Oct 2001 18:06:32 +0800 From: Igor M Podlesny To: "Daniel C. Sobral" Cc: Vadim Vygonets , freebsd-hackers@FreeBSD.ORG Subject: Re: loader.conf conditional assignment Message-ID: <20011014180632.A76030@ns.morning.ru> References: <20011013174339.A21230@cs.huji.ac.il> <3BC86AF9.BB1CF2E8@newsguy.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3BC86AF9.BB1CF2E8@newsguy.com> User-Agent: Mutt/1.3.23i 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 On Sat, Oct 13, 2001 at 01:25:29PM -0300, Daniel C. Sobral wrote: > 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. Is there any chance off implementing syntax like kernel=${kernel:-/kernel} which is obviously sh-compilant? > > -- > 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 -- Igor M Podlesny Morning Network hostmaster http://good.morning.ru phone: +7 3912 296962 mailto:hostmaster@morning.ru To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message