X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=scripts%2Flive-bottom%2F21xvidemode;h=489fc5c6ac3d2ee87de49f671cd495f0c25029a3;hb=4fc648acc4e010fe0c3046baeb26ec1334c16e27;hp=27d943e76936dc69224f8c21bd031dcd550d78ea;hpb=ea5ccacffb14572b4800d14fc9eea23cad7ca893;p=live-boot-grml.git diff --git a/scripts/live-bottom/21xvidemode b/scripts/live-bottom/21xvidemode index 27d943e..489fc5c 100755 --- a/scripts/live-bottom/21xvidemode +++ b/scripts/live-bottom/21xvidemode @@ -1,30 +1,57 @@ #!/bin/sh -PREREQ="" -DESCRIPTION="Configuring X kludges..." +#set -e -. /scripts/live-functions +# initramfs-tools header + +PREREQ="" prereqs() { - echo "$PREREQ" + echo "${PREREQ}" } -case $1 in -# get pre-requisites -prereqs) - prereqs - exit 0 - ;; +case "${1}" in + prereqs) + prereqs + exit 0 + ;; esac -log_begin_msg "$DESCRIPTION" +# live-initramfs header + +if [ -n "${NOXAUTOCONFIG}" ] +then + exit 0 +fi + +if [ ! -x /root/usr/bin/X ] +then + exit 0 +fi + +[ -n "$XVIDEOMODE" ] || exit + +. /scripts/live-functions + +log_begin_msg "Configuring X video modes" + +# live-initramfs script + +. /live.vars -if [ -n "$XVIDEOMODE" ] +if [ $(cat /root/etc/debian_version | sed 's|\..*$||') -ge 4 ] then - mount -n -o bind /sys /root/sys - mount -n -o bind /proc /root/proc - mount -n -o bind /dev /root/dev + # lenny or newer + if [ -x "$(which xrandr 2>/dev/null)" ] + then + echo "xrandr -s ${XVIDEOMODE} || /bin/true" >> /root/etc/X11/Xsession.d/21xvidemode + fi +else + # etch + mount -o bind /sys /root/sys + mount -o bind /proc /root/proc + mount -o bind /dev /root/dev chroot /root debconf-communicate -fnoninteractive live-initramfs > /dev/null << EOF set xserver-xorg/config/monitor/mode-list ${XVIDEOMODE}