crossmenuconfig.sh 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #!/bin/bash
  2. set -x
  3. set -e
  4. #Runs Make menuconfig with the proper enviroment vars for cross compiling arm
  5. #Grabs the file named config in resources/BuildResources directory, and updates it
  6. # This file is part of PrawnOS (http://www.prawnos.com)
  7. # Copyright (c) 2018 Hal Emmerich <hal@halemmerich.com>
  8. # PrawnOS is free software: you can redistribute it and/or modify
  9. # it under the terms of the GNU General Public License version 2
  10. # as published by the Free Software Foundation.
  11. # PrawnOS is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. # You should have received a copy of the GNU General Public License
  16. # along with PrawnOS. If not, see <https://www.gnu.org/licenses/>.
  17. if [ -z "$1" ]
  18. then
  19. echo "No kernel version supplied"
  20. exit 1
  21. fi
  22. KVER=$1
  23. TEST_PATCHES=false
  24. ROOT_DIR=`pwd`
  25. RESOURCES=$ROOT_DIR/resources/BuildResources
  26. [ ! -d build ] && mkdir build
  27. cd build
  28. # build Linux-libre, with ath9k_htc
  29. [ ! -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
  30. [ ! -d linux-$KVER ] && tar --lzip -xvf linux-libre-$KVER-gnu.tar.lz && FRESH=true
  31. cd linux-$KVER
  32. make clean
  33. make mrproper
  34. #Apply the usb and mmc patches if unapplied
  35. [ "$FRESH" = true ] && for i in $RESOURCES/patches-tested/kernel/5.x-dwc2/*.patch; do echo $i; patch -p1 < $i; done
  36. [ "$FRESH" = true ] && for i in $RESOURCES/patches-tested/DTS/*.patch; do echo $i; patch -p1 < $i; done
  37. [ "$FRESH" = true ] && for i in $RESOURCES/patches-tested/kernel/*.patch; do echo $i; patch -p1 < $i; done
  38. cp $RESOURCES/config .config
  39. make menuconfig ARCH=arm CROSS_COMPILE=arm-none-eabi- .config
  40. cp .config $RESOURCES/config