-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake-dm500-commando
executable file
·164 lines (145 loc) · 4.96 KB
/
make-dm500-commando
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
#!/bin/bash
# UkCvs.net Commando Project dm500 build script for Ubuntu LTS 32bit - 20th Sep 2016
COMMANDO_BRANCH="16.0"
buildstart=`date +%s`
CURRENT_PATH=`pwd`
PROJECT_PATH="$CURRENT_PATH/commando-$COMMANDO_BRANCH"
if [ `readlink /bin/sh` = "dash" ]; then
echo
echo "WARNING - i am reconfiguring your system to use bash as shell"
echo "command: 'sudo dpkg-reconfigure dash', select YES to reverse"
sudo ln -sf bash /bin/sh
sudo ln -sf dash /bin/sh.distrib
fi
echo
echo "I am testing that you have the required tools installed"
for pkg in automake git subversion cvs libtool make g++ flex bison mtd-utils diffutils \
pkg-config patch squashfs-tools zlib1g-dev ccache gawk bzip2 dialog expect-dev zip; do
if [ $(dpkg-query -W -f='${Status}' $pkg 2>/dev/null | grep -c "ok installed") -eq 0 ]; then
sudo apt-get install -y $pkg
else
echo "checking for $pkg ... yes"
fi
done
echo
if [ ! -d $CURRENT_PATH/Archive ]; then
echo "creating Archive folder"
mkdir -p $CURRENT_PATH/Archive
else
echo "checking for Archive folder ... yes"
fi
if [ ! -d $PROJECT_PATH/dreambox ]; then
echo "creating dreambox folder"
mkdir -p $PROJECT_PATH/dreambox
else
echo "checking for dreambox folder ... yes"
fi
dialog \
--clear --cancel-label "Exit" --backtitle "UkCvs.net Commando $COMMANDO_BRANCH Project Build Script - dm500" \
--colors --title "\Z4 [ PLEASE CHOOSE AN OPTION ] \Zn" \
--menu "\n Please select what type of image to build \n\n\
You can use the UP/DOWN arrow navigation keys\n\
or keypress C,M,R,U,N as a choice of hot keys" 16 52 8 \
Create "make local only build - distclean" \
Modify "make local only build - mostlyclean" \
Remake "make local only build - neutrinoclean" \
Update "online >> local build - distclean" \
New "online checkout build - deleted" 2>/tmp/ukcvs
buildenv="Exit"
buildclean="distclean"
menuitem=$(</tmp/ukcvs)
case $menuitem in
Create) buildenv="Create";;
Modify) buildenv="Modify";buildclean="mostlyclean";;
Remake) buildenv="Modify";buildclean="neutrinoclean";;
Update) buildenv="Update";;
New) buildenv="New";;
esac
[ -f /tmp/ukcvs ] && rm /tmp/ukcvs
if [ $buildenv = "Exit" ] ; then
echo "Bye"
exit 0
fi
echo
if [ ! -d $PROJECT_PATH/cdk ] || [ $buildenv = "New" ]; then
echo "checking out new build environment"
[ -d $PROJECT_PATH ] && rm -rf $PROJECT_PATH
git clone -b $COMMANDO_BRANCH git://github.com/UkCvs/commando.git $PROJECT_PATH
cd $PROJECT_PATH
git status
elif [ $buildenv = "Update" ]; then
echo "updating current build environment"
cd $PROJECT_PATH
git pull
elif [ $buildenv = "Create" ] || [ $buildenv = "Modify" ]; then
echo "using the local build environment"; echo
echo "Display Latest Info for Commando $COMMANDO_BRANCH Project environment";echo
cd $PROJECT_PATH
git log -1 && echo && git status
sleep 10
else
echo "Bye"
exit 0
fi
echo
cd $PROJECT_PATH/cdk
if [ -f $PROJECT_PATH/cdk/Makefile-archive ]; then
echo "$buildclean is cleaning the local build environment, please wait..."
make $buildclean > /dev/null 2>&1
fi
./autogen.sh;
./configure \
--prefix=$PROJECT_PATH/dreambox \
--with-cvsdir=$PROJECT_PATH \
--with-archivedir=$CURRENT_PATH/Archive \
--with-boxtype=dreambox \
--with-boxmodel=dm500 \
--with-filesystems="nfs,cifs,smbfs" \
--with-defaultlocale=english \
--with-flashtool=expert \
--disable-pictureviewer \
--disable-tuxmail \
--enable-dvbsnoop \
--enable-dreambox-serial-console \
--enable-fx2-tetris \
--enable-fx2-vierg \
--enable-fx2-pac \
--enable-shellexec \
--enable-openvpn \
--enable-madplay \
--enable-msgbox \
--enable-input \
--enable-inadyn-mt \
--enable-automount \
--enable-freesatepg \
--enable-upnp
make flash-neutrino-squashfs 2>$PROJECT_PATH/buildlog.txt
builddate=`date +%Y%m%d-%H%M`
buildstop=$(expr `date +%s` - $buildstart)
buildhour=$(expr $buildstop / 3600)
buildstop=$(expr $buildstop % 3600)
buildmins=$(expr $buildstop / 60)
buildsecs=$(expr $buildstop % 60)
cd $PROJECT_PATH
revision=$(git log -1 | grep '^commit' | cut -d ' ' -f2 | cut -c1-7)
if [ -f dreambox/cdkflash/complete-neutrino.img ]; then
buildfile="commando-$COMMANDO_BRANCH-dm500-$builddate-$revision.img"
cp dreambox/cdkflash/complete-neutrino.img $buildfile
md5sum -b $buildfile > MD5SUM
rm -f commando-$COMMANDO_BRANCH-dm500-$revision.zip
zip -j commando-$COMMANDO_BRANCH-dm500-$revision.zip $buildfile MD5SUM
dialog \
--clear --backtitle "UkCvs.net Commando $COMMANDO_BRANCH Project Build Script - dm500" \
--colors --title "\Z4[ Github:$revision $buildenv Build Finished ]\Zn" \
--msgbox "commando-$COMMANDO_BRANCH-dm500-$builddate-$revision.img\n\n
`date`\nTotal Time: $buildhour hours $buildmins mins $buildsecs secs\n" 8 52
else
dialog \
--clear --backtitle "UkCvs.net Commando $COMMANDO_BRANCH Project Build Script - dm500" \
--colors --title "\Z4[ Github:$revision $buildenv Build Finished ]\Zn" \
--msgbox " ERROR: Build failed to create an image\n\n
`date`\n Total Time: $buildhour hours $buildmins mins $buildsecs secs\n" 8 52
echo && echo "Buildlog - DEBUG MESSAGE:" && tail -20 buildlog.txt
fi
echo
exit 0