1#!/bin/sh
2#
3# /etc/init.d/rcS
4#
5
6echo -n "mounting swap..."
7/sbin/swapon /dev/hdc
8echo "done."
9
10echo -n "setting up network..."
11/sbin/ifconfig eth0 10.0.0.1 txqueuelen 1000
12/sbin/ifconfig lo 127.0.0.1
13
14echo "1" > /proc/sys/net/ipv4/tcp_tw_recycle
15echo "1" > /proc/sys/net/ipv4/tcp_tw_reuse
16echo "1" > /proc/sys/net/ipv4/tcp_window_scaling
17echo "0" > /proc/sys/net/ipv4/tcp_timestamps
18echo "0" > /proc/sys/net/ipv4/tcp_sack
19echo "15" > /proc/sys/net/ipv4/tcp_fin_timeout
20echo "16384" > /proc/sys/net/ipv4/tcp_max_syn_backlog
21echo "262144" > /proc/sys/net/ipv4/ip_conntrack_max
22echo "1024 65535" > /proc/sys/net/ipv4/ip_local_port_range
23echo "10000000 10000000 10000000" > /proc/sys/net/ipv4/tcp_rmem
24echo "10000000 10000000 10000000" > /proc/sys/net/ipv4/tcp_wmem
25echo "10000000 10000000 10000000" > /proc/sys/net/ipv4/tcp_mem
26echo "524287" > /proc/sys/net/core/rmem_max
27echo "524287" > /proc/sys/net/core/wmem_max
28echo "524287" > /proc/sys/net/core/optmem_max
29echo "300000" > /proc/sys/net/core/netdev_max_backlog
30echo "131072" > /proc/sys/fs/file-max
31echo "done."
32
33#if [ ! -x /dev/sda ] 
34#then
35#     mknod /dev/sda b 8 0
36#     mknod /dev/sda1 b 8 1
37#fi
38
39/sbin/insmod /modules/scsi_debug.ko dev_size_mb=80
40
41echo -n "creating partition and formatting..."
42/sbin/mke2fs -F /dev/sda 
43mkdir /nfs
44/bin/mount  /dev/sda /nfs 
45chmod a+rwx /nfs
46echo "done."
47
48echo "/nfs 10.0.0.0/255.0.0.0(rw,sync,no_root_squash)" > /etc/exports
49echo -n "starting nfs kernel server..."
50/sbin/portmap
51/sbin/lockd
52/sbin/statd
53/sbin/nfsd 8
54/sbin/mountd
55echo "done."
56
57echo "Exporting shares..."
58/sbin/exportfs -r -v
59
60echo -n "signal client to mount..."
61sleep 5
62echo "server ready" | netcat -c 10.0.0.2 8000
63echo "done."
64
65echo -n "starting bash shell..."
66/bin/bash
67