crossmenuconfig.sh 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 (https://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. ROOT_DIR="$(pwd)"
  24. RESOURCES=$ROOT_DIR/resources/BuildResources
  25. [ ! -d build ] && mkdir build
  26. cd build
  27. # build Linux-libre, with ath9k_htc
  28. [ ! -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
  29. [ ! -d linux-$KVER ] && tar --lzip -xvf linux-libre-$KVER-gnu.tar.lz && FRESH=true
  30. cd linux-$KVER
  31. make clean
  32. make mrproper
  33. #Apply the usb and mmc patches if unapplied
  34. [ "$FRESH" = true ] && for i in "$RESOURCES"/patches-tested/kernel/5.x-dwc2/*.patch; do echo $i; patch -p1 < $i; done
  35. [ "$FRESH" = true ] && for i in "$RESOURCES"/patches-tested/DTS/*.patch; do echo $i; patch -p1 < $i; done
  36. [ "$FRESH" = true ] && for i in "$RESOURCES"/patches-tested/kernel/*.patch; do echo $i; patch -p1 < $i; done
  37. cp $RESOURCES/config .config
  38. make menuconfig ARCH=arm CROSS_COMPILE=arm-none-eabi- .config
  39. cp .config $RESOURCES/config