www.nico.schottelius.org/software/cinit/browse_source/cinit-0.3pre9/doc/user/profiles.text
Nico Schottelius 423ba10303 import cinit from unix.schottelius.org
Signed-off-by: Nico Schottelius <nico@ikn.schottelius.org>
2009-09-16 12:53:45 +02:00

79 lines
2.5 KiB
Text

cinit - Profiles
================
Nico Schottelius <nico-cinit__@__schottelius.org>
0.1, for cinit 0.3, Initial Version from 2005-06-04
:Author Initials: NS
cinit profiles described.
What are profiles?
------------------
Profiles are different configurations for different scenarios.
This means you can use the 'home' profile to setup things
differently than at work, where you would use either
no profile (standard configuration) or the 'work' profile.
How to use profiles?
---------------------
Simply pass 'cprofile:PROFILENAME' (like cprofile:home) to cinit.
How to pass argumenents to cinit?
---------------------------------
How to pass arguments to your init system depends on your operating
system and on your bootloader.
Linux
~~~~~
Under Linux the init-system gets the kernel arguments
(see linux.kernel.eats.arguments) as arguments.
So you can use
kernel /usr/src/linux/vmlinuz cprofile:work (grub1,grub2)
append="cprofile:work" (LILO,yaboot)
Other Unices should work like Linux, please consult your local
documentation.
How to configure profiles?
--------------------------
It's very simple: Normally cinit would call /etc/cinit/svc/init as
the first service (with all its dependencies). If you pass 'cprofile=wireless'
to it, cinit will start from /etc/cinit/svc/wireless
instead.
So the only thing you have to do is to create a service directory
below /etc/cinit/svc with the name of the profile you want to use.
You can simply copy the init-dir and use it as a template:
ei # cd /etc/cinit/svc; rsync -a init yourprofile
Standard cp will copy the linked files, not the links, that's why I use rsync
You could also use tar:
ei # cd /etc/cinit/svc/init; tar c . | (mkdir ../myprof; cd ../myprof; tar x )
That's it!
Some examples
-------------
Here are some examples we found in #cLinux:
--------------------------------------------------------------------------------
profile name what it does
musibox only start mp3blaster
terminal start only minicom, which opens the serial line
net-terminal start a respawning shell script, which starts
ssh to the selected host
video start X+mplayer, which plays the dvd/cdrom
wireless What to start when beeing in an unknown wlan
home/work selected services (nfs, ip, ...) for home or work
--------------------------------------------------------------------------------