@@ -35,11 +35,19 Set system host name. It's recommended that the host name is unique in the corre | |||
|
35 | 35 | Set system `root` password. The same password is used for the created user `pi`. It's **STRONGLY** recommended that you choose a custom password. |
|
36 | 36 | |
|
37 | 37 | ##### `DEFLOCAL`="en_US.UTF-8" |
|
38 |
Set default system locale |
|
|
38 | Set default system locale. This setting can also be changed inside the running OS using the `dpkg-reconfigure locales` command. The script variant `minbase` (ENABLE_MINBASE=true) doesn't install `locales`. | |
|
39 | ||
|
39 | 40 | |
|
40 | 41 | ##### `TIMEZONE`="Europe/Berlin" |
|
41 | 42 | Set default system timezone. All available timezones can be found in the `/usr/share/zoneinfo/` directory. This setting can also be changed inside the running OS using the `dpkg-reconfigure tzdata` command. |
|
42 | 43 | |
|
44 | #### Keyboard settings: | |
|
45 | These options are used to configure keyboard layout in `/etc/default/keyboard` for console and Xorg. These settings can also be changed inside the running OS using the `dpkg-reconfigure keyboard-configuration` command. | |
|
46 | ##### `XKBMODEL`="" | |
|
47 | ##### `XKBLAYOUT`="" | |
|
48 | ##### `XKBVARIANT`="" | |
|
49 | ##### `XKBOPTIONS`="" | |
|
50 | ||
|
43 | 51 | #### Basic system features: |
|
44 | 52 | ##### `ENABLE_CONSOLE`=true |
|
45 | 53 | Enable serial console interface. Recommended if no monitor or keyboard is connected to the RPi2. In case of problems fe. if the network (auto) configuration failed - the serial console can be used to access the system. |
@@ -45,6 +45,10 HOSTNAME=${HOSTNAME:=rpi2-${RELEASE}} | |||
|
45 | 45 | PASSWORD=${PASSWORD:=raspberry} |
|
46 | 46 | DEFLOCAL=${DEFLOCAL:="en_US.UTF-8"} |
|
47 | 47 | TIMEZONE=${TIMEZONE:="Europe/Berlin"} |
|
48 | XKBMODEL=${XKBMODEL:=""} | |
|
49 | XKBLAYOUT=${XKBLAYOUT:=""} | |
|
50 | XKBVARIANT=${XKBVARIANT:=""} | |
|
51 | XKBOPTIONS=${XKBOPTIONS:=""} | |
|
48 | 52 | |
|
49 | 53 | # APT settings |
|
50 | 54 | APT_PROXY=${APT_PROXY:=""} |
@@ -128,7 +132,7 mkdir -p $R | |||
|
128 | 132 | if [ "$ENABLE_MINBASE" = true ] ; then |
|
129 | 133 | APT_INCLUDES="${APT_INCLUDES},vim-tiny,netbase,net-tools" |
|
130 | 134 | else |
|
131 | APT_INCLUDES="${APT_INCLUDES},locales" | |
|
135 | APT_INCLUDES="${APT_INCLUDES},locales,keyboard-configuration,console-setup" | |
|
132 | 136 | fi |
|
133 | 137 | |
|
134 | 138 | # Add dbus package, recommended if using systemd |
@@ -218,12 +222,6 EOM | |||
|
218 | 222 | echo ${TIMEZONE} >$R/etc/timezone |
|
219 | 223 | LANG=C chroot $R dpkg-reconfigure -f noninteractive tzdata |
|
220 | 224 | |
|
221 | # Set up default locales to "en_US.UTF-8" default | |
|
222 | if [ "$ENABLE_MINBASE" = false ] ; then | |
|
223 | LANG=C chroot $R sed -i '/${DEFLOCAL}/s/^#//' /etc/locale.gen | |
|
224 | LANG=C chroot $R locale-gen ${DEFLOCAL} | |
|
225 | fi | |
|
226 | ||
|
227 | 225 | # Upgrade collabora package index and install collabora keyring |
|
228 | 226 | echo "deb https://repositories.collabora.co.uk/debian ${RELEASE} rpi2" >$R/etc/apt/sources.list |
|
229 | 227 | LANG=C chroot $R apt-get -qq -y update |
@@ -247,6 +245,49 EOM | |||
|
247 | 245 | LANG=C chroot $R apt-get -qq -y update |
|
248 | 246 | LANG=C chroot $R apt-get -qq -y -u dist-upgrade |
|
249 | 247 | |
|
248 | # Set up default locale and keyboard configuration | |
|
249 | if [ "$ENABLE_MINBASE" = false ] ; then | |
|
250 | # Set locale choice in debconf db, even though dpkg-reconfigure ignores and overwrites them due to some bug | |
|
251 | # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=684134 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=685957 | |
|
252 | # ... so we have to set locales manually | |
|
253 | if [ "$DEFLOCAL" = "en_US.UTF-8" ] ; then | |
|
254 | LANG=C chroot $R echo "locales locales/locales_to_be_generated multiselect ${DEFLOCAL} UTF-8" | debconf-set-selections | |
|
255 | else | |
|
256 | # en_US.UTF-8 should be available anyway : https://www.debian.org/doc/manuals/debian-reference/ch08.en.html#_the_reconfiguration_of_the_locale | |
|
257 | LANG=C chroot $R echo "locales locales/locales_to_be_generated multiselect en_US.UTF-8 UTF-8, ${DEFLOCAL} UTF-8" | debconf-set-selections | |
|
258 | LANG=C chroot $R sed -i "/en_US.UTF-8/s/^#//" /etc/locale.gen | |
|
259 | fi | |
|
260 | LANG=C chroot $R sed -i "/${DEFLOCAL}/s/^#//" /etc/locale.gen | |
|
261 | LANG=C chroot $R echo "locales locales/default_environment_locale select ${DEFLOCAL}" | debconf-set-selections | |
|
262 | LANG=C chroot $R locale-gen | |
|
263 | LANG=C chroot $R update-locale LANG=${DEFLOCAL} | |
|
264 | ||
|
265 | # Keyboard configuration, if requested | |
|
266 | if [ "$XKBMODEL" != "" ] ; then | |
|
267 | LANG=C chroot $R sed -i "s/^XKBMODEL.*/XKBMODEL=\"${XKBMODEL}\"/" /etc/default/keyboard | |
|
268 | fi | |
|
269 | if [ "$XKBLAYOUT" != "" ] ; then | |
|
270 | LANG=C chroot $R sed -i "s/^XKBLAYOUT.*/XKBLAYOUT=\"${XKBLAYOUT}\"/" /etc/default/keyboard | |
|
271 | fi | |
|
272 | if [ "$XKBVARIANT" != "" ] ; then | |
|
273 | LANG=C chroot $R sed -i "s/^XKBVARIANT.*/XKBVARIANT=\"${XKBVARIANT}\"/" /etc/default/keyboard | |
|
274 | fi | |
|
275 | if [ "$XKBOPTIONS" != "" ] ; then | |
|
276 | LANG=C chroot $R sed -i "s/^XKBOPTIONS.*/XKBOPTIONS=\"${XKBOPTIONS}\"/" /etc/default/keyboard | |
|
277 | fi | |
|
278 | LANG=C chroot $R dpkg-reconfigure -f noninteractive keyboard-configuration | |
|
279 | # Set up font console | |
|
280 | case "${DEFLOCAL}" in | |
|
281 | *UTF-8) | |
|
282 | LANG=C chroot $R sed -i 's/^CHARMAP.*/CHARMAP="UTF-8"/' /etc/default/console-setup | |
|
283 | ;; | |
|
284 | *) | |
|
285 | LANG=C chroot $R sed -i 's/^CHARMAP.*/CHARMAP="guess"/' /etc/default/console-setup | |
|
286 | ;; | |
|
287 | esac | |
|
288 | LANG=C chroot $R dpkg-reconfigure -f noninteractive console-setup | |
|
289 | fi | |
|
290 | ||
|
250 | 291 | # Kernel installation |
|
251 | 292 | # Install flash-kernel last so it doesn't try (and fail) to detect the platform in the chroot |
|
252 | 293 | LANG=C chroot $R apt-get -qq -y --no-install-recommends install linux-image-3.18.0-trunk-rpi2 |
General Comments 0
Vous devez vous connecter pour laisser un commentaire.
Se connecter maintenant