3dfaa361 |
1 | #! /bin/sh |
2 | |
3 | # install a diskless workstation |
4 | # this is just an example, but not perfect code |
5 | # |
6 | # (c) Thomas Lange, 2001, lange at debian.org |
7 | |
8 | # server and all filesystems for diskless client |
9 | server=...... # Fill in your server's name |
10 | root=/export/$HOSTNAME # Change according to your situation |
11 | var= |
12 | swap= |
13 | |
14 | # Under lenny, the mount point does not exist at this stage yet. |
15 | [ ! -d $target ] && mkdir $target |
16 | |
17 | # dpkg wants a lock but linux NFS can't do it yet |
18 | mountopt="-o nolock,async" |
19 | # Add the options which helped to speed up diskless machines under etch. |
20 | mountopt=${mountopt},tcp,intr,rsize=8192,wsize=8192,retrans=10 |
21 | |
22 | # mount2dir can't mount nfs directories yet, so do it now |
23 | # and skip the default task later |
24 | # also clean up the directories (preserve is not yet possible) |
25 | mount $mountopt $server:$root $target |
26 | echo 'Deleting target files from previous OS may take some time...' |
27 | echo 'You may help a little by deleting files yourself on the server.' |
28 | #rm -rf $target/.[0-z]* $target/* |
29 | (cd $target; mklost+found) |
30 | |
31 | # create fstab |
32 | cat > /tmp/fai/fstab <<EOF |
33 | $server:$root / nfs rw,errors=remount-ro 0 0 |
34 | EOF |
35 | # $server:$usr /usr nfs rw 0 0 |
36 | |
37 | echo "#!" > $LOGDIR/disk_var.sh |
38 | |
39 | # now skip some default tasks |
40 | skiptask partition mountdisks |