Sourcing live.vars in 21xdriver and 21xvidemode in order to be able to set variables...
[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 . /live.vars
40
41 if [ -n "$XDRIVER" ]
42 then
43         mount -o bind /sys /root/sys
44         mount -o bind /proc /root/proc
45         mount -o bind /dev /root/dev
46
47 chroot /root debconf-communicate -fnoninteractive live-initramfs > /dev/null << EOF
48 set xserver-xorg/autodetect_video_card false
49 set xserver-xorg/config/device/driver ${XDRIVER}
50 EOF
51
52         chroot /root dexconf
53
54         umount /root/sys
55         umount /root/proc
56         umount /root/dev
57 fi
58
59 log_end_msg