1.1.16
by Daniel Baumann
Import upstream version 2.0.0 |
1 |
:B~ Customizing run time behaviours |
2 |
||
3 |
1~customizing-run-time-behaviours Customizing run time behaviours |
|
4 |
||
5 |
All configuration that is done during run time is done by live-config. Here |
|
1.1.15
by Daniel Baumann
Import upstream version 2.0~a12 |
6 |
are some most common options of live-config that users are interested in. A |
7 |
full list of all possibilities can be found in the manpage of live-config. |
|
8 |
||
1.1.16
by Daniel Baumann
Import upstream version 2.0.0 |
9 |
2~ Customizing the live user |
1.1.15
by Daniel Baumann
Import upstream version 2.0~a12 |
10 |
|
1.1.16
by Daniel Baumann
Import upstream version 2.0.0 |
11 |
One important consideration is that the live user is created by live-boot at |
12 |
boot time, not by live-build at build time. This not only influences where |
|
13 |
materials relating to the live user are introduced in your build, as |
|
14 |
discussed in {Live/chroot local includes}#live-chroot-local-includes, but |
|
15 |
also any groups and permissions associated with the live user. |
|
1.1.15
by Daniel Baumann
Import upstream version 2.0~a12 |
16 |
|
17 |
You can specify additional groups that the live user will belong to by |
|
18 |
preseeding the #{passwd/user-default-groups}# debconf value. For example, to |
|
19 |
add the live user to the #{fuse}# group, add the following to a file in the |
|
20 |
#{config/chroot_local-preseed}# directory: |
|
21 |
||
22 |
code{ |
|
23 |
||
1.1.19
by Daniel Baumann
Import upstream version 3.0~a1 |
24 |
user-setup passwd/user-default-groups string audio cdrom dip floppy video plugdev netdev powerdev scanner bluetooth fuse |
1.1.15
by Daniel Baumann
Import upstream version 2.0~a12 |
25 |
|
26 |
}code |
|
27 |
||
1.1.16
by Daniel Baumann
Import upstream version 2.0.0 |
28 |
2~customizing-locale-and-language Customizing locale and language |
1.1.15
by Daniel Baumann
Import upstream version 2.0~a12 |
29 |
|
30 |
When the live system boots, language is involved in three steps: |
|
31 |
||
32 |
_* the locale generation |
|
33 |
||
34 |
_* setting the keyboard layout for the console |
|
35 |
||
36 |
_* setting the keyboard layout for X |
|
37 |
||
1.1.16
by Daniel Baumann
Import upstream version 2.0.0 |
38 |
The default locale when building a Live system is "locales=en_US.UTF-8". To |
39 |
define the locale that should be generated, use the #{locales}# parameter in |
|
40 |
the #{--bootappend-live}# option of #{lb config}#, e.g. |
|
1.1.15
by Daniel Baumann
Import upstream version 2.0~a12 |
41 |
|
42 |
code{ |
|
43 |
||
1.1.17
by Daniel Baumann
Import upstream version 2.0.1 |
44 |
$ lb config --bootappend-live "locales=de_CH.UTF-8" |
1.1.15
by Daniel Baumann
Import upstream version 2.0~a12 |
45 |
|
46 |
}code |
|
47 |
||
1.1.16
by Daniel Baumann
Import upstream version 2.0.0 |
48 |
This parameter can also be used at the kernel command line. You can specify |
49 |
a locale by a full #{language_country.encoding}# word. |
|
1.1.15
by Daniel Baumann
Import upstream version 2.0~a12 |
50 |
|
1.1.16
by Daniel Baumann
Import upstream version 2.0.0 |
51 |
Both the console and X keyboard configuration depend on the |
52 |
#{keyboard-layouts}# parameter of the #{--bootappend-live}# option. Valid |
|
1.1.17
by Daniel Baumann
Import upstream version 2.0.1 |
53 |
options for X keyboard layouts can be found in |
54 |
#{/usr/share/X11/xkb/rules/base.xml}# (rather limited to two-letters country |
|
55 |
codes). To find the value (the two characters) corresponding to a language |
|
56 |
try searching for the english name of the nation where the language is |
|
57 |
spoken, e.g: |
|
1.1.15
by Daniel Baumann
Import upstream version 2.0~a12 |
58 |
|
59 |
code{ |
|
60 |
||
1.1.17
by Daniel Baumann
Import upstream version 2.0.1 |
61 |
$ grep -i sweden -C3 /usr/share/X11/xkb/rules/base.xml | grep name |
62 |
<name>se</name> |
|
1.1.15
by Daniel Baumann
Import upstream version 2.0~a12 |
63 |
|
64 |
}code |
|
65 |
||
66 |
To get the locale files for German and Swiss German keyboard layout in X |
|
67 |
use: |
|
68 |
||
69 |
code{ |
|
70 |
||
1.1.17
by Daniel Baumann
Import upstream version 2.0.1 |
71 |
$ lb config --bootappend-live "locales=de_CH.UTF-8 keyboard-layouts=ch" |
1.1.15
by Daniel Baumann
Import upstream version 2.0~a12 |
72 |
|
73 |
}code |
|
74 |
||
75 |
A list of the valid values of the keyboards for the console can be figured |
|
76 |
with the following command: |
|
77 |
||
78 |
code{ |
|
79 |
||
1.1.17
by Daniel Baumann
Import upstream version 2.0.1 |
80 |
$ for i in $(find /usr/share/keymaps/ -iname "*kmap.gz"); \ |
81 |
do basename $i | head -c -9; echo; done | sort | less |
|
1.1.15
by Daniel Baumann
Import upstream version 2.0~a12 |
82 |
|
83 |
}code |
|
84 |
||
85 |
Alternatively, you can use the #{console-setup}# package, a tool to let you |
|
1.1.16
by Daniel Baumann
Import upstream version 2.0.0 |
86 |
configure console layout using X (XKB) definitions; you can then set your |
1.1.15
by Daniel Baumann
Import upstream version 2.0~a12 |
87 |
keyboard layout more precisely with #{keyboard-layouts}#, |
88 |
#{keyboard-variant}#, #{keyboard-options}# and #{keyboard-model}# variables; |
|
89 |
live-boot will use also these parameters for X configuration. For example, |
|
90 |
to set up a French system with a French-Dvorak layout (called Bepo) on a |
|
91 |
TypeMatrix keyboard, both in console and X11, use: |
|
92 |
||
93 |
code{ |
|
94 |
||
1.1.17
by Daniel Baumann
Import upstream version 2.0.1 |
95 |
$ lb config --bootappend-live \ |
96 |
"locales=fr_FR.UTF-8 keyboard-layouts=fr keyboard-variant=bepo keyboard-model=tm2030usb"
|
|
1.1.15
by Daniel Baumann
Import upstream version 2.0~a12 |
97 |
|
98 |
}code |
|
99 |
||
1.1.16
by Daniel Baumann
Import upstream version 2.0.0 |
100 |
2~persistence Persistence |
1.1.15
by Daniel Baumann
Import upstream version 2.0~a12 |
101 |
|
102 |
A live cd paradigm is a pre-installed system which runs from read-only |
|
103 |
media, like a cdrom, where writes and modifications do not survive reboots |
|
104 |
of the host hardware which runs it. |
|
105 |
||
106 |
A Debian Live system is a generalization of this paradigm and thus supports |
|
107 |
other media in addition to CDs; but still, in its default behaviour, it |
|
108 |
should be considered read-only and all the run-time evolutions of the system |
|
109 |
are lost at shutdown. |
|
110 |
||
111 |
Persistence is a common name for different kinds of solutions for saving |
|
112 |
across reboots some, or all, of this run-time evolution of the system. To |
|
113 |
understand how it could work it could be handy to know that even if the |
|
114 |
system is booted and run from read-only media, modification to the files and |
|
115 |
directories are written on writable media, typically a ram disk (tmpfs) and |
|
116 |
ram disks' data do not survive reboots. |
|
117 |
||
118 |
The data stored on this ramdisk should be saved on a writable persistent
|
|
119 |
medium like a Hard Disk, a USB key, a network share or even a session of a
|
|
120 |
multisession (re)writable CD/DVD. All these media are supported in Debian
|
|
121 |
Live in different ways, and all but the last one require a special boot
|
|
122 |
parameter to be specified at boot time: #{persistent}#.
|
|
123 |
||
124 |
3~ Full persistence
|
|
125 |
||
126 |
By 'full persistence' it is meant that instead of using a tmpfs for storing |
|
127 |
modifications to the read-only media (with the copy-on-write, COW, system) a
|
|
128 |
writable partition is used. In order to use this feature a partition with a
|
|
129 |
clean writable supported filesystem on it labeled "live-rw" must be attached
|
|
130 |
on the system at boot time and the system must be started with the boot
|
|
131 |
parameter 'persistent'. This partition could be an ext2 partition on the |
|
132 |
hard disk or on a usb key created with, e.g.:
|
|
133 |
||
134 |
code{
|
|
135 |
||
1.1.17
by Daniel Baumann
Import upstream version 2.0.1 |
136 |
# mkfs.ext2 -L live-rw /dev/sdb1
|
1.1.15
by Daniel Baumann
Import upstream version 2.0~a12 |
137 |
|
138 |
}code
|
|
139 |
||
140 |
If you already have a partition on your device, you could just change the
|
|
141 |
label with one of the following:
|
|
142 |
||
143 |
code{
|
|
144 |
||
1.1.17
by Daniel Baumann
Import upstream version 2.0.1 |
145 |
# tune2fs -L live-rw /dev/sdb1 # for ext2,3,4 filesystems
|
146 |
# dosfslabel /dev/sdb1 live-rw # for a fat filesystem
|
|
1.1.15
by Daniel Baumann
Import upstream version 2.0~a12 |
147 |
|
148 |
}code
|
|
149 |
||
150 |
But since live system users cannot always use a hard drive partition, and
|
|
151 |
considering that most USB keys have poor write speeds, 'full' persistence |
|
152 |
could be also used with just image files, so you could create a file
|
|
153 |
representing a partition and put this image file even on a NTFS partition of
|
|
154 |
a foreign OS, with something like:
|
|
155 |
||
156 |
code{
|
|
157 |
||
1.1.17
by Daniel Baumann
Import upstream version 2.0.1 |
158 |
$ dd if=/dev/null of=live-rw bs=1G seek=1 # for a 1GB sized image file
|
159 |
$ /sbin/mkfs.ext2 -F live-rw
|
|
1.1.15
by Daniel Baumann
Import upstream version 2.0~a12 |
160 |
|
161 |
}code
|
|
162 |
||
163 |
Then copy the #{live-rw}# file to a writable partition and reboot with the
|
|
164 |
boot parameter 'persistent'. |
|
165 |
||
166 |
3~ Home automounting |
|
167 |
||
168 |
If during the boot a partition (filesystem) image file or a partition |
|
169 |
labeled #{home-rw}# is discovered, this filesystem will be directly mounted |
|
170 |
as #{/home}#, thus permitting persistence of files that belong to e.g. the |
|
171 |
default user. It can be combined with full persistence. |
|
172 |
||
173 |
3~ Snapshots |
|
174 |
||
175 |
Snapshots are collections of files and directories which are not mounted |
|
176 |
while running but which are copied from a persistent device to the system |
|
177 |
(tmpfs) at boot and which are resynced at reboot/shutdown of the system. The |
|
178 |
content of a snapshot could reside on a partition or an image file (like the |
|
179 |
above mentioned types) labeled #{live-sn}#, but it defaults to a simple cpio |
|
180 |
archive named #{live-sn.cpio.gz}#. As above, at boot time, the block devices |
|
181 |
connected to the system are traversed to see if a partition or a file named |
|
182 |
like that could be found. A power interruption during run time could lead to |
|
183 |
data loss, hence a tool invoked #{live-snapshot --refresh}# could be called |
|
184 |
to sync important changes. This type of persistence, since it does not write |
|
185 |
continuously to the persistent media, is the most flash-based device |
|
186 |
friendly and the fastest of all the persistence systems. |
|
187 |
||
188 |
A /home version of snapshot exists too and its label is #{home-sn.*}#; it |
|
189 |
works the same as the main snapshot but it is only applied to /home. |
|
190 |
||
191 |
Snapshots cannot currently handle file deletion but full persistence and |
|
192 |
home automounting can. |
|
193 |
||
194 |
3~ Persistent SubText |
|
195 |
||
196 |
If a user would need multiple persistent storage of the same type for |
|
197 |
different locations or testing, such as #{live-rw-nonwork}# and |
|
198 |
#{live-rw-work}#, the boot parameter #{persistent-subtext}# used in |
|
199 |
conjuntion with the boot parameter #{persistent}# will allow for multiple |
|
200 |
but unique persistent media. An example would be if a user wanted to use a |
|
201 |
persistent partition labeled #{live-sn-subText}# they would use the boot |
|
202 |
parameters of: #{persistent}# #{persistent-subtext=subText}#. |
|
203 |
||
204 |
3~ Partial remastering |
|
205 |
||
206 |
The run-time modification of the tmpfs could be collected using |
|
207 |
live-snapshot in a squashfs and added to the cd by remastering the iso in |
|
208 |
the case of cd-r or adding a session to multisession cd/dvd(rw); live-boot |
|
209 |
mounts all /live filesystem in order or with the module boot parameter. |