#!/bin/bash # # OpenIPC (c) | version 2022.08.31 # Autoupdate COMPOSER repo # Remove old building folder (full rebuild) # Download OpenIPC repo # Copy files from Projects Overlay # Build Firmware # Copy Kernel and Rootfs to TFTP server RELEASE="" PROJECT="$1" TFTPSRV="root@172.17.32.17:/mnt/bigger-2tb/Rotator/TFTP" OUTTIME=$(date +"%Y%m%d") echo_c() { # 30 grey, 31 red, 32 green, 33 yellow, 34 blue, 35 magenta, 36 cyan, 37 white t="\e[1;$1m$2\e[0m" || t="$2" echo -e "$t" } 2archive() { mkdir -p ../archive/${PROJECT}_${OUTTIME} cp -a output/images/autoupdate* output/images/rootfs.squashfs.* output/images/uImage.* output/images/*.tar ../archive/${PROJECT}_${OUTTIME} echo_c 35 "\nYou can get the new assembled firmware components here:\n" tree -C ../archive/${PROJECT}_${OUTTIME} } 2tftp() { echo_c 32 "\nStart transferring files to the TFTP server ...\n" scp -r output/images/autoupdate* output/images/rootfs.squashfs.* output/images/uImage.* ${TFTPSRV} } if [ -z ${PROJECT} ]; then echo_c 31 "\nPlease specify one project from the list at the command line:\n" tree -L 1 projects else echo_c 31 "\nAttention, let's start working on the ${PROJECT} project ...\n" tree -C projects/${PROJECT}; sleep 3 echo_c 33 "\nSync of Composer repo ...\n" git pull echo_c 33 "\nDownload Firmware repo ...\n" rm -rf openipc git clone --depth=1 https://github.com/OpenIPC/firmware.git openipc cp -afv projects/${PROJECT}/* firmware cd openipc ./building.sh ${PROJECT} 2archive; 2tftp echo_c 35 "\nRollback to home ...\n" cd - fi