Release new version 0.22.0
[grml-autoconfig.git] / doc / grml-autoconfig.current.txt
1 Behavior in current Grml versions
2 ---------------------------------
3
4 This section applies to all Grml versions newer than release 2013.02.
5
6 The central concept of grml-autoconfig is the DCS directory which holds debs,
7 configuration and scripts which are used during system startup.
8
9 Determination of DCS directory
10 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11
12 The DCS directory defaults to the root directory of the GRML live image
13 (Note: the directory is known as /run/live/medium/ on a _running_
14 Grml system then!). If a file system labeled GRMLCFG is found, the DCS
15 directory is the root directory of that file system. Alternatively, the
16 myconfig boot parameter can be used to directly specify a device which
17 is then taken as DCS directory (myconfig=/dev/sda1, for example). If
18 your device is labeled different to GRMLCFG the proper label can be set
19 via the autoconfig boot parameter (autoconfig=SOMELABEL, for example).
20
21 Without any additional boot parameters, the GCA at DCSDIR/config.tbz is
22 automatically unpacked and DCSDIR/scripts/grml.sh is automatically executed on
23 system startup. The 'noautoconfig' boot parameter disables this automatic
24 behavior.
25
26 Boot Parameters
27 ~~~~~~~~~~~~~~~
28
29 The following boot parameters are supported. Use them at the (isolinux)
30 bootprompt as documented here.
31
32 myconfig::
33
34    This parameter directly sets DCSDIR to the root directory of the specified
35    device. Usage examples:
36
37   myconfig=/dev/sda1                        => read DCS from usb-device
38
39 autoconfig::
40
41    This parameter specifies the label used to determine the DCS device.
42    If undefined the label GRMLCFG is used to find the DCS device.
43
44   autoconfig=SOMELABEL      => search for device labeled SOMELABEL to use as
45                                DCS device.
46
47 home::
48
49     This parameter is for setting a specific partition as home directory.  Usage
50     examples:
51
52   home=/dev/sda3    =>  use /dev/sda3 as the homepartition
53   home=scan         =>  scan through the available partitions and search
54                         for file grml.img
55
56 partconf::
57
58     This parameter mounts the specified device in read-only mode and tries to
59     copy all files specified in /etc/grml/partconf to the Grml system. This
60     provides the possibility to use the configuration of a harddisk
61     installation. For example using the network configuration (which is
62     specified in /etc/network) is possible using this boot parameter. Usage
63     example:
64
65   partconf=/dev/sda2 => try to mount /dev/sda2 and copy files specified
66                         in /etc/grml/partconf to the booted Grml system
67
68 netconfig::
69
70     Use this parameter to restore configuration using wget to download a GCA
71     from the specified destination. You can also add variables to change the
72     file name depending on the host configuration. Predefined and useful
73     variables are $ARCH, $HOSTNAME and $KERNEL. Usage example:
74
75   netconfig=server.tld/path/to/config.tbz  =>   restore configuration using wget to download file config.tbz
76   netconfig=server.tld/config-$ARCH.tbz    =>   download config for specified architecture
77
78 netscript::
79     Use this parameter to download and run a script from specified destination:
80     You can also add variables to change the file name depending on the host
81     configuration. Predefined and useful variables are $ARCH, $HOSTNAME and
82     $KERNEL. The environment variable NETSCRIPT is set to the specified URI.
83     This can be used to detect if the script is executed via the netscript bootoption.
84     Usage example:
85
86   netscript=server.tld/path/to/script      =>   download and run script/executable from server
87   netscript=server.tld/script-$HOSTNAME    =>   download and run script/executable for specific host
88
89 extract::
90
91     Extract specific directories from the GCA which needs to be specified by
92     other means.
93
94   extract=/home/grml         => extract only /home/grml from archive
95   extract=/etc               => extract only /etc from archive
96   extract=/home/grml/config  => extract only $HOME/config from archive
97
98 scripts::
99
100     This parameter executes scripts. If an optional path is given, it is
101     relative to DCSDIR. If the path points to a file, this single file is
102     executed. If no path is given, it defaults to scripts/grml.sh.
103     If the given name points to a directory, all scripts inside it are
104     executed. Usage examples:
105
106   scripts               =>   run script DCSDIR/scripts/grml.sh
107   scripts=foobar.sh     =>   run script foobar.sh in DCSDIR
108   scripts=foobar        =>   run all scripts inside DCSDIR/foobar directory
109
110 config::
111
112     This parameter restores a configuration using a GCA. If an optional path is
113     given, it is relative to DCSDIR. If no path is given, it defaults to
114     DCSDIR/config.tbz. Usage examples:
115
116   config                    =>   restore configuration using file DCSDIR/config.tbz
117   config=config_foobar.tbz  =>   restore configuration using file DCSDIR/config_foobar.tbz
118
119 debs::
120
121     This parameter allows automatic installation of deb packages while booting.
122     The path is relative to DCSDIR, not optional and is a shell wildcard. All
123     Files matching the wildcard are installed in a single dpkg --install call.
124     For backwards compatibility, if no slash is contained in the path, it is
125     taken relative to DCSDIR/debs.
126
127     Usage examples:
128
129   debs=*.deb        =>   install all debian packages (suffix .deb) from directory DCSDIR/debs/
130   debs=foo/01*.deb  =>   install all debian packages (suffix .deb) starting with 01 in the filename from directory DCSDIR/foo
131
132 debnet::
133
134     Search all local partitions and dm devices for file /etc/network/interfaces and
135     copy the directory /etc/network to the grml system and restart networking.
136
137 noautoconfig::
138
139     Deactivate automounting. By default the scripts try to mount a device with
140     label 'GRMLCFG'. If you specify the noautoconfig boot parameter this
141     automounting will be deactivated.
142
143   noautoconfig            => disables auto mounting of label 'GRMLCFG'
144
145
146 Permanently adjust boot parameters
147 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
148
149 As you probably know you can adjust boot parameters on the bootprompt.
150 You want to set some boot parameters permanently? That's possible via
151 adding a directory named 'bootparams' to the Grml ISO which has to be
152 located at the root-directory /bootparams/ (Note: the directory is known
153 as /run/live/medium/bootparams/ on a_running_Grml system then!).
154 Place a textfile inside the directory containing the boot parameters
155 which should be appended to default ones (this corresponds to booting
156 without any special parameters).
157
158   mkdir bootparams
159   echo lang=de > bootparams/my_bootparams
160
161 Then burn a multisession CD where directory bootparams is located in the root
162 directory of the CD.
163
164 [NOTE]
165 Not all boot parameters can be used via /bootparams/. This is a limitation of
166 the way the kernel and userspace retrieve boot parameters. Boot parameter
167 regarding the kernel definitely do *NOT* work. Boot parameter related to
168 grml-autoconfig (the main part of the boot process in Grml running in userspace,
169 being all the stuff after startup of udev) are expected to work. Boot parameter
170 related to initrd/initramfs (the part between 'Searching for GRML file' and
171 startup of udev) are *NOT* covered by /bootparams/ as well yet.
172
173 TIP: the application k3b (not available on the live-CD but available through the
174 Debian repositories) provides an easy to use interface for doing the
175 multisession task.
176