From patchwork Wed Mar 16 22:13:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [3/3] added buildrelease() for release process From: Jan Kraus X-Patchwork-Id: 21 Message-Id: <1458166418-20390-4-git-send-email-mayosemmel@gmail.com> To: franken-dev@freifunk.net Cc: Jan Kraus Date: Wed, 16 Mar 2016 23:13:38 +0100 Signed-off-by: Jan Kraus --- buildscript | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/buildscript b/buildscript index ded4c82..8bfa1e2 100755 --- a/buildscript +++ b/buildscript @@ -233,7 +233,7 @@ build() { mkdir bin fi - postbuild + cp_firmware } config() { @@ -272,7 +272,7 @@ cp_firmware() { for image in ${images[@]}; do filename_build=$(echo $image | sed -e "s/openwrt/${community}_${version}/") if [[ -n "$chipset" ]] ; then - filename_build=$(echo $filename_build | sed -e "s/${chipset}//") + filename_build=$(echo $filename_build | sed -e "s/${chipset}-//") fi cp "$target/bin/${chipset}/$image" "./bin/$filename_build" @@ -284,8 +284,25 @@ cp_firmware() { done } -postbuild() { - cp_firmware +buildrelease() { + if [ "$1" = "all" ];then + buildall + elif [ "$1" = "fast" ];then + build fast + elif [ "$1" = "all" ] && [ "$2" = "fast" ];then + buildall fast + else + build + fi + rm -f "./bin/MD5SUMS" + rm -f "./bin/SHA1SUMS" + cd bin + for binary in $(ls *.bin); do + md5sum "$binary" >> ./MD5SUMS + sha1sum "$binary" >> ./SHA1SUMS + done + cd .. + echo -e "VERSION:$version" > ./bin/release.nfo } clean() { @@ -425,6 +442,16 @@ case "$1" in buildall "$2" "$3" fi ;; + "release") + if [ "$2" = help ]; then + echo "This option builds the firmware of a given board. It also creates Checksums and a release.nfo" + echo + echo "Usage: $0 $1 [all] [fast]" + echo + else + buildrelease "$2" + fi + ;; *) echo "This is the Build Environment Script of the Freifunk Community Franken." echo @@ -436,6 +463,7 @@ case "$1" in echo " config openwrt" echo " build [fast|debug]" echo " buildall [fast]" + echo " release [all] [fast]" echo " clean" echo "" echo "If you need help to one of these options just type: $0 help"