crossmenuconfig.sh 2.2 KB

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