create_sunxi_boot_files.sh 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #/bin/sh
  2. ######################
  3. # Sunxi part #
  4. ######################
  5. # Sunxi u-boot
  6. #if [ -d /olinux/sunxi/u-boot-sunxi/ ] ; then
  7. # cd /olinux/sunxi/u-boot-sunxi/ && make clean && git pull
  8. #else
  9. # git clone -b sunxi https://github.com/linux-sunxi/u-boot-sunxi.git /olinux/sunxi/u-boot-sunxi
  10. #fi
  11. #
  12. #cd /olinux/sunxi/u-boot-sunxi && make CROSS_COMPILE=arm-linux-gnueabihf A20-OLinuXino-Lime_config && make CROSS_COMPILE=arm-linux-gnueabihf-
  13. clone_or_pull (){
  14. repo=$1
  15. if [ -d /olinux/sunxi/$repo/ ] ; then
  16. cd /olinux/sunxi/$repo/ && make clean && git pull
  17. else
  18. git clone https://github.com/linux-sunxi/$repo /olinux/sunxi/$repo/
  19. fi
  20. }
  21. if [ -d /olinux/sunxi/u-boot/ ] ; then
  22. cd /olinux/sunxi/u-boot/ && make clean && git pull
  23. else
  24. git clone git://git.denx.de/u-boot.git /olinux/sunxi/u-boot
  25. fi
  26. cd /olinux/sunxi/u-boot && make CROSS_COMPILE=arm-linux-gnueabihf A20-OLinuXino-Lime_config && make CROSS_COMPILE=arm-linux-gnueabihf-
  27. # Sunxi kernel
  28. clone_or_pull linux-sunxi
  29. # Sunxi board configs
  30. clone_or_pull sunxi-boards
  31. # Sunxi tools
  32. clone_or_pull sunxi-tools
  33. cp /olinux/a20_defconfig /olinux/sunxi/linux-sunxi/arch/arm/configs/.
  34. cd /olinux/sunxi/linux-sunxi/ && make ARCH=arm a20_defconfig
  35. cd /olinux/sunxi/linux-sunxi/ && make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j2 uImage
  36. cd /olinux/sunxi/linux-sunxi/ && make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j2 INSTALL_MOD_PATH=out modules
  37. cd /olinux/sunxi/linux-sunxi/ && make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j2 INSTALL_MOD_PATH=out modules_install
  38. cd /olinux/sunxi/sunxi-tools/ && make
  39. cd /olinux/sunxi/ && rm -f script.bin && ./sunxi-tools/fex2bin sunxi-boards/sys_config/a20/a20-olinuxino_lime2.fex script.bin
  40. cd /olinux/sunxi/ && chmod +x script.bin