ViitorSetup/Viitor_Setup
kueller 73824ab468 V962 Branch
git-svn-id: svn://svn.compuextreme.de/Viitor/V962/ViitorSetup@4435 504e572c-2e33-0410-9681-be2bf7408885
2008-05-03 17:02:57 +00:00

149 lines
3.6 KiB
Bash
Executable File

#!/bin/bash
#Framework, welches ein komplettes Linux System aus den Sourcen erstellt
#dieses Framework wird im CVS Repository
#:pserver:cvs.compuextreme.de:/Data/cvs zur Verfügung gestellt
#
#Lage dieser Datei im Archiv: $Source: $
#
#(c) 2003 Harald Kueller, Germany
#This program is free software; you can redistribute it and/or
#modify ist under the terms of the GNU General Public License
#as published by the Free Software Foundation; either version
#2 of the License, or (at your option) any later version.
#
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#See the GNU General Public License for more details.
#
#You should have received a copy of the GNU General Public License
#along with this program; if not write to the Free Software Foundation,
#Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
#Script:
#Script zum Setup der Viitor Linux Distribution
#
#Letzte Änderung von: $Author: $
#Datum der letzten Änderung: $Date: $
#Version der Datei: $Revision: $
#
#$Log: $
#
SOURCEPATH=`dirname $0`
source $SOURCEPATH/VSetup_functionHD
source $SOURCEPATH/VSetup_functionVol
source $SOURCEPATH/VSetup_functionFormat
source $SOURCEPATH/VSetup_functionNet
source $SOURCEPATH/VSetup_functionInst
if [ "$DISPLAY" ]; then
DIALOGPRG=Xdialog
else
DIALOGPRG=dialog
fi
while getopts :r:xc opt_char; do
case $opt_char in
r)
INSTALLROOT=$OPTARG
;;
x)
DIALOGPRG=Xdialog
;;
c)
DIALOGPRG=dialog
;;
\?)
echo "$opt_char ist not an valid argument"
exit 1
;;
esac
done
GetPartitionTable () {
DEVICE=$1
LANGSTORE=$LANG
unset LANG
/sbin/fdisk -l $DEVICE >/tmp/sfdisk$$
BEGLINE=`cat /tmp/sfdisk$$| \
grep -n Id| \
awk '{print $1}'| \
awk -F":" '{print $1}'`
ALLINE=`cat /tmp/sfdisk$$|wc -l|awk '{print $1}'`
(( TAILLINE = $ALLINE - $BEGLINE ))
tail -n $TAILLINE /tmp/sfdisk$$ |sed -e "s/\*//" >/tmp/sfdisk$$.use
rm /tmp/sfdisk$$
SWAPS=`cat /tmp/sfdisk$$.use|awk '{if ( $5 == "82" ) print $1}'`
LINUX=`cat /tmp/sfdisk$$.use|awk '{if ( $5 == "83" ) print $1}'`
VOLUME=`cat /tmp/sfdisk$$.use|awk '{if ( $5 == "8e" ) print $1}'`
rm /tmp/sfdisk$$.use
}
while FUNC=`$DIALOGPRG --stdout --clear --title "Viitor Setup Programm" \
--menu "Select Task to perform" 0 40 6 \
"HD" "Setup" \
"Network" "Setup" \
"Select" "Installation Type" \
"Rescue" "Shell" \
"Exit" "Exit Viitor Setup"`; do
case $FUNC in
HD)
HDMenue
;;
Network)
while DEVICE=`SelectNetDevices`; do
if [ "$DEVICE" = "Exit" ]; then
break;
fi
if [ "$DEVICE" = "Select" ]; then
GetNameServiceType
continue
fi
if [ "$DEVICE" = "Enter" ]; then
GetDefaultGateway
continue
fi
if ! GetNetConfigType $DEVICE; then
continue
fi
done
;;
Select)
INSTALLCONFIG=`SelectInstallConfig`
if [ ${INSTALLCONFIG} == "Select" ]; then
INSTALLCONFIG=`$DIALOGPRG --stdout --title "Please Select the Package Configuration file to use for installation" --fselect / 0 0`
if [ ! $? == "0" ]; then
continue
fi
fi
ROOTDIR=`$DIALOGPRG --stdout --title "Please Select the Mountpoint of your Root Filesystem" --fselect / 0 0 `
if [ ! $? == "0" ]; then
continue
fi
./make_base_install -c $INSTALLCONFIG -m $ROOTDIR
read
;;
Exit)
if [ "$DIALOGPRG" == "dialog" ]; then
reset
clear
fi
break
;;
Rescue)
reset
clear
bash --login
reset
clear
;;
esac
done
if [ ! "$DISPLAY" ]; then
reset
clear
fi