# Wget packages
wget http://gma500re.altervista.org/_altervista_ht/libdrm-poulsbo1_2.3.0-0ubuntu3netbook7_i386.deb -O /tmp/libdrm-poulsbo1_2.3.0-0ubuntu3netbook7_i386.deb
wget http://gma500re.altervista.org/_altervista_ht/libva1_0.29-9-0ubuntu6netbook2_i386.deb -O /tmp/libva1_0.29-9-0ubuntu6netbook2_i386.deb
wget http://gma500re.altervista.org/_altervista_ht/poulsbo-config_0.1_all.deb -O /tmp/poulsbo-config_0.1_all.deb
wget http://gma500re.altervista.org/_altervista_ht/poulsbo-driver-2d_1.1-0ubuntu1~904um1_all.deb -O /tmp/poulsbo-driver-2d_1.1-0ubuntu1~904um1_all.deb
wget http://gma500re.altervista.org/_altervista_ht/poulsbo-driver-3d_1.1-0ubuntu1~904um1_all.deb -O /tmp/poulsbo-driver-3d_1.1-0ubuntu1~904um1_all.deb
wget http://gma500re.altervista.org/_altervista_ht/psb-firmware_0.30-0ubuntu1netbook1_i386.deb -O /tmp/psb-firmware_0.30-0ubuntu1netbook1_i386.deb
wget http://gma500re.altervista.org/_altervista_ht/psb-kernel-headers_4.41.2-0ubuntu1~910um1_all.deb -O /tmp/psb-kernel-headers_4.41.2-0ubuntu1~910um1_all.deb
wget http://gma500re.altervista.org/_altervista_ht/psb-kernel-source_4.41.2-0ubuntu1~910um1_all.deb -O /tmp/psb-kernel-source_4.41.2-0ubuntu1~910um1_all.deb
wget http://gma500re.altervista.org/_altervista_ht/psb-modules_4.41.2-0ubuntu1~910um1_i386.deb -O /tmp/psb-modules_4.41.2-0ubuntu1~910um1_i386.deb
wget http://gma500re.altervista.org/_altervista_ht/xpsb-glx_0.18-0ubuntu1netbook1_i386.deb -O /tmp/xpsb-glx_0.18-0ubuntu1netbook1_i386.deb
wget http://gma500re.altervista.org/_altervista_ht/xserver-xorg-video-psb_0.31.0-0ubuntu1~904um1_i386.deb -O /tmp/xserver-xorg-video-psb_0.31.0-0ubuntu1~904um1_i386.deb

# Install packages
sudo apt-get update
sudo apt-get install -q=0 -y --force-yes dkms fakeroot
sudo gdebi -n /tmp/libdrm-poulsbo1_2.3.0-0ubuntu3netbook7_i386.deb
sudo gdebi -n /tmp/libva1_0.29-9-0ubuntu6netbook2_i386.deb
sudo gdebi -n /tmp/poulsbo-config_0.1_all.deb
sudo gdebi -n /tmp/poulsbo-driver-2d_1.1-0ubuntu1~904um1_all.deb
sudo gdebi -n /tmp/poulsbo-driver-3d_1.1-0ubuntu1~904um1_all.deb
sudo gdebi -n /tmp/psb-firmware_0.30-0ubuntu1netbook1_i386.deb
sudo gdebi -n /tmp/psb-kernel-headers_4.41.2-0ubuntu1~910um1_all.deb
sudo gdebi -n /tmp/psb-kernel-source_4.41.2-0ubuntu1~910um1_all.deb
sudo gdebi -n /tmp/psb-modules_4.41.2-0ubuntu1~910um1_i386.deb
sudo gdebi -n /tmp/xpsb-glx_0.18-0ubuntu1netbook1_i386.deb
sudo gdebi -n /tmp/xserver-xorg-video-psb_0.31.0-0ubuntu1~904um1_i386.deb

# Blacklist DRM
echo "blacklist i915" | sudo tee -a /etc/modprobe.d/blacklist.conf

# Update Initramfs
sudo update-initramfs -u

# Xorg
echo 'Section "Device"
        Identifier      "GMA500"
        Option 		"AccelMethod" "EXA"
        Option 		"MigrationHeuristic" "greedy"
        Option 		"IgnoreACPI" "yes"
        Driver 		"psb"
EndSection

Section "DRI"
    Mode    0666
EndSection' | sudo tee /etc/X11/xorg.conf
