Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 3 commits
  • 3 files changed
  • 0 comments
  • 1 contributor
11  compile-flickernoise/Makefile
@@ -234,10 +234,15 @@ flickernoise-pdf.fbiz: flickernoise.fbi
234 234
 	(cd $(MILKYMIST_GIT_DIR)/flickernoise.git/src && make clean && WITH_PDF=1 make bin/flickernoise.fbiz)
235 235
 	cp $(MILKYMIST_GIT_DIR)/flickernoise.git/src/bin/flickernoise.fbiz ./$@
236 236
 
237  
-autotest-m1-boot.bin:
238  
-	(cd $(MILKYMIST_GIT_DIR)/autotest-m1.git/src && MMDIR=$(MILKYMIST_GIT_DIR)/milkymist.git make)
  237
+boot.bin:
  238
+	MMDIR=$(MILKYMIST_GIT_DIR)/milkymist.git make -C $(MILKYMIST_GIT_DIR)/autotest-m1.git/src
239 239
 	cp $(MILKYMIST_GIT_DIR)/autotest-m1.git/src/boot.bin ./$@
240 240
 
  241
+boot.crc.bin:
  242
+	MMDIR=$(MILKYMIST_GIT_DIR)/milkymist.git IMAGES_DIR=$(IMAGES_DIR) \
  243
+	  make -C $(MILKYMIST_GIT_DIR)/autotest-m1.git/src boot.crc.bin
  244
+	cp $(MILKYMIST_GIT_DIR)/autotest-m1.git/src/boot.crc.*.bin ./
  245
+
241 246
 ####
242 247
 $(DL)/$(LIBPNG).ok:
243 248
 	mkdir -p dl
@@ -287,7 +292,7 @@ $(DL)/$(EXPAT).ok:
287 292
 	 http://download.sourceforge.net/project/expat/expat/$(EXPAT_VERSION)/expat-$(EXPAT_VERSION).tar.gz
288 293
 	touch $@
289 294
 
290  
-.PHONY: clean clean-rtems
  295
+.PHONY: clean clean-rtems boot.crc.bin
291 296
 
292 297
 clean:
