Re: Profile rc idea

From: Alexander Leidinger <Alexander_at_Leidinger.net>
Date: Fri, 29 May 2009 11:00:44 +0200
Quoting Nathan Lay <nslay_at_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_at_ (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 _at_ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org       netchild _at_ FreeBSD.org  : PGP ID = 72077137
Received on Fri May 29 2009 - 07:17:11 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:48 UTC