-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake-dm500-tuxbox-git
More file actions
executable file
·170 lines (150 loc) · 4.9 KB
/
make-dm500-tuxbox-git
File metadata and controls
executable file
·170 lines (150 loc) · 4.9 KB
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
164
165
166
167
168
169
#!/bin/bash
# UkCvs.net UkCvs Tuxbox Git Project dm500 build script for Ubuntu LTS 32bit - 20th Sep 2016
TUXBOX_BRANCH="ukcvs"
REPOLIST="boot driver hostapps cdk apps"
buildstart=`date +%s`
CURRENT_PATH=`pwd`
PROJECT_PATH="$CURRENT_PATH/tuxbox-git-$TUXBOX_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 $TUXBOX_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,U,N as the choice of hot keys" 15 50 8 \
Create "make local only build - distclean" \
Modify "make local only build - mostlyclean" \
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";;
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
echo "creating dreambox folder"
mkdir -p $PROJECT_PATH/dreambox
cd $PROJECT_PATH
for repo in boot driver hostapps cdk apps; do
git clone -b $TUXBOX_BRANCH git://github.com/UkCvs/tuxbox-git-$repo.git $repo
done
elif [ $buildenv = "Update" ]; then
echo "updating current build environment"
cd $PROJECT_PATH
for repo in boot driver hostapps cdk apps; do
cd $repo
git pull
cd ..
done
elif [ $buildenv = "Create" ] || [ $buildenv = "Modify" ]; then
echo "using the local build environment"; echo
echo "Display Latest Info for $TUXBOX_BRANCH Project environment";echo
cd $PROJECT_PATH
for repo in boot driver hostapps cdk apps; do
cd $repo
git log -1 && echo && git status
cd ..
done
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-shellexec \
--enable-openvpn \
--enable-msgbox \
--enable-input \
--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
if [ -f dreambox/cdkflash/complete-neutrino.img ]; then
buildfile="tuxbox-$TUXBOX_BRANCH-dm500-$builddate.img"
cp dreambox/cdkflash/complete-neutrino.img $buildfile
md5sum -b $buildfile > MD5SUM
rm -f tuxbox-$TUXBOX_BRANCH-dm500.zip
zip -j tuxbox-$TUXBOX_BRANCH-dm500.zip $buildfile MD5SUM
dialog \
--clear --backtitle "UkCvs.net $TUXBOX_BRANCH Project Build Script - dm500" \
--colors --title "\Z4[ Github:tuxbox-git $buildenv Build Finished ]\Zn" \
--msgbox "tuxbox-$TUXBOX_BRANCH-dm500-$builddate.img\n\n
`date`\nTotal Time: $buildhour hours $buildmins mins $buildsecs secs\n" 8 52
else
dialog \
--clear --backtitle "UkCvs.net $TUXBOX_BRANCH Project Build Script - dm500" \
--colors --title "\Z4[ Github:tuxbox-git $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