summaryrefslogtreecommitdiff
path: root/test/TEST-20-NFS/server-init.sh
blob: c3c023890c7670ca2365ec58d62121c7899e52c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/sh
exec >/dev/console 2>&1
set -x
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
export TERM=linux
export PS1='nfstest-server:\w\$ '
echo > /dev/watchdog
stty sane
echo "made it to the rootfs!"
echo server > /proc/sys/kernel/hostname
ip addr add 127.0.0.1/8 dev lo
ip link set lo up
ip addr add 192.168.50.1/24 dev eth0
ip addr add 192.168.50.2/24 dev eth0
ip addr add 192.168.50.3/24 dev eth0
ip link set eth0 up
echo > /dev/watchdog
mount --bind /nfs/client /nfs/nfs3-5
echo > /dev/watchdog
mount --bind /nfs/client /nfs/ip/192.168.50.101
echo > /dev/watchdog
mount --bind /nfs/client /nfs/tftpboot/nfs4-5
echo > /dev/watchdog
modprobe sunrpc
echo > /dev/watchdog
mount -t rpc_pipefs sunrpc /var/lib/nfs/rpc_pipefs
echo > /dev/watchdog
[ -x /sbin/portmap ] && portmap
echo > /dev/watchdog
[ -x /sbin/rpcbind ] && rpcbind
echo > /dev/watchdog
modprobe nfsd
echo > /dev/watchdog
mount -t nfsd nfsd /proc/fs/nfsd
echo > /dev/watchdog
exportfs -r
echo > /dev/watchdog
rpc.nfsd
echo > /dev/watchdog
rpc.mountd
echo > /dev/watchdog
rpc.idmapd
echo > /dev/watchdog
exportfs -r
echo > /dev/watchdog
>/var/lib/dhcpd/dhcpd.leases
echo > /dev/watchdog
chmod 777 /var/lib/dhcpd/dhcpd.leases
echo > /dev/watchdog
dhcpd -cf /etc/dhcpd.conf -lf /var/lib/dhcpd/dhcpd.leases
echo -n "V" > /dev/watchdog
echo "Serving NFS mounts"
while :; do sleep 30; done
mount -n -o remount,ro /
poweroff -f