293 298
 	rm -rf build_dir/*
88  scripts/compile-milkymist-firmware.sh
@@ -4,19 +4,29 @@ DATE=$(date "+%Y-%m-%d")
4 4
 TIME=$(date "+%H-%M-%S")
5 5
 DATE_TIME=`date +"%m%d%Y-%H%M"`
6 6
 
7  
-CURR_DIR="`pwd`"
8  
-IMAGE_DIR="${HOME}/.qi/milkymist/milkymist-firmware/${DATE_TIME}/"
9  
-mkdir -p ${IMAGE_DIR}
10 7
 
11  
-BUILD_LOG="${IMAGE_DIR}/BUILD_LOG"
12  
-VERSIONS="${IMAGE_DIR}/VERSIONS"
  8
+IMAGES_DIR="/home/xiangfu/build-milkymist/milkymist-firmware-${DATE_TIME}/"
  9
+mkdir -p ${IMAGES_DIR}
  10
+
  11
+
  12
+BUILD_LOG="${IMAGES_DIR}/BUILD_LOG"
  13
+VERSIONS="${IMAGES_DIR}/VERSIONS"
13 14
 touch ${BUILD_LOG} ${VERSIONS}
14 15
 
15  
-MILKYMIST_GIT_DIR="../../milkymist"
16  
-SCRIPTS_GIT_DIR=".."
  16
+
  17
+MILKYMIST_GIT_DIR=/home/xiangfu/milkymist-firmware/milkymist/
  18
+SCRIPTS_GIT_DIR=/home/xiangfu/milkymist-firmware/scripts.git
  19
+
17 20
 
18 21
 MD5_BINARIES="bios.bin bios-rescue.bin boot.bin data.flash5.bin flickernoise flickernoise.bin flickernoise.fbi flickernoise.ralf soc.fpg soc-rescue.fpg splash.raw splash-rescue.raw standby.fpg"
19 22
 
  23
+
  24
+abort() {
  25
+	tail -n 100 ${IMAGES_DIR}/BUILD_LOG > ${IMAGES_DIR}/BUILD_LOG.`date +"%m%d%Y-%H%M"`.last100
  26
+	echo "$1"
  27
+	exit 1
  28
+}
  29
+
20 30
 get-feeds-revision() {
21 31
     if [ -d "$1" ]; then
22 32
         cd $1
@@ -25,20 +35,22 @@ get-feeds-revision() {
25 35
         branch=$(git branch | grep "*" | cut -b3-)
26 36
         echo "${repo}  ${branch} ${rev}" >> ${VERSIONS}
27 37
     fi
28  
-    cd ${CURR_DIR}
29 38
 }
30 39
 
31 40
 
  41
+RTEMS_MAKEFILE_PATH=/opt/rtems-4.11/lm32-rtems4.11/milkymist
  42
+export RTEMS_MAKEFILE_PATH
  43
+
  44
+PATH=/opt/rtems-4.11/bin:${PATH}
  45
+export PATH
  46
+
  47
+
32 48
 echo "update git ..."
33 49
 (cd ${SCRIPTS_GIT_DIR} && git fetch -a && git reset --hard origin/master)
34 50
 #make -C ${SCRIPTS_GIT_DIR}/compile-flickernoise/ milkymist-git-clone #no needs every build
35 51
 MILKYMIST_GIT_DIR=${MILKYMIST_GIT_DIR}  make -C ${SCRIPTS_GIT_DIR}/compile-flickernoise/ milkymist-git-update
36 52
 if [ "$?" != "0" ]; then
37  
-	echo "ERROR: milkymist-git-update"
38  
-        echo -e "\
39  
-say #milkymist ERROR: milkymist-git-update \
40  
-see log here: http://fidelio.qi-hardware.com/~xiangfu/build-milkymist/milkymist-firmware-${DATE_TIME}/ \nclose" \
41  
-             | nc turandot.qi-hardware.com 3858
  53
+	abort "ERROR: milkymist-git-update"
42 54
 fi
43 55
 
44 56
 
@@ -57,7 +69,7 @@ echo "compile toolchain ..."
57 69
 rm -rf /opt/rtems-4.11/
58 70
 make -C ${SCRIPTS_GIT_DIR}/compile-lm32-rtems clean all >> ${BUILD_LOG} 2>&1
59 71
 if [ "$?" != "0" ]; then
60  
-	echo "ERROR: compile-lm32-rtems toolchain "
  72
+	abort "ERROR: compile-lm32-rtems toolchain "
61 73
 fi
62 74
 
63 75
 
@@ -65,28 +77,21 @@ echo "compile tools ..."
65 77
 (cd ${MILKYMIST_GIT_DIR}/milkymist.git && ./clean_all.sh)
66 78
 make -C ${MILKYMIST_GIT_DIR}/milkymist.git/tools >> ${BUILD_LOG} 2>&1
67 79
 if [ "$?" != "0" ]; then
68  
-	echo "ERROR: milkymist.git/tools"
  80
+	abort "ERROR: milkymist.git/tools"
69 81
 fi
70 82
 
  83
+
71 84
 echo "compile soc ..."
72 85
 #the Xilinx libs(libstdc++.so.6) have some conflict
73  
-(source /home/Xilinx/13.2/ISE_DS/settings64.sh && \
  86
+(source ~/.bashrc && \
  87
+ source /home/Xilinx/13.2/ISE_DS/settings64.sh && \
74 88
  make -C ${MILKYMIST_GIT_DIR}/milkymist.git/boards/milkymist-one/flash)  >> ${BUILD_LOG} 2>&1
75 89
 if [ "$?" != "0" ]; then
76  
-	echo "ERROR: compile SOC"
  90
+	abort "ERROR: compile SOC"
77 91
 fi
78 92
 
79 93
 
80  
-echo "compile flickernoise ..."
81  
-export PATH=${MILKYMIST_GIT_DIR}/milkymist.git/tools:$PATH
82  
-MILKYMIST_GIT_DIR=${MILKYMIST_GIT_DIR} make -C ${SCRIPTS_GIT_DIR}/compile-flickernoise \
83  
-         clean flickernoise.fbi autotest-m1-boot.bin  >> ${BUILD_LOG} 2>&1
84  
-if [ "$?" != "0" ]; then
85  
-	echo "ERROR: compile flickernoise"
86  
-fi
87  
-
88  
-
89  
-echo "copy images to bin/ ..."
  94
+echo "copy soc to bin/ ..."
90 95
 cp ${MILKYMIST_GIT_DIR}/milkymist.git/boards/milkymist-one/flash/standby.fpg ${IMAGES_DIR}
91 96
 cp ${MILKYMIST_GIT_DIR}/milkymist.git/boards/milkymist-one/flash/soc.fpg ${IMAGES_DIR}
92 97
 cp ${MILKYMIST_GIT_DIR}/milkymist.git/boards/milkymist-one/flash/bios.bin ${IMAGES_DIR}
@@ -95,22 +100,41 @@ cp ${MILKYMIST_GIT_DIR}/milkymist.git/boards/milkymist-one/flash/soc-rescue.fpg
95 100
 cp ${MILKYMIST_GIT_DIR}/milkymist.git/boards/milkymist-one/flash/bios-rescue.bin ${IMAGES_DIR}
96 101
 cp ${MILKYMIST_GIT_DIR}/milkymist.git/boards/milkymist-one/flash/splash-rescue.raw ${IMAGES_DIR}
97 102
 
  103
+BIOS_LEN=`ls -l  ${IMAGES_DIR}/bios-rescue.bin  | awk '{printf "%d\n",$5-4}'`
  104
+dd if=${IMAGES_DIR}/bios-rescue.bin of=${IMAGES_DIR}/bios-rescue-without-CRC.bin bs=1 count=${BIOS_LEN}
  105
+
  106
+echo "compile flickernoise ..."
  107
+export PATH=${MILKYMIST_GIT_DIR}/milkymist.git/tools:$PATH
  108
+export PATH=/home/xiangfu/openwrt-xburst.full_system/staging_dir/host/bin:$PATH  #for autoconf 2.68
  109
+MILKYMIST_GIT_DIR=${MILKYMIST_GIT_DIR} IMAGES_DIR=${IMAGES_DIR} \
  110
+  make -C ${SCRIPTS_GIT_DIR}/compile-flickernoise \
  111
+  clean flickernoise.fbi boot.bin boot.crc.bin >> ${BUILD_LOG} 2>&1
  112
+if [ "$?" != "0" ]; then
  113
+	abort "ERROR: compile flickernoise"
  114
+fi
  115
+
  116
+
  117
+echo "copy flickernoise to bin/ ..."
98 118
 cp ${MILKYMIST_GIT_DIR}/flickernoise.git/src/bin/* ${IMAGES_DIR}/
99  
-cp ${MILKYMIST_GIT_DIR}/autotest-m1.git/src/boot.bin ${IMAGES_DIR}/
  119
+cp ${MILKYMIST_GIT_DIR}/autotest-m1.git/src/boot*.bin ${IMAGES_DIR}/
  120
+
100 121
 
101 122
 echo "build data patitions ..."
102  
-mkdir -p ${IMAGE_DIR}/data.flash5/patchpool
103  
-find ${MILKYMIST_GIT_DIR}/flickernoise.git/patches -name "*.fnp" -exec cp {} ${IMAGE_DIR}/data.flash5/patchpool \;
  123
+mkdir -p ${IMAGES_DIR}/data.flash5/patchpool
  124
+find ${MILKYMIST_GIT_DIR}/flickernoise.git/patches -name "*.fnp" -exec cp {} ${IMAGES_DIR}/data.flash5/patchpool \;
104 125
 
105 126
 make -C ${MILKYMIST_GIT_DIR}/rtems-yaffs2.git/utils mm-mkyaffs2image
106  
-${MILKYMIST_GIT_DIR}/rtems-yaffs2.git/utils/mm-mkyaffs2image ${IMAGE_DIR}/data.flash5 ${IMAGES_DIR}/data.flash5.bin convert  >> ${BUILD_LOG} 2>&1
  127
+${MILKYMIST_GIT_DIR}/rtems-yaffs2.git/utils/mm-mkyaffs2image \
  128
+  ${IMAGES_DIR}/data.flash5 ${IMAGES_DIR}/data.flash5.bin convert  >> ${BUILD_LOG} 2>&1
107 129
 chmod 644 ${IMAGES_DIR}/data.flash5.bin
108 130
 
  131
+
109 132
 echo "generate md5sum ..."
110  
-(cd ${IMAGES_DIR} && md5sum --binary * > ${IMAGES_DIR}/md5sums)
  133
+(cd ${IMAGES_DIR} && md5sum --binary ${MD5_BINARIES} > ${IMAGES_DIR}/md5sums)
111 134
 
112 135
 
113 136
 echo "create SDK ..."
114 137
 (cd /opt/ && tar cjvf ${IMAGES_DIR}/Flickernoise-lm32-rtems-4.11-SDK-for-Linux-x86_64.tar.bz2 rtems-4.11/)
115 138
 
  139
+
116 140
 echo "DONE!"
91  scripts/compile-openwrt-milkymist.sh
... ...
@@ -0,0 +1,91 @@
  1
+#!/bin/bash
  2
+
  3
+OPENWRT_DIR_NAME="openwrt-milkymist."$1
  4
+OPENWRT_DIR="/home/xiangfu/${OPENWRT_DIR_NAME}/"
  5
+CONFIG_FILE_TYPE="config."$1
  6
+
  7
+MAKE_VARS=" V=99 IGNORE_ERRORS=m -j4 "
  8
+
  9
+########################################################################
  10
+DATE=$(date "+%Y-%m-%d")
  11
+TIME=$(date "+%H-%M-%S")
  12
+DATE_TIME=`date +"%m%d%Y-%H%M"`
  13
+
  14
+GET_FEEDS_VERSION_SH="/home/xiangfu/bin/get-feeds-revision.sh"
  15
+PATCH_OPENWRT_SH="/home/xiangfu/bin/patch-openwrt.sh"
  16
+
  17
+IMAGES_DIR="/home/xiangfu/build-milkymist/milkymist-openwrt.$1-${DATE_TIME}/"
  18
+mkdir -p ${IMAGES_DIR}
  19
+
  20
+BUILD_LOG="${IMAGES_DIR}/BUILD_LOG"
  21
+VERSIONS_FILE="${IMAGES_DIR}/VERSIONS"
  22
+
  23
+
  24
+########################################################################
  25
+cd ${OPENWRT_DIR}
  26
+
  27
+echo "make distclean ..."
  28
+make distclean 
  29
+
  30
+
  31
+echo "updating git repo..."
  32
+git fetch -a
  33
+git reset --hard origin/master
  34
+if [ "$?" != "0" ]; then
  35
+	echo "ERROR: updating openwrt failed"
  36
+	exit 1
  37
+fi
  38
+
  39
+
  40
+echo "update and install feeds..."
  41
+./scripts/feeds update -a && ./scripts/feeds install -a
  42
+if [ "$?" != "0" ]; then
  43
+	echo "ERROR: update and install feeds failed"
  44
+	exit 1
  45
+fi
  46
+cp feeds/qipackages/milkymist-files/data/m1/conf/${CONFIG_FILE_TYPE} .config
  47
+sed -i '/CONFIG_ALL/s/.*/CONFIG_ALL=y/' .config 
  48
+yes "" | make oldconfig > /dev/null
  49
+
  50
+
  51
+echo "copy files, create VERSION, copy dl folder, last prepare..."
  52
+rm -f dl    && ln -s ~/dl
  53
+
  54
+
  55
+echo "patch openwrt "
  56
+${PATCH_OPENWRT_SH} ${OPENWRT_DIR}
  57
+
  58
+
  59
+echo "starting compiling - this may take several hours..."
  60
+time make ${MAKE_VARS} > ${IMAGES_DIR}/BUILD_LOG 2>&1
  61
+if [ "$?" != "0" ]; then
  62
+	echo "ERROR: Build failed! Please refer to the log file"
  63
+	tail -n 100 ${IMAGES_DIR}/BUILD_LOG > ${IMAGES_DIR}/BUILD_LOG.`date +"%m%d%Y-%H%M"`.last100
  64
+        echo -e "\
  65
+say #milkymist The build has FAILED, \
  66
+see log here: http://fidelio.qi-hardware.com/~xiangfu/build-milkymist/milkymist-openwrt.$1-${DATE_TIME}/\nclose" \
  67
+             | nc turandot.qi-hardware.com 3858
  68
+else
  69
+echo -e "\
  70
+say #milkymist The build was successfull, \
  71
+see images here: http://fidelio.qi-hardware.com/~xiangfu/build-milkymist/milkymist-openwrt.$1-${DATE_TIME}/\nclose" \
  72
+     | nc turandot.qi-hardware.com 3858
  73
+fi
  74
+
  75
+
  76
+echo "getting version numbers of used repositories..."
  77
+${GET_FEEDS_VERSION_SH} ${OPENWRT_DIR} > ${VERSIONS_FILE}
  78
+
  79
+
  80
+echo "copy all files to IMAGES_DIR..."
  81
+cp .config ${IMAGES_DIR}/config
  82
+cp build_dir/linux-lm32/linux-3.0/.config ${IMAGES_DIR}/kernel.config
  83
+cp feeds.conf ${IMAGES_DIR}/
  84
+cp -a bin/lm32/* ${IMAGES_DIR} 2>/dev/null
  85
+
  86
+(cd ${IMAGES_DIR}; \
  87
+ grep -E "ERROR:\ package.*failed to build" BUILD_LOG | grep -v "package/kernel" > failed_packages.txt; \
  88
+ bzip2 -z BUILD_LOG; \
  89
+)
  90
+
  91
+echo "DONE :)"

No commit comments for this range

Something went wrong with that request. Please try again.