Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Oct 2001 13:25:29 -0300
From:      "Daniel C. Sobral" <dcs@newsguy.com>
To:        Vadim Vygonets <vadik-hackers@freebsd.vygo.net>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: loader.conf conditional assignment
Message-ID:  <3BC86AF9.BB1CF2E8@newsguy.com>
References:  <20011013174339.A21230@cs.huji.ac.il>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3BC86AF9.BB1CF2E8>