| 1 |
#! /bin/sh
|
| 2 |
|
| 3 |
# $Id$
|
| 4 |
#*********************************************************************
|
| 5 |
#
|
| 6 |
# make-fai-bootfloppy -- create a boot floppy for FAI
|
| 7 |
#
|
| 8 |
# This script is part of FAI (Fully Automatic Installation)
|
| 9 |
# (c) 2000 by Thomas Lange, lange@informatik.uni-koeln.de
|
| 10 |
# Universitaet zu Koeln
|
| 11 |
#
|
| 12 |
#*********************************************************************
|
| 13 |
# This program is free software; you can redistribute it and/or modify
|
| 14 |
# it under the terms of the GNU General Public License as published by
|
| 15 |
# the Free Software Foundation; either version 2 of the License, or
|
| 16 |
# (at your option) any later version.
|
| 17 |
#
|
| 18 |
# This program is distributed in the hope that it will be useful, but
|
| 19 |
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 20 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
| 21 |
# General Public License for more details.
|
| 22 |
#
|
| 23 |
# A copy of the GNU General Public License is available as
|
| 24 |
# `/usr/share/common-licences/GPL' in the Debian GNU/Linux distribution
|
| 25 |
# or on the World Wide Web at http://www.gnu.org/copyleft/gpl.html. You
|
| 26 |
# can also obtain it by writing to the Free Software Foundation, Inc.,
|
| 27 |
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
| 28 |
#*********************************************************************
|
| 29 |
|
| 30 |
# Thomas Lange, Universitaet Koeln, 10/2000
|
| 31 |
|
| 32 |
set -e
|
| 33 |
|
| 34 |
. /etc/fai.conf
|
| 35 |
|
| 36 |
SERVERIP=`ifconfig eth0 | perl -ne '/inet addr:([0-9\.]+)/ && print $1'`
|
| 37 |
|
| 38 |
grep -q ic_bootp $NFSROOT/boot/System.map-$KERNELVERSION && TYPE=BOOTP
|
| 39 |
grep -q ic_dhcp $NFSROOT/boot/System.map-$KERNELVERSION && TYPE=DHCP
|
| 40 |
|
| 41 |
mke2fs -i 8192 -m 0 /dev/fd0 >/dev/null || exit
|
| 42 |
mount /floppy || mount /dev/fd0 /floppy || exit
|
| 43 |
cp -dpR $NFSROOT/boot /floppy
|
| 44 |
mkdir -p /floppy/etc
|
| 45 |
ln -s boot/vmlinuz-$KERNELVERSION /floppy/vmlinuz
|
| 46 |
|
| 47 |
cat > /floppy/etc/lilo.conf <<EOF
|
| 48 |
boot=/dev/fd0
|
| 49 |
#root=/dev/boot255
|
| 50 |
root=$NFSROOT/dev/boot255
|
| 51 |
install=/floppy/boot/boot.b
|
| 52 |
map=/floppy/boot/map
|
| 53 |
append = "NFSROOT=$SERVERIP:$NFSROOT"
|
| 54 |
delay=10
|
| 55 |
compact
|
| 56 |
image=/floppy/vmlinuz
|
| 57 |
label=FAI-$TYPE
|
| 58 |
read-only
|
| 59 |
EOF
|
| 60 |
|
| 61 |
echo now writing boot data to floppy
|
| 62 |
lilo -C /floppy/etc/lilo.conf
|
| 63 |
cd /
|
| 64 |
umount /floppy
|
| 65 |
|
| 66 |
cat <<EOF
|
| 67 |
FAI bootfloppy ready
|
| 68 |
boot protocol : $TYPE
|
| 69 |
server : $SERVERIP
|
| 70 |
nfsroot : $SERVERIP:$NFSROOT
|
| 71 |
EOF
|