Merge remote-tracking branch 'origin/github/pr/45'
[grml.org.git] / docs / config-framework.sgml
1 <!doctype linuxdoc system>
2 <article>
3
4 <!--
5 docbook info - http://www.ibiblio.org/pub/Linux/docs/HOWTO/Howtos-with-LinuxDoc
6
7   <bf>boldface font</bf>   <em>emphasis font</em>     <sf>sans serif</sf>
8   <sl>slanted font</sl>    <tt>typewriter font</tt>   <it>italics font</it>
9   <sect> Links <label id="links_">
10   <sect1> Cross-References
11   <p> If you click on <ref id="links_" name="Links">
12   <tscreen><verb>
13   % sgml2txt -f example.sgml
14   </verb></tscreen>
15   <tscreen><code>
16   Put computer source code here
17   </code></tscreen>
18   <sect1> Newline
19   <p> To force a newline use <newline>
20   This sentence always starts at the left margin.
21   <itemize>
22   <item> This is the first item in a list.
23   <item> This is the second item
24          <itemize>
25          <item> Multiple levels (nesting) are supported.
26          <item> The second item in this sublist
27          </itemize>
28          <enum>
29          <item> Enumerated lists using <tt/enum/ also work.
30          <item> This is item number 2
31          </enum>
32   <item> The final item in the main list
33   </itemize>  
34   <sect> Chapter 1            Note: Put a <p> on the first line of
35   <sect1> Subsection 1.1      each section (or subsection, etc.)
36   <sect1> Subsection 1.2
37   <sect> Chapter 2            Choose title names to replace "Chapter"
38   <sect1> Subsection 2.1      "Subsection", etc.
39   <sect2> Sub-subsection 2.1.1
40   <sect2> Sub-subsection 2.1.2
41   <sect1> Subsection 2.2
42   ·  Use &amp; for the ampersand (&),
43   ·  Use &lt; for a left bracket (<),
44   ·  Use &gt; for a right bracket (>),
45   ·  Use &etago; for a left bracket with a slash (</)
46   ·  Use &dollar; for a dollar sign ($),
47   ·  Use &num; for a hash (#),
48   ·  Use &percnt; for a percent (%),
49   ·  Use &tilde; for a tilde (~),
50   ·  Use &dquot; for ".
51 -->
52
53 <title>grml - config-framework</title>
54 <author><url url="http://grml.org/team/" name="grml team / Michael Prokop"></author>
55 <date>
56 Thu Jul 21 14:39:32 CEST 2005
57 </date>
58
59 <abstract>
60 Documentation of
61 <url url="http://grml.org/config/" name="the grml config-framework">.
62 Created with Vim and sgml2html (debian package linuxdoc-tools).
63
64 <!-- The "toc" = Table of Contents. -->
65 <toc>
66
67 <sect>Introduction
68 <p>
69
70 With the config-framework it is possible to save the configuration of a running
71 grml system and restore it again. save-config is a script to create the
72 configuration file(s) and store it on a specific place. It's possible to
73 use save-config interactive (useful for beginners) and non-interactive
74 (useful for experts and automatization). restore-config is a script to
75 restore the configuration via using the stored configuration-file.
76 Several bootoptions provide additional features. Whileas the framework
77 might look complicate it's very powerful and as soon as you are used to
78 the options you will find it very easy and comfortabel to use it. Just
79 take a look at the available options and read through the section
80 <ref id="usage_scenario" name="Usage Scenarios">.
81
82 <sect>Scripts
83
84 <sect1>save-config - save configuration
85 <p>
86 Calling the script 'save-config' without any further options will start
87 the script in interactive mode. No further options can be set/are
88 supported on the command line to avoid problems with environment.
89
90 If any of the following options are provided on command line, save-config
91 will run in non-interactive mode. The following options are supported
92 for specifying which parts should be saved in the configuration file:
93
94 <tscreen><code>
95  -etc               =>    save directory /etc
96  -home              =>    save hidden files in $HOME (that's: '.*')
97  -configdir         =>    save directory $HOME/config
98  -system            =>    save unionfs-snapshot (complete system state)
99  -all               =>    save /etc, $HOME/.*, $HOME/config and unionfs-snapshot
100 </code></tscreen>
101
102 The following options are supported for specifying destination of
103 configuration file(s):
104
105 <tscreen><code>
106  -local                                 =>    save directory /etc
107  -mail user@example.com                 =>    save hidden files in $HOME (that's: '.*')
108  -ssh [user@]remotehost:/path/to/file/  =>    ssh/scp configuration
109  -sda                                   =>    mount /dev/sda and store configuration there
110  -sda1                                  =>    mount /dev/sda1 and store configuration there
111  -floppy                                =>    mount /dev/fd0 and store configuration there
112  -manual /dev/ice                       =>    mount /device and store configuration there
113 </code></tscreen>
114
115 The name of the configuration files must start with
116 grml_{etc|home|configdir|system|all}_ and end with .tbz so restoring is
117 possible as (FEHLERFREI) as possible. By default the middlepart will be
118 namend as the current date (for example '20050722') but you can define
119 the middlepart manually by using the following option:
120
121 <tscreen><code>
122  -filename foobar    =>    take foobar as identifier for filename
123 </code></tscreen>
124
125 Example: 'save-config -all -filename foobar' will create a configuration
126 file named 'grml_all_foobar.tbz'.
127
128 <sect1>restore-config - restore configuration
129 <p>
130 It is not only possible to restore a configuration via bootoptions but
131 also via a script namend 'restore-config'. This script exists to restore
132 a specific configuration saved via 'save-config'. By default
133 restore-config will search for any files in current directory namend
134 grml_{etc|home|configdir|system|all}_ and end with .tbz. If there are
135 several files available you will be prompted to choose a specific one.
136 The following options are available to fetch the configuration from a
137 specific destination:
138
139 <tscreen><code>
140  http://example.com/path/to/grml_all_foobar.tbz  =>    download file grml_all_foobar.tbz and use it for restoring configuration
141  ftp://example.com/path/to/grml_all_foobar.tbz   =>    download file grml_all_foobar.tbz and use it for restoring configuration
142  ssh://[user@]host:/path/to/grml_all_foobar.tbz  =>    get file via grml_all_foobar.tbz via ssh/scp and use it for restoring configuration
143 </code></tscreen>
144
145 Example: 'restore-config ssh://mika@grml.org/conf/grml_all_foobar.tbz'
146 will download the file via scp/ssh and restore configuration saved in
147 file grml_all_foobar.tbz. 'restore-config grml_all_foobar'tbz' will
148 restore configuration via file grml_all_foobar.tbz located in current
149 directory.
150
151 <sect1>mkpersistenthome - use persistent home-directory
152 <p>
153 You have a local partition you would like to use as your home-directory?
154 Just use the interactive script called 'mkpersistenthome'. It will
155 create a file namend .grml_homedirectory on the specified partition so
156 it is possible to scan through the partitions to identify the
157 appropriate partition. To use the home-directory when booting grml
158 specify the appropriate bootoption on bootprompt:
159
160 <tscreen><code>
161  home=/dev/hda3    =>   use /dev/hda3 as the homepartition
162  home=scan         =>   scan through the available partitions and search
163                         for file .grml_homedirectory
164 </code></tscreen>
165
166 <sect>Boot-Options
167 <p>
168 The following bootoptions are supported. Use them at the bootprompt as
169 documented here.
170
171 <descrip>
172
173 <!--
174 <tag/lcfg/ If this option is set, ....
175 <tscreen><code>
176  home=/dev/hda3    =>   use /dev/hda3 as the homepartition
177  home=scan         =>   scan through the available partitions and search
178                         for file .grml_homedirectory
179 </code></tscreen>
180 -->
181
182 <tag/ocfg=grml.org&sol;config&sol;grml_all_foobar.tbz/ If this option is set,
183 the file will be downloaded via wget from the specified destination.
184 Tip: Use 'onlineconfig' as reminder for the option.
185
186 <tag/cfg/ This option is for restoring configuration from a local file.
187
188 <tscreen><code>
189  home=/dev/hda3    =>   use /dev/hda3 as the homepartition
190  home=scan         =>   scan through the available partitions and search
191                         for file .grml_homedirectory
192 </code></tscreen>
193
194 <tag/home/ If this option is set, ....
195
196 <tscreen><code>
197  home=/dev/hda3    =>   use /dev/hda3 as the homepartition
198  home=scan         =>   scan through the available partitions and search
199                         for file .grml_homedirectory
200 </code></tscreen>
201
202 <tag/scripts/ If this option is set, ....
203
204 <tscreen><code>
205  home=/dev/hda3    =>   use /dev/hda3 as the homepartition
206  home=scan         =>   scan through the available partitions and search
207                         for file .grml_homedirectory
208 </code></tscreen>
209
210 <tag/config/ If this option is set, ....
211
212 <tscreen><code>
213  home=/dev/hda3    =>   use /dev/hda3 as the homepartition
214  home=scan         =>   scan through the available partitions and search
215                         for file .grml_homedirectory
216 </code></tscreen>
217
218 <tag/debs/ If this option is set, ....
219
220 <tscreen><code>
221  home=/dev/hda3    =>   use /dev/hda3 as the homepartition
222  home=scan         =>   scan through the available partitions and search
223                         for file .grml_homedirectory
224 </code></tscreen>
225
226 </descrip>
227
228 <sect>Usage Scenarios <label id="usage_scenario">
229 <p>
230 foo
231
232 </article>