6 grml-autoconfig - main bootup process of a grml system
10 None - it is a framework. See grml-autoconfig(8) for information regarding
16 By using the config framework, it is possible to customize Grml's startup in a
17 multitude of ways. It allows to:
19 - execute one or more scripts on startup
20 - install Debian packages from deb files on startup
21 - unpack configuration on startup
23 The combination of Debs, Configuration and Scripts is called DCS in Grml. DCS
24 can be read from the Live Image itself, from an arbitrary file system on the
25 local system which is marked with the volume label GRMLCFG, or from the file
26 system pointed to by the myconfig boot parameter.
28 The DCS handling is controlled by a number of boot parameters.
30 The scripts save-config and restore-config can be used to create and handle
31 files called 'grml configuration archive', abbreviated GCA. save-config stores
32 the running configuration inside a GCA; restore-config is a script to restore a
33 configuration from a GCA.
36 A GCA is a plain bzip2 compressed tar archive. All the files are generated
37 starting from the root-directory '/' so it is easy to handle. You can generate
38 configuration archives manually as well. save-config is just a frontend which
39 should make it easier to use.
41 The grml-autoconfig code has been re-worked in August 2009. This document
42 handles both the behavior of Grml releases up to 2009.05 (see
43 <<up-to-200905,section 'Behavior up to grml 2009.05'>>) and the current behavior
44 (see <<current-versions,section 'Behavior in current Grml versions'>>). Great
45 care has been taken to provide maximum backwards compatibility during the
49 Starting with grml release 2009.05 its possible to use root persistency on grml.
50 This means you can store your settings and reuse them on reboot, without having
51 to deal with this config framework. Visit
52 link:http://wiki.grml.org/doku.php?id=persistency for further information.
55 include::grml-autoconfig.200905.txt[]
58 include::grml-autoconfig.current.txt[]
60 Permanently adjust boot parameters
61 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
63 As you probably know you can adjust boot parameters on the bootprompt. You want
64 to set some boot parameters permanently? That's possible via adding a directory
65 named 'bootparams' to the Grml ISO which has to be located at the root-directory
66 /bootparams/ (note: the directory is known as /live/image/bootparams/ on a
67 _running_ Grml system then). Place a textfile inside the directory containing
68 the boot parameters which should be appended to default ones (this corresponds
69 to booting without any special parameters).
72 echo lang=de > bootparams/my_bootparams
74 Then burn a multisession CD where directory bootparams is located in the root
78 Not all boot parameters can be used via /bootparams/. This is a limitation of
79 the way the kernel and userspace retrieve boot parameters. Boot parameter
80 regarding the kernel definitely do *NOT* work. Boot parameter related to
81 grml-autoconfig (the main part of the boot process in Grml running in userspace,
82 being all the stuff after startup of udev) are expected to work. Boot parameter
83 related to initrd/initramfs (the part between 'Searching for GRML file' and
84 startup of udev) are *NOT* covered by /bootparams/ as well yet.
86 TIP: the application k3b (not available on the live-CD but available through the
87 Debian repositories) provides an easy to use interface for doing the
94 Personal configuration files
95 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
97 You are a fan of the editor vim? Great. You probably have your own ~/.vimrc and
98 want to use it on the Grml system. You also don't like the default zsh
99 configuration and want to use your own ~/.zshrc? How to procede? Copy your
100 .vimrc and .zshrc to $HOME of user 'grml'. Place additional files in
101 $HOME/config. Now create a configuration for your files running:
103 save-config -home -configdir
105 Now you should have a file named config.tbz containing your configuration files.
106 You can copy the archive to a webserver and restore it via downloading during
107 reboot using the following commandline on bootprompt:
109 grml netconfig=server.tld/path/to/config.tbz
111 You don't have network access but own a floppy drive? Copy the file to a floppy
114 grml myconfig=/dev/fd0
116 Floppy is to small or to slow? Ok, let's use a usb device:
118 grml myconfig=/dev/sda1
120 Network configuration
121 ~~~~~~~~~~~~~~~~~~~~~
123 You need a specific network setup and want to use your own
124 /etc/network/interfaces by default? Generate the configuration archive running
125 the following command as user root:
129 Now you should have a file named config.tbz containing your configuration files.
130 If you want to use it with a floppy disk copy the file to a floppy and boot via
131 using the following command on bootprompt:
133 grml myconfig=/dev/fd0
135 Floppy is to small or to slow? Ok, let's use a usb device:
137 grml myconfig=/dev/sda1
139 You do have an existing harddisk installation and want to use its configuration?
140 Let's say the debian system is located in /dev/sda2. You want to use the
141 directory /etc/network. This directory is activated by default in
142 /etc/grml/partconf so we don't have to do any further work. We just need to
143 activate it via using the following commandline on bootprompt:
145 grml partconf=/dev/sda2
147 Automatic installation of debian packages
148 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
150 You have a specified debian package named 'foobar.deb' and want to use it with
151 (therefore: install it on) Grml by default? Notice: this feature is useful
152 especially for grml-small (a ~100 MB ISO). If you want to use it with the large
153 version of Grml you might have to overburn the ISO.
155 Let's assume you have burned the Grml iso to a CD-RW using a commandline like:
157 cdrecord dev=/dev/hdc -v -multi -tao grml_0.5.iso
159 Now create a directory named debs and place foobar.deb in it:
161 mkdir debs/ && cp foobar.deb debs/
163 Notice: This directory will be located in /live/image after burning the second
166 Now create the second session containing this directory:
168 mkisofs -M grml_0.5.iso -C `cdrecord -msinfo dev=/dev/hdc` -R -o 2nd_session.iso debs
170 Finally append the second session to the cd using:
172 cdrecord dev=/dev/hdc -v -multi -tao 2nd_session.iso
174 TIP: the application k3b (not available on the live CD but available through the
175 Debian repositories) provides an easy to use interface for doing the
178 Now boot from your new personalized Grml CD using the debs parameter:
182 Run your own commands on startup
183 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
185 You know that booting with 'grml service=foobar' executes /etc/init.d/foobar
186 when booting Grml. But you want to setup a more complex network configuration,
187 adjust some other stuff and so on on your own? Just write a script named grml.sh
188 which does the job and use own of the mentioned bootparams. Let's say you have
189 placed grml.sh on your usb device (usb stick) then use the following commandline
192 grml myconfig=/dev/sda1
194 Or even better: create a floppy disk with label GRMLCFG running:
196 fdformat /dev/fd0 # format the floppy disk if not done already
197 mkfs.ext2 -L GRMLCFG /dev/fd0 # now create ext2 filesystem with label GRMLCFG on it:
199 TIP: several filesystems provide the possibility to provide a label. For
200 example FAT provides this through: 'mkfs.vfat -n GRMLCFG /dev/sda1' (attention:
201 this will destroy data on /dev/sda1 of course!). Take a look at the
202 documentation/manpage of the filesystem you want to use.
204 Now place your configuration archive (see save-config and the other usage
205 scenarios) and the script grml.sh on the floppy disk. Now you can boot your
206 system without specifying any bootparameters on bootprompt because devices
207 labeled with GRMLCFG are mounted readonly and used by default. If you did not
208 label your device you can use the device anyway using 'grml myconfig=/dev/ice'
214 You are responsible for a customer's system in her data center. The system has
215 failed and you need to debug from remote, and the remote hands available in the
216 data center do not have enough knowledge to get Grml booted and configure the
217 network without external help?
219 If the hard disk of the system is still available, you hopefully have saved a
220 configuration file with IP address, netmask and default gateway somewhere on
221 that hard disk. Grml can use the information found on a partition. Take a look
222 at the 'partconf' boot parameter. Usage example: 'grml partconf=/dev/sda2'
223 copies files defined in /etc/grml/partconf from /dev/sda2 to the Grml system. As
224 /etc/network is predefined in /etc/grml/partconf the configuration from
225 /dev/sda2 will be taken.
227 Or you use a standard Grml medium and have grml read IP address, netmask and
228 default gateway from another medium like a floppy or an USB stick. Take a look
229 at the script saveconfig and the boot parameter myconfig.
231 Or you put a grml.iso file on your hard disk (maybe in /boot/grml) or on an USB
232 stick, use grub to boot from there and place debs, configuration scripts or Grml
233 configuraton archives alongside the .iso.
235 Use persistent home directory
236 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
238 You want to use a persistent home directory which includes all the files located
239 in $HOME. Use the script mkpersistenthome to create such a persistent home
240 directory. You have the options to either use a specific partition as your home
241 directory or add a loopback file named grml.img on the specified partition (the
244 TIP: /dev/external in the partition selection of mkpersistenthome is an usb
245 device without partitions. /dev/external1 corresponds to the first partition on
246 an usb device (usually an usb stick).
248 After running the script mkpersistenthome you can use the boot parameter home to
249 activate the home directory. If you are using the option with the loopback file
250 (grml.img) you can boot via:
254 which will scan through the partitions and if a file grml.img is found it will
255 be mounted as your $HOME-directory. If you want to use a partition as your home
256 directory specify the device as an option. If you want to use /dev/sda2 as your
261 Notice: the files located in /etc/skel will be copied to the partition (but will
262 not overwrite any files).
266 If you find a bug please report it. See link:http://grml.org/bugs/ for details
267 about how to report bugs.
271 grml-autoconfig(8), mkpersistenthome(1), restore-config(1), save-config(1)
275 (c) 2005++, Michael Prokop <mika@grml.org>