#!/bin/bash -e

INSTALL_DIR=$PWD/out/install
KERNEL_DIR=$PWD/packages

sudo apt-get update
sudo apt-get install libva-drm2 libgstreamer-plugins-bad1.0-0 -y

sudo dpkg -i $KERNEL_DIR/linux-headers-*.deb
sudo dpkg -i $KERNEL_DIR/linux-image-*.deb

sudo cp -r $INSTALL_DIR/etc/* /etc/
sudo cp -r $INSTALL_DIR/usr/* /usr/

sudo sed -i 's/^GRUB_CMDLINE_LINUX_DEFAULT="\(.*\)"$/GRUB_CMDLINE_LINUX_DEFAULT="\1 i915.force_probe=7d51"/' /etc/default/grub
sudo update-grub
