#!/bin/sh -e # # Copyright (c) 2012-2014 Robert Nelson # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. check_dpkg () { LC_ALL=C dpkg --list | awk '{print $2}' | grep "^${pkg}$" >/dev/null || deb_pkgs="${deb_pkgs}${pkg} " } deb_distro=$(lsb_release -cs) deb_arch=$(LC_ALL=C dpkg --print-architecture) unset deb_pkgs pkg="read-edid" check_dpkg pkg="x11-xserver-utils" check_dpkg pkg="libdrm-omap1:${deb_arch}" check_dpkg pkg="xserver-xorg-video-omap" check_dpkg if [ "${deb_pkgs}" ] ; then echo "" echo "Installing: ${deb_pkgs}" sudo apt-get update sudo apt-get -y install ${deb_pkgs} sudo apt-get clean echo "--------------------" fi if [ ! -d /etc/X11/ ] ; then sudo mkdir -p /etc/X11/ || true fi if [ -f /etc/X11/xorg.conf ] ; then sudo rm -rf /etc/X11/xorg.conf.bak || true sudo mv /etc/X11/xorg.conf /etc/X11/xorg.conf.bak fi cat > /tmp/xorg.conf <<-__EOF__ Section "Monitor" Identifier "Builtin Default Monitor" EndSection Section "Device" Identifier "Builtin Default fbdev Device 0" Driver "omap" Option "HWcursor" "false" EndSection Section "Screen" Identifier "Builtin Default fbdev Screen 0" Device "Builtin Default fbdev Device 0" Monitor "Builtin Default Monitor" DefaultDepth 16 EndSection Section "ServerLayout" Identifier "Builtin Default Layout" Screen "Builtin Default fbdev Screen 0" EndSection __EOF__ sudo cp -v /tmp/xorg.conf /etc/X11/xorg.conf #