Adding live-initramfs 1.99.2-1.
[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 if [ -n "${NOXAUTOCONFIG}" ]
24 then
25         exit 0
26 fi
27
28 . /scripts/live-functions
29
30 log_begin_msg "Configuring X..."
31
32 # live-initramfs script
33
34 if [ "$TERM_TYPE" = "serial" ]
35 then
36         # Don't bother trying to configure or start X on a serial console
37         rm -f /etc/rc?.d/S??[gxk]dm
38         exit 0
39 fi
40
41 locale=en_US.UTF-8
42
43 mount -n -o bind /sys /root/sys
44 mount -n -o bind /proc /root/proc
45 mount -n -o bind /dev /root/dev
46
47 if [ -n "${XDEBCONF}" -a -x /root/usr/sbin/xdebconfigurator ]
48 then
49         # xdebconfigurator
50         chroot /root /usr/sbin/xdebconfigurator
51 fi
52
53 if [ "${BUILD_SYSTEM}" = "Ubuntu" ]
54 then
55
56 chroot /root debconf-communicate -fnoninteractive live-initramfs > /dev/null << EOF
57 set xserver-xorg/autodetect_keyboard true
58 fset xserver-xorg/autodetect_keyboard seen true
59 EOF
60
61 else
62         # d-i code not present, so:
63         if [ -n "${KOPTIONS}" ]
64         then
65                 setoptions="set xserver-xorg/config/inputdevice/keyboard/options ${KOPTIONS}"
66         fi
67
68         if [ -n "${KVARIANT}" ]
69         then
70                 setvariant="set xserver-xorg/config/inputdevice/keyboard/variant ${KVARIANT}"
71         fi
72
73         if [ -n "${KMODEL}" ]
74         then
75                 setmodel="set xserver-xorg/config/inputdevice/keyboard/model ${KMODEL}"
76         fi
77
78 chroot /root debconf-communicate -fnoninteractive live-initramfs > /dev/null << EOF
79 set xserver-xorg/config/inputdevice/keyboard/layout ${kbd}
80 ${setvariant}
81 ${setmodel}
82 ${setoptions}
83 EOF
84
85 fi
86
87 DEBUG_XORG_PACKAGE=1 DEBUG_XORG_DEBCONF=1 live-reconfigure /root xserver-xorg
88 umount /root/sys
89 umount /root/proc
90 umount /root/dev
91
92 log_end_msg