6847ffb561cc3b024e0540773eac089f2d1308c4
[debian6500.git] / master / etc / initramfs-tools / scripts / tftp
1 # TRC6500 specific mount sequence -*- shell-script -*-
2
3 mountroot ()
4 {
5 # configure ethernet
6 ipconfig -c dhcp eth0
7
8 mount -t ramfs /dev/ram0 ${rootmnt}
9
10 # download all tarballs
11 for f in $(echo ${tarballs} | sed 's/,/ /g'); do
12 log_begin_msg "download $f"
13 tftp -b 32764 -g -r $f ${tftpserver}
14 log_begin_msg "Extract $f into ${rootmnt}"
15 log_end_msg
16 tar xzf $f -C ${rootmnt} || exec /bin/sh
17 rm -f $f
18 done
19
20 # remove files predeced by tilde
21 for f in $(find ${rootmnt} -name '~*'); do
22 o=$(echo $f | sed 's/\/~/\//')
23 [ -f $o ] && rm -rf $o $f
24 done
25
26 # execute files predeced by plus
27 for f in $(find ${rootmnt} -name '+*'); do
28 [ -x $f ] && ./$f
29 [ -f $f ] && rm -f $f
30 done
31 }