Don't configure X.org if it's not installed.
[live-boot-grml.git] / scripts / live-bottom / 21xdriver
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 if [ ! -x /root/usr/bin/X ]
29 then
30         exit 0
31 fi
32
33 . /scripts/live-functions
34
35 log_begin_msg "Configuring X video driver"
36
37 # live-initramfs script
38
39 if [ -n "$XDRIVER" ]
40 then
41         mount -n -o bind /sys /root/sys
42         mount -n -o bind /proc /root/proc
43         mount -n -o bind /dev /root/dev
44
45 chroot /root debconf-communicate -fnoninteractive live-initramfs > /dev/null << EOF
46 set xserver-xorg/autodetect_video_card false
47 set xserver-xorg/config/device/driver ${XDRIVER}
48 EOF
49
50         chroot /root dexconf
51
52         umount /root/sys
53         umount /root/proc
54         umount /root/dev
55 fi
56
57 log_end_msg