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