-
Notifications
You must be signed in to change notification settings - Fork 0
/
make_oe_image
executable file
·84 lines (66 loc) · 2.73 KB
/
make_oe_image
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
#!/bin/bash
export CVS_RSH=ssh
if [ "${OE_BUILD}x" = "x" -a "${MACHINE}x" = "x" ]; then
echo "ERROR: either OE_BUILD or MACHINE must be defined!"
exit
fi
# Default: build image from PWD
if [ "${OE_ROOT}x" = "x" ]; then
OE_ROOT=${PWD}
fi
if [ "${OE_BUILD}x" = "x" ]; then
#when OE_BUILD is not defined, MACHINE must be defined (checked above)
OE_BUILD=${OE_ROOT}/build-${MACHINE}
fi
if [ "${MACHINE}x" = "x" ]; then
#when MACHINE is not defined, OE_BUILD must be defined (checked above)
MACHINE=`grep "^MACHINE = " $OE_BUILD/conf/local.conf | sed "s/MACHINE = \"//" | sed "s/\"$//"`
fi
export MACHINE
if [ "${IMAGEDIR}x" = "x" ]; then
IMAGEDIR=${MACHINE}
fi
if [ "${DISTROVERSION}x" = "x" ]; then
DISTROVERSION=openpli-2.1
FILENAME="OpenPLi-2.1-beta-${MACHINE}-`date +%Y%m%d`"
else
FILENAME="${DISTROVERSION}-${MACHINE}-`date +%Y%m%d`"
fi
OE_IMAGES=$OE_BUILD/tmp/deploy/images/${MACHINE}
#old images can be cleared
rm -f $OE_IMAGES/*.nfi
rm -f $OE_IMAGES/*.zip
rm -f $OE_IMAGES/*.jffs2
rm -f $OE_IMAGES/*.jffs2.sum
#start with a clean feed, so we can detect whether something failed during the build
for FEED in all $MACHINE mipsel; do
rm -f $OE_BUILD/tmp/deploy/ipk/$FEED/Packages
rm -f $OE_BUILD/tmp/deploy/ipk/$FEED/Packages.gz
done
cd $OE_ROOT
MACHINE=${MACHINE} make -f Makefile-2.1 initialize
cd $OE_BUILD && . env.source && bitbake openpli-enigma2-feed || ( echo "Error building image started in $OE_BUILD"; exit 1 )
mv $OE_IMAGES/*.nfi $OE_IMAGES/$FILENAME.nfi
[ -f $OE_IMAGES/$FILENAME.nfi ] && zip -j $OE_IMAGES/$FILENAME.zip $OE_IMAGES/$FILENAME.nfi
mv $OE_IMAGES/*_usb.zip $OE_IMAGES/${FILENAME}_usb.zip
rsync $OE_IMAGES/$FILENAME*.zip rsync://upload.pli-images.org:8730/builds/$IMAGEDIR/
rm -Rf $OE_BUILD/tmp/deploy/3rd-party
mkdir $OE_BUILD/tmp/deploy/3rd-party
mkdir $OE_BUILD/tmp/deploy/3rd-party/old
rsync rsync://upload.pli-images.org:8730/feeds/$DISTROVERSION/3rd-party/upload/*.ipk $OE_BUILD/tmp/deploy/3rd-party/
rsync rsync://upload.pli-images.org:8730/feeds/$DISTROVERSION/3rd-party/upload/$MACHINE/*.ipk $OE_BUILD/tmp/deploy/3rd-party/
cd $OE_ROOT
./recreate_feed $OE_BUILD/tmp/deploy/3rd-party
rsync -h -r --timeout=600 --progress --delete-during $OE_BUILD/tmp/deploy/3rd-party/ rsync://upload.pli-images.org:8730/feeds/$DISTROVERSION/$MACHINE/3rd-party/
if [ ! -f $OE_BUILD/tmp/deploy/ipk/$MACHINE/Packages.gz ]; then
echo "Feed not complete!"
exit
fi
for FEED in all $MACHINE mipsel; do
rm -f $OE_BUILD/tmp/deploy/ipk/$FEED/*-dbg_*.ipk
rm -f $OE_BUILD/tmp/deploy/ipk/$FEED/*-doc_*.ipk
done
cd $OE_BUILD && bitbake package-index
for FEED in all $MACHINE mipsel; do
rsync -h -r --timeout=600 --progress --delete-during --exclude morgue $OE_BUILD/tmp/deploy/ipk/$FEED rsync://upload.pli-images.org:8730/feeds/$DISTROVERSION/$MACHINE
done