summaryrefslogtreecommitdiff
path: root/package/adkinstall/src/adkinstall.rb4xx
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2010-06-07 12:34:57 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2010-06-07 12:34:57 +0200
commitd22b78be7b2b95ba028c6584e9ee5abb69a375cb (patch)
tree039da0ef61265cda4512279d36aea46c4670a715 /package/adkinstall/src/adkinstall.rb4xx
parent702e216210d58f1301c80d4e55af5d29f813eb19 (diff)
parent2e2eee9052d2c487d7114818ca446c370dba7f49 (diff)
Merge branch 'master' of git+ssh://openadk.org/git/openadk
Diffstat (limited to 'package/adkinstall/src/adkinstall.rb4xx')
-rw-r--r--package/adkinstall/src/adkinstall.rb4xx36
1 files changed, 36 insertions, 0 deletions
diff --git a/package/adkinstall/src/adkinstall.rb4xx b/package/adkinstall/src/adkinstall.rb4xx
new file mode 100644
index 000000000..f96cc7f05
--- /dev/null
+++ b/package/adkinstall/src/adkinstall.rb4xx
@@ -0,0 +1,36 @@
+#!/bin/sh
+# installs a rootfs tar archive from OpenADK onto
+# a NAND device
+# special script for routerboard rb4xx
+
+if [ -z $1 ];then
+ printf "Please give your root tar archive as parameter\n"
+ exit 1
+fi
+
+printf "Preparing mountpoints\n"
+mount -t yaffs2 /dev/mtdblock2 /mnt
+rm -rf /mnt/* >/dev/null 2>&1
+mkdir /mnt/boot
+mount -t yaffs2 /dev/mtdblock1 /mnt/boot
+
+printf "Extracting install archive\n"
+tar -C /mnt -xzpf $1
+if [ $? -ne 0 ];then
+ printf "Extracting of install archive failed"
+ exit 1
+fi
+
+chmod 1777 /mnt/tmp
+chmod 4755 /mnt/bin/busybox
+
+sync
+umount /mnt/boot
+umount /mnt
+if [ $? -ne 0 ];then
+ printf "Unmounting filesystem failed"
+ exit 1
+else
+ printf "Successfully installed.\n"
+ exit 0
+fi