Root/bin/fk

Source at commit 3f820dc41d82c78d972efe3c69f139f209a742f9 created 9 years 13 days ago.
By Werner Almesberger, cad/test2/README: added more results and cleaned up the text
1#!/bin/sh -e
2if [ "${1#usb}" = "$1" ]; then
3    if ! ping -c 1 -w 1 "$1" >/dev/null; then
4    echo "no ping response from $1" 1>&2
5    exit 1
6    fi
7    NN=$1
8else
9    NN=`ifconfig ${1:-usb0} |
10      sed '/.*inet addr:\([^ ]*\).*/{s//\1/;s/100$/101/;s/200$/202/;p;};d'`
11fi
12if [ "$NN" ]; then
13    echo "SCP to $NN" 1>&2
14    scp uImage $NN:
15    ssh $NN 'PATH=$PATH:/usr/sbin;
16      flash_eraseall /dev/mtd1 && nandwrite -p /dev/mtd1 uImage &&
17      rm -f uImage && sync && sleep 1 && sync && sleep 1 && /sbin/reboot -f'
18else
19    echo "usbboot with idbg" 1>&2
20    idbg-nnboot usb
21    idbg-reset
22    sleep 3
23    usbboot -c "boot;nprog 1024 uImage 0 0 -n"
24    idbg-nnboot nand
25    idbg-reset
26fi
27

Archive Download this file

Branches:
master



interactive