]> git.vomp.tv Git - makedevenv.git/blob - makedevenv
Add ignores for generated things
[makedevenv.git] / makedevenv
1 #!/bin/bash
2
3 WGET=wget
4 TAR=tar
5 GZIP=gzip
6 BZIP2=bzip2
7 PATCH=patch
8 AUTOCONF=autoconf
9 MAKE=make
10 GIT=git
11 # The following are required by crosstool
12 BISON=bison
13 FLEX=flex
14
15 PACKAGES_DIR=packages
16 DOWNLOAD_PREFIX=http://www.loggytronic.com/dl/
17
18 FILE_MVPDEVFS=mvpdevfs-4.tar.gz
19
20 # Files used by the script packages
21 SOURCEFILES="crosstool-0.43.tar.gz linux-2.4.31.tar.bz2 busybox-1.00.tar.bz2 jpegsrc.v6b.tar.gz genext2fs-1.4.tar.gz"
22 # And files downloaded by crosstool:
23 SOURCEFILES+=" binutils-2.15.tar.bz2 glibc-2.2.5.tar.gz linux-2.6.8.tar.bz2 gcc-3.4.5.tar.bz2 glibc-linuxthreads-2.2.5.tar.gz"
24
25 set -e
26
27 # ----------------------------------------------
28
29 makeDir()
30 {
31   if ! mkdir -p $1
32   then
33     echo "Error: could not create directory: $1"
34     exit
35   fi
36 }
37
38 downloadFile()
39 {
40   if [ ! -r ${PACKAGES_DIR}/$1 -o ! -s ${PACKAGES_DIR}/$1 ]
41   then
42     if ! $WGET -O ${PACKAGES_DIR}/$1 ${DOWNLOAD_PREFIX}$1
43     then
44       echo "Error: could not download $1"
45       exit
46     fi
47   fi
48 }
49
50 checkProg()
51 {
52   if [ -x /bin/$1 ] || [ -x /usr/bin/$1 ]
53   then
54     return 0
55   else
56     echo "$1 not found in /bin or /usr/bin."
57     exit 1
58   fi
59 }
60
61 # The Start
62
63 echo
64 echo "VOMP Development Environment Setup Script (git version)"
65 echo
66
67 TOP=`pwd`
68
69 # Test for prerequisites
70
71 if [ -L /bin/sh ] && [ $(readlink /bin/sh) = dash ]
72 then
73   echo "Your /bin/sh symlink links to dash which causes the crosstool build to fail."
74   echo "Please point /bin/sh to another shell (bash works)."
75   exit 1
76 fi
77
78 checkProg $WGET
79 checkProg $TAR
80 checkProg $GZIP
81 checkProg $BZIP2
82 checkProg $PATCH
83 checkProg $AUTOCONF
84 checkProg $MAKE
85 checkProg $GIT
86 checkProg $BISON
87 checkProg $FLEX
88
89 # Make directories
90
91 makeDir $PACKAGES_DIR
92
93 # Download files
94
95 downloadFile $FILE_MVPDEVFS
96
97 for i in $SOURCEFILES ; do
98   downloadFile $i
99 done
100
101 # Build cross compiler
102
103 cd ${TOP}/crosstool
104 ./autobuild
105
106 # Build kernels
107
108 cd ${TOP}/kernel
109 ./autobuild
110
111 # Build busybox
112
113 cd ${TOP}/busybox
114 ./autobuild
115
116 # Build JPEG
117
118 cd ${TOP}/jpeg
119 ./autobuild
120
121 # Build kernel module
122
123 cd ${TOP}/lbox_border
124 ./autobuild
125
126 # Get client and build for dongle
127
128 cd $TOP
129 $GIT clone http://git.vomp.tv/vompclient.git client
130 cd client
131 $MAKE release
132
133 # Build a dongle
134
135 cd ${TOP}/dongle
136 ./autobuild
137
138 # Done
139
140 echo
141 echo "Done. A dongle should have been created as dongle/vomp-dongle"
142 echo "Optionally you can set-up an NFS root development environment by following the"
143 echo "MVP-Filesystem->DHCP->TFTP->NFS guide."
144 echo