1105e4a2b878e7b894cf82843d32052e505dfe16
[live-boot-grml.git] / scripts / live-bottom / 20xconfig
1 #!/bin/sh
2
3 #set -e
4
5 # initramfs-tools header
6
7 PREREQ=""
8
9 prereqs()
10 {
11         echo "${PREREQ}"
12 }
13
14 case "${1}" in
15         prereqs)
16                 prereqs
17                 exit 0
18                 ;;
19 esac
20
21 # live-initramfs header
22
23 . /scripts/live-functions
24
25 log_begin_msg "Configuring X..."
26
27 # live-initramfs script
28
29 if [ "$TERM_TYPE" = "serial" ]; then
30     # Don't bother trying to configure or start X on a serial console
31     rm -f /etc/rc?.d/S??[gxk]dm
32     exit 0
33 fi
34
35 locale=en_US.UTF-8
36
37 mount -n -o bind /sys /root/sys
38 mount -n -o bind /proc /root/proc
39 mount -n -o bind /dev /root/dev
40
41 if [ -n "${XDEBCONF}" -a -x /root/usr/sbin/xdebconfigurator ]; then
42     # xdebconfigurator
43     chroot /root /usr/sbin/xdebconfigurator
44 fi
45
46 if [ "${BUILD_SYSTEM}" = "Ubuntu" ]; then
47     chroot /root debconf-communicate -fnoninteractive live-initramfs > /dev/null <<EOF
48 set xserver-xorg/autodetect_keyboard true
49 fset xserver-xorg/autodetect_keyboard seen true
50 EOF
51 else
52     # d-i code not present, so:
53     if [ -n "${KOPTIONS}" ]; then
54         setoptions="set xserver-xorg/config/inputdevice/keyboard/options ${KOPTIONS}"
55     fi
56     if [ -n "${KVARIANT}" ]; then
57         setvariant="set xserver-xorg/config/inputdevice/keyboard/variant ${KVARIANT}"
58     fi
59     if [ -n "${KMODEL}" ]; then
60         setmodel="set xserver-xorg/config/inputdevice/keyboard/model ${KMODEL}"
61     fi
62
63     chroot /root debconf-communicate -fnoninteractive live-initramfs > /dev/null <<EOF
64 set xserver-xorg/config/inputdevice/keyboard/layout ${kbd}
65 ${setvariant}
66 ${setmodel}
67 ${setoptions}
68 EOF
69 fi
70
71 DEBUG_XORG_PACKAGE=1 DEBUG_XORG_DEBCONF=1 live-reconfigure /root xserver-xorg
72 umount /root/sys
73 umount /root/proc
74 umount /root/dev
75
76 log_end_msg