Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Oct 2001 18:06:32 +0800
From:      Igor M Podlesny <hostmaster@morning.ru>
To:        "Daniel C. Sobral" <dcs@newsguy.com>
Cc:        Vadim Vygonets <vadik-hackers@freebsd.vygo.net>, freebsd-hackers@FreeBSD.ORG
Subject:   Re: loader.conf conditional assignment
Message-ID:  <20011014180632.A76030@ns.morning.ru>
In-Reply-To: <3BC86AF9.BB1CF2E8@newsguy.com>
References:  <20011013174339.A21230@cs.huji.ac.il> <3BC86AF9.BB1CF2E8@newsguy.com>

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




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