| 27 |
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 28 |
#********************************************************************* |
#********************************************************************* |
| 29 |
|
|
| 30 |
# Thomas Lange, Universitaet Koeln, 6/2000 |
# Thomas Lange, Universitaet Koeln, 7/2000 |
| 31 |
|
|
| 32 |
# configuration of some packages will need some interactive input |
# configuration of some packages will need some interactive input |
| 33 |
# lilo, netbase,... will not be set up correctly, but that doesn't matter |
# lilo, netbase,... will not be set up correctly, but that doesn't matter |
|
|
|
| 34 |
# apt-get must been working on your server (sources.list must be OK) |
# apt-get must been working on your server (sources.list must be OK) |
| 35 |
|
|
| 36 |
|
PATH=/bin:/sbin:/usr/bin:/usr/sbin |
| 37 |
|
|
| 38 |
|
rootpw="56hNVqht51tzc" |
| 39 |
|
url=ftp://ftp.debian.org/debian # format for http or ftp |
| 40 |
|
#url=/mnt # format for a mounted directory |
| 41 |
dversion=2_2 |
dversion=2_2 |
| 42 |
|
dname=potato |
| 43 |
verbose=1 |
verbose=1 |
| 44 |
# Additional packages that are install to nfsroot |
# Additional packages that are install to nfsroot |
| 45 |
packages="debconf file rdate cfengine bootpc wget rsh-client less dump ext2resize raidtools2 lvm" |
packages="debconf file rdate cfengine bootpc wget rsh-client less ssh dump ext2resize raidtools2 lvm" |
| 46 |
|
|
| 47 |
|
|
| 48 |
basetgz=base${dversion}.tgz |
basetgz=base${dversion}.tgz |
| 66 |
echo Unpacking $basetgz |
echo Unpacking $basetgz |
| 67 |
tar zxpf /tmp/$basetgz |
tar zxpf /tmp/$basetgz |
| 68 |
touch etc/fstab etc/raidtab # dump and raidtool2 needs these files |
touch etc/fstab etc/raidtab # dump and raidtool2 needs these files |
| 69 |
|
mkdir -p etc/ssh |
| 70 |
|
touch etc/ssh/NOSERVER # don't start sshd on the host where fai is installed |
| 71 |
mkdir -p lib/modules/`uname -r` # dirty trick to hoax lvm |
mkdir -p lib/modules/`uname -r` # dirty trick to hoax lvm |
| 72 |
touch lib/modules/`uname -r`/modules.dep # dirty trick to hoax lvm |
touch lib/modules/`uname -r`/modules.dep # dirty trick to hoax lvm |
| 73 |
update_nfsroot |
upgrade_nfsroot |
| 74 |
|
|
| 75 |
|
perl -pi -e "s/^root::/root:${rootpw}:/" etc/passwd |
| 76 |
mkdir -p $root/fai/fai_config |
mkdir -p $root/fai/fai_config |
| 77 |
|
touch $root/fai/BOOTP # enable BOOTP support |
| 78 |
cp -p /usr/lib/fai/sbin/* $root/sbin |
cp -p /usr/lib/fai/sbin/* $root/sbin |
| 79 |
cp -p /usr/lib/fai/etc/apt.conf $root/etc/apt |
cp -p /usr/lib/fai/etc/apt.conf $root/etc/apt |
| 80 |
cp -p /usr/lib/perl5/Debian/Fai.pm $root/usr/lib/perl5/Debian/ |
cp -p /usr/lib/perl5/Debian/Fai.pm $root/usr/lib/perl5/Debian/ |
| 98 |
chmod a+rx $root/etc/rc2.d/S01fai_abort |
chmod a+rx $root/etc/rc2.d/S01fai_abort |
| 99 |
} |
} |
| 100 |
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| 101 |
update_nfsroot() { |
upgrade_nfsroot() { |
| 102 |
|
|
| 103 |
echo Upgrading $root |
echo Upgrading $root |
| 104 |
apt-get -c $aptconf update > $devnull |
apt-get -c $aptconf update > $devnull |
| 116 |
# mounted readonly by all clients during installation process |
# mounted readonly by all clients during installation process |
| 117 |
# get base2_2.tgz via wget from ftp.debian.org (default no) |
# get base2_2.tgz via wget from ftp.debian.org (default no) |
| 118 |
|
|
| 119 |
|
|
| 120 |
|
# TODO: parse sources.list and guess location for baseX_X.tgz |
| 121 |
|
if [ ! -f /tmp/$basetgz ]; then |
| 122 |
|
case $url in |
| 123 |
|
ftp:*|http:*) |
| 124 |
|
echo "Getting base${dversion}.tgz from $url via wget" |
| 125 |
|
echo "This may take some time" |
| 126 |
|
wget -q -P/tmp $url/dists/$dname/main/disks-i386/current/base${dversion}.tgz |
| 127 |
|
;; |
| 128 |
|
*) cp -p $url/dists/$dname/main/disks-i386/current/base${dversion}.tgz /tmp |
| 129 |
|
;; |
| 130 |
|
esac |
| 131 |
|
fi |
| 132 |
|
|
| 133 |
if [ ! -f /tmp/$basetgz ]; then |
if [ ! -f /tmp/$basetgz ]; then |
| 134 |
echo "Please put the Debian $basetgz file into /tmp before creating nfsroot for fai." |
echo "Please put the Debian $basetgz file into /tmp before creating nfsroot for fai." |
| 135 |
exit 1 |
exit 1 |