diff options
author | Waldemar Brodkorb <wbx@openadk.org> | 2010-01-10 15:19:38 +0100 |
---|---|---|
committer | Waldemar Brodkorb <wbx@openadk.org> | 2010-01-10 15:19:38 +0100 |
commit | e268ce3ada4d6a15d48d1065a6e5a2ab80b43cb5 (patch) | |
tree | f0f91fca0b87b6beabbf0797ca0efe16aca00408 /package/base-files/extra/sbin | |
parent | 84b655b833b38f83d5908560914efc6b9d29cbac (diff) |
implement update for foxboard
Diffstat (limited to 'package/base-files/extra/sbin')
-rwxr-xr-x | package/base-files/extra/sbin/update | 11 |
1 files changed, 8 insertions, 3 deletions
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 } |