Root/bin/fk

Source at commit ba5a392555fd70c6f668f0d9750791f9b35eb179 created 8 years 19 days ago.
By Werner Almesberger, m1/tools/README: m1nor description
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