Move install/* to .
[debian6500.git] / cluster / master / etc / initramfs-tools / scripts / tftp
diff --git a/cluster/master/etc/initramfs-tools/scripts/tftp b/cluster/master/etc/initramfs-tools/scripts/tftp
new file mode 100644 (file)
index 0000000..4e6caa0
--- /dev/null
@@ -0,0 +1,33 @@
+# TRC6500 specific mount sequence  -*- shell-script -*-
+
+mountroot ()
+{
+
+    # configure ethernet
+    ipconfig -c dhcp eth0
+    ipconfig -c dhcp eth1
+
+    mount -t ramfs /dev/ram0 ${rootmnt}
+
+    # download all tarballs
+    for f in $(echo ${tarballs} | sed 's/,/ /g'); do
+        log_begin_msg "download $f"
+        tftp -b 32764 -g -r $f ${tftpserver}
+       log_begin_msg "Extract $f into ${rootmnt}"
+       log_end_msg
+       tar xzf $f -C ${rootmnt} || exec /bin/sh
+       rm -f $f
+    done
+
+    # remove files predeced by tilde
+    for f in $(find ${rootmnt} -name '~*'); do
+        o=$(echo $f | sed 's/\/~/\//')
+        [ -f $o ] && rm -rf $o $f
+    done
+
+    # execute files predeced by plus
+    for f in $(find ${rootmnt} -name '+*'); do
+        [ -x $f ] && ./$f
+        [ -f $f ] && rm -f $f
+    done
+}