-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit f9a59b3
Showing
105 changed files
with
16,275 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
flash-bs | ||
===== | ||
|
||
Flash for the Duckbox Development Toolchain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#git status excludes the following files (except those line who start with !) | ||
out | ||
tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
#!/bin/bash | ||
if [ `id -u` != 0 ]; then | ||
echo "You are not running this script as root. Try it again as root or with \"sudo ./at7500.sh\"." | ||
echo "Bye Bye..." | ||
exit | ||
fi | ||
|
||
CURDIR=`pwd` | ||
BASEDIR=$CURDIR/../.. | ||
|
||
TUFSBOXDIR=$BASEDIR/tufsbox | ||
|
||
SCRIPTDIR=$CURDIR/scripts | ||
TMPDIR=$CURDIR/tmp | ||
TMPROOTDIR=$TMPDIR/ROOT | ||
TMPEXTDIR=$TMPDIR/EXT | ||
TMPKERNELDIR=$TMPDIR/KERNEL | ||
TMPFWDIR=$TMPDIR/FW | ||
|
||
OUTDIR=$CURDIR/out | ||
|
||
if [ -e $TMPDIR ]; then | ||
rm -rf $TMPDIR/* | ||
fi | ||
|
||
mkdir -p $TMPEXTDIR | ||
mkdir -p $TMPROOTDIR | ||
mkdir -p $TMPKERNELDIR | ||
mkdir -p $TMPFWDIR | ||
|
||
echo "This script creates flashable images for Atevio 7500" | ||
echo "Will probably be adapted in future to support clones." | ||
echo "Author: Schischu, BPanther" | ||
echo "Date: 05-05-2013" | ||
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 target..." | ||
$SCRIPTDIR/prepare_root.sh $CURDIR $TUFSBOXDIR/release $TMPROOTDIR $TMPEXTDIR $TMPKERNELDIR $TMPFWDIR | ||
echo "Root prepared" | ||
echo "Checking if flashtool fup exists..." | ||
if [ ! -e $CURDIR/fup ]; then | ||
echo "Flashtool fup is missing, trying to compile it..." | ||
cd $CURDIR/../common/fup.src | ||
$CURDIR/../common/fup.src/compile.sh USE_ZLIB | ||
mv $CURDIR/../common/fup.src/fup $CURDIR/fup | ||
cd $CURDIR | ||
if [ ! -e $CURDIR/fup ]; then | ||
echo "Compiling failed! Exiting..." | ||
echo "It the error is \"cannot find -lz\" than you need to install the 32bit version of libz" | ||
exit 3 | ||
else | ||
echo "Compiling successfull" | ||
fi | ||
fi | ||
|
||
echo "Flashtool fup exists" | ||
echo "-----------------------------------------------------------------------" | ||
echo "Creating flash image..." | ||
$SCRIPTDIR/flash_part_w_fw.sh $CURDIR $TUFSBOXDIR $OUTDIR $TMPKERNELDIR $TMPFWDIR $TMPROOTDIR $TMPEXTDIR | ||
echo "-----------------------------------------------------------------------" | ||
AUDIOELFSIZE=`stat -c %s $TMPFWDIR/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 $TMPFWDIR/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 "To flash the created image copy the *.ird file to the root (/) of your usb drive." | ||
echo "To start the flashing process press CH UP for 10 sec on your box while the box is starting." | ||
echo "" |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/bin/bash | ||
|
||
CURDIR=$1 | ||
TUFSBOXDIR=$2 | ||
OUTDIR=$3 | ||
TMPFWDIR=$4 | ||
|
||
echo "CURDIR = $CURDIR" | ||
echo "TUFSBOXDIR = $TUFSBOXDIR" | ||
echo "OUTDIR = $OUTDIR" | ||
echo "TMPFWDIR = $TMPFWDIR" | ||
|
||
MKFSJFFS2=$TUFSBOXDIR/host/bin/mkfs.jffs2 | ||
SUMTOOL=$TUFSBOXDIR/host/bin/sumtool | ||
PAD=$CURDIR/../common/pad | ||
FUP=$CURDIR/fup | ||
|
||
OUTFILE=$OUTDIR/update_fw.ird | ||
|
||
if [ ! -e $OUTDIR ]; then | ||
mkdir $OUTDIR | ||
fi | ||
|
||
if [ -e $OUTFILE ]; then | ||
rm -f $OUTFILE | ||
rm -f $OUTFILE.md5 | ||
fi | ||
|
||
# Create a jffs2 partition for fw's | ||
# Size 6.875 MB = -p0x6E0000 | ||
# Folder which contains fw's is -r fw | ||
# e.g. | ||
# . | ||
# ./fw | ||
# ./fw/audio.elf | ||
# ./fw/video.elf | ||
$MKFSJFFS2 -qUfv -p0x6E0000 -e0x20000 -r $TMPFWDIR -o $CURDIR/mtd_fw.bin | ||
$SUMTOOL -v -p -e 0x20000 -i $CURDIR/mtd_fw.bin -o $CURDIR/mtd_fw.sum.bin | ||
$PAD 0x6E0000 $CURDIR/mtd_fw.sum.bin $CURDIR/mtd_fw.sum.pad.bin | ||
|
||
# Create a fortis signed update file for fw's | ||
echo "CMD: $FUP -ce $OUTFILE -f $CURDIR/mtd_fw.sum.pad.bin" | ||
$FUP -ce $OUTFILE -f $CURDIR/mtd_fw.sum.pad.bin | ||
|
||
rm -f $CURDIR/mtd_fw.bin | ||
rm -f $CURDIR/mtd_fw.sum.bin | ||
rm -f $CURDIR/mtd_fw.sum.pad.bin | ||
|
||
zip -j $OUTFILE.zip $OUTFILE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
|
||
CURDIR=$1 | ||
TUFSBOXDIR=$2 | ||
OUTDIR=$3 | ||
TMPKERNELDIR=$4 | ||
|
||
echo "CURDIR = $CURDIR" | ||
echo "TUFSBOXDIR = $TUFSBOXDIR" | ||
echo "OUTDIR = $OUTDIR" | ||
echo "TMPKERNELDIR = $TMPKERNELDIR" | ||
|
||
MKFSJFFS2=$TUFSBOXDIR/host/bin/mkfs.jffs2 | ||
FUP=$CURDIR/fup | ||
|
||
OUTFILE=$OUTDIR/update_kernel.ird | ||
|
||
if [ ! -e $OUTDIR ]; then | ||
mkdir $OUTDIR | ||
fi | ||
|
||
if [ -e $OUTFILE ]; then | ||
rm -f $OUTFILE | ||
fi | ||
|
||
cp $TMPKERNELDIR/uImage $CURDIR/uImage | ||
|
||
# Create a fortis signed update file for fw's | ||
$FUP -ce $OUTFILE -k $CURDIR/uImage | ||
|
||
rm -f $CURDIR/uImage | ||
|
||
zip -j $OUTFILE.zip $OUTFILE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
#!/bin/bash | ||
|
||
CURDIR=$1 | ||
TUFSBOXDIR=$2 | ||
OUTDIR=$3 | ||
TMPKERNELDIR=$4 | ||
TMPFWDIR=$5 | ||
TMPROOTDIR=$6 | ||
TMPEXTDIR=$7 | ||
|
||
echo "CURDIR = $CURDIR" | ||
echo "TUFSBOXDIR = $TUFSBOXDIR" | ||
echo "OUTDIR = $OUTDIR" | ||
echo "TMPKERNELDIR = $TMPKERNELDIR" | ||
echo "TMPFWDIR = $TMPFWDIR" | ||
echo "TMPROOTDIR = $TMPROOTDIR" | ||
echo "TMPEXTDIR = $TMPEXTDIR" | ||
|
||
MKFSJFFS2=$TUFSBOXDIR/host/bin/mkfs.jffs2 | ||
SUMTOOL=$TUFSBOXDIR/host/bin/sumtool | ||
PAD=$CURDIR/../common/pad | ||
FUP=$CURDIR/fup | ||
|
||
HOST=`cat $TMPEXTDIR/etc/hostname` | ||
|
||
. $CURDIR/../common/gitversion.sh $CURDIR | ||
|
||
OUTFILE=$OUTDIR/update_w_fw.ird | ||
OUTFILE_Z=$OUTDIR/$HOST$gitversion | ||
|
||
if [ ! -e $OUTDIR ]; then | ||
mkdir $OUTDIR | ||
fi | ||
|
||
if [ -e $OUTFILE ]; then | ||
rm -f $OUTFILE | ||
rm -f $OUTFILE.md5 | ||
fi | ||
|
||
cp $TMPKERNELDIR/uImage $OUTDIR/uImage.bin | ||
|
||
# Create a jffs2 partition for fw's | ||
# Size 6.875 MB = -p0x6E0000 | ||
# Folder which contains fw's is -r fw | ||
# e.g. | ||
# . | ||
# ./fw | ||
# ./fw/audio.elf | ||
# ./fw/video.elf | ||
echo "MKFSJFFS2 -qUfv -p0x6E0000 -e0x20000 -r $TMPFWDIR -o $OUTDIR/mtd_fw.bin" | ||
$MKFSJFFS2 -qUfv -p0x6E0000 -e0x20000 -r $TMPFWDIR -o $OUTDIR/mtd_fw.bin > /dev/null | ||
echo "SUMTOOL -v -p -e 0x20000 -i $OUTDIR/mtd_fw.bin -o $OUTDIR/mtd_fw.sum.bin" | ||
$SUMTOOL -v -p -e 0x20000 -i $OUTDIR/mtd_fw.bin -o $OUTDIR/mtd_fw.sum.bin > /dev/null | ||
echo "PAD 0x6E0000 $OUTDIR/mtd_fw.sum.bin $OUTDIR/mtd_fw.sum.pad.bin" | ||
$PAD 0x6E0000 $OUTDIR/mtd_fw.sum.bin $OUTDIR/mtd_fw.sum.pad.bin | ||
|
||
# Create a jffs2 partition for ext | ||
# 0x01220000 - 0x01DFFFFF (11.875 MB) | ||
# Should be p0xBE0000 but due to a bug in stock uboot the size had to be decreased | ||
$MKFSJFFS2 -qUfv -p0xBA0000 -e0x20000 -r $TMPEXTDIR -o $OUTDIR/mtd_ext.bin | ||
$SUMTOOL -v -p -e 0x20000 -i $OUTDIR/mtd_ext.bin -o $OUTDIR/mtd_ext.sum.bin | ||
$PAD 0xBA0000 $OUTDIR/mtd_ext.sum.bin $OUTDIR/mtd_ext.sum.pad.bin | ||
|
||
# Create a jffs2 partition for root | ||
# Size 30 MB = -p0x1E00000 | ||
# Folder which contains fw's is -r fw | ||
# e.g. | ||
# . | ||
# ./release | ||
# ./release/etc | ||
# ./release/usr | ||
echo "MKFSJFFS2 -qUfv -p0x1E00000 -e0x20000 -r $TMPROOTDIR -o $OUTDIR/mtd_root.bin" | ||
$MKFSJFFS2 -qUfv -p0x1E00000 -e0x20000 -r $TMPROOTDIR -o $OUTDIR/mtd_root.bin > /dev/null | ||
echo "SUMTOOL -v -p -e 0x20000 -i $OUTDIR/mtd_root.bin -o $OUTDIR/mtd_root.sum.bin" | ||
$SUMTOOL -v -p -e 0x20000 -i $OUTDIR/mtd_root.bin -o $OUTDIR/mtd_root.sum.bin > /dev/null | ||
echo "PAD 0x1E00000 $OUTDIR/mtd_root.sum.bin $OUTDIR/mtd_root.sum.pad.bin" | ||
$PAD 0x1E00000 $OUTDIR/mtd_root.sum.bin $OUTDIR/mtd_root.sum.pad.bin | ||
|
||
# Create a fortis signed update file for fw's | ||
# Note: -g is a workaround which will be removed as soon as the missing conf partition is found | ||
# Note: -e could be used as a extension partition but at the moment we dont use it | ||
echo "FUP -ce $OUTFILE -k $OUTDIR/uImage.bin -f $OUTDIR/mtd_fw.sum.pad.bin -g foo -e foo -r $OUTDIR/mtd_root.sum.pad.bin" | ||
$FUP -ce $OUTFILE -k $OUTDIR/uImage.bin -f $OUTDIR/mtd_fw.sum.pad.bin -r $OUTDIR/mtd_root.sum.pad.bin -g foo -e $OUTDIR/mtd_ext.sum.pad.bin | ||
|
||
rm -f $OUTDIR/uImage.bin | ||
rm -f $OUTDIR/mtd_fw.bin | ||
rm -f $OUTDIR/mtd_fw.sum.bin | ||
rm -f $OUTDIR/mtd_fw.sum.pad.bin | ||
rm -f $OUTDIR/mtd_root.bin | ||
rm -f $OUTDIR/mtd_root.sum.bin | ||
rm -f $OUTDIR/mtd_root.sum.pad.bin | ||
rm -f $OUTDIR/mtd_ext.bin | ||
rm -f $OUTDIR/mtd_ext.sum.bin | ||
rm -f $OUTDIR/mtd_ext.sum.pad.bin | ||
|
||
md5sum -b $OUTFILE | awk -F' ' '{print $1}' > $OUTFILE.md5 | ||
zip -j $OUTFILE_Z.zip $OUTFILE $OUTFILE.md5 | ||
rm -f $OUTFILE | ||
rm -f $OUTFILE.md5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#!/bin/bash | ||
|
||
CURDIR=$1 | ||
TUFSBOXDIR=$2 | ||
OUTDIR=$3 | ||
TMPKERNELDIR=$4 | ||
TMPROOTDIR=$5 | ||
TMPEXTDIR=$6 | ||
|
||
echo "CURDIR = $CURDIR" | ||
echo "TUFSBOXDIR = $TUFSBOXDIR" | ||
echo "OUTDIR = $OUTDIR" | ||
echo "TMPKERNELDIR = $TMPKERNELDIR" | ||
echo "TMPROOTDIR = $TMPROOTDIR" | ||
echo "TMPEXTDIR = $TMPEXTDIR" | ||
|
||
MKFSJFFS2=$TUFSBOXDIR/host/bin/mkfs.jffs2 | ||
SUMTOOL=$TUFSBOXDIR/host/bin/sumtool | ||
PAD=$CURDIR/../common/pad | ||
FUP=$CURDIR/fup | ||
|
||
OUTFILE=$OUTDIR/update_wo_fw.ird | ||
|
||
if [ ! -e $OUTDIR ]; then | ||
mkdir $OUTDIR | ||
fi | ||
|
||
if [ -e $OUTFILE ]; then | ||
rm -f $OUTFILE | ||
fi | ||
|
||
cp $TMPKERNELDIR/uImage $CURDIR/uImage | ||
|
||
# Create a jffs2 partition for root | ||
# Size 30 MB = -p0x1E00000 | ||
# Folder which contains fw's is -r fw | ||
# e.g. | ||
# . | ||
# ./release | ||
# ./release/etc | ||
# ./release/usr | ||
$MKFSJFFS2 -qUfv -p0x1E00000 -e0x20000 -r $TMPROOTDIR -o $CURDIR/mtd_root.bin | ||
$SUMTOOL -v -p -e 0x20000 -i $CURDIR/mtd_root.bin -o $CURDIR/mtd_root.sum.bin | ||
$PAD 0x1E00000 $CURDIR/mtd_root.sum.bin $CURDIR/mtd_root.sum.pad.bin | ||
|
||
# Create a jffs2 partition for ext | ||
# 0x01220000 - 0x01DFFFFF (11.875 MB) | ||
# Should be p0xBE0000 but due to a bug in stock uboot the size had to be decreased | ||
$MKFSJFFS2 -qUfv -p0xBC0000 -e0x20000 -r $TMPEXTDIR -o $CURDIR/mtd_ext.bin | ||
$SUMTOOL -v -p -e 0x20000 -i $CURDIR/mtd_ext.bin -o $CURDIR/mtd_ext.sum.bin | ||
$PAD 0xBC0000 $CURDIR/mtd_ext.sum.bin $CURDIR/mtd_ext.sum.pad.bin | ||
|
||
# Create a fortis signed update file for fw's | ||
# Note: -g is a workaround which will be removed as soon as the missing conf partition is found | ||
# Note: -e could be used as a extension partition but at the moment we dont use it | ||
$FUP -ce $OUTFILE -k $CURDIR/uImage -r $CURDIR/mtd_root.sum.pad.bin -g foo -e $CURDIR/mtd_ext.sum.pad.bin | ||
|
||
rm -f $CURDIR/uImage | ||
rm -f $CURDIR/mtd_root.bin | ||
rm -f $CURDIR/mtd_root.sum.bin | ||
rm -f $CURDIR/mtd_root.sum.pad.bin | ||
rm -f $CURDIR/mtd_ext.bin | ||
rm -f $CURDIR/mtd_ext.sum.bin | ||
rm -f $CURDIR/mtd_ext.sum.pad.bin | ||
|
||
zip -j $OUTFILE.zip $OUTFILE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash | ||
|
||
CURDIR=$1 | ||
RELEASEDIR=$2 | ||
|
||
TMPROOTDIR=$3 | ||
TMPEXTDIR=$4 | ||
TMPKERNELDIR=$5 | ||
TMPFWDIR=$6 | ||
|
||
find $RELEASEDIR -mindepth 1 -maxdepth 1 -exec cp -at$TMPROOTDIR -- {} + | ||
|
||
if [ ! -e $TMPROOTDIR/dev/mtd0 ]; then | ||
cd $TMPROOTDIR/dev/ | ||
if [ -e $TMPROOTDIR/var/etc/init.d/makedev ]; then | ||
$TMPROOTDIR/var/etc/init.d/makedev start | ||
else | ||
$TMPROOTDIR/etc/init.d/makedev start | ||
fi | ||
cd - | ||
fi | ||
|
||
mv $TMPROOTDIR/var/* $TMPEXTDIR | ||
mv $TMPROOTDIR/boot/uImage $TMPKERNELDIR/uImage | ||
rm -fr $TMPROOTDIR/boot | ||
mv $TMPROOTDIR/lib/firmware/* $TMPFWDIR | ||
|
||
# mini-rcS and inittab | ||
rm -f $TMPROOTDIR/etc | ||
mkdir -p $TMPROOTDIR/etc/init.d | ||
echo "#!/bin/sh" > $TMPROOTDIR/etc/init.d/rcS | ||
echo "mount -n -t proc proc /proc" >> $TMPROOTDIR/etc/init.d/rcS | ||
echo "mount -t jffs2 -o rw,noatime,nodiratime /dev/mtdblock2 /lib/firmware" >> $TMPROOTDIR/etc/init.d/rcS | ||
echo "mount -t jffs2 -o rw,noatime,nodiratime /dev/mtdblock3 /var" >> $TMPROOTDIR/etc/init.d/rcS | ||
echo "mount --bind /var/etc /etc" >> $TMPROOTDIR/etc/init.d/rcS | ||
echo "/etc/init.d/rcS &" >> $TMPROOTDIR/etc/init.d/rcS | ||
chmod 755 $TMPROOTDIR/etc/init.d/rcS | ||
cp -f $TMPEXTDIR/etc/inittab $TMPROOTDIR/etc |
Oops, something went wrong.