forked from retrogamehandheld/OpenRGH
-
Notifications
You must be signed in to change notification settings - Fork 15
/
create_flasher.sh
66 lines (54 loc) · 1.13 KB
/
create_flasher.sh
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
#!/bin/bash
set -e
umask 0022
VERSION="`cat ./version.txt`"
if [ -r "flasher/sd_image.bin" ]; then
SD="flasher/sd_image.bin"
else
SD=""
fi
# TODO: Reinstate this:
# X-OD-Manual=CHANGELOG
if [ -r "flasher/sd_image.bin" ] ; then
DATE=`date -r "$SD" +%F`
fi
echo "$DATE" > flasher/date.txt
echo "$VERSION" > flasher/version.txt
# Report metadata.
echo
echo "=========================="
echo "SD Imagen: $SD"
echo "build date: $DATE"
echo "build version: $VERSION"
echo "=========================="
echo
# Write metadata.
cat > flasher/default.gcw0.desktop <<EOF
[Desktop Entry]
Name=Flasher $VERSION
Comment=RG350 ROGUE flasher $DATE
Exec=flasher.sh
Icon=rogue
Terminal=true
Type=Application
StartupNotify=true
Categories=applications;
EOF
# Create OPK.
OPK_FILE=flasher/rg350-flasher-$VERSION-$DATE.opk
mksquashfs \
flasher/default.gcw0.desktop \
flasher/rogue.png \
flasher/flasher.sh \
flasher/dd \
flasher/pv \
flasher/date.txt \
flasher/version.txt \
$SD \
$OPK_FILE \
-no-progress -noappend -comp gzip -all-root
echo
echo "=========================="
echo
echo "Flasher OPK: $OPK_FILE"
echo