Date:2011-05-24 15:34:19 (12 years 10 months ago)
Author:Werner Almesberger
Commit:387e6dd0949887bc1bf96445aaad75e7424850d6
Message:bin/fk: little helper script to flash the kernel via SSH or usbboot

Files: bin/fk (1 diff)

Change Details

bin/fk
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

Archive Download the corresponding diff file

Branches:
master



interactive