#!/bin/bash echo -e "" echo -e "$1-uboot-default: u-boot_clean u-boot" echo -e "\t@cp -f \$(UBOOT_INSTALL_DIR)/MLO EVSE/Projects/$1/Images/" echo -e "\t@cp -f \$(UBOOT_INSTALL_DIR)/u-boot.img EVSE/Projects/$1/Images/" echo -e "" echo -e "$1-uboot-menuconfig:" echo -e "\t@echo ===================================" echo -e "\t@echo Building U-boot menuconfig" echo -e "\t@echo ===================================" echo -e "\t\$(MAKE) -j \$(MAKE_JOBS) -C \$(UBOOT_INSTALL_DIR) CROSS_COMPILE=\$(CROSS_COMPILE) menuconfig" echo -e "" echo -e "$1-uboot:" echo -e "\t@echo ===================================" echo -e "\t@echo Building U-boot" echo -e "\t@echo ===================================" echo -e "\t@cp -f \$(UBOOT_INSTALL_DIR)/arch/arm/dts/[$1]am335x-evm.dts \$(UBOOT_INSTALL_DIR)/arch/arm/dts/am335x-evm.dts" 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" echo -e "\t@cp -f \$(UBOOT_INSTALL_DIR)/MLO EVSE/Projects/$1/Images/" echo -e "\t@cp -f \$(UBOOT_INSTALL_DIR)/u-boot.img EVSE/Projects/$1/Images/" echo -e "\t@cp -f \$(UBOOT_INSTALL_DIR)/spl/u-boot-spl.bin EVSE/Projects/$1/Images/" echo -e "" echo -e "$1-linux-default: linux_clean linux" echo -e "\t@cp -f \$(LINUXKERNEL_INSTALL_DIR)/arch/arm/boot/zImage EVSE/Projects/$1/Images/" echo -e "\t@cp -f \$(LINUXKERNEL_INSTALL_DIR)/arch/arm/boot/dts/am335x-evm.dtb EVSE/Projects/$1/Images/" echo -e "" echo -e "$1-linux:" echo -e "\t@echo =====================================" echo -e "\t@echo Building the Linux Kernel DTBs" echo -e "\t@echo =====================================" echo -e "\t@rm -f \$(LINUXKERNEL_INSTALL_DIR)/arch/arm/boot/dts/am335x-evm.dtb" 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" echo -e "\t\$(MAKE) -j \$(MAKE_JOBS) -C \$(LINUXKERNEL_INSTALL_DIR) ARCH=arm CROSS_COMPILE=\$(CROSS_COMPILE) am335x-evm.dtb" echo -e "\t@echo =================================" echo -e "\t@echo Building User Linux Kernel" echo -e "\t@echo =================================" echo -e "\t@rm -f \$(LINUXKERNEL_INSTALL_DIR)/arch/arm/boot/zImage" echo -e "\t\$(MAKE) -j \$(MAKE_JOBS) -C \$(LINUXKERNEL_INSTALL_DIR) ARCH=arm CROSS_COMPILE=\$(CROSS_COMPILE) zImage" echo -e "\t\$(MAKE) -j \$(MAKE_JOBS) -C \$(LINUXKERNEL_INSTALL_DIR) ARCH=arm CROSS_COMPILE=\$(CROSS_COMPILE) modules" echo -e "\t@cp -f \$(LINUXKERNEL_INSTALL_DIR)/arch/arm/boot/zImage EVSE/Projects/$1/Images/" echo -e "\t@cp -f \$(LINUXKERNEL_INSTALL_DIR)/arch/arm/boot/dts/am335x-evm.dtb EVSE/Projects/$1/Images/" echo -e "\t@cp -f \$(LINUXKERNEL_INSTALL_DIR)/drivers/net/ethernet/qualcomm/qcaspi.ko EVSE/rootfs/lib/" echo -e "" echo -e "$1-rootfs:" echo -e "\t@echo =================================" echo -e "\t@echo Building User rootfs" echo -e "\t@echo =================================" echo -e "#\t@cd EVSE/GPL;make Project=$1 all" echo -e "\t@cd EVSE/Modularization;make TLS_EXPIRED=TLS_VALID_CERT_EXPIRED Project=$1 all" echo -e "\t@cd EVSE/Projects/$1/Apps;make Project=$1 all" echo -e "\t@rm -f EVSE/Projects/$1/Images/ramdisk.gz" echo -e "\t@dd if=/dev/zero of=/dev/ram0 bs=1k count=131072" echo -e "\t@mke2fs -vm0 /dev/ram0 131072" echo -e "\t@tune2fs -c 0 /dev/ram0" echo -e "\t@dd if=/dev/ram0 bs=1k count=131072 | gzip -v9 > EVSE/Projects/$1/Images/ramdisk.gz" echo -e "\t@mkdir -p EVSE/Projects/$1/Images/mnt" echo -e "\t@gunzip EVSE/Projects/$1/Images/ramdisk.gz" echo -e "\t@sync" echo -e "\t@mount -o loop EVSE/Projects/$1/Images/ramdisk EVSE/Projects/$1/Images/mnt" echo -e "\t@cp -rfv EVSE/rootfs/* EVSE/Projects/$1/Images/mnt/" echo -e "\t@chown www-data:www-data EVSE/Projects/$1/Images/mnt/var/www -R" echo -e "\t@chmod 777 EVSE/Projects/$1/Images/mnt/var/log -R" echo -e "\t@chmod 777 EVSE/Projects/$1/Images/mnt/var/run -R" echo -e "\t@cp -rfv EVSE/Projects/$1/Images/root/* EVSE/Projects/$1/Images/mnt/root" echo -e "\t@sync" echo -e "\t@sleep 3" echo -e "\t@umount EVSE/Projects/$1/Images/mnt" echo -e "\t@sync" echo -e "\t@gzip -v9 EVSE/Projects/$1/Images/ramdisk" echo -e "\t@rm -rfv EVSE/Projects/$1/Images/root" echo -e "\t@rm -rfv EVSE/Projects/$1/Images/mnt" echo -e "" echo -e "$1-all: $1-uboot $1-linux $1-rootfs" echo -e ""