ich hab bei RedHat 9 mit den anderen Installationsanleitungen etwas Ã?rger gehabt, außerdem wollte ich, daß eine wirklich korrekte RPM-Datenbank angelegt wird.
Daher hab ich ein Skript geschrieben, mit dem man die Kickstart-Funktion von Redhat verwenden um RH 9 auf einem Rootserver zu installieren.
Also:
1. Daten sichern ;-)
2. Rescue-System booten
3. Script hochladen
4. chmod 755 [script]
5. Script starten
6. Bootmodus auf "Normal" zurückstellen
7. Reboot
8. ca. 10 Min warten bis Ins Installation fertig
Viel Erfolg!
Gruß,
Gerd
Code: Select all
#!/bin/sh
# installing RedHat 9 on a Rootserver
#
# Copyright (C) 2003 Gerd v. Egidy
#
# This software may be freely redistributed under the terms of the GNU
# library public license.
#
# You should have received a copy of the GNU Library Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# This program will ERASE ALL DATA on the harddisk WITHOUT FURTHER WARNING!!!
# DELETE ALL PARTITIONS
# and create a small boot partition
echo "o" >/root/fd
echo "n" >>/root/fd
echo "p" >>/root/fd
echo "1" >>/root/fd
echo >>/root/fd
echo "+1G" >>/root/fd
echo "w" >>/root/fd
cat /root/fd | fdisk /dev/hda
# init & mount
mke2fs /dev/hda1
mount /dev/hda1 /mnt/
mkdir /mnt/boot
mkdir /mnt/dev
mkdir /mnt/etc
# create lilo.conf
echo "lba32" >/mnt/etc/lilo.conf
echo "boot=/dev/hda" >>/mnt/etc/lilo.conf
echo "root=/dev/hda1" >>/mnt/etc/lilo.conf
echo "image=/boot/vmlinuz" >>/mnt/etc/lilo.conf
echo "label=linux" >>/mnt/etc/lilo.conf
echo "initrd=/boot/initrd.img" >>/mnt/etc/lilo.conf
echo "append="reiserfs ks=hd:hda1:/ks.cfg"" >>/mnt/etc/lilo.conf
# get local IP config
IP=`grep fixed-address /var/lib/dhcp3/dhclient.leases | cut -d " " -f 4 | cut -d ";" -f 1`
NETMASK="255.255.255.0"
GW=`grep routers /var/lib/dhcp3/dhclient.leases | cut -d " " -f 5 | cut -d ";" -f 1`
DNS=`grep domain-name-servers /var/lib/dhcp3/dhclient.leases | cut -d " " -f 5 | cut -d "," -f 1`
# create kickstart file
echo "#System language" >/mnt/ks.cfg
echo "lang en_US" >>/mnt/ks.cfg
echo "#Language modules to install" >>/mnt/ks.cfg
echo "langsupport en_US" >>/mnt/ks.cfg
echo "#System keyboard" >>/mnt/ks.cfg
echo "keyboard de-latin1" >>/mnt/ks.cfg
echo "#System mouse" >>/mnt/ks.cfg
echo "mouse none" >>/mnt/ks.cfg
echo "#Sytem timezone" >>/mnt/ks.cfg
echo "timezone --utc Europe/Berlin" >>/mnt/ks.cfg
echo "#Root password" >>/mnt/ks.cfg
echo "rootpw secret" >>/mnt/ks.cfg
echo "#Reboot after installation" >>/mnt/ks.cfg
echo "reboot" >>/mnt/ks.cfg
echo "#Use text mode install" >>/mnt/ks.cfg
echo "text" >>/mnt/ks.cfg
echo "#Install Red Hat Linux instead of upgrade" >>/mnt/ks.cfg
echo "install" >>/mnt/ks.cfg
echo "#Use Web installation" >>/mnt/ks.cfg
echo "url --url ftp://ftp.cs.tu-berlin.de/pub/linux/Mirrors/ftp.redhat.com/linux/9/en/os/i386/" >>/mnt/ks.cfg
echo "#System bootloader configuration" >>/mnt/ks.cfg
echo "bootloader --location=mbr " >>/mnt/ks.cfg
echo "#Clear the Master Boot Record" >>/mnt/ks.cfg
echo "zerombr yes" >>/mnt/ks.cfg
echo "#Partition clearing information" >>/mnt/ks.cfg
echo "clearpart --all --initlabel " >>/mnt/ks.cfg
echo "#Disk partitioning information" >>/mnt/ks.cfg
echo "part /boot --fstype ext3 --size 100 --asprimary" >>/mnt/ks.cfg
echo "part / --fstype reiserfs --size 10000" >>/mnt/ks.cfg
echo "part /var --fstype reiserfs --size 1000 --grow" >>/mnt/ks.cfg
echo "part /var/log --fstype reiserfs --size 2000" >>/mnt/ks.cfg
echo "part swap --size 1024" >>/mnt/ks.cfg
echo "#System authorization infomation" >>/mnt/ks.cfg
echo "auth --useshadow --enablemd5 " >>/mnt/ks.cfg
echo "#Network information" >>/mnt/ks.cfg
echo "network --bootproto=static --ip=$IP --netmask=$NETMASK --gateway=$GW --nameserver=$DNS --device=eth0" >>/mnt/ks.cfg
echo "#Firewall configuration" >>/mnt/ks.cfg
echo "firewall --disabled " >>/mnt/ks.cfg
echo "#Do not configure XWindows" >>/mnt/ks.cfg
echo "skipx" >>/mnt/ks.cfg
echo "#Package install information" >>/mnt/ks.cfg
echo "#install just base packages" >>/mnt/ks.cfg
echo "%packages" >>/mnt/ks.cfg
# --> add additional packages here <---
# download boot kernel & initrd
wget -O /mnt/boot/vmlinuz ftp://ftp.cs.tu-berlin.de/pub/linux/Mirrors/ftp.redhat.com/linux/9/en/os/i386/isolinux/vmlinuz
wget -O /mnt/boot/initrd.img ftp://ftp.cs.tu-berlin.de/pub/linux/Mirrors/ftp.redhat.com/linux/9/en/os/i386/isolinux/initrd.img
# prepare boot dir
cp /boot/* /mnt/boot/
# prepare dev
mknod /mnt/dev/hda b 3 0
mknod /mnt/dev/hda1 b 3 1
# install kernel
lilo -r /mnt
umount /mnt
# done
echo "change boot mode to normal and reboot"
