Adding live-initramfs 1.87.1-1.
[live-boot-grml.git] / scripts / live-bottom / 20xconfig
1 #!/bin/sh
2
3 PREREQ=""
4 DESCRIPTION="Configuring X..."
5
6 . /scripts/live-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                         locale=*)
37                                 locale=${x#locale=}
38                                 ;;
39                 esac
40 done
41
42 mount -n -o bind /sys /root/sys
43 mount -n -o bind /proc /root/proc
44 mount -n -o bind /dev /root/dev
45
46 if [ -n "${XDEBCONF}" -a -x /root/usr/sbin/xdebconfigurator ]; then
47     # xdebconfigurator
48     chroot /root /usr/sbin/xdebconfigurator
49 fi
50
51 chroot /root debconf-communicate -fnoninteractive live-initramfs > /dev/null <<EOF
52 set xserver-xorg/autodetect_keyboard true
53 fset xserver-xorg/autodetect_keyboard seen true
54 EOF
55
56 DEBUG_XORG_PACKAGE=1 DEBUG_XORG_DEBCONF=1 LANG=$(grep "^${locale}" /root/usr/share/i18n/SUPPORTED | grep UTF-8 | sed -e 's, .*,,' -e q) live-reconfigure /root xserver-xorg
57 umount /root/sys
58 umount /root/proc
59 umount /root/dev
60
61 log_end_msg