run_gen_make_script.sh 4.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #!/bin/bash
  2. echo -e ""
  3. echo -e "$1-uboot-default: u-boot_clean u-boot"
  4. echo -e "\t@cp -f \$(UBOOT_INSTALL_DIR)/MLO EVSE/Projects/$1/Images/"
  5. echo -e "\t@cp -f \$(UBOOT_INSTALL_DIR)/u-boot.img EVSE/Projects/$1/Images/"
  6. echo -e ""
  7. echo -e "$1-uboot-menuconfig:"
  8. echo -e "\t@echo ==================================="
  9. echo -e "\t@echo Building U-boot menuconfig"
  10. echo -e "\t@echo ==================================="
  11. echo -e "\t\$(MAKE) -j \$(MAKE_JOBS) -C \$(UBOOT_INSTALL_DIR) CROSS_COMPILE=\$(CROSS_COMPILE) menuconfig"
  12. echo -e ""
  13. echo -e "$1-uboot:"
  14. echo -e "\t@echo ==================================="
  15. echo -e "\t@echo Building U-boot"
  16. echo -e "\t@echo ==================================="
  17. echo -e "\t@cp -f \$(UBOOT_INSTALL_DIR)/arch/arm/dts/[$1]am335x-evm.dts \$(UBOOT_INSTALL_DIR)/arch/arm/dts/am335x-evm.dts"
  18. echo -e "\t\$(MAKE) -j \$(MAKE_JOBS) -C \$(UBOOT_INSTALL_DIR) CROSS_COMPILE=\$(CROSS_COMPILE) FLASH_IC=MT29F16G08_BCH16 DDR_IC=MT41K256M16HA125E_303 PMIC=TPS65910"
  19. echo -e "\t@cp -f \$(UBOOT_INSTALL_DIR)/MLO EVSE/Projects/$1/Images/"
  20. echo -e "\t@cp -f \$(UBOOT_INSTALL_DIR)/u-boot.img EVSE/Projects/$1/Images/"
  21. echo -e "\t@cp -f \$(UBOOT_INSTALL_DIR)/spl/u-boot-spl.bin EVSE/Projects/$1/Images/"
  22. echo -e ""
  23. echo -e "$1-linux-default: linux_clean linux"
  24. echo -e "\t@cp -f \$(LINUXKERNEL_INSTALL_DIR)/arch/arm/boot/zImage EVSE/Projects/$1/Images/"
  25. echo -e "\t@cp -f \$(LINUXKERNEL_INSTALL_DIR)/arch/arm/boot/dts/am335x-evm.dtb EVSE/Projects/$1/Images/"
  26. echo -e ""
  27. echo -e "$1-linux:"
  28. echo -e "\t@echo ====================================="
  29. echo -e "\t@echo Building the Linux Kernel DTBs"
  30. echo -e "\t@echo ====================================="
  31. echo -e "\t@rm -f \$(LINUXKERNEL_INSTALL_DIR)/arch/arm/boot/dts/am335x-evm.dtb"
  32. echo -e "\t@cp -f \$(LINUXKERNEL_INSTALL_DIR)/arch/arm/boot/dts/[$1]am335x-evm.dts \$(LINUXKERNEL_INSTALL_DIR)/arch/arm/boot/dts/am335x-evm.dts"
  33. echo -e "\t\$(MAKE) -j \$(MAKE_JOBS) -C \$(LINUXKERNEL_INSTALL_DIR) ARCH=arm CROSS_COMPILE=\$(CROSS_COMPILE) am335x-evm.dtb"
  34. echo -e "\t@echo ================================="
  35. echo -e "\t@echo Building User Linux Kernel"
  36. echo -e "\t@echo ================================="
  37. echo -e "\t@rm -f \$(LINUXKERNEL_INSTALL_DIR)/arch/arm/boot/zImage"
  38. echo -e "\t\$(MAKE) -j \$(MAKE_JOBS) -C \$(LINUXKERNEL_INSTALL_DIR) ARCH=arm CROSS_COMPILE=\$(CROSS_COMPILE) zImage"
  39. echo -e "\t\$(MAKE) -j \$(MAKE_JOBS) -C \$(LINUXKERNEL_INSTALL_DIR) ARCH=arm CROSS_COMPILE=\$(CROSS_COMPILE) modules"
  40. echo -e "\t@cp -f \$(LINUXKERNEL_INSTALL_DIR)/arch/arm/boot/zImage EVSE/Projects/$1/Images/"
  41. echo -e "\t@cp -f \$(LINUXKERNEL_INSTALL_DIR)/arch/arm/boot/dts/am335x-evm.dtb EVSE/Projects/$1/Images/"
  42. echo -e "\t@cp -f \$(LINUXKERNEL_INSTALL_DIR)/drivers/net/ethernet/qualcomm/qcaspi.ko EVSE/rootfs/lib/"
  43. echo -e ""
  44. echo -e "$1-rootfs:"
  45. echo -e "\t@echo ================================="
  46. echo -e "\t@echo Building User rootfs"
  47. echo -e "\t@echo ================================="
  48. echo -e "#\t@cd EVSE/GPL;make Project=$1 all"
  49. echo -e "\t@cd EVSE/Modularization;make TLS_EXPIRED=TLS_VALID_CERT_EXPIRED Project=$1 all"
  50. echo -e "\t@cd EVSE/Projects/$1/Apps;make Project=$1 all"
  51. echo -e "\t@rm -f EVSE/Projects/$1/Images/ramdisk.gz"
  52. echo -e "\t@dd if=/dev/zero of=/dev/ram0 bs=1k count=131072"
  53. echo -e "\t@mke2fs -vm0 /dev/ram0 131072"
  54. echo -e "\t@tune2fs -c 0 /dev/ram0"
  55. echo -e "\t@dd if=/dev/ram0 bs=1k count=131072 | gzip -v9 > EVSE/Projects/$1/Images/ramdisk.gz"
  56. echo -e "\t@mkdir -p EVSE/Projects/$1/Images/mnt"
  57. echo -e "\t@gunzip EVSE/Projects/$1/Images/ramdisk.gz"
  58. echo -e "\t@sync"
  59. echo -e "\t@mount -o loop EVSE/Projects/$1/Images/ramdisk EVSE/Projects/$1/Images/mnt"
  60. echo -e "\t@cp -rfv EVSE/rootfs/* EVSE/Projects/$1/Images/mnt/"
  61. echo -e "\t@chown www-data:www-data EVSE/Projects/$1/Images/mnt/var/www -R"
  62. echo -e "\t@chmod 777 EVSE/Projects/$1/Images/mnt/var/log -R"
  63. echo -e "\t@chmod 777 EVSE/Projects/$1/Images/mnt/var/run -R"
  64. echo -e "\t@cp -rfv EVSE/Projects/$1/Images/root/* EVSE/Projects/$1/Images/mnt/root"
  65. echo -e "\t@sync"
  66. echo -e "\t@sleep 3"
  67. echo -e "\t@umount EVSE/Projects/$1/Images/mnt"
  68. echo -e "\t@sync"
  69. echo -e "\t@gzip -v9 EVSE/Projects/$1/Images/ramdisk"
  70. echo -e "\t@rm -rfv EVSE/Projects/$1/Images/root"
  71. echo -e "\t@rm -rfv EVSE/Projects/$1/Images/mnt"
  72. echo -e ""
  73. echo -e "$1-all: $1-uboot $1-linux $1-rootfs"
  74. echo -e ""