2020-05-09 11:00:02 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -x
|
|
|
|
set -e
|
2018-06-21 18:33:30 +02:00
|
|
|
|
|
|
|
#Runs Make menuconfig with the proper enviroment vars for cross compiling arm
|
2018-09-07 18:56:22 +02:00
|
|
|
#Grabs the file named config in resources/BuildResources directory, and updates it
|
2018-06-21 18:33:30 +02:00
|
|
|
|
2018-10-11 22:09:25 +02:00
|
|
|
|
2020-06-15 23:27:21 +02:00
|
|
|
# This file is part of PrawnOS (https://www.prawnos.com)
|
2018-10-11 22:09:25 +02:00
|
|
|
# Copyright (c) 2018 Hal Emmerich <hal@halemmerich.com>
|
|
|
|
|
|
|
|
# PrawnOS is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License version 2
|
|
|
|
# as published by the Free Software Foundation.
|
|
|
|
|
|
|
|
# PrawnOS is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with PrawnOS. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
2019-02-27 20:20:11 +01:00
|
|
|
if [ -z "$1" ]
|
|
|
|
then
|
|
|
|
echo "No kernel version supplied"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
KVER=$1
|
2018-06-21 18:33:30 +02:00
|
|
|
|
2019-02-27 20:20:11 +01:00
|
|
|
|
2020-05-20 20:00:00 +02:00
|
|
|
ROOT_DIR="$(pwd)"
|
2018-09-07 18:56:22 +02:00
|
|
|
RESOURCES=$ROOT_DIR/resources/BuildResources
|
2019-02-27 20:20:11 +01:00
|
|
|
|
2018-09-07 18:56:22 +02:00
|
|
|
[ ! -d build ] && mkdir build
|
|
|
|
cd build
|
2019-02-27 20:20:11 +01:00
|
|
|
# build Linux-libre, with ath9k_htc
|
2018-06-21 18:33:30 +02:00
|
|
|
[ ! -f linux-libre-$KVER-gnu.tar.lz ] && wget https://www.linux-libre.fsfla.org/pub/linux-libre/releases/$KVER-gnu/linux-libre-$KVER-gnu.tar.lz
|
2019-02-27 20:20:11 +01:00
|
|
|
[ ! -d linux-$KVER ] && tar --lzip -xvf linux-libre-$KVER-gnu.tar.lz && FRESH=true
|
2018-06-21 18:33:30 +02:00
|
|
|
cd linux-$KVER
|
2019-01-23 20:42:48 +01:00
|
|
|
make clean
|
|
|
|
make mrproper
|
|
|
|
#Apply the usb and mmc patches if unapplied
|
2020-05-20 22:32:43 +02:00
|
|
|
[ "$FRESH" = true ] && for i in "$RESOURCES"/patches-tested/kernel/5.x-dwc2/*.patch; do echo $i; patch -p1 < $i; done
|
|
|
|
[ "$FRESH" = true ] && for i in "$RESOURCES"/patches-tested/DTS/*.patch; do echo $i; patch -p1 < $i; done
|
|
|
|
[ "$FRESH" = true ] && for i in "$RESOURCES"/patches-tested/kernel/*.patch; do echo $i; patch -p1 < $i; done
|
2019-02-27 20:20:11 +01:00
|
|
|
|
2018-09-07 18:56:22 +02:00
|
|
|
cp $RESOURCES/config .config
|
2018-06-21 18:33:30 +02:00
|
|
|
make menuconfig ARCH=arm CROSS_COMPILE=arm-none-eabi- .config
|
2018-09-07 18:56:22 +02:00
|
|
|
cp .config $RESOURCES/config
|