Initial commit

master
informatic 2016-01-27 02:08:18 +01:00
commit 6ed69c9df6
7 changed files with 51 additions and 0 deletions

2
data/config Normal file
View File

@ -0,0 +1,2 @@
openwrt-ar71xx-generic-zsun-sdreader-kernel.bin:S:/dev/mtd3
openwrt-ar71xx-generic-zsun-sdreader-rootfs-squashfs.bin:S:/dev/mtd2

BIN
data/minreboot Executable file

Binary file not shown.

10
data/mtd_write Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
cp ./minreboot /tmp
chmod +x /tmp/minreboot
./mtd_write.actual write openwrt-ar71xx-generic-zsun-sdreader-kernel.bin /dev/mtd3
./mtd_write.actual write openwrt-ar71xx-generic-zsun-sdreader-rootfs-squashfs.bin /dev/mtd2
/tmp/minreboot
# aaaaand there we go ,_,

BIN
data/mtd_write.actual Executable file

Binary file not shown.

21
flashfirmware Executable file
View File

@ -0,0 +1,21 @@
#!/bin/bash
echo "** Building firmware"
. ./makefirmware
UPDATEFILE=${MODEL}-update.tar.gz
echo -n "** Switching mode..."
curl http://10.168.168.1:8080/goform/Setcardworkmode?workmode=0
echo
echo "** Uploading firmware"
while ! smbclient \\\\10.168.168.1\\public -U Admin%xxx -c "mkdir .update ; cd .update ; put ${UPDATEFILE}"; do
echo -n "!! smbclient failed, retrying ... "
sleep 3
done
echo -n "** Now doing system update ... "
curl http://10.168.168.1:8080/goform/upFirmWare
echo '** If command above returned {"status":2} your device should now blink for a while and then reboot'

10
makefirmware Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
VERSION=${VERSION:-1.1}
MODEL=${MODEL:-SD100}
OUTDIR=${OUTDIR:-$(dirname $0)}
DATADIR=${DATADIR:-$(dirname $0)/data}
tar zcvf $OUTDIR/intermediate-v${VERSION}.tar.gz -C $DATADIR .
md5sum $OUTDIR/intermediate-v${VERSION}.tar.gz | cut -d ' ' -f 1 > md5
tar zcvf $OUTDIR/${MODEL}-update.tar.gz $OUTDIR/intermediate-v${VERSION}.tar.gz md5

8
minreboot.c Normal file
View File

@ -0,0 +1,8 @@
#include <unistd.h>
#include <linux/reboot.h>
int main(int argc, char *argv[])
{
reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, LINUX_REBOOT_CMD_RESTART, NULL);
return 0;
}