-
Notifications
You must be signed in to change notification settings - Fork 9
/
make_flash.sh
executable file
·105 lines (94 loc) · 4.06 KB
/
make_flash.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
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
#!/bin/bash
if [ `id -u` != 0 ]; then
echo "You are not running this script with fakeroot! Try it again with \"fakeroot ./make_flash.sh\"."
echo "Bye Bye..."
exit
fi
CURDIR=`pwd`
BASEDIR=$CURDIR/../..
TUFSBOXDIR=$BASEDIR/tufsbox
CDKDIR=$BASEDIR/cdk
SCRIPTDIR=$CURDIR/scripts
TMPDIR=$CURDIR/tmp
TMPROOTDIR=$TMPDIR/ROOT
TMPKERNELDIR=$TMPDIR/KERNEL
TMPSTORAGEDIR=$TMPDIR/STORAGE
OUTDIR=$CURDIR/out
if [ -e $TMPDIR ]; then
rm -rf $TMPDIR/*
fi
mkdir -p $TMPDIR
mkdir -p $TMPROOTDIR
mkdir -p $TMPKERNELDIR
mkdir -p $TMPSTORAGEDIR
echo "This script creates flashable images for NOR flash receivers."
echo "Author: Schischu, Oxygen-1, BPanther, TangoCash, Grabber66"
echo "Last Change: 05-05-2013"
echo "Changed for \"classic flash\" (no mini_fo) for UFS910 and add more receivers by BPanther, 13-Feb-2013."
echo ""
echo "Supported receivers (autoselection) are:"
echo "UFS910, UFS922, Octagon1008, Fortis HDBox, Cuberevo MINI2, Cuberevo, Cuberevo 2000HD"
echo "-----------------------------------------------------------------------"
echo "It's expected that an image was already build prior to this execution!"
echo "-----------------------------------------------------------------------"
$BASEDIR/flash/common/common.sh $BASEDIR/flash/common/
echo "-----------------------------------------------------------------------"
echo "Checking targets..."
echo "Found targets:"
if [ -e $TUFSBOXDIR/release ]; then
echo "Preparing Enigma2..."
$SCRIPTDIR/prepare_root.sh $CURDIR $TUFSBOXDIR/release $TMPROOTDIR $TMPSTORAGEDIR $TMPKERNELDIR
fi
if [ -e $TUFSBOXDIR/release_neutrino ]; then
echo "Preparing Neutrino..."
$SCRIPTDIR/prepare_root_neutrino.sh $CURDIR $TUFSBOXDIR/release_neutrino $TMPROOTDIR $TMPSTORAGEDIR $TMPKERNELDIR
fi
echo "Root prepared"
echo ""
echo "You can customize your image now (i.e. move files you like from ROOT to STORAGE)."
echo "Or insert your changes into scripts/customize.sh"
$SCRIPTDIR/customize.sh $CURDIR $TMPROOTDIR $TMPSTORAGEDIR $TMPKERNELDIR
echo "-----------------------------------------------------------------------"
echo "Creating flash image..."
$SCRIPTDIR/flash_part_w_fw.sh $CURDIR $TUFSBOXDIR $OUTDIR $TMPKERNELDIR $TMPROOTDIR $TMPSTORAGEDIR
echo "-----------------------------------------------------------------------"
AUDIOELFSIZE=`stat -c %s $TMPROOTDIR/lib/firmware/audio.elf`
if [ "$AUDIOELFSIZE" == "0" -o "$AUDIOELFSIZE" == "" ]; then
echo -e "\033[01;31m"
echo "!!! WARNING: AUDIOELF SIZE IS ZERO OR MISSING !!!"
echo "IF YOUR ARE CREATING THE FW PART MAKE SURE THAT YOU USE CORRECT ELFS"
echo "-----------------------------------------------------------------------"
echo -e "\033[00m"
fi
VIDEOELFSIZE=`stat -c %s $TMPROOTDIR/lib/firmware/video.elf`
if [ "$VIDEOELFSIZE" == "0" -o "$VIDEOELFSIZE" == "" ]; then
echo -e "\033[01;31m"
echo "!!! WARNING: VIDEOELF SIZE IS ZERO OR MISSING !!!"
echo "IF YOUR ARE CREATING THE FW PART MAKE SURE THAT YOU USE CORRECT ELFS"
echo "-----------------------------------------------------------------------"
echo -e "\033[00m"
fi
if [ ! -e $TMPROOTDIR/dev/mtd0 ]; then
echo -e "\033[01;31m"
echo "!!! WARNING: DEVS ARE MISSING !!!"
echo "IF YOUR ARE CREATING THE ROOT PART MAKE SURE THAT YOU USE A CORRECT DEV.TAR"
echo "-----------------------------------------------------------------------"
echo -e "\033[00m"
fi
echo ""
echo ""
echo ""
echo "-----------------------------------------------------------------------"
echo "Flashimage created:"
ls -o $OUTDIR | awk -F " " '{print $7}'
echo "-----------------------------------------------------------------------"
echo "UFS910: To flash the created image rename the *.img file to miniFLASH.img"
echo " and copy it to the root (/) of your usb drive."
echo " To start the flashing process press RECORD for 10 sec on your"
echo " remote control while the box is starting."
echo ""
echo "MINI2: To flash the created image rename the *.img file to usb_update.img"
echo " and copy it to the root (/) of your usb drive."
echo " To start the flashing process press POWER for 10 sec on your"
echo " box while the box is starting."
echo ""