98d29291b9cbd5f179fb32a2aa6b4b3d89abb8f0
[live-boot-grml.git] / scripts / casper-bottom / 20xconfig
1 #!/bin/sh
2
3 PREREQ=""
4 DESCRIPTION="Configuring X..."
5
6 . /scripts/casper-functions
7
8
9 prereqs()
10 {
11        echo "$PREREQ"
12 }
13
14 case $1 in
15 # get pre-requisites
16 prereqs)
17        prereqs
18        exit 0
19        ;;
20 esac
21
22 log_begin_msg "$DESCRIPTION"
23
24 if [ "$TERM_TYPE" = "serial" ]; then
25     # Don't bother trying to configure or start X on a serial console
26     rm -f /etc/rc?.d/S??[gxk]dm
27     exit 0
28 fi
29
30 mount -n -o bind /sys /root/sys
31 mount -n -o bind /proc /root/proc
32
33 if [ "${BUILD_SYSTEM}" == "Ubuntu" ]; then
34     chroot /root debconf-communicate -fnoninteractive casper > /dev/null <<EOF
35 set xserver-xorg/autodetect_keyboard true
36 fset xserver-xorg/autodetect_keyboard seen true
37 EOF
38 else
39     # d-i code not present, so:
40     echo "set xserver-xorg/config/inputdevice/keyboard/layout ${kbd}" | chroot /root debconf-communicate -fnoninteractive casper > /dev/null
41 fi
42
43 DEBUG_XORG_PACKAGE=1 DEBUG_XORG_DEBCONF=1 casper-reconfigure /root xserver-xorg
44 umount /root/sys
45 umount /root/proc
46
47 log_end_msg