From: <abe...@us...> - 2016-02-08 17:15:01
|
Revision: 7509 http://sourceforge.net/p/astlinux/code/7509 Author: abelbeck Date: 2016-02-08 17:15:00 +0000 (Mon, 08 Feb 2016) Log Message: ----------- update master-build and master-upload for ISO installer images 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 2016-02-05 16:17:55 UTC (rev 7508) +++ branches/1.0/scripts/master-build 2016-02-08 17:15:00 UTC (rev 7509) @@ -9,6 +9,8 @@ FAT_SIZE=256 +REQUIRED_CMDS="which sudo genisoimage sha1sum" + BOARDS_SMP64="genx86_64 genx86_64-serial" BOARDS_SMP="geni586 geni586-serial" @@ -19,11 +21,8 @@ build_board() { - local firmware="$1" img="$2" + local firmware="$1" - mkdir "$output_path/$firmware/$board" - mkdir "$output_path/$img/$board" - ./scripts/build $board if [ $? -ne 0 ]; then @@ -39,9 +38,12 @@ ./scripts/astlinux-makeimage -z $FAT_SIZE $FAT_SIZE 0 + mkdir "$output_path/$firmware/$board" + mkdir -p "$output_path/img/${ASTVER}-${board}" + 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/${board}-${ASTVER#astlinux-}-${ASTERISK_VERSION}.img.gz" + mv "${ASTVER}.img.gz" "$output_path/img/${ASTVER}-${board}/${board}-${ASTVER#astlinux-}-${ASTERISK_VERSION}.img.gz" rm -rf "${ASTVER}" } @@ -59,21 +61,18 @@ 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" ;; ast13) CONFIG="astlinux-ast13.config" ASTERISK_VERSION="$(awk -F'=' '/^ASTERISK_VERSION/ { if ($2 ~ /^ *13./) {print $2; exit} }' package/asterisk/asterisk.mk)" ASTERISK_VERSION="asterisk-${ASTERISK_VERSION// /}" FIRMWARE="ast13-firmware-1.x" - IMG="ast13-img" ;; *) echo "master-build: Unknown Asterisk Version." @@ -103,6 +102,28 @@ fi fi +if ! mkdir "$output_path/img"; then + exit 1 +fi +if ! mkdir "$output_path/iso"; then + exit 1 +fi + +error=0 +for i in $REQUIRED_CMDS; do + if ! which $i >/dev/null 2>&1; then + error=1 + echo "master-build: Required command \"$i\" is missing in your build environment." >&2 + if [ "$i" = "which" ]; then # no use proceeding + break + fi + fi +done +if [ $error -ne 0 ]; then + echo "Missing Required Command(s)." >&2 + exit 1 +fi + echo " Trying sudo, if this prompts for a password, ^C and 'sudoedit /etc/sudoers' and add a line at the end something like: @@ -128,9 +149,6 @@ if ! mkdir "$output_path/$FIRMWARE"; then exit 1 fi - if ! mkdir "$output_path/$IMG"; then - exit 1 - fi # Non-SMP Builds echo "Cleaning out any existing builds..." @@ -139,7 +157,7 @@ cp "$CONFIG" .config for board in $BOARDS_NO_SMP; do - build_board "$FIRMWARE" "$IMG" + build_board "$FIRMWARE" done # SMP Builds @@ -150,7 +168,7 @@ set_smp_kernel for board in $BOARDS_SMP; do - build_board "$FIRMWARE" "$IMG" + build_board "$FIRMWARE" done # SMP64 Builds @@ -160,10 +178,32 @@ cp "x86_64-configs/$CONFIG" .config for board in $BOARDS_SMP64; do - build_board "$FIRMWARE" "$IMG" + build_board "$FIRMWARE" done done +# AstLinux ISO Installer +echo "Cleaning out any existing builds..." +rm -rf output + +cp runnix-iso.config .config + +for board in $BOARDS_NO_SMP $BOARDS_SMP $BOARDS_SMP64; do + if [ "${board}" != "${board%-serial}" -o "$board" = "alix" -o "$board" = "net5501" ]; then + SERIAL="serial" + else + SERIAL="" + fi + ./scripts/build-runnix-iso "$output_path/img/${ASTVER}-${board}" $SERIAL + if [ $? -ne 0 ]; then + exit 1 + fi + if [ ! -f "${ASTVER}-${board}.iso" ]; then + exit 1 + fi + mv "${ASTVER}-${board}.iso" "$output_path/iso/" +done + echo " ## ## Master Build Successful for ${ASTVER} Modified: branches/1.0/scripts/master-upload =================================================================== --- branches/1.0/scripts/master-upload 2016-02-05 16:17:55 UTC (rev 7508) +++ branches/1.0/scripts/master-upload 2016-02-08 17:15:00 UTC (rev 7509) @@ -55,15 +55,22 @@ { local local_dir="$1" firmware_path="$2" - for board in $(ls -1 "$local_dir"); do - echo "Flash Image for Board: $board" - file="$(ls -1 "$local_dir/$board/"*.img.gz | head -n1)" - if [ -n "$file" ]; then - upload_file "$firmware_path/$board" "$file" count - else - echo "master-upload: missing file(s) in \"$local_dir/$board/\"" - exit 1 - fi + for astver_board in $(ls -1 "$local_dir"); do + for file in $(ls -1 "$local_dir/$astver_board/"*.img.gz); do + echo "Flash Image: ${file##*/}" + upload_file "$firmware_path/$astver_board" "$file" count + echo "" + done + done +} + +upload_iso_images() +{ + local local_dir="$1" firmware_path="$2" + + for file in $(ls -1 "$local_dir/"*.iso); do + echo "ISO Image: ${file##*/}" + upload_file "$firmware_path" "$file" count echo "" done } @@ -73,21 +80,15 @@ case $1 in 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" ;; ast13) FIRMWARE="ast13-firmware-1.x" - IMG="ast13-img" MIRROR_FIRMWARE="$FIRMWARE" - MIRROR_IMG="downloads/img" ;; *) echo "master-upload: Unknown Asterisk Version." @@ -105,16 +106,18 @@ echo "master-upload: directory \"$input_path\" not found." exit 1 else + check_iso=0 check_img=0 check_firmware=0 for dir in $(ls -1 "$input_path"); do case $dir in - *img) check_img=1 ;; + iso) check_iso=1 ;; + img) check_img=1 ;; *firmware-1.x) check_firmware=1 ;; esac done - if [ $check_img -eq 0 -o $check_firmware -eq 0 ]; then - echo "master-upload: missing img/firmware-1.x directories." + if [ $check_iso -eq 0 -o $check_img -eq 0 -o $check_firmware -eq 0 ]; then + echo "master-upload: missing iso/img/firmware-1.x directories." exit 1 fi fi @@ -124,9 +127,6 @@ exit 1 fi -# -# Upload Asterisk 1.8, 11 and 13 versions of AstLinux -# for asterisk in ast18 ast11 ast13; do @@ -135,11 +135,15 @@ # 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 +# Upload .img.gz flash images +upload_flash_images "$input_path/img" "downloads/img" + +# Upload .iso installer images +upload_iso_images "$input_path/iso" "downloads/iso" + + 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. |