mirror of
git://projects.qi-hardware.com/wernermisc.git
synced 2024-11-15 11:20:17 +02:00
bin/fk: little helper script to flash the kernel via SSH or usbboot
This commit is contained in:
parent
5ae2c4677f
commit
387e6dd094
26
bin/fk
Executable file
26
bin/fk
Executable file
@ -0,0 +1,26 @@
|
|||||||
|
#!/bin/sh -e
|
||||||
|
if [ "${1#usb}" = "$1" ]; then
|
||||||
|
if ! ping -c 1 -w 1 "$1" >/dev/null; then
|
||||||
|
echo "no ping response from $1" 1>&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
NN=$1
|
||||||
|
else
|
||||||
|
NN=`ifconfig ${1:-usb0} |
|
||||||
|
sed '/.*inet addr:\([^ ]*\).*/{s//\1/;s/100$/101/;s/200$/202/;p;};d'`
|
||||||
|
fi
|
||||||
|
if [ "$NN" ]; then
|
||||||
|
echo "SCP to $NN" 1>&2
|
||||||
|
scp uImage $NN:
|
||||||
|
ssh $NN 'PATH=$PATH:/usr/sbin;
|
||||||
|
flash_eraseall /dev/mtd1 && nandwrite -p /dev/mtd1 uImage &&
|
||||||
|
rm -f uImage && sync && sleep 1 && sync && sleep 1 && /sbin/reboot -f'
|
||||||
|
else
|
||||||
|
echo "usbboot with idbg" 1>&2
|
||||||
|
idbg-nnboot usb
|
||||||
|
idbg-reset
|
||||||
|
sleep 3
|
||||||
|
usbboot -c "boot;nprog 1024 uImage 0 0 -n"
|
||||||
|
idbg-nnboot nand
|
||||||
|
idbg-reset
|
||||||
|
fi
|
Loading…
Reference in New Issue
Block a user