Adding casper 1.59+debian-1.
[live-boot-grml.git] / scripts / casper-bottom / 20xconfig
1 #!/bin/sh
2
3 PREREQ=""
4 DESCRIPTION="Configuring X..."
5
6 . /scripts/functions
7
8 prereqs()
9 {
10        echo "$PREREQ"
11 }
12
13 case $1 in
14 # get pre-requisites
15 prereqs)
16        prereqs
17        exit 0
18        ;;
19 esac
20
21 log_begin_msg "$DESCRIPTION"
22
23 if [ "$TERM_TYPE" = "serial" ]; then
24     # Don't bother trying to configure or start X on a serial console
25     rm -f /etc/rc?.d/S??[gxk]dm
26     exit 0
27 fi
28
29 locale=en_US.UTF-8
30
31 for x in $(cat /proc/cmdline); do
32                 case $x in
33                         debian-installer/locale=*)
34                                 locale=${x#debian-installer/locale=}
35                                 ;;
36                 esac
37 done
38
39 mount -n -o bind /sys /root/sys
40 mount -n -o bind /proc /root/proc
41
42 chroot /root debconf-communicate -fnoninteractive casper > /dev/null <<EOF
43 set xserver-xorg/autodetect_keyboard true
44 fset xserver-xorg/autodetect_keyboard seen true
45 EOF
46
47 DEBUG_XORG_PACKAGE=1 DEBUG_XORG_DEBCONF=1 LANG=$(grep "^${locale}" /root/usr/share/i18n/SUPPORTED | grep UTF-8 | sed -e 's, .*,,' -e q) casper-reconfigure /root xserver-xorg
48 umount /root/sys
49 umount /root/proc
50
51 log_end_msg