home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-06-27 | 33.7 KB | 1,676 lines |
- #!/bin/sh
- #
- ####################################################
- # #
- # File: doinst1 #
- # Authors: Niels Mache, Ngo Than #
- # Last change: 16/06/97 #
- # #
- # DLD - German Linux Distribution - #
- # #
- # Copyright (c) 1993-1997 delix Computer GmbH #
- # Schlo▀stra▀e 98 #
- # D-70176 Stuttgart #
- # All rights reserved. #
- # #
- ####################################################
- #
-
- umask 022
-
- declare -i MountStat
- declare -i Stat
- clear="H"
- export DLDVersion="5.2"
- InstallRoot="/mnt"
- InstallPath="$InstallRoot/delix"
- RootPath="/dest"
- KernelImage="vmlinuz"
- SetupDir="/usr/lib/delix/setup"
- InstallLogDir="/usr/lib/delix/install"
- BOOTIMG=bootimg
- ErrorLogFile="$InstallLogDir/errors.log"
- BaseArchive=dldbase.tgz
- CDrom=
- CDFileSystem="iso9660"
- LIBM="libm.so.5"
- FIXES=/usr/adm/setup/fixes.tgz
-
- [ "$TERM" = "xterm" ] && export TERM=color_xterm
-
- PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/adm/setup:$RootPath$SetupDir
- PATH=$PATH:$RootPath/linux/bin:$RootPath/linux/usr/bin:$RootPath/linux/sbin:$RootPath/linux/$SetupDir:$RootPath/linux/usr/sbin
- export PATH
-
- InstallUpdateDefault=
-
- INSTSRC=
- INSTMEDIA=
- SYSCFG=
-
-
- DIALOGTITLE=" DLD $DLDVersion (C) 1993-1997 by delix GmbH, Schlo▀str. 98, 70176 Stuttgart, Germany"
- export DIALOGTITLE
- DIALOG=mydialog
-
-
- # programs
- CP="cp -f"
- TR=tr
- MV="mv -f"
- RM="rm -f"
- TAR=tar
- GZIP=gzip
- CUT=cut
- GREP=grep
- CAT=cat
- FDISK=fdisk
- MKDIR=mkdir
- CHMOD=chmod
- MOUNT=mount
- UMOUNT=umount
- SYNC=sync
- UMSSYNC=umssync
- SED=sed
- MKSWAP=mkswap
- SYSINSTALL=pkginst
-
-
- startup() {
-
- $RM /tmp/tmp.doi
-
- umsdos=
- IPath=$RootPath
- fstab=
- swapDevives=
- swapFiles=
- primaryDOS=
-
- if [ ! -d $RootPath ]; then
- $MKDIR -p $RootPath
- fi
-
- if [ ! -f /lib/$LIBM ]; then
- (cd /lib; ln -sf $IPath/lib/$LIBM)
- fi
- }
-
- cursorOff() {
- echo -ne "\033[?25l"
- }
-
- cursorOn() {
- echo -ne "\033[?25h"
- }
-
-
- myreboot() {
- reboot >/dev/null 2>&1
- }
-
- mydialog() {
- dialog --backtitle "$DIALOGTITLE" "$@"
- }
-
- debug() {
- if [ -n "$DEBUG" ]; then
- echo -n "debug: "
- echo $@
- fi
- }
-
- cleanup() {
- $RM /tmp/tmp.doi /tmp/ret.doi /tmp/err.doi
- }
-
- Wait() {
- echo
- echo -n "Weiter mit [return]: "
- read ans
- }
-
- userWait() {
- mydialog --msgbox "Weiter mit [return]" 5 40
- }
-
- error() {
- mydialog --title "Fehler:" --msgbox "$@" 12 73
- }
-
- warning() {
- mydialog --title "Achtung:" --msgbox "$@" 12 73
- }
-
- errorCheck() {
- if [ -s /tmp/err.doi ]; then
- error "`cat /tmp/err.doi`"
- if [ -f $ErrorLogFile ]; then
- cat /tmp/err.doi >> $ErrorLogFile
- fi
- fi
- $RM /tmp/err.doi
- }
-
- umountAll() {
- for i in $swapFiles; do
- swapoff $i 2>/dev/null
- done
- swapFiles=
- for i in $swapDevices; do
- swapoff $i 2>/dev/null
- done
- swapoff -a 2>/dev/null
- swapDevices=
-
- for i in $fstab; do
- $UMOUNT $i 2>/dev/null
- done
- fstab=
- SourceMounted=
- }
-
- bye() {
- cd /
- cleanup
- $RM /tmp/fdisk.out /tmp/fstab.tmp
- umountAll
- mydialog --infobox "\n Installation beendet.\n" 5 28
- sleep 2
- exit 1
- }
-
- listbox() {
- if [ $# = "0" ]; then
- mydialog --textbox /tmp/tmp.doi 20 73
- $RM /tmp/tmp.doi
- elif [ $# = "1" ]; then
- mydialog --textbox $1 20 73
- elif [ $# = "2" ]; then
- mydialog --title "$2" --textbox $1 20 73
- fi
- }
-
- installArchive() {
- local wert=0
- local prozent=0
- local size=0
- local par
- local status=0
- local sizeF=0
- par=$1
-
- cursorOff
-
- for i in `df -t ext2 | grep "$IPath" | cut -c29-36` ; do
- sizeF=`echo "$sizeF $i + p" | dc`
- done
-
- sizeG=55400
-
- cat <<EOF >/tmp/foo
- #!/bin/sh
- >/tmp/.err
- cd $IPath
- >fastboot
- tar zpxf $par 2>/dev/err.doi
-
- if [ "\$?" != "0" ] ; then
- echo "1" >/tmp/.err
- exit 1
- fi
- echo "0" >/tmp/.err
- EOF
-
- chmod a+x /tmp/foo
- /tmp/foo &
-
- (while [ 1 ] ; do
- echo "XXX"
- echo "$prozent"
- echo "\n Paketname : dldbasis\n"
- echo " Gesamte Gr÷▀e : `echo "$sizeG 1024 / p" | dc` MB\n"
- echo " Verbliebene Gr÷▀e: `echo "$sizeG $size - 1024 / p" | dc 2>/dev/null` MB\n"
- echo " Beschreibung : das Paket dldbasis ist n÷tig fⁿr die weitere\n"
- echo " Installation von DLD 5.2\n"
- echo "XXX"
-
- wert=0
- for i in `df -t ext2 | grep "$IPath" | cut -c29-36` ; do
- wert=`echo "$wert $i + p" | dc`
- done
-
- size="`echo "$wert $sizeF - p" | dc 2>/dev/null`"
- prozent="`echo "$size 100 * $sizeG / p"| dc 2>/dev/null`"
- [ "$prozent" -ge "100" ] && prozent=100
-
- case "`cat /tmp/.err`" in
- 1|0) break ;;
- *) continue ;;
- esac
-
- done) | mydialog --title "DLD Installation" --gauge "" 12 70 0
-
- if [ "`cat /tmp/.err`" = "1" ] ; then
- echo -ne "\a"
- errorCheck
- status=1
- else
- status=0
- fi
-
- rm -f /tmp/.err /tmp/foo
- cursorOn
- return $status
-
- }
-
-
- domount() {
- if [ ! -b "$1" ]; then
- echo -ne "\a"
- error "$1 ist keine Festplattenpartition."
- return 2
- fi
-
- MountType="ext2"
- $MOUNT -t $MountType $1 $2 2>/dev/null
- MNTSTAT=$?
-
- if [ $MNTSTAT != "0" ] ; then
- echo -ne "\a"
- mydialog --title "Fehler" --msgbox \
- "Die Partition \"$1\" kann nicht gemountet werden.\n\
- M÷gliche Fehlerursachen:\n\n\
- - Diese Partition existiert nicht (Eingabefehler)\n\
- --> Partitionen anzeigen lassen und neu versuchen\n\n\
- - Falscher Partitionstyp (mu▀ vom Typ \"Linux ext\" sein, d.h Id = 83)\n\
- --> wenn falscher Typ (unwahrscheinlich), dann\n\
- mit fdisk verΣndern und neu booten\n\n\
- - Ungⁿltiges Filesystem (nicht formatiert)\n\
- --> Linux Filesystem einrichten und erneut mounten\n\n\
- - Partition bereits gemountet\n\
- --> Fehler ignorieren" 20 74
- return 1
- fi
-
- if [ "$2" = "$IPath" ]; then
- echo "$1 / $MountType defaults 0 1" >/tmp/fstab.tmp
- echo "/proc /proc proc defaults 0 0" >>/tmp/fstab.tmp
- echo "/dev/cdrom /cdrom iso9660 ro,noauto,user,exec 0 0" >>/tmp/fstab.tmp
- else
- echo "$1 $MountDir $MountType defaults 0 2" >>/tmp/fstab.tmp
- fi
-
- fstab="$1 $fstab"
- return 0
- }
-
- showPartitions() {
- cat << EOF > /tmp/tmp.doi
-
- Folgende Partitionen wurden erkannt:
-
- --------------------------------------------------------------------------------
- EOF
- cat /tmp/fdisk.out >> /tmp/tmp.doi
- echo "--------------------------------------------------------------------------------" >> /tmp/tmp.doi
- listbox /tmp/tmp.doi "Partitionen"
- cleanup
- }
-
- runfdisk() {
- local disk
-
- cat /tmp/fdisk.out | $GREP Disk >/tmp/tmpmsg
- choosePart1 "Partition partitionieren" "Welche Festplatte m÷chten Sie partitionieren ?"
- if [ -z "$LINUX_PART" ]; then
- return 1
- fi
- disk=$LINUX_PART
-
- if [ ! -b "$disk" ]; then
- echo -ne "\a"
- error "$disk ist keine Festplattenpartition."
- return 2
- fi
-
- echo $clear
- $FDISK $disk
-
- mydialog --yesno "Wenn Sie VerΣnderungen vorgenommen haben und fdisk mit \
- \"w\" verlassen haben, mⁿssen Sie Ihren PC jetzt neu booten. \
- System jetzt rebooten?" 8 60
- if [ $? = "0" ]; then
- $SYNC
- myreboot
- fi
- }
-
- domkfs() {
- if [ "$1" = "" ]; then
- return 1
- fi
-
- if [ ! -b $1 ]; then
- echo -ne "\a"
- mydialog --title "Fehler" --msgbox \
- "\n $1 ist keine gⁿltige Partition." 7 50
- return 1
- fi
-
- if [ "`echo $1 | $CUT -c9`" = "" ]; then
- echo -ne "\a"
- mydialog --title "Fehler" --msgbox \
- "\n Die Partition ist ungⁿltig!" 7 35
- return 1
- fi
-
- mydialog --title "Partition formatieren" --yesno \
- "\n Wollen Sie die Partition nach kaputten Sektoren prⁿfen?" 7 64
- if [ $? = "0" ]; then
- OPTION="-c"
- else
- OPTION=""
- fi
-
- mydialog --title "Partition formatieren" --infobox \
- "\nFormatiere die Partition $1. Bitte warten..." 5 62
-
- mke2fs $OPTION $1 2>/dev/tty4 >/dev/tty3
- status=$?
- if [ "$status" != "0" ]; then
- echo -ne "\a"
- mydialog --title "Fehler" --msgbox \
- "\n Die Partition konnte nicht formatiert werden!" 7 51
- return 1
- fi
- return 0
- }
-
- testPart() {
- if [ "$1" = "" ]; then
- status=
- else
- status=`cat /tmp/fdisk.out | $GREP $1`
- fi
- }
-
- choosePart() {
- local Anz
- local Flag
- local Dev
- local Groesse
-
-
- cat /tmp/tmpmsg | $TR -d "*" > /tmp/tmpmsg.new
- $MV /tmp/tmpmsg.new /tmp/tmpmsg
- for i in `wc /tmp/tmpmsg`; do
- let Anz=$i+1
- break
- done
-
- let Anz1=$Anz+7
- cat << EOF > /tmp/exec
- #!/bin/sh
- dialog --backtitle "$DIALOGTITLE" --title "$1" --menu "$2" $Anz1 60 $Anz \\
- EOF
-
- Flag="0"
- for i in `cat /tmp/tmpmsg`; do
- if [ "`echo $i | $GREP /dev/`" ]; then
- Dev=$i
- Flag="1"
- fi
-
- if [ "$Flag" -gt "0" -a "$Flag" -lt "6" ]; then
- let Flag=$Flag+1
- fi
-
- if [ "$Flag" = "6" ]; then
- Groesse=${i%+}
- Flag="0"
-
- cat << EOF >> /tmp/exec
- "$Dev" "$Groesse KByte" \\
- EOF
- fi
- done
-
- cat << EOF >> /tmp/exec
- "p" "Partitionsbezeichner eingeben" \\
- EOF
-
- cat << EOF >> /tmp/exec
- 2> /tmp/ret
- EOF
-
- $CHMOD 755 /tmp/exec
- /tmp/exec
- if [ $? != 0 ]; then
- $RM /tmp/exec
- $RM /tmp/tmpmsg
- $RM /tmp/ret
- LINUX_PART=
- fi
-
- $RM /tmp/exec
- $RM /tmp/tmpmsg
- if [ -s /tmp/ret ]; then
- LINUX_PART="`cat /tmp/ret`"
- $RM /tmp/ret
- else
- LINUX_PART=
- fi
-
- if [ "$LINUX_PART" = "p" ]; then
- mydialog --title "Partitionsbezeichner" --inputbox \
- "Geben Sie den Partitionsbezeichner ein:" 9 50 2> /tmp/ret.doi
- if [ $? != 0 ]; then
- LINUX_PART=
- else
- LINUX_PART=`cat /tmp/ret.doi`
- fi
- rm -f /tmp/ret.doi
- fi
- }
-
- choosePart1() {
- local Anz
- local Flag
- local Dev
- local msg
-
-
- cat /tmp/tmpmsg | $TR -d ":" > /tmp/tmpmsg.new
- $MV /tmp/tmpmsg.new /tmp/tmpmsg
- for i in `wc /tmp/tmpmsg`; do
- Anz=$i
- break
- done
-
- let Anz1=$Anz+7
- cat << EOF > /tmp/exec
- #!/bin/sh
- dialog --backtitle "$DIALOGTITLE" --title "$1" --menu "$2" $Anz1 72 $Anz \\
- EOF
-
- Flag="0"
- msg=
- for i in `cat /tmp/tmpmsg`; do
- if [ "`echo $i | $GREP /dev/`" ]; then
- Dev=$i
- Flag="1"
- fi
- if [ "$Flag" -gt "0" ]; then
- msg="$msg $i"
- let Flag=$Flag+1
- fi
-
- if [ "$Flag" = "7" ]; then
- Flag="0"
- cat << EOF >> /tmp/exec
- "$Dev" "$msg" \\
- EOF
- msg=
- fi
- done
-
- cat << EOF >> /tmp/exec
- 2> /tmp/ret
- EOF
-
- $CHMOD 755 /tmp/exec
- /tmp/exec
- if [ $? != 0 ]; then
- $RM /tmp/exec
- $RM /tmp/tmpmsg
- $RM /tmp/ret
- LINUX_PART=
- fi
-
- $RM /tmp/exec
- $RM /tmp/tmpmsg
- if [ -s /tmp/ret ]; then
- LINUX_PART="`cat /tmp/ret`"
- $RM /tmp/ret
- else
- LINUX_PART=
- fi
- }
-
-
- formatPartition() {
- cat /tmp/fdisk.out | $GREP "Linux native" > /tmp/tmpmsg
- choosePart "Partition formatieren" "Welche Partition wollen Sie formatieren?"
- if [ -z "$LINUX_PART" ]; then
- return 0
- fi
-
- NEWPART=$LINUX_PART
-
- testPart $NEWPART
- if [ "$status" = "" ]; then
- echo -ne "\a"
- mydialog --title "Fehler" --msgbox "\nUngⁿltige Partitionsangabe!" 7 32
- return 1
- fi
-
- mount | grep "$NEWPART" 2>/dev/null >/dev/null
- if [ "$?" = "0" ] ; then
- echo -ne "\a"
- mydialog --title "Fehler" --msgbox \
- "\nDie \"$NEWPART\" wurde bereits gemountet und\n\
- konnte nicht formatiert werden.\n" 8 48
- return 1
- fi
-
- $UMOUNT $NEWPART 2> /dev/null
- $MOUNT -o errors=continue -t ext2 $NEWPART $IPath >/dev/null 2>&1
- if [ "$?" = "0" ] ; then
- freezeLinux
- $UMOUNT $NEWPART 2>/dev/null
- fi
-
- mydialog --title "Partition formatieren" --yesno \
- "\nDurch das Formatieren der Partition $NEWPART werden alle\n\
- darauf gespeicherten Daten gel÷scht.\n\n\
- Wollen Sie wirklich fortfahren?\n" 10 63
-
- if [ "$?" = "0" ]; then
- domkfs $NEWPART || return 1
- mountit $NEWPART
- else
- return 0
- fi
- }
-
- mountPartition() {
- local mountPart
-
- cat /tmp/fdisk.out | $GREP "Linux native" > /tmp/tmpmsg
- choosePart "Partition mounten" "Welche Partition wollen Sie mounten?"
-
- if [ -z "$LINUX_PART" ]; then
- return 0
- fi
-
- mountPart=$LINUX_PART
-
- testPart $mountPart
- if [ "$status" = "" ]; then
- echo -ne "\a"
- mydialog --title "Fehler" --msgbox "\nUngⁿltige Partitionsangabe!" 7 32
- return 1
- fi
- mountit $mountPart
- return $?
- }
-
-
- mountit() {
- while [ 1 ] ; do
- if [ "$RootPartition" = "" ]; then
- mydialog --title "Partition mounten" --yesno \
- "\nSoll die Partition $1 als Root-Verzeichnis\n\
- gemountet werden?\n" 8 56
-
- if [ "$?" != "0" ]; then
- echo -ne "\a"
- mydialog --title "Fehler" --msgbox \
- "\nBitte mounten Sie zuerst die Root-Partition!" 7 50
- return 1
- fi
- RootPartition=$1
-
- domount $RootPartition $IPath
- MNTSTAT=$?
- if [ $MNTSTAT != "0" ]; then
- RootPartition=
- return 1
- fi
- mydialog --title "Partition mounten" --infobox \
- "\n$RootPartition wurde als Root Partition gemountet.\n" 5 51
- sleep 2
- else
- mydialog --title "Partition mounten" \
- --menu "\nAn welchen Pfad soll diese Partition gemountet werden?\n" 16 60 6 \
- "/usr/local" "" \
- "/home" "" \
- "/usr" "" \
- "/var" "" \
- "/var/tmp" "" \
- "/tmp" "" \
- "b" "Benutzerdefiniert" 2> /tmp/ret.doi
-
- if [ "$?" != "0" ]; then
- return 1
- fi
-
- MountDir=`cat /tmp/ret.doi`
- if [ "$MountDir" = "b" ]; then
- mydialog --title "Partition mounten" --inputbox \
- "\nAn welchen Pfad soll diese Partition gemountet werden :\n" 10 60 2> /tmp/ret.doi
- MountDir=`cat /tmp/ret.doi`
- if [ "$?" != "0" ] ; then
- continue
- fi
- fi
-
- MountPoint=$IPath$MountDir
- if [ "$MountDir" != "" ]; then
- $MKDIR -p $MountPoint || return 1
- else
- return 1
- fi
-
- [ "`basename $MountPoint`" = "tmp" ] && chmod 1777 $MountPoint
-
- domount $1 $MountPoint
-
- MNTSTAT=$?
- if [ $MNTSTAT != "0" ]; then
- return 1
- fi
-
- mydialog --title "Partition mounten" --msgbox \
- "\nEs wurde Partition $1 nach $MountDir gemountet.\n" 7 70
-
- fi
- return 0
- done
- }
-
-
-
- swappartsetup() {
- local swapsize
- local swappart
- local part
-
- cat /tmp/fdisk.out | $GREP "Linux swap" > /tmp/tmpmsg
- if [ "$?" != "0" ] ; then
- $RM /tmp/tmpmsg
- echo -ne "\a"
- mydialog --title "Fehler" --msgbox \
- "\nEs wurden keine Swap-Partitionen gefunden." 7 48
- return 1
- else
- choosePart "Swap-Partitionen formatieren" "Welche Swap-Partition soll formatiert werden?"
- if [ -z "$LINUX_PART" ]; then
- return 1
- fi
-
- swappart=$LINUX_PART
- part=`cat /tmp/fdisk.out | $GREP swap | $GREP $swappart | $CUT -c1-10`
- mydialog --title "Swap-Partitionen formatieren" --infobox \
- "\nDie Swap-Partition $swappart wird formatiert. Bitte warten...\n" 5 68
- sleep 1
- $MKSWAP $swappart 2>/dev/null >/dev/null
- if [ "$?" != "0" ] ; then
- echo -ne "\a"
- mydialog --title "Fehler" --msgbox \
- "\nSwap-Partition konnte nicht erzeugt werden.\n\
- Bitte prⁿfen Sie Ihre Hardware und wiederholen\n\
- den Vorgang spΣter nochmals!" 9 50
- return 1
- fi
- mydialog --title "Swap-Partitionen formatieren" --msgbox \
- "\nDie Swap-Partition $swappart wurde erfolgreich formatiert." 7 63
- fi
- }
-
-
-
- swapfilesetup() {
- local ipath
-
- if [ "$RootPartition" = "" ]; then
- echo -ne "\a"
- mydialog --title "Fehler" --msgbox \
- "\nBitte legen Sie zuerst das Root-Filesystem an." 7 51
- return 1
- fi
-
- mydialog --title "Swap-Datei erzeugen" --inputbox \
- "\nGr÷▀e des Swap-Bereiches in KByte (z.B. 10000):\n" 10 60 "10000" 2>/tmp/ret.doi
-
- if [ "$?" != "0" ]; then
- return 1
- fi
-
- mydialog --title "Swap-Datei erzeugen" --infobox \
- "\nSwap-Datei wird jetzt eingerichtet. Bitte warten..." 5 58
-
- sleep 1
- swapsize=`cat /tmp/ret.doi`
- ipath=$IPath
-
- if [ ! -d $ipath/dev ]; then
- $MKDIR $ipath/dev
- fi
-
- dd if=/dev/zero of=$ipath/dev/swapfile bs=1024 count=$swapsize >/dev/null 2>/dev/null
- if [ "$?" != "0" ] ; then
- echo -ne "\a"
- mydialog --title "Fehler" --msgbox \
- "\nSwap-Datei konnte nicht erzeugt werden. Die Partition\n\
- hat nicht ausreichenden Platz." 8 58
- return 1
- fi
-
- $MKSWAP $ipath/dev/swapfile $swapsize >/dev/null 2>/dev/null
- if [ "$?" != "0" ] ; then
- echo -ne "\a"
- mydialog --title "Fehler" --msgbox \
- "\nSwap-Datei konnte nicht erzeugt werden. Die Partition\n\
- hat nicht ausreichenden Platz." 8 58
- return 1
- fi
- sync
- $CHMOD 600 $ipath/dev/swapfile
- mydialog --title "Swap-Datei erzeugen" --msgbox \
- "\n Swap-Datei wurde erfolgreich erzeugt." 7 44
- return
- }
-
- swaponfile() {
- local ipath
- ipath=$IPath
-
- swapoff $ipath/dev/swapfile 2>/dev/null >/dev/null
- swapon $ipath/dev/swapfile 2>/dev/null >/dev/null
- grep "/dev/swapfile" /tmp/fstab.tmp 2>/dev/null >/dev/null
- if [ "$?" != "0" ] ; then
- echo "/dev/swapfile none swap 0 0" >> /tmp/fstab.tmp
- swapFiles="$ipath/dev/swapfile $swapFiles"
- fi
- }
-
-
- copyInstallFiles() {
- if [ ! -d $IPath$SetupDir ]; then
- $MKDIR -p $IPath$SetupDir
- $CHMOD 755 $IPath$SetupDir
- fi
- if [ ! -d $IPath$InstallLogDir ]; then
- $MKDIR -p $IPath$InstallLogDir
- $CHMOD 755 $IPath$InstallLogDir
- fi
- cat /dev/null > $IPath$ErrorLogFile
-
- # $CP -a $SetupSrcDir/* $IPath$SetupDir 2> /dev/null
- # hash -r
- }
-
- checkFreeMemory() {
- declare -i mem
-
- mem="`filesize /proc/kcore`"
- mem=$mem/1048576
-
- if [ $mem -lt 7 ]; then
- cat << EOF > /tmp/tmp.doi
- Achtung: Es sind nur $mem MB Speicher vorhanden.
- Legen Sie vor der Installation Swapspace an.
- EOF
- warning "`cat /tmp/tmp.doi`"
- mydialog --title "Speichermangel" \
- --yesno "Trotzdem weitermachen?" 6 40
- if [ "$?" != "0" ]; then
- RootPartition=
- return 1
- fi
- fi
- return 0
- }
-
- partitionSetup() {
- local choice
-
- while [ 1 ]; do
- mydialog --title "Partitionen einrichten" --menu \
- "\nWΣhlen Sie bitte aus:\n" 15 70 5 \
- "1" "Partitionen anzeigen" \
- "2" "Festplatte partitionieren (danach Neustart erforderlich)" \
- "3" "Formatieren einer Linux Partition (mke2fs)" \
- "4" "Mounten einer Linux Partition (mount)" \
- "w" "weiter" \
- 2> /tmp/ret.doi
-
- if [ $? != "0" ]; then
- RootPartition=
- return 1
- fi
-
- choice=`cat /tmp/ret.doi`
- $RM /tmp/ret.doi
-
- case $choice in
- w) if [ "$RootPartition" != "" ] ; then
- break
- else
- echo -ne "\a"
- mydialog --title "Fehler" --msgbox \
- "\nBitte mounten Sie zuerst die Root-Partition!" 7 50
-
- fi
- ;;
- 1) showPartitions;;
- 4) mountPartition
- if [ "$?" != "0" ] ; then
- continue
- else
- freezeLinux
- fi
- ;;
- 2) runfdisk;;
- 3) formatPartition;;
- esac
- done
- return 0
- }
-
- swapSetup() {
- local choice
-
- while [ 1 ]; do
- mydialog --title "Swap einrichten" --menu \
- "\nWΣhlen Sie aus:\n" 13 64 3 \
- "1" "Swap Partition einrichten (mkswap)" \
- "2" "Swap Datei im Root-Filesystem einrichten (mkswap)" \
- "w" "weiter" \
- 2> /tmp/ret.doi
-
- if [ "$?" != "0" ]; then
- RootPartition=
- return 1
- fi
-
- choice=`cat /tmp/ret.doi`
- $RM /tmp/ret.doi
-
- case $choice in
- w) break ;;
- 1) swappartsetup ;;
- 2) swapfilesetup
- if [ "$?" = "0" ]; then
- swaponfile
- fi ;;
- esac
- done
- return 0
- }
-
-
- mountAll() {
- MountType="ext2"
- $UMOUNT $1 >/dev/null 2>&1
- $UMOUNT $2 >/dev/null 2>&1
- $MOUNT $3 -t $MountType $1 $2 2>/dev/null
- MountStat=$?
- }
-
-
- mountSource() {
- local ipaddr
- local network
- local netmask
- local gateway
- local nfsserver
- local nfspath
-
-
- INSTSRC=$InstallPath
- type=$2
- CDrom=
- MountStat=1
-
- $UMOUNT $InstallRoot >/dev/null 2>&1
-
- case $1 in
- harddrive)
- mydialog --title "Harddisk" --infobox \
- "\nErtelle die List der vorhandenen Partitionen. Bitte warten...\n" 5 68
- cat /tmp/fdisk.out | $GREP "^/dev/" | $GREP -v "Linux swap" | $GREP -v "Extended" >/tmp/tmpmsg
- choosePart "Partition auswΣhlen" "Von welcher Partition soll installiert werden?"
- if [ -z "$LINUX_PART" ]; then
- return 1
- fi
- HDdev=$LINUX_PART
- mount | grep "$LINUX_PART" >/dev/null 2>&1
- if [ "$?" = "0" ] ; then
- echo -ne "\a"
- mydialog --title "Fehler" --msgbox \
- "\nDie \"$LINUX_PART\" wurde bereits gemountet und\n\
- konnte nicht gemountet werden.\n" 8 48
- return 1
- fi
-
- cleanup
-
- HDpath=`basename $INSTSRC`
- while [ 1 ]; do
- dialog --shadow --title "Harddisk" --inputbox \
- "\nIn welchem Verzeichnis befindet sich DLD Installationsfiles ?\n\
- Geben Sie bitte den Pfad ein:\n" 12 70 $HDpath 2>/tmp/ret.doi
-
- if [ $? != 0 ]; then
- cleanup
- return 1
- fi
-
- HDpath=`cat /tmp/ret.doi`
- if [ "$HDpath" != "" ]; then
- INSTSRC=$InstallRoot/$HDpath
- break
- fi
- done
-
- mountAll $HDdev $InstallRoot -r
- cleanup
- ;;
-
- cdrom)
- if [ ! -f /tmp/cdrom ]; then
- mydialog --title "CD-ROM Auswahl" \
- --menu "Installation der DLD von CD-ROM" 18 74 11 \
- "/dev/scd0" "SCSI Laufwerk 1" \
- "/dev/scd1" "SCSI Laufwerk 2" \
- "/dev/hda" "ATAPI Laufwerk (1. Laufwerk)" \
- "/dev/hdb" "ATAPI Laufwerk (2. Laufwerk)" \
- "/dev/hdc" "ATAPI Laufwerk (3. Laufwerk)" \
- "/dev/hdd" "ATAPI Laufwerk (4. Laufwerk)" \
- "/dev/mcd" "Mitsumi Laufwerk" \
- "/dev/sonycd" "Sony CDU31A/33A" \
- "/dev/cdu535" "Sony 535" \
- "/dev/sbpcd" "Matsushita/Panasonic (am Soundblaster)" \
- "/dev/aztcd0" "Aztech CDA268-01A, ORCHID CD-3110, OKANO/WEARNES CDD110" \
- "i" "Installations-Device eingeben" 2> /tmp/ret.doi
- if [ $? != 0 ]; then
- CDrom=
- return 1
- fi
-
- HDdev=`cat /tmp/ret.doi`
- if [ "$HDdev" = "i" ]; then
- mydialog --title "Laufwerksbezeichner" --inputbox \
- "Geben Sie das Installations-Device ein:" 9 40 2> /tmp/ret.doi
- if [ $? != 0 ]; then
- CDrom=
- return 1
- fi
- HDdev=`cat /tmp/ret.doi`
- fi
- else
- HDdev="`cat /tmp/cdrom`"
- fi
-
- while [ 1 ]; do
- $UMOUNT $InstallRoot >/dev/null 2>&1
- $MOUNT -r -t $CDFileSystem $HDdev $InstallRoot 2>/dev/null
- MountStat=$?
-
- if [ $MountStat = 0 ]; then
- mydialog --shadow --title "CD-Mount" --infobox \
- "\n Die CD-ROM wurde gemountet.\n" 5 35
- sleep 2
- CDrom="true"
- fstab="$HDdev $fstab"
- echo "$HDdev" > /tmp/cdrom
- break
- fi
- $RM /etc/mtab~
- mydialog --title "Mount Fehler" --yesno \
- "\nmount-Fehler (manchmal 2-3 Versuche n÷tig).\n\
- M÷chten Sie nochmals versuchen ?\n" 8 49
-
- if [ $? != "0" ]; then
- break
- fi
- done
- ;;
-
- network)
- MountStat=1
- netsetup
- [ "$?" != "0" ] && return 1
-
- [ -f /tmp/NETINST ] && source /tmp/NETINST
-
- nfsserver=$NFSSERVER
- nfspath=$NFSPATH
-
- mydialog --title "Netzwerk Setup" --infobox \
- "\nDas Quellenverzeichnis des NFS-Servers:\n($nfsserver:$nfspath)\n\
- wird gemountet. Bitte warten...\n" 7 73
-
- sleep 1
-
- while [ 1 ]; do
- $UMOUNT $InstallRoot > /dev/null 2> /dev/null
- $MOUNT -r -t nfs -o nodev,noexec $nfsserver:$nfspath/delix $InstallRoot 2>/tmp/err.doi
- MountStat=$?
- errorCheck
-
- if [ $MountStat = 0 ]; then
- INSTSRC=$InstallRoot
- fstab="$InstallRoot $fstab"
- break
- fi
-
- $RM /etc/mtab~
- mydialog --title "Netzwerk Setup" \
- --yesno "\nmount-Fehler (manchmal 2-3 Versuche n÷tig).\n\
- M÷chte Sie nochmals versuchen ?" 8 50
-
- if [ $? != "0" ]; then
- break
- fi
- done
- ;;
- esac
-
-
- if [ $MountStat != 0 ]; then
- echo -ne "\a"
- mydialog --title "Fehler" --msgbox \
- "\nLaufwerk kann nicht gemountet werden." 7 42
- return 1
- fi
-
- if [ "$type" = "update" ]; then
- if [ ! -f $INSTSRC/update.tgz ]; then
- echo -ne "\a"
- mydialog --title "Fehler" --msgbox \
- "\nDLD-Update unter $INSTSRC nicht gefunden." 7 62
- MountStat=1
- return 1
- fi
- elif [ ! -f $INSTSRC/$BaseArchive ]; then
- echo -ne "\a"
- error "$INSTSRC/$BaseArchive nicht gefunden."
- MountStat=1
- return 1
- fi
-
- SourceMounted="yes"
- return 0
- }
-
-
- getSourceDev() {
- Stat=0
- type=$1
-
- while [ 1 ]; do
- mydialog --title "DLD $DLDVersion Installation" --menu \
- "\nWΣhlen Sie bitte die Installations-Quelle:\n" 13 50 3 \
- "1" "Installation von CDROM" \
- "2" "Installation von Festplatte" \
- "3" "Installation ⁿber Netzwerk (mit NFS)" 2>/tmp/ret.doi
-
- if [ $? != 0 ]; then
- Stat=1
- return 1
- fi
-
- ans=`cat /tmp/ret.doi`
-
- case $ans in
- 1) INSTMEDIA=cdrom;;
- 2) INSTMEDIA=harddrive;;
- 3) INSTMEDIA=network;;
- esac
-
- mountSource $INSTMEDIA $type
- [ "$?" = "1" ] && continue
- Stat=MountStat
-
- break
- done
-
- return $Stat
- }
-
-
- checkDOSPartitions() {
- local i id line fstyp
- declare -i counter=0
-
- for i in `cat /tmp/fdisk.out | $GREP DOS | $CUT -c 1-10`; do
- counter=$counter+1
- done
-
- if [ $counter -eq 0 ]; then
- return
- fi
-
- if [ $counter -eq 1 ]; then
- mydialog --title "MS-DOS Partition" \
- --infobox "\n Es wurde eine MS-DOS Partition gefunden.\n" 5 47
-
- sleep 2
- fi
- if [ $counter -gt 1 ]; then
- mydialog --title "MS-DOS Partition" \
- --infobox "\n Es wurden $counter MS-DOS Partitionen gefunden.\n" 5 52
- sleep 2
- fi
-
- counter=0
- for i in `cat /tmp/fdisk.out | $GREP DOS | $CUT -c 1-10`; do
- mydialog --title "MS-DOS Partition" \
- --yesno "\nEnthΣlt die Partition \"$i\" ein Windows95 VFAT Filesystem?\n" 7 72
-
- if [ $? = "0" ]; then
- fstyp="vfat"
- else
- fstyp="msdos"
- fi
-
- mydialog --title "MS-DOS Partition mounten" --yesno \
- "\nSoll die vorhandene MS-DOS Partition \"$i\" beim
- Systemstart automatisch gemountet werden?\n" 8 60
-
- status=$?
-
- let counter=$counter+1
-
- case $counter in
- 1) id="c"
- primaryDOS=$i;;
- 2) id="d";;
- 3) id="e";;
- 4) id="f";;
- esac
-
- $MKDIR -p "$IPath/dos/${id}"
-
- if [ "$status" = "0" ]; then
- line="$i /dos/${id} $fstyp user,noexec,nosuid,nodev 0 2"
- else
- line="$i /dos/${id} $fstyp noauto,user,noexec,nosuid,nodev 0 2"
- fi
-
- echo "$line" >> /tmp/fstab.tmp
- done
- }
-
-
- checkSwapPartitions() {
- local i
- success=0
- declare -i counter=0
-
- for i in `cat /tmp/fdisk.out | $GREP "Linux swap" | $CUT -c 1-10`; do
- counter=$counter+1
- done
-
- if [ "$counter" = "0" ]; then
- return
- fi
-
- if [ "$counter" = "1" ]; then
- mydialog --title "Swap-Partition" \
- --infobox "\nEs wurde eine Linux Swap-Partition gefunden.\n" 5 54
- sleep 2
- fi
-
- if [ $counter -gt 1 ]; then
- mydialog --title "Swap-Partition" \
- --infobox "Es wurden $counter Linux Swap-Partitionen gefunden." 5 56
- sleep 2
- fi
-
- for i in `cat /tmp/fdisk.out | $GREP "Linux swap" | $CUT -c 1-10`; do
-
- swapoff $i >/dev/null 2>&1
- swapon $i >/dev/null 2>&1
-
- if [ "$?" != "0" ]; then
- mydialog --title "Swap-Partition" --yesno \
- "\nDie Swap-Partition \"$i\" wurde noch nicht formatiert.\n\
- Wollen Sie \"$i\" jetzt formatieren?\n" 8 66
-
- if [ "$?" = "0" ] ; then
- $MKSWAP $i 2>/dev/tty3 >/dev/tty3
- status=$?
-
- if [ "$status" != "0" ] ; then
- mydialog --title "Fehler" --msgbox \
- "\n Swap-Partition konnte nicht formatiert werden.\n\
- Prⁿfen Sie bitte Ihre Hardware und wiederholen\n\
- den Vorgang spΣter nochmals!" 9 52
- else
- success=1
- fi
- fi
- else
- success=1
- fi
-
- if [ "$success" = "1" ] ; then
- swapDevices="$i $swapDevices"
- echo "$i swap swap defaults 0 0" >> /tmp/fstab.tmp
- fi
- done
- }
-
-
- installBase() {
- local options
- installArchive $INSTSRC/$BaseArchive
- }
-
-
- installSystem() {
- mydialog --title "System installieren" --yesno \
- "\n M÷chten Sie die Installation jetzt beginnen?\n" 7 52
-
- [ $? = "1" ] && return 1
-
- installBase
-
- return 0
- }
-
- install1() {
- umsdos=
- hwsetup
- [ "$?" != "0" ] && return 1
-
- mydialog --title "Festplatte prⁿfen" --infobox \
- "\nPrⁿfe Festplatten. Bitte warten..." 5 40
-
- rm -f /tmp/fdisk.out /tmp/fstab.tmp
- fdisk -l >/tmp/fdisk.out 2>/dev/tty3
- sleep 1
-
- IPath=$RootPath
- partitionSetup
- if [ "$?" != "0" -o "$RootPartition" = "" ]; then
- return 1
- fi
-
- swapSetup
-
- if [ "$?" != "0" ] ; then
- return 1
- fi
-
- checkFreeMemory
- if [ $? != "0" ] ; then
- return 1
- fi
- return 0
- }
-
-
-
- linuxSetup() {
- local choice
- umsdos=
- SourceMounted=
-
- while [ 1 ]; do
- cleanup
- umountAll
- mydialog --title "DLD $DLDVersion Basisinstallation" --menu \
- "\nBewegen Sie den Menⁿ-Cursor mit den Cursor Tasten\n\
- oder mit Tab. MenⁿeintrΣge k÷nnen mit <Return> oder\n\
- <Space> ausgewΣhlt werden.\n" 17 57 5 \
- "1" "DLD Installation" \
- "2" "Hilfetext anzeigen" \
- "3" "Kernel Meldungen anzeigen" \
- "s" "System neu starten" \
- "b" "Installation beenden" \
- 2> /tmp/ret.doi
-
- if [ "$?" != "0" ]; then
- $RM /tmp/ret.doi
- return 1
- fi
-
- choice=`cat /tmp/ret.doi`
- $RM /tmp/ret.doi
-
- case $choice in
- s) mydialog --title "Neustart" --yesno \
- "M÷chten Sie das System neu booten?" 6 50
- if [ $? != "0" ]; then continue; fi
- mydialog --title "Neustart" --infobox \
- "\nBitte warten Sie bis das System neu gebootet wird." 6 54
- myreboot
- ;;
-
- 3) dmesg > /tmp/tmp.doi
- listbox /tmp/tmp.doi "Kernel Meldungen"
- $RM /tmp/tmp.doi
- ;;
- 2) dldhelp
- ;;
- b) return 1
- ;;
- 1) install1
- if [ "$?" != "0" ]; then continue; fi
- break
- ;;
- esac
- done
- return 0
- }
-
-
- formatDisk() {
- formatdisk
- [ "$?" != "0" ] && return 1
- mydialog --title "Diskette formatieren" --infobox \
- "\n Ext2 Filesystem wird jetzt erzeugt. Bitte warten...\n" 5 58
-
- mke2fs /dev/fd0h1440 2>/dev/null >/dev/tty3
-
- if [ "$?" != "0" ]; then
- echo -ne "\a"
- mydialog --title "Fehler" --msgbox \
- "\nExt2 Filesystem konnte nicht erzeugt werden." 7 50
- return 1
- fi
- mydialog --title "Diskette formatieren" --msgbox \
- "\n Ext2 Filesystem auf Diskette wurde erfolgreich erzeugt.\n" 7 62
-
- return 0
- }
-
- prepareFloppy() {
- mydialog --title "Systemkonfiguration sichern" --msgbox \
- "\n -- Diskettenwechsel --\n\
- Legen Sie jetzt eine Leerdiskette in Ihr A: Laufwerk ein." 8 61
-
- if [ -d /floppy/a ]; then
- $UMOUNT /floppy/a >/dev/null 2>&1
- else
- $MKDIR -p /floppy/a
- fi
-
- mydialog --title "Diskette formatieren" --yesno \
- "\nDurch das Formatieren der Diskette werden alle darauf\n\
- gespeicherten Daten gel÷scht.\n
- Wollen Sie wirklich fortfahren?" 10 58
-
- if [ "$?" = "0" ]; then
- formatDisk
- if [ "$?" != "0" ]; then
- return 1
- fi
- else
- return 1
- fi
-
- $MOUNT -t ext2 /dev/fd0 /floppy/a 2>/tmp/err.doi >/dev/tty3
- if [ $? != 0 ]; then
- echo -ne "\a"
- mydialog --title "Fehler" --msgbox \
- "\nLaufwerk A kann nicht gemountet werden." 7 43
- return 1
- fi
- }
-
-
- saveConfig() {
- local savefil
- local i
- local count
-
- for i in \
- etc/passwd etc/passwd- etc/shadow etc/shadow- etc/group \
- etc/sysconfig etc/conf.modules etc/isdnlog \
- usr/lib/news/inn.conf etc/flexlm etc/dosemu.conf \
- usr/lib/news/nnrp.access usr/lib/news/nntp_access \
- usr/lib/news/nntpsend.ctl usr/lib/news/hosts.nntp \
- usr/lib/news/newsfeeds usr/lib/news/active \
- etc/hosts etc/named.boot etc/named.cache etc/named.local etc/named.rev \
- etc/ppp/chatbin.* etc/ppp/options.* etc/ppp/chat-public.* \
- etc/sendmail.cf etc/resolv.conf \
- etc/lilo.conf etc/lilo.msg \
- etc/XF86Config etc/Xaccel.ini; do
-
- if [ -f $IPath/$i ]; then
- savefil="$savefil $i"
- fi
- done
-
- if [ $# = 1 ]; then
- SYSCFG=$1
- else
- SYSCFG=/tmp/syscfg.tgz
- fi
-
- while [ 1 ]; do
- mydialog --title "Systemkonfiguration sichern" --yesno \
- "\nAuf der Partition $LINUX_PART ist bereits ein Linux System\n\
- installiert. Wollen Sie die Systemkonfiguration dieses\n\
- Systems sichern?" 9 62
-
- if [ "$?" = "0" ]; then
- prepareFloppy
- if [ $? != "0" ]; then
- mydialog --title "Systemkonfiguration sichern" --msgbox \
- "\n \"Systemkonfiguration sichern\" wurde abgebrochen!\n" 7 54
- break
- fi
- mydialog --title "Systemkonfiguration sichern" --infobox \
- "\n Die Systemkonfiguration wird jetzt auf Diskette\n\
- (Ext2-Format) als Datei syscfg.tgz gesichert.\n\
- Bitte warten...\n" 8 53
- (cd $IPath; $TAR zcf /floppy/a/syscfg.tgz $savefil 2>/dev/null >/dev/tty3)
- umount /floppy/a 2>/dev/null >/dev/tty3
- mydialog --title "Systemkonfiguration gesichert" --msgbox \
- "\n Die Systemkonfiguration wurde erfolgreich auf Diskette\n\
- (Ext2-Format) als Datei syscfg.tgz gesichert." 8 60
-
- fi
- break
- done
- }
-
- restoreConfig() {
- [ ! -f "$SYSCFG" ] && return
-
- local cfgfile
- local cfgpath
- local CFGFILE="syscfg"
-
- $MKDIR -p $IPath/$SetupDir/config
-
- cfgfile=$IPath$SetupDir/config/syscfg-$DLDVersion.tgz
-
- if [ -f "$cfgfile" ]; then
- $CP $SYSCFG $IPath$SetupDir/config/syscfg-old.tgz
- fi
-
- $CP $SYSCFG $cfgfile
- mydialog --title "Systemkonfiguration" --msgbox \
- "Die Systemkonfiguration der DLD $DLDVersion wurde unter \
- $SetupDir/config/syscfg-$DLDVersion.tgz gesichert." 9 73
-
- mydialog --title "Systemkonfiguration ⁿbernehmen" --yesno \
- "\nSoll die Systemkonfiguration des bisher installierten \n\
- Linux Systems auf das neue System ⁿbernommen werden?" 8 59
- if [ $? = "0" ]; then
- (cd $IPath; $GZIP -cd $SYSCFG | $TAR xpf -) 2>/tmp/err.doi
- errorCheck
- else
- while [ 1 ]; do
- mydialog --title "Systemkonfiguration herstellen" --yesno \
- "\nSoll eine Systemkonfiguration von Diskette installiert werden?" 7 70
- if [ $? = "0" ]; then
- mydialog --title "Systemkonfiguration herstellen" --msgbox \
- " -- Diskettenwechsel --\n\
- Legen Sie jetzt die Diskette mit der\n\
- Systemkonfiguration in Ihr A: Laufwerk ein." 7 47
-
- mount /dev/fd0 /floppy/a 2> /tmp/err.doi >/dev/null
- if [ $? != 0 ]; then
- echo -ne "\a"
- mydialog --title "Fehler" --msgbox \
- "\nLaufwerk A kann nicht gemountet werden." 7 43
- mydialog --title "Systemkonfiguration" --yesno \
- "Abbrechen ?" 5 35
- [ $? = "0" ] && break
- fi
- if [ ! -f /floppy/a/syscfg.tgz ]; then
- umount /floppy/a >/dev/null 2>&1
- mydialog --title "Systemkonfiguration herstellen" --msgbox \
- "Es konnte keine Systemkonfiguration auf Diskette A: gefunden werden" 6 45
- mydialog --title "Systemkonfiguration" --yesno \
- "Abbrechen ?" 5 35
- [ $? = "0" ] && break
- else
- (cd $IPath; $GZIP -cd /floppy/a/syscfg.tgz | $TAR xpf -) 2>/tmp/err.doi
- umount /floppy/a >/dev/null 2>/dev/tty3
- errorCheck
- fi
- mydialog --title "Systemkonfiguration wiederhergestellt" --infobox \
- "Die Systemkonfiguration wurde wiederhergestellt." 5 61
- sleep 2
- fi
- break
- done
- fi
- }
-
- freezeLinux() {
- local i
- for i in etc/passwd etc/group etc/HOSTNAME; do
- if [ ! -f $IPath/$i ]; then return 0; fi
- done
- saveConfig
- }
-
- banner() {
- cat << EOF > /tmp/tmp.doi
-
- delix Computer GmbH
- Schlo▀str. 98
- 70176 Stuttgart
- Germany
-
-
- eMail: delix@delix.de
- www: http://www.delix.de
- ftp: ftp://ftp.delix.de
-
-
- Entwickelt von:
- Ngo Than <than@delix.de>
- Niels Mache <niels@delix.de>
- EOF
-
- mydialog --title "DLD $DLDVersion Installation" --textbox /tmp/tmp.doi 20 36
- rm -f /tmp/tmp.doi
- }
-
- Inittab() {
- ed $IPath/etc/inittab >/dev/null 2>&1 << EOF
- 25
- d
- i
- id:4:initdefault:
- .
- w
- q
- EOF
- }
-
-
- setupBase() {
- hash -r
- [ ! -d $IPath/etc ] && $MKDIR $IPath/etc
-
- $CP /tmp/fstab.tmp $IPath/etc/fstab
- echo $RootPartition > /tmp/ROOTDEV
- Inittab
-
- if [ -f /tmp/pcmcia ]; then
- $CP /tmp/pcmcia $IPath/etc/sysconfig/pcmcia
- fi
-
- if [ -f /tmp/conf.modules ]; then
- $CP /tmp/conf.modules $IPath/etc
- fi
-
- if [ -f /tmp/cdrom ]; then
- device=`cat /tmp/cdrom`
- (cd $IPath/dev; rm -f cdrom; ln -s `basename $device` cdrom)
- echo "CDROM_DEVICE=$device" > $IPath/etc/sysconfig/cdrom
- fi
-
- for i in NETINST ROOTDEV; do
- [ -f /tmp/$i ] && $CP /tmp/$i $IPath$SetupDir
- done
-
- echo "LANGUAGE=de" > $IPath/etc/sysconfig/language
- echo "KEYTABLE=/usr/lib/kbd/keytables/de-dld.map" > $IPath/etc/sysconfig/keyboard
-
- # restoreConfig
- }
-
-
- # ----------------------- main program ---------------------------
-
- trap bye 2
-
-
- startup
- banner
-
-
- while [ 1 ]; do
-
- RootPartition=
- umountAll
- umount /mnt >/dev/null 2>&1
- linuxSetup
-
- if [ $? != "0" ]; then
- bye
- fi
-
- getSourceDev
-
- if [ "$Stat" = "0" ]; then
- break
- fi
-
- done
-
- checkSwapPartitions
- checkDOSPartitions
- copyInstallFiles
-
- installSystem
- [ "$?" = "1" ] && bye
-
- setupBase
-
- $SYNC
- $UMOUNT $InstallRoot 2>/dev/null
-
- # Fixes
- if [ -f $FIXES ] ; then
- (cd $IPath ; tar zopxf $FIXES >/dev/null 2>&1)
- fi
-
- if [ -x $IPath/install/doinst.sh ] ; then
- (cd $IPath ; sh install/doinst.sh)
- fi
-
- $RM -r $IPath/install
- $SYNC
-
- cleanup
- umountAll
-
- exit 0
-