crossmenuconfig.sh 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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/DTS/*.patch; do patch -p1 < $i; done
  34. [ "$FRESH" = true ] && for i in $RESOURCES/patches-tested/kernel/*.patch; do patch -p1 < $i; done
  35. #Apply all of the rockMyy patches that make sense
  36. [ "$TEST_PATCHES" = true ] && for i in $RESOURCES/patches-untested/kernel/*.patch; do patch -p1 < $i; done
  37. [ "$TEST_PATCHES" = true ] && for i in $RESOURCES/patches-untested/DTS/*.patch; do 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