Date: Fri, 29 May 2009 11:00:44 +0200 From: Alexander Leidinger <Alexander@Leidinger.net> To: Nathan Lay <nslay@comcast.net> Cc: arch@freebsd.org, freebsd-current@freebsd.org Subject: Re: Profile rc idea Message-ID: <20090529110044.200461pczbdmklk4@webmail.leidinger.net> In-Reply-To: <4A1F12E4.1060404@comcast.net> References: <4A1F12E4.1060404@comcast.net>
next in thread | previous in thread | raw e-mail | index | archive | help
Quoting Nathan Lay <nslay@comcast.net> (from Thu, 28 May 2009 18:40:36 -0400):
> Hi list,
> Wasn't sure which list this idea belongs, so I sent it here. It
arch@ (cced) is the generic place to discuss architectural changes of
subsystems.
> would be interesting if rc was extended to support profiles. Each
> profile would reflect a different system configuration. For example
> profiles could describe the computing environment at: home, work,
> friend's house, airplane, etc... The active profile the system uses
> could be chosen based on some contingency condition. For example,
> simply prompting the user to choose an rc profile at boot, or using
> hardware to choose the profile (e.g. like location based contingency
> using GPS hardware), or whatever... I guess this only pertains to
> booting though, but rc seems like a natural place to do this.
> Thoughts, comments? Yet another idea I have no time to try...
You can already do this in rc.conf:
---snip---
location=at_home
case ${location} in
at_home)
ifconfig_xx0="..."
...
;;
at_work)
ifconfig_xx0="..."
...
;;
*)
echo wrong location set
exit 1
# alternatively use some kind of default setup
;;
esac
---snip---
This way you need to know before where you are, or boot into
single-user mode. You can also extend it to read a kenv
("location=$(/bin/kenv profile.location)"), this way you can specify
the location in the loader (bonus points to implement a loader
extension in forth to read a file which lists possible profiles and
offer them in the menu).
Bye,
Alexander.
--
"I keep seeing spots in front of my eyes."
"Did you ever see a doctor?"
"No, just spots."
http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090529110044.200461pczbdmklk4>
