Date:2012-03-07 03:09:11 (12 years 22 days ago)
Author:Xiangfu Liu
Commit:26a488ae1fbef3b20ce247e767c6f63f17793c0b
Message:compile-openwrt-xburst.sh: don't copy failed build to IMAGES_URL

Files: nanonote-files/data/qi_lb60/scripts/compile-openwrt-xburst.sh (5 diffs)

Change Details

nanonote-files/data/qi_lb60/scripts/compile-openwrt-xburst.sh
11#!/bin/bash
22
3# this script file is using in build host
3# This script file is using in build host
44# $1: full_system minimal xbboot
55
66OPENWRT_DIR_NAME="openwrt-xburst."$1
...... 
1616GET_FEEDS_VERSION_SH="/home/xiangfu/bin/get-feeds-revision.sh"
1717PATCH_OPENWRT_SH="/home/xiangfu/bin/patch-openwrt.sh"
1818
19IMAGES_DIR="/home/xiangfu/building/Nanonote/Ben/${OPENWRT_DIR_NAME}-${DATE_TIME}/"
19IMAGES_URL="http://fidelio.qi-hardware.com/~xiangfu/build-nanonote"
20IMAGES_DIR_BASE="/home/xiangfu/building/Nanonote/Ben"
21IMAGES_DIR="${IMAGES_DIR_BASE}/${OPENWRT_DIR_NAME}-${DATE_TIME}/"
2022DEST_DIR="/home/xiangfu/build-nanonote"
2123mkdir -p ${IMAGES_DIR}
2224mkdir -p ${DEST_DIR}
...... 
2426BUILD_LOG="${IMAGES_DIR}/BUILD_LOG"
2527VERSIONS_FILE="${IMAGES_DIR}/VERSIONS"
2628
27
2829########################################################################
2930cd ${OPENWRT_DIR}
3031
31echo "make distclean ..."
32echo "make distclean..."
3233make distclean
3334
3435
...... 
3637git fetch -a
3738git reset --hard origin/master
3839if [ "$?" != "0" ]; then
39    echo "ERROR: updating openwrt-xburst failed"
40    exit 1
40    echo "ERROR: updating openwrt-xburst failed"
41    exit 1
4142fi
4243
4344
4445echo "update and install feeds..."
4546./scripts/feeds update -a && ./scripts/feeds install -a
4647if [ "$?" != "0" ]; then
47    echo "ERROR: update and install feeds failed"
48    exit 1
48    echo "ERROR: update and install feeds failed"
49    exit 1
4950fi
50cp feeds/qipackages/nanonote-files/data/qi_lb60/conf/${CONFIG_FILE_TYPE} .config
51cp feeds/qipackages/nanonote-files/data/qi_lb60/conf/${CONFIG_FILE_TYPE} \
52    .config
5153sed -i '/CONFIG_ALL/s/.*/CONFIG_ALL=y/' .config
5254yes "" | make oldconfig > /dev/null
5355
5456
55echo "copy files, create VERSION, copy dl folder, last prepare..."
57echo "copy files, create VERSION, link dl folder, last prepare..."
5658rm -f files && ln -s feeds/qipackages/nanonote-files/data/qi_lb60/files/
5759rm -f dl && ln -s ~/dl
5860mkdir -p files/etc && echo ${DATE} > files/etc/VERSION
59    mkdir -p files/etc/uci-defaults && echo -e "\0043\0041/bin/sh \ndate --set `date +"%Y%m%d%H%M"`\nhwclock --systohc" > files/etc/uci-defaults/99-set-time
61mkdir -p files/etc/uci-defaults && \
62    echo -e "\0043\0041/bin/sh \ndate --set `date +"%Y%m%d%H%M"`\nhwclock --systohc" > files/etc/uci-defaults/99-set-time
6063
6164
62echo "patch openwrt "
65echo "patch openwrt..."
6366${PATCH_OPENWRT_SH} ${OPENWRT_DIR}
6467
6568
6669echo "starting compiling - this may take several hours..."
6770time make ${MAKE_VARS} > ${IMAGES_DIR}/BUILD_LOG 2>&1
68if [ "$?" != "0" ]; then
69    echo "ERROR: Build failed! Please refer to the log file"
70    tail -n 100 ${IMAGES_DIR}/BUILD_LOG > ${IMAGES_DIR}/BUILD_LOG.`date +"%m%d%Y-%H%M"`.last100
71        echo -e "\
72say #qi-hardware The build has FAILED, \
73see log here: http://fidelio.qi-hardware.com/~xiangfu/build-nanonote/${OPENWRT_DIR_NAME}-${DATE_TIME}/\nclose" \
74             | nc turandot.qi-hardware.com 3858
75else
76echo -e "\
77say #qi-hardware The build was successful, \
78see images here: http://fidelio.qi-hardware.com/~xiangfu/build-nanonote/${OPENWRT_DIR_NAME}-${DATE_TIME}/\nclose" \
79     | nc turandot.qi-hardware.com 3858
80fi
71MAKE_RET="$?"
8172
8273
8374echo "getting version numbers of used repositories..."
...... 
9384cp -a files/* ${IMAGES_DIR}/files/
9485
9586(cd ${IMAGES_DIR}; \
96 grep -E "ERROR:\ package.*failed to build" BUILD_LOG | grep -v "package/kernel" > failed_packages.txt; \
97 bzip2 -z BUILD_LOG; \
98 bzip2 -z openwrt-xburst-qi_lb60-root.ubi; \
87    grep -E "ERROR:\ package.*failed to build" BUILD_LOG | \
88        grep -v "package/kernel" > failed_packages.txt; \
89    bzip2 -z BUILD_LOG; \
90    bzip2 -z openwrt-xburst-qi_lb60-root.ubi; \
9991)
10092
101mv ${IMAGES_DIR} ${DEST_DIR}
93if [ "${MAKE_RET}" != "0" ]; then
94    echo "ERROR: Build failed! please refer to the BUILD_LOG file"
95    tail -n 100 ${IMAGES_DIR}/BUILD_LOG > \
96    ${IMAGES_DIR}/BUILD_LOG.`date +"%m%d%Y-%H%M"`.last100
97    MSG="The build was FAILED"
98    URL="http://fidelio.qi-hardware.com/~xiangfu/building/Nanonote/Ben/\
99/${OPENWRT_DIR_NAME}-${DATE_TIME}"
100else
101    mv ${IMAGES_DIR} ${DEST_DIR}
102    MSG="The build was successful"
103    URL="${IMAGES_URL}/${OPENWRT_DIR_NAME}-${DATE_TIME}"
104fi
105
106echo -e "say #qi-hardware ${MSG}: ${URL} \nclose" \
107    | nc turandot.qi-hardware.com 3858
102108
103echo "DONE!"
109echo "Done"

Archive Download the corresponding diff file



interactive