mirror of
git://projects.qi-hardware.com/openwrt-packages.git
synced 2025-04-21 12:27:27 +03:00
nanonote-files: cleanup the file structure. update version to 201204
This commit is contained in:
116
nanonote-files/base-files/usr/bin/mtd.nn
Executable file
116
nanonote-files/base-files/usr/bin/mtd.nn
Executable file
@@ -0,0 +1,116 @@
|
||||
#!/bin/sh
|
||||
|
||||
__VERSION__=2011-03-07
|
||||
|
||||
if [ "$1" == "flash" ] && [ "$#" == "3" ]; then
|
||||
case "$2" in
|
||||
"bootloader")
|
||||
echo "not implenment"
|
||||
#flash_eraseall /dev/mtd0
|
||||
exit 0
|
||||
;;
|
||||
"kernel")
|
||||
echo "flashing kernel ..."
|
||||
flash_eraseall /dev/mtd1
|
||||
nandwrite -p /dev/mtd1 "$3"
|
||||
exit 0
|
||||
;;
|
||||
"rootfs")
|
||||
echo "flashing rootfs ..."
|
||||
ubiformat /dev/mtd2 -f "$3"
|
||||
exit 0
|
||||
;;
|
||||
"data")
|
||||
echo "flashing data partition ..."
|
||||
ubiformat /dev/mtd3 -f "$3"
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if [ "$1" == "mount" ] && [ "$#" == "3" ]; then
|
||||
if [ "$2" == "rootfs" ] || [ "$2" == "data" ]; then
|
||||
MOUNT_POINT="$3"
|
||||
if [ "$2" == "rootfs" ]; then
|
||||
PARTITION="2"
|
||||
elif [ "$2" == "data" ]; then
|
||||
PARTITION="3"
|
||||
fi
|
||||
|
||||
mkdir -p $MOUNT_POINT
|
||||
if [ "$?" != "0" ]; then
|
||||
echo "mkdir -p $MOUNT_POINT Fail"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ubiattach /dev/ubi_ctrl -m ${PARTITION}
|
||||
DEV_UBI=`dmesg | grep "UBI: attached mtd${PARTITION} to" | cut -d ":" -f 2 | cut -d " " -f 5`
|
||||
mount -t ubifs ${DEV_UBI}_0 $MOUNT_POINT
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$1" == "format_data_default" ]; then
|
||||
ubiformat /dev/mtd3 -y
|
||||
ubiattach /dev/ubi_ctrl -m 3
|
||||
ubimkvol /dev/ubi1 -s 1480MiB -N data
|
||||
# test in xiangfu's nanonote. 1486 is the MAX size we can make
|
||||
# so we using 1480 for now
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$1" == "fw_setenv_default" ]; then
|
||||
fw_setenv bootargs mem=32M console=tty0 console=ttyS0,57600n8 ubi.mtd=2 rootfstype=ubifs root=ubi0:rootfs rw rootwait consoleblank=30 quiet
|
||||
fw_setenv bootcmd nand read 0x80600000 0x400000 0x280000\;bootm
|
||||
fw_setenv bootargsfromsd mem=32M console=tty0 console=ttyS0,57600n8 rootfstype=ext2 root=/dev/mmcblk0p1 rw rootwait
|
||||
fw_setenv bootcmdfromsd mmc init\; ext2load mmc 0 0x80600000 /boot/uImage\; bootm
|
||||
fw_setenv bootdelay 0
|
||||
fw_setenv baudrate 57600
|
||||
fw_setenv loads_echo 1
|
||||
fw_setenv stdin serial
|
||||
fw_setenv stderr serial
|
||||
fw_setenv stdout serial
|
||||
fw_setenv bootcmdf1 mmc init\; ext2load mmc 0:1 0x80600000 /boot/uImage\; bootm
|
||||
fw_setenv bootargsf1 mem=32M console=tty0 console=ttyS0,57600n8 rootfstype=ext2 root=/dev/mmcblk0p1 rw rootwait
|
||||
fw_setenv bootcmdf2 mmc init\; ext2load mmc 0:2 0x80600000 /boot/uImage\; bootm
|
||||
fw_setenv bootargsf2 mem=32M console=tty0 console=ttyS0,57600n8 rootfstype=ext2 root=/dev/mmcblk0p2 rw rootwait
|
||||
fw_setenv bootcmdf3 mmc init\; ext2load mmc 0:3 0x80600000 /boot/uImage\; bootm
|
||||
fw_setenv bootargsf3 mem=32M console=tty0 console=ttyS0,57600n8 rootfstype=ext2 root=/dev/mmcblk0p3 rw rootwait
|
||||
fw_setenv bootcmdf4 mtdparts default\;ubi part rootfs\;ubifsmount rootfs\;ubifsload 0x80600000 /boot/uImage\; bootm
|
||||
fw_setenv bootargsf4 mem=32M console=tty0 console=ttyS0,57600n8 ubi.mtd=2 rootfstype=ubifs root=ubi0:rootfs rw rootwait
|
||||
fw_setenv silent 1
|
||||
echo "fw_setenv finished, check u-boot env by fw_printenv"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "\
|
||||
Usage: $0 [ command ] [ <para1> <para2> <para3> ]
|
||||
flash bootloader|kernel|rootfs|data image_file
|
||||
flash nand partition using <image_file>
|
||||
|
||||
mount rootfs|data mount_point
|
||||
mount nand partition
|
||||
|
||||
format_data_default
|
||||
lookinside for more detari
|
||||
NOTICE:
|
||||
this command will format data
|
||||
partition, create a default
|
||||
1400MB volume, named 'data',
|
||||
ALL data will lost after run.
|
||||
|
||||
fw_setenv_default
|
||||
reset bootloader default variable
|
||||
lookinside for more detail
|
||||
NOTICE:
|
||||
this command write hardcode
|
||||
variables to nand, so it must
|
||||
run once before you want change
|
||||
change it.
|
||||
|
||||
script file for Qi Hardware Ben NanoNote
|
||||
written by: Xiangfu Liu (xiangfu@sharism.cc)
|
||||
written with Emacs in Ben NanoNote
|
||||
version: ${__VERSION__}
|
||||
Report bugs to developer@lists.qi-hardware.com"
|
||||
exit 0
|
||||
36
nanonote-files/base-files/usr/bin/pick-pdf
Executable file
36
nanonote-files/base-files/usr/bin/pick-pdf
Executable file
@@ -0,0 +1,36 @@
|
||||
#! /bin/bash
|
||||
|
||||
export CMD=nupdf
|
||||
export EXT=pdf
|
||||
|
||||
export i=0
|
||||
|
||||
export PDF_PATH=~/
|
||||
|
||||
echo -e `basename $0` "\t\tVersion: 2012-02-02"
|
||||
echo "Searching for *.$EXT files. It may take a while..."
|
||||
echo " "
|
||||
|
||||
rm -f /tmp/fsel.tmp 2>/dev/null
|
||||
touch /tmp/fsel.tmp
|
||||
for aa in `find ${PDF_PATH} -name "*.$EXT" -type f -print` ; do
|
||||
i=`expr $i + 1` ;
|
||||
echo $i $aa >>/tmp/fsel.tmp ;
|
||||
done
|
||||
|
||||
export B=`cat /tmp/fsel.tmp`
|
||||
if [ "$B" == "" ]; then
|
||||
echo "No pdf file found"
|
||||
exit
|
||||
fi
|
||||
|
||||
export A=`dialog --menu "Select a File" 0 50 20 $B --stdout`
|
||||
|
||||
if test $A > 0
|
||||
then
|
||||
export C=`grep "^$A" /tmp/fsel.tmp`
|
||||
export D=`echo $C | cut -d' ' -f2 -`
|
||||
$CMD $D
|
||||
else
|
||||
echo "No file selected!"
|
||||
fi
|
||||
14
nanonote-files/base-files/usr/bin/wav2png
Executable file
14
nanonote-files/base-files/usr/bin/wav2png
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
#usage: wav2png.sh file.wav
|
||||
|
||||
BASE=${1%.wav}
|
||||
PNG=$BASE.png
|
||||
WAV=$BASE.wav
|
||||
DAT=$BASE.dat
|
||||
|
||||
#echo $BASE,$PNG,$WAV,$DAT
|
||||
sox $WAV $DAT
|
||||
grep -v '^;' $DAT >$DAT.clean
|
||||
FREQ=`head -1 $DAT|tr -d ';'`
|
||||
|
||||
echo -e "set terminal png; set title '$FREQ';set output '$PNG'; plot '$DAT.clean' w l lt 2" | gnuplot
|
||||
31
nanonote-files/base-files/usr/bin/wpan.nn
Executable file
31
nanonote-files/base-files/usr/bin/wpan.nn
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
cd /lib/modules/`uname -r`
|
||||
|
||||
echo jz4740-mmc.0 > /sys/bus/platform/drivers/jz4740-mmc/unbind
|
||||
insmod at86rf230.ko
|
||||
insmod spi_atben.ko
|
||||
|
||||
cd ${HOME}
|
||||
|
||||
iz add wpan-phy0
|
||||
if [ "$1" == "2" ]; then
|
||||
ip link set wpan0 address de:ad:be:af:ca:fe:ba:b2
|
||||
else
|
||||
ip link set wpan0 address de:ad:be:af:ca:fe:ba:b1
|
||||
fi
|
||||
ifconfig wpan0 up
|
||||
|
||||
if [ "$1" == "2" ]; then
|
||||
iz assoc wpan0 777 1 11 short
|
||||
|
||||
izchat 777 8001 1
|
||||
#dirtpan 777 8001 1 'ifconfig tun0 10.8.0.2 dstaddr 10.8.0.1 up' &
|
||||
else
|
||||
rm -f /tmp/lease
|
||||
izcoordinator -d 1 -l /tmp/lease -i wpan0 -p 0x777 -s 1 -c 11 &
|
||||
|
||||
izchat 777 1 8001
|
||||
#dirtpan 777 1 8001 'ifconfig tun0 10.8.0.1 dstaddr 10.8.0.2 up' &
|
||||
fi
|
||||
Reference in New Issue
Block a user