From e268ce3ada4d6a15d48d1065a6e5a2ab80b43cb5 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sun, 10 Jan 2010 15:19:38 +0100 Subject: implement update for foxboard --- package/base-files/extra/sbin/update | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'package/base-files/extra/sbin') diff --git a/package/base-files/extra/sbin/update b/package/base-files/extra/sbin/update index 0cd4ee713..c51962f5b 100755 --- a/package/base-files/extra/sbin/update +++ b/package/base-files/extra/sbin/update @@ -6,6 +6,11 @@ if [ $who -ne 0 ]; then exit 1 fi +if [ -x /sbin/mtd ];then + updatecmd="mtd -r write - linux" +else + updatecmd="gunzip -c | tar -xf -" +fi check_exit() { if [ $? -ne 0 ];then @@ -22,19 +27,19 @@ prepare() { extract_from_file() { prepare - cat $1 | gunzip -c | tar -xf - + cat $1 | $updatecmd check_exit } extract_from_ssh() { prepare - ssh $1 "cat $2" | gunzip -c | tar -xf - + ssh $1 "cat $2" | $updatecmd check_exit } extract_from_http() { prepare - wget -O - $1 | gunzip -c | tar -xf - + wget -O - $1 | $updatecmd check_exit } -- cgit v1.2.3