From: <abe...@us...> - 2012-12-06 21:33:56
|
Revision: 5789 http://astlinux.svn.sourceforge.net/astlinux/?rev=5789&view=rev Author: abelbeck Date: 2012-12-06 21:33:48 +0000 (Thu, 06 Dec 2012) Log Message: ----------- Refactor master-build and master-upload scripts to easily specify Asterisk versions Modified Paths: -------------- branches/1.0/scripts/master-build branches/1.0/scripts/master-upload Modified: branches/1.0/scripts/master-build =================================================================== --- branches/1.0/scripts/master-build 2012-12-04 17:56:04 UTC (rev 5788) +++ branches/1.0/scripts/master-build 2012-12-06 21:33:48 UTC (rev 5789) @@ -49,6 +49,37 @@ sed -i 's:^BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="[^"]*":BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="project/astlinux/geni586/linux-smp.config":' .config } +set_asterisk_version() +{ + case $1 in + ast14) + CONFIG="astlinux.config" + ASTERISK_VERSION="$(awk -F'=' '/^ASTERISK_VERSION/ { if ($2 ~ /^ *1.4/) {print $2; exit} }' package/asterisk/asterisk.mk)" + ASTERISK_VERSION="asterisk-${ASTERISK_VERSION// /}" + FIRMWARE="firmware-1.x" + IMG="img" + ;; + ast18) + CONFIG="astlinux18.config" + ASTERISK_VERSION="$(awk -F'=' '/^ASTERISK_VERSION/ { if ($2 ~ /^ *1.8/) {print $2; exit} }' package/asterisk/asterisk.mk)" + ASTERISK_VERSION="asterisk-${ASTERISK_VERSION// /}" + FIRMWARE="ast18-firmware-1.x" + IMG="ast18-img" + ;; + ast11) + CONFIG="astlinux-ast11.config" + ASTERISK_VERSION="$(awk -F'=' '/^ASTERISK_VERSION/ { if ($2 ~ /^ *11./) {print $2; exit} }' package/asterisk/asterisk.mk)" + ASTERISK_VERSION="asterisk-${ASTERISK_VERSION// /}" + FIRMWARE="ast11-firmware-1.x" + IMG="ast11-img" + ;; + *) + echo "master-build: Unknown Asterisk Version." + exit 1 + ;; + esac +} + if [ -z "$output_path" ]; then echo "usage: master-build output_path [ force ]" exit 1 @@ -74,75 +105,42 @@ rm -f initrd.img # -# Build Asterisk 1.4 AstLinux +# Build Asterisk 1.4, 1.8 versions of AstLinux # -ASTERISK_VERSION="$(awk -F'=' '/^ASTERISK_VERSION/ { if ($2 ~ /^ *1.4/) {print $2; exit} }' package/asterisk/asterisk.mk)" -ASTERISK_VERSION="asterisk-${ASTERISK_VERSION// /}" +for asterisk in ast14 ast18; do -if ! mkdir "$output_path/firmware-1.x"; then - exit 1 -fi -if ! mkdir "$output_path/img"; then - exit 1 -fi + set_asterisk_version $asterisk -# Non-SMP Builds -echo "Cleaning out any existing builds..." -rm -rf output + if ! mkdir "$output_path/$FIRMWARE"; then + exit 1 + fi + if ! mkdir "$output_path/$IMG"; then + exit 1 + fi -cp astlinux.config .config + # Non-SMP Builds + echo "Cleaning out any existing builds..." + rm -rf output -for board in $BOARDS_NO_SMP; do - build_board "firmware-1.x" "img" -done + cp "$CONFIG" .config -# SMP Builds -echo "Cleaning out any existing builds..." -rm -rf output + for board in $BOARDS_NO_SMP; do + build_board "$FIRMWARE" "$IMG" + done -cp astlinux.config .config -set_smp_kernel + # SMP Builds + echo "Cleaning out any existing builds..." + rm -rf output -for board in $BOARDS_SMP; do - build_board "firmware-1.x" "img" -done + cp "$CONFIG" .config + set_smp_kernel -# -# Build Asterisk 1.8 AstLinux -# - -ASTERISK_VERSION="$(awk -F'=' '/^ASTERISK_VERSION/ { if ($2 ~ /^ *1.8/) {print $2; exit} }' package/asterisk/asterisk.mk)" -ASTERISK_VERSION="asterisk-${ASTERISK_VERSION// /}" - -if ! mkdir "$output_path/ast18-firmware-1.x"; then - exit 1 -fi -if ! mkdir "$output_path/ast18-img"; then - exit 1 -fi - -# Non-SMP Builds -echo "Cleaning out any existing builds..." -rm -rf output - -cp astlinux18.config .config - -for board in $BOARDS_NO_SMP; do - build_board "ast18-firmware-1.x" "ast18-img" + for board in $BOARDS_SMP; do + build_board "$FIRMWARE" "$IMG" + done done -# SMP Builds -echo "Cleaning out any existing builds..." -rm -rf output - -cp astlinux18.config .config -set_smp_kernel - -for board in $BOARDS_SMP; do - build_board "ast18-firmware-1.x" "ast18-img" -done - echo " ## ## Master Build Successful for ${ASTVER} Modified: branches/1.0/scripts/master-upload =================================================================== --- branches/1.0/scripts/master-upload 2012-12-04 17:56:04 UTC (rev 5788) +++ branches/1.0/scripts/master-upload 2012-12-06 21:33:48 UTC (rev 5789) @@ -3,12 +3,6 @@ # master-upload input_path # -MIRROR_IMG_PATH="downloads/img" - -MIRROR_FIRMWARE_PATH="firmware-1.x" - -MIRROR_FIRMWARE_PATH_18="ast18-firmware-1.x" - input_path="$1" auth_file="$HOME/.s3cfg" @@ -74,6 +68,34 @@ done } +set_asterisk_version() +{ + case $1 in + ast14) + FIRMWARE="firmware-1.x" + IMG="img" + MIRROR_FIRMWARE="$FIRMWARE" + MIRROR_IMG="downloads/img" + ;; + ast18) + FIRMWARE="ast18-firmware-1.x" + IMG="ast18-img" + MIRROR_FIRMWARE="$FIRMWARE" + MIRROR_IMG="downloads/img" + ;; + ast11) + FIRMWARE="ast11-firmware-1.x" + IMG="ast11-img" + MIRROR_FIRMWARE="$FIRMWARE" + MIRROR_IMG="downloads/img" + ;; + *) + echo "master-upload: Unknown Asterisk Version." + exit 1 + ;; + esac +} + if [ -z "$input_path" ]; then echo "Usage: master-upload input_path" exit 1 @@ -102,18 +124,22 @@ exit 1 fi -# Upload Asterisk 1.4 .tar.gz run images -upload_run_images "$input_path/firmware-1.x" "$MIRROR_FIRMWARE_PATH" +# +# Uplaod Asterisk 1.4, 1.8 versions of AstLinux +# -# Upload Asterisk 1.4 .img.gz flash images -upload_flash_images "$input_path/img" "$MIRROR_IMG_PATH" +for asterisk in ast14 ast18; do -# Upload Asterisk 1.8 .tar.gz run images -upload_run_images "$input_path/ast18-firmware-1.x" "$MIRROR_FIRMWARE_PATH_18" + set_asterisk_version $asterisk -# Upload Asterisk 1.8 .img.gz flash images -upload_flash_images "$input_path/ast18-img" "$MIRROR_IMG_PATH" + # Upload .tar.gz run images + upload_run_images "$input_path/$FIRMWARE" "$MIRROR_FIRMWARE" + # Upload .img.gz flash images + upload_flash_images "$input_path/$IMG" "$MIRROR_IMG" + +done + echo " ## ## Master Upload Finished for '$success_count' Images This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |