#!/bin/sh

if [ ! -f "./install_fix_rpi3" ]
then
    echo "Sorry.. this needs to run from '.'"
    exit 2
fi

if [ -d "$1" ]
then
    HERE=`pwd`
    export HERE

    cd $1
    echo "Patching in $1"
    patch -b < $HERE/sys_arch_arm_broadcom_bcm2835_bsc.c.diff
else
    echo "$1 does not appear to exist as a directory"
    exit 1
fi
