From: <abe...@us...> - 2011-10-17 16:08:26
|
Revision: 5202 http://astlinux.svn.sourceforge.net/astlinux/?rev=5202&view=rev Author: abelbeck Date: 2011-10-17 16:08:17 +0000 (Mon, 17 Oct 2011) Log Message: ----------- add './scripts/master-build' script, to build images for all boards Modified Paths: -------------- branches/1.0/scripts/astlinux-makeimage Added Paths: ----------- branches/1.0/scripts/master-build Modified: branches/1.0/scripts/astlinux-makeimage =================================================================== --- branches/1.0/scripts/astlinux-makeimage 2011-10-17 13:07:58 UTC (rev 5201) +++ branches/1.0/scripts/astlinux-makeimage 2011-10-17 16:08:17 UTC (rev 5202) @@ -13,20 +13,6 @@ RUNFS_DIR="output/build/runfs" -make_release_version() -{ - ASTURL="$(LANG=C svn info | awk -F': ' '/^URL:/ { print $2 }')" - ASTBASE="$(basename ${ASTURL})" - ASTREV="$(LANG=C svn info | awk -F': ' '/^Last Changed Rev:/ { print $2 }')" - ASTEXTRA="" - - if [ "$(cat "project/astlinux/target_skeleton/etc/astlinux-release")" = "svn" ]; then - ASTVER="astlinux-${ASTBASE}-${ASTREV}${ASTEXTRA}" - else - ASTVER="$(cat "project/astlinux/target_skeleton/etc/astlinux-release")${ASTEXTRA}" - fi -} - # # put whatever edits you need to make to the VFAT filesystem here. # @@ -40,8 +26,6 @@ return 0 } -make_release_version - ASTRW_FORMAT= BOOT_ONLY= DUMP_PARTITIONS= @@ -97,6 +81,13 @@ exit 1 fi +ASTVER="$(cat ${RUNFS_DIR}/os/ver)" + +if [ -z "$ASTVER" ]; then + echo "astlinux-makeimage: missing runfs version file." >&2 + exit 1 +fi + if ! sudo /bin/true; then echo "astlinux-makeimage: You need to be a sudo group member to run this script" >&2 exit 1 Added: branches/1.0/scripts/master-build =================================================================== --- branches/1.0/scripts/master-build (rev 0) +++ branches/1.0/scripts/master-build 2011-10-17 16:08:17 UTC (rev 5202) @@ -0,0 +1,131 @@ +#!/bin/bash +# +# master-build output_path [ force ] +# + +FAT_SIZE=192 + +BOARDS="geni586 geni586-serial net5501 alix via via-serial viac7 viac7-serial net4801 wrap" + +RUNFS_DIR="output/build/runfs" + +output_path="$1" + +force="$2" + +if [ -z "$output_path" ]; then + echo "usage: master-build output_path [ force ]" + exit 1 +fi + +if [ -d "$output_path" ]; then + if [ "$force" = "force" ]; then + rm -rf "$output_path" + if ! mkdir "$output_path"; then + exit 1 + fi + else + echo "master-build: directory \"$output_path\" exists, use 'force' verb to override." + exit 1 + fi +else + if ! mkdir "$output_path"; then + exit 1 + fi +fi + +echo "Regenerate the initrd" +rm -f initrd.img + +# +# Build Asterisk 1.4 AstLinux +# + +echo "Cleaning out any existing builds..." +rm -rf output + +cp astlinux.config .config + +if ! mkdir "$output_path/firmware"; then + exit 1 +fi +if ! mkdir "$output_path/img"; then + exit 1 +fi + +for board in $BOARDS; do + + mkdir "$output_path/firmware/$board" + mkdir "$output_path/img/$board" + + ./scripts/build $board + + if [ $? -ne 0 ]; then + exit 1 + fi + + ASTVER="$(cat ${RUNFS_DIR}/os/ver)" + + if [ -z "$ASTVER" ]; then + echo "master-build: missing runfs version file." + exit 1 + fi + + ./scripts/astlinux-makeimage -z $FAT_SIZE $FAT_SIZE 0 + + mv "${ASTVER}.tar.gz" "$output_path/firmware/$board/${ASTVER}.tar.gz" + mv "${ASTVER}.tar.gz.sha1" "$output_path/firmware/$board/${ASTVER}.tar.gz.sha1" + mv "${ASTVER}.img.gz" "$output_path/img/$board/${ASTVER}.img.gz" + + rm -rf "${ASTVER}" +done + +# +# Build Asterisk 1.8 AstLinux +# + +echo "Cleaning out any existing builds..." +rm -rf output + +cp astlinux18.config .config + +if ! mkdir "$output_path/ast18-firmware"; then + exit 1 +fi +if ! mkdir "$output_path/ast18-img"; then + exit 1 +fi + +for board in $BOARDS; do + + mkdir "$output_path/ast18-firmware/$board" + mkdir "$output_path/ast18-img/$board" + + ./scripts/build $board + + if [ $? -ne 0 ]; then + exit 1 + fi + + ASTVER="$(cat ${RUNFS_DIR}/os/ver)" + + if [ -z "$ASTVER" ]; then + echo "master-build: missing runfs version file." + exit 1 + fi + + ./scripts/astlinux-makeimage -z $FAT_SIZE $FAT_SIZE 0 + + mv "${ASTVER}.tar.gz" "$output_path/ast18-firmware/$board/${ASTVER}.tar.gz" + mv "${ASTVER}.tar.gz.sha1" "$output_path/ast18-firmware/$board/${ASTVER}.tar.gz.sha1" + mv "${ASTVER}.img.gz" "$output_path/ast18-img/$board/${ASTVER}.img.gz" + + rm -rf "${ASTVER}" +done + +echo " +## +## Master Build Successful for ${ASTVER} +## +" + Property changes on: branches/1.0/scripts/master-build ___________________________________________________________________ Added: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |