Neue Version V963
git-svn-id: svn://svn.compuextreme.de/Viitor/V963/ViitorSetup@5933 504e572c-2e33-0410-9681-be2bf7408885
This commit is contained in:
commit
d1fa99da5e
199
VSetup_functionFormat
Normal file
199
VSetup_functionFormat
Normal file
@ -0,0 +1,199 @@
|
||||
#!/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:
|
||||
#BasisScript Viitor_Setup
|
||||
#Sammlung von Funktionen zum Format von Volumes/Partitions
|
||||
#
|
||||
#Letzte Änderung von: $Author: $
|
||||
#Datum der letzten Änderung: $Date: $
|
||||
#Version der Datei: $Revision: $
|
||||
#
|
||||
#$Log: $
|
||||
#
|
||||
|
||||
FindMountablePart() {
|
||||
PART=""
|
||||
DIALOGCFG=""
|
||||
NumEntrys=0
|
||||
for i in `\ls /dev/{h,s}d? 2>/dev/null`; do
|
||||
DEVNAME=`basename $i`
|
||||
if [ "`cat /sys/block/$DEVNAME/device/type 2>/dev/null`" == "0" ] || \
|
||||
[ "`cat /sys/block/$DEVNAME/device/media 2>/dev/null`" == "disk" ]; then
|
||||
if [ "`cat /sys/block/$DEVNAME/removable 2>/dev/null`" == "0" ]; then
|
||||
for j in `fdisk -l /dev/${DEVNAME}| \
|
||||
grep "^\/dev"|\
|
||||
sed -e "s/\*//"|\
|
||||
awk '{ if ($5 == "83") print $1}'`; do
|
||||
PART=$PART" $j"
|
||||
done
|
||||
fi
|
||||
fi
|
||||
done
|
||||
for i in `vgdisplay|grep "VG Name"|awk '{print $3}'`; do
|
||||
for j in `lvdisplay $i|grep "LV Name"|awk '{print $3}'`; do
|
||||
PART=$PART" $j"
|
||||
done
|
||||
done
|
||||
for i in `cat /proc/mdstat 2>/dev/null| \
|
||||
grep active | \
|
||||
awk '{print $1}'| \
|
||||
sed -e "s/md//"`; do
|
||||
PART=$PART" /dev/md/$i"
|
||||
done
|
||||
NumEntrys=0
|
||||
for i in $PART; do
|
||||
if ! grep $i /etc/fstab >/dev/null 2>&1; then
|
||||
if ! grep $i /proc/mounts >/dev/null 2>&1; then
|
||||
(( NumEntrys = $NumEntrys + 1 ))
|
||||
DIALOGCFG=$DIALOGCFG" $i NoConfig off"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
DIALOGCFG=$DIALOGCFG" Exit MountMenue off"
|
||||
(( NumEntrys = $NumEntrys + 1 ))
|
||||
while [ ! "$PARTITION" == "Exit" ]; do
|
||||
PARTITION=`$DIALOGPRG --backtitle "Viitor Setup" \
|
||||
--title "ViitorLinux VolumeManager Setup" \
|
||||
--stdout --radiolist \
|
||||
"Select Volume to mount" 0 65 $NumEntrys \
|
||||
$DIALOGCFG`
|
||||
if [ ! $? == "0" ]; then
|
||||
break;
|
||||
fi
|
||||
if [ $PARTITION != "Exit" ]; then
|
||||
MOUNTPOINT=`$DIALOGPRG --stdout --title "Please choose a Mounpoint for $PARTITION" --fselect / 0 0`
|
||||
if [ $? == "0" ]; then
|
||||
echo "$PARTITION $MOUNTPOINT" >>/tmp/mountlist.$$
|
||||
else
|
||||
continue
|
||||
fi
|
||||
if $DIALOGPRG --title "mount" --clear --yesno \
|
||||
"Should i Mount Partition \n$PARTITION on \n$MOUNTPOINT now?" 10 50; then
|
||||
if [ $INSTALLROOT ]; then
|
||||
MOUNTPOINT=$INSTALLROOT/$MOUNTPOINT
|
||||
if [ ! -d $MOUNTPOINT ]; then
|
||||
mkdir -p $MOUNTPOINT
|
||||
fi
|
||||
fi
|
||||
mount $PARTITION $MOUNTPOINT
|
||||
fi
|
||||
unset DIALOGCFG
|
||||
for i in $PART; do
|
||||
if ! grep $i /etc/fstab >/dev/null 2>&1; then
|
||||
if ! grep $i /proc/mounts >/dev/null 2>&1; then
|
||||
if grep $i /tmp/mountlist.$$ >/dev/null 2>&1; then
|
||||
MNTPOINT=`grep $i /tmp/mountlist.$$|awk '{print $2}'`
|
||||
DIALOGCFG=$DIALOGCFG" $i $MNTPOINT off"
|
||||
else
|
||||
DIALOGCFG=$DIALOGCFG" $i NoConfig off"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
DIALOGCFG=$DIALOGCFG" Exit MountMenue off"
|
||||
fi
|
||||
done
|
||||
MOUNTPOINTS=`cat /tmp/mountlist.$$`
|
||||
rm /tmp/mountlist.$$
|
||||
NumEntrys=0
|
||||
echo $MOUNTPOINTS
|
||||
}
|
||||
|
||||
FindFormatablePart() {
|
||||
PART=""
|
||||
REALPART=""
|
||||
NumEntrys=0
|
||||
for i in `\ls /dev/{h,s}d? 2>/dev/null`; do
|
||||
DEVNAME=`basename $i`
|
||||
if [ "`cat /sys/block/$DEVNAME/device/type 2>/dev/null`" == "0" ] || \
|
||||
[ "`cat /sys/block/$DEVNAME/device/media 2>/dev/null`" == "disk" ]; then
|
||||
if [ "`cat /sys/block/$DEVNAME/removable 2>/dev/null`" == "0" ]; then
|
||||
for j in `fdisk -l /dev/${DEVNAME}| \
|
||||
grep "^\/dev"|\
|
||||
sed -e "s/\*//"|\
|
||||
awk '{ if ($5 == "83") print $1}'`; do
|
||||
PART=$PART" $j"
|
||||
done
|
||||
fi
|
||||
fi
|
||||
done
|
||||
for i in `vgdisplay|grep "VG Name"|awk '{print $3}'`; do
|
||||
for j in `lvdisplay $i|grep "LV Name"|awk '{print $3}'`; do
|
||||
PART=$PART" $j"
|
||||
done
|
||||
done
|
||||
for i in $PART; do
|
||||
VOLNAME=`basename $i`
|
||||
DIRNAME=`dirname $i`
|
||||
VGNAME=`basename $DIRNAME`
|
||||
SIZE=`fdisk -s $i`
|
||||
(( SIZE = $SIZE / 1024 ))
|
||||
SIZE=$SIZE"M"
|
||||
if [ -e /dev/mapper/$VGNAME-$VOLNAME ]; then
|
||||
if ! mount|grep /dev/mapper/$VGNAME-$VOLNAME >/dev/null 2>&1; then
|
||||
REALPART=$REALPART" $i $SIZE off"
|
||||
(( NumEntrys = $NumEntrys + 1 ))
|
||||
fi
|
||||
elif ! mount|grep $i >/dev/null 2>&1; then
|
||||
REALPART=$REALPART" $i $SIZE off"
|
||||
(( NumEntrys = $NumEntrys + 1 ))
|
||||
fi
|
||||
done
|
||||
for i in `cat /proc/mdstat 2>/dev/null| \
|
||||
grep active| \
|
||||
awk '{print $1}'|\
|
||||
sed -e "s/md//"`; do
|
||||
if ! pvdisplay /dev/md/$i >/dev/null 2>&1; then
|
||||
REALPART=$REALPART" $i $SIZE off"
|
||||
(( NumEntrys = $NumEntrys + 1 ))
|
||||
fi
|
||||
done
|
||||
(( NumEntrys = $NumEntrys + 1 ))
|
||||
$DIALOGPRG --stdout \
|
||||
--backtitle "ViitorLinux Setup" \
|
||||
--title "Filesystem Creator" \
|
||||
--checklist "Select Volumes/Partitions to Format" \
|
||||
0 70 $NumEntrys \
|
||||
$REALPART |sed -e "s%//% /%g"
|
||||
}
|
||||
|
||||
SelectFilesystemForPart() {
|
||||
if [ -f /tmp/format$$.tmp ]; then
|
||||
rm /tmp/format$$.tmp
|
||||
fi
|
||||
for i in $*; do
|
||||
FSYSTEM=`$DIALOGPRG --stdout \
|
||||
--backtitle "ViitorLinux Setup" \
|
||||
--title "Filesystem Creator" \
|
||||
--radiolist "Select Filesystem for use with $i" \
|
||||
0 50 3 \
|
||||
"xfs" "jornaling Filesystem from SGI" on \
|
||||
"reiserfs" "jornaling DB Filesystem" off \
|
||||
"ext3fs" "Extendet ext2fs with journaling" off \
|
||||
"swapfs" "Use Partition as Swap Device" off`
|
||||
if [ ! $? = "0" ]; then
|
||||
return 1
|
||||
fi
|
||||
echo "$i $FSYSTEM" >>/tmp/format$$.tmp
|
||||
done
|
||||
}
|
152
VSetup_functionHD
Normal file
152
VSetup_functionHD
Normal file
@ -0,0 +1,152 @@
|
||||
#!/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:
|
||||
#BasisScript Viitor_Setup
|
||||
#Sammlung von Scripts zur Erkennung, Auswahl und Partitionierung
|
||||
#von Festplatten
|
||||
#Letzte Änderung von: $Author: $
|
||||
#Datum der letzten Änderung: $Date: $
|
||||
#Version der Datei: $Revision: $
|
||||
#
|
||||
#$Log: $
|
||||
#
|
||||
|
||||
GetHDDev() {
|
||||
HD=""
|
||||
NumEntrys=0
|
||||
for i in `\ls /dev/{h,s}d? 2>/dev/null`; do
|
||||
DEVNAME=`basename $i`
|
||||
if [ "`cat /sys/block/$DEVNAME/device/type 2>/dev/null`" == "0" ] || \
|
||||
[ "`cat /sys/block/$DEVNAME/device/media 2>/dev/null`" == "disk" ]; then
|
||||
if [ "`cat /sys/block/$DEVNAME/removable 2>/dev/null`" == "0" ]; then
|
||||
HD="$HD /dev/${DEVNAME} hd${NumEntrys}"
|
||||
(( NumEntrys++ ))
|
||||
fi
|
||||
fi
|
||||
done
|
||||
HD="$HD Partitionierung Verlassen"
|
||||
(( NumEntrys = $NumEntrys + 2 ))
|
||||
$DIALOGPRG --stdout --clear --title "Viitor Setup Programm" \
|
||||
--menu "Select HD to setup" 0 0 $NumEntrys \
|
||||
$HD
|
||||
}
|
||||
|
||||
GetHDPart() {
|
||||
PART=""
|
||||
NumEntrys=0
|
||||
for i in `/bin/ls /dev/discs`; do
|
||||
for j in `fdisk -l /dev/discs/$i/disc|grep "^\/dev\/discs"|awk '{print $1}'`; do
|
||||
PART=$PART" $i `basename $j`"
|
||||
done
|
||||
done
|
||||
echo $PART
|
||||
}
|
||||
|
||||
HDMenue() {
|
||||
while FUNC=`$DIALOGPRG --stdout --clear --title "Viitor Setup Programm" \
|
||||
--menu "Select Task" 0 0 6 \
|
||||
"Partition" "HD" \
|
||||
"Volume" "Management" \
|
||||
"Format" "HD/Volume" \
|
||||
"Mount" "Points" \
|
||||
"Exit" "PartitionMenue"`; do
|
||||
case $FUNC in
|
||||
Partition)
|
||||
if [ ${DIALOGPRG} == "Xdialog" ]; then
|
||||
/usr/X11R7/sbin/gparted
|
||||
else
|
||||
while PHD=`GetHDDev`; do
|
||||
if [ "$PHD" == "Partitionierung" ]; then
|
||||
break
|
||||
else
|
||||
cfdisk $PHD
|
||||
fi
|
||||
done
|
||||
fi
|
||||
;;
|
||||
Volume)
|
||||
VolumeMenue
|
||||
;;
|
||||
Format)
|
||||
PART=""
|
||||
FSPART=`FindFormatablePart`
|
||||
if [ ! $? == "0" ];then
|
||||
continue
|
||||
fi
|
||||
if [ ! "$FSPART" ]; then
|
||||
continue
|
||||
fi
|
||||
SelectFilesystemForPart $FSPART
|
||||
if [ ! $? = "0" ];then
|
||||
continue
|
||||
fi
|
||||
exec 3</tmp/format$$.tmp
|
||||
while read <&3 PARTITION FILESYS; do
|
||||
PART=$PART"\n$PARTITION"
|
||||
done
|
||||
exec 3>&-
|
||||
if ! $DIALOGPRG --title "Viitor Setup" \
|
||||
--yesno "Should i really Format the Followin Partitions:\n$PART" 0 0; then
|
||||
continue
|
||||
fi
|
||||
exec 3</tmp/format$$.tmp
|
||||
while read <&3 PARTITION FILESYS; do
|
||||
PARTITION=`echo $PARTITION|sed -e "s/\"//g"`
|
||||
case $FILESYS in
|
||||
xfs)
|
||||
$DEBUG mkfs.xfs -f $PARTITION
|
||||
;;
|
||||
reiserfs)
|
||||
yes|mkreiserfs $PARTITION
|
||||
;;
|
||||
ext3fs)
|
||||
$DEBUG mkfs.ext3 $PARTITION
|
||||
;;
|
||||
swapfs)
|
||||
$DEBUG mkswap $PARTITION
|
||||
if $DIALOGPRG --title "Viitor Setup" \
|
||||
--yesno "Should i activate this swappartition now ?" 0 0; then
|
||||
swapon $PARTITION
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
done
|
||||
exec 3>&-
|
||||
rm /tmp/format$$.tmp
|
||||
;;
|
||||
Mount)
|
||||
FSPART=`FindMountablePart`
|
||||
if [ ! $? == "0" ];then
|
||||
continue
|
||||
fi
|
||||
if [ ! "$FSPART" ]; then
|
||||
continue
|
||||
fi
|
||||
echo "Selected Mountpoint Entrys: $FSPART"
|
||||
;;
|
||||
Exit)
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
26
VSetup_functionInst
Normal file
26
VSetup_functionInst
Normal file
@ -0,0 +1,26 @@
|
||||
SelectInstallConfig() {
|
||||
NumEntrys=0
|
||||
ENTRY=""
|
||||
for i in *.cfg; do
|
||||
if [ ${NumEntrys} == "0" ]; then
|
||||
ENTRY="$i config on"
|
||||
else
|
||||
ENTRY=$ENTRY" $i config off"
|
||||
fi
|
||||
(( NumEntrys++ ))
|
||||
done
|
||||
ENTRY="$ENTRY Select Own off"
|
||||
(( NumEntrys++ ))
|
||||
(( NumEntrys++ ))
|
||||
if [ ! $NumEntrys = "1" ]; then
|
||||
$DIALOGPRG --stdout \
|
||||
--backtitle "ViitorLinux Installation Setup" \
|
||||
--title "Select Installtion Configuration" \
|
||||
--radiolist "To use" 0 0 $NumEntrys \
|
||||
$ENTRY
|
||||
else
|
||||
$DISLOGPRG --title "ViitorLinux Installation Setup" --clear \
|
||||
--msgbox "No usable installation config found"
|
||||
return 1
|
||||
fi
|
||||
}
|
243
VSetup_functionNet
Normal file
243
VSetup_functionNet
Normal file
@ -0,0 +1,243 @@
|
||||
#!/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:
|
||||
#BasisScript ViitorSetup
|
||||
#Funktionsammlung zur Netzwerk Konfiguration in ViitorLinux
|
||||
#
|
||||
#Letzte Änderung von: $Author: $
|
||||
#Datum der letzten Änderung: $Date: $
|
||||
#Version der Datei: $Revision: $
|
||||
#
|
||||
#$Log: $
|
||||
|
||||
source /etc/init.d/functions
|
||||
|
||||
GetNetConfigType() {
|
||||
DEVICE=$1
|
||||
TYPE=`$DIALOGPRG --stdout --clear --title "Viitor Setup Programm" \
|
||||
--radiolist "Select Configuration Type for Device $1" 0 0 3 \
|
||||
Dynamic dhcp true \
|
||||
Static Manual false`
|
||||
if [ "$TYPE" == "Static" ]; then
|
||||
GetStaticNetConfig $1
|
||||
else
|
||||
if [ "$INSTALLROOT" ]; then
|
||||
touch $INSTALLROOT/etc/sysconfig/net/eth0.dhcp
|
||||
else
|
||||
touch /etc/sysconfig/net/eth0.dhcp
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
GetStaticNetConfig() {
|
||||
DEVICE=$1
|
||||
AKT_IP=`/sbin/ifconfig $DEVICE|grep inet|awk '{print $2}'|cut -d":" -f 2
|
||||
`
|
||||
AKT_MASK=`/sbin/ifconfig $DEVICE|grep inet|awk '{print $4}'|cut -d":" -f 2`
|
||||
AKT_HOSTNAME=`getent hosts $AKT_IP|awk '{print $2}'`
|
||||
if [ "$DIALOGPRG" == "dialog" ]; then
|
||||
IP_INFO=`dialog --stdout --form \
|
||||
"Insert your Network Information" 10 35 0 \
|
||||
"IP Adress:" 1 1 "$AKT_IP" 1 12 15 0 \
|
||||
"Hostname :" 2 1 "$AKT_HOSTNAME" 2 12 15 0 \
|
||||
"Net Mask :" 3 1 "$AKT_MASK" 3 12 15 0 `
|
||||
if [ $? == "0" ]; then
|
||||
IP=`echo $IP_INFO|awk '{ print $1 }'`
|
||||
HN=`echo $IP_INFO|awk '{ print $2 }'`
|
||||
NM=`echo $IP_INFO|awk '{ print $3 }'`
|
||||
else
|
||||
return 1;
|
||||
fi
|
||||
else
|
||||
IP_INFO=`Xdialog --stdout --title "ViitorLinux Network Setup" \
|
||||
--3inputsbox "Insert IP and Hostname" 20 0 \
|
||||
"IP Adress:" "$AKT_IP" \
|
||||
"Hostname :" "$AKT_HOSTNAME" \
|
||||
"Net Mask :" "$AKT_MASK"`
|
||||
if [ $? == "0" ]; then
|
||||
IP=`echo $IP_INFO|awk -F"/" '{ print $1 }'`
|
||||
HN=`echo $IP_INFO|awk -F"/" '{ print $2 }'`
|
||||
GW=`echo $IP_INFO|awk -F"/" '{ print $3 }'`
|
||||
else
|
||||
return 1;
|
||||
fi
|
||||
NETADDR=`getnetaddr $IP $NM`
|
||||
if [ "$INSTALLROOT" ]; then
|
||||
NMFILE=$INSTALLROOT/etc/netmasks
|
||||
HOSTFILE=$INSTALLROOT/etc/hosts
|
||||
else
|
||||
NMFILE=/etc/netmasks
|
||||
HOSTFILE=/etc/hosts
|
||||
fi
|
||||
if [ ! -f /etc/netmasks ]; then
|
||||
touch $NMFILE
|
||||
fi
|
||||
if grep $NETADDR /etc/netmasks; then
|
||||
sed -e "s/$NETADDR.*$/$NETADDR $NM" $NMFILE >/tmp/netmasks
|
||||
mv /tmp/netmasks $NMFILE
|
||||
else
|
||||
echo "$NETADDR $NM" >>$NMFILE
|
||||
fi
|
||||
if grep $HN /etc/hosts; then
|
||||
sed -e "s/$IP.*$/$IP $HN/" $HOSTFILE >/tmp/hosts
|
||||
mv /tmp/hosts $HOSTFILE
|
||||
else
|
||||
echo "$IP $HN" >>$HOSTFILE
|
||||
fi
|
||||
if [ "$INSTALLROOT" ]; then
|
||||
echo $HN >$INSTALLROOT/etc/sysconfig/net/hostname.$DEVICE
|
||||
else
|
||||
echo $HN >/etc/sysconfig/net/hostname.$DEVICE
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
GetNameServiceType() {
|
||||
TYPE=`$DIALOGPRG --title "Select Nameservice" --clear --stdout \
|
||||
--radiolist "Which Nameservice should i use?" 0 0 3 \
|
||||
"DNS " "Use DNS only" off \
|
||||
"NIS " "Use NIS only" off \
|
||||
"both" "Use NIS and DNS" on`
|
||||
}
|
||||
|
||||
GetDNSInformation() {
|
||||
DNS_SEARCH=`grep search /etc/resolv.conf|sed -e "s/search *//"`
|
||||
DNS_IP=`grep nameserver /etc/resolv.conf|sed -e "s/nameserver *//"`
|
||||
DNS_DOMAIN=`grep domain /etc/resolv.conf|sed -e "s/domain *//"`
|
||||
RESOLVFILE=/etc/resolve.conf
|
||||
if [ $INSTALLROOT ]; then
|
||||
$RESOLVFILE=$INSTALLROOT/$RESOLVFILE
|
||||
fi
|
||||
if [ "$DIALOGPRG" == "dialog" ]; then
|
||||
DNS_INFO=`dialog --stdout --form \
|
||||
"Insert your DNS Information" 10 35 0 \
|
||||
"DNS Server Adress:" 1 1 "$DNS_IP" 1 12 15 0 \
|
||||
"DNS Domain Name :" 2 1 "$DNS_DOMAIN" 2 12 15 0 \
|
||||
"DNS Search List :" 3 1 "$DNS_SEARCH" 3 12 15 0`
|
||||
if [ $? == "0" ]; then
|
||||
DNS_IP=`echo $DNS_INFO|awk '{print $1}'`
|
||||
DNS_DOMAIN=`echo $DNS_INFO|awk '{print $2}'`
|
||||
DNS_SEARCH=`echo $DNS_INFO|awk '{print $3}'`
|
||||
echo "domain $DNS_DOMAIN" >$RESOLVFILE
|
||||
echo "search $DNS_SEARCH" >>$RESOLVFILE
|
||||
echo "nameserver $DNS_IP" >>$RESOLVFILE
|
||||
fi
|
||||
else
|
||||
DNS_INFO=`Xdialog --stdout --title "ViitorLinuxNetwork Setup" \
|
||||
--3inputsbox "Insert your DNS Information" 20 0 \
|
||||
"DNS Server Adress:" "$DNS_IP" \
|
||||
"DNS Domain Name :" "$DNS_DOMAIN" \
|
||||
"DNS Search List :" "$DNS_SEARCH"`
|
||||
if [ $? == "0" ]; then
|
||||
DNS_IP=`echo $DNS_INFO|awk -F "/" '{print $1}'`
|
||||
DNS_DOMAIN=`echo $DNS_INFO|awk -F "/" '{print $2}'`
|
||||
DNS_SEARCH=`echo $DNS_INFO|awk -F "/" '{print $3}'`
|
||||
echo "domain $DNS_DOMAIN" >$RESOLVFILE
|
||||
echo "search $DNS_SEARCH" >>$RESOLVFILE
|
||||
echo "nameserver $DNS_IP" >>$RESOLVFILE
|
||||
fi
|
||||
fi
|
||||
if [ $? == "0" ]; then
|
||||
DNS_IP=`echo $DNS_INFO|awk -F "/" '{print $1}'`
|
||||
DNS_DOMAIN=`echo $DNS_INFO|awk -F "/" '{print $2}'`
|
||||
DNS_SEARCH=`echo $DNS_INFO|awk -F "/" '{print $3}'`
|
||||
echo "domain $DNS_DOMAIN" >$RESOLVFILE
|
||||
echo "search $DNS_SEARCH" >>$RESOLVFILE
|
||||
echo "nameserver $DNS_IP" >>$RESOLVFILE
|
||||
fi
|
||||
}
|
||||
|
||||
GetNISInformation() {
|
||||
if ypwhich >/dev/null 2>&1; then
|
||||
NIS_IP=`ypwhich`
|
||||
NIS_IP=`ping -c 1 $NIS_IP| \
|
||||
head -n 1| \
|
||||
awk '{print $3}'| \
|
||||
sed -e "s/[():]//g"`
|
||||
fi
|
||||
NIS_DOMAIN=`domainname`
|
||||
if [ "$DIALOGPRG" == "dialog" ]; then
|
||||
NIS_INFO=`dialog --stdout --form \
|
||||
"Insert your NIS Information" 10 35 0 \
|
||||
"NIS Server :" 1 1 "$NIS_IP" 1 12 15 0 \
|
||||
"NIS Domain :" 2 1 "$NIS_DOMAIN" 2 12 15 0`
|
||||
if [ $? == "0" ]; then
|
||||
NIS_IP=`echo $NIS_INFO|awk '{print $1}'`
|
||||
NIS_DOMAIN=`echo $NIS_INFO|awk '{print $2}'`
|
||||
fi
|
||||
else
|
||||
NIS_INFO=`Xdialog --stdout --title "ViitorLinuxNetwork Setup" \
|
||||
--2inputsbox "Insert your NIS Information" 20 0 \
|
||||
"NIS Server :" "$NIS_IP" \
|
||||
"NIS Domain :" "$NIS_DOMAIN"`
|
||||
if [ $? == "0" ]; then
|
||||
NIS_IP=`echo $NIS_INFO|awk -F "/" '{print $1}'`
|
||||
NIS_DOMAIN=`echo $NIS_INFO|awk -F "/" '{print $2}'`
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
GetNetDevices() {
|
||||
ifconfig -a|sed -e "/^ /d" -e "/^$/d"|awk '{print $1}'
|
||||
}
|
||||
|
||||
GetDeviceIP() {
|
||||
DEVICE=$1
|
||||
|
||||
ifconfig $DEVICE|grep inet|cut -d":" -f 2 |awk '{print $1}'
|
||||
}
|
||||
|
||||
SelectNetDevices() {
|
||||
NumEntrys=0
|
||||
unset DIALOGCFG
|
||||
for i in `GetNetDevices`; do
|
||||
IP=`GetDeviceIP $i`
|
||||
DIALOGCFG=$DIALOGCFG" $i $IP false"
|
||||
(( NumEntrys = $NumEntrys + 1 ))
|
||||
done
|
||||
DIALOGCFG=$DIALOGCFG" Select Nameservice false"
|
||||
DIALOGCFG=$DIALOGCFG" Enter DefaultGateway false"
|
||||
DIALOGCFG=$DIALOGCFG" Exit Netsetup true"
|
||||
(( NumEntrys = $NumEntrys + 3 ))
|
||||
$DIALOGPRG --stdout --clear --title "Viitor Setup Programm" \
|
||||
--radiolist "Select Network Device" 0 0 $NumEntrys \
|
||||
$DIALOGCFG
|
||||
}
|
||||
|
||||
GetDefaultGateway() {
|
||||
DEFROUTFILE=/etc/sysconfig/net/defaultrouter
|
||||
if [ "$INSTALLROOT" ]; then
|
||||
DEFROUTFILE=$INSTALLROOT/$DEFROUTFILE
|
||||
fi
|
||||
AKT_ROUTER=`/sbin/ip route list|grep default|awk '{print $3}'`
|
||||
GW=`$DIALOGPRG --stdout --title "ViitorLinux Network Setup" \
|
||||
--inputbox "Specify your default gateway" 20 0 \
|
||||
"$AKT_ROUTER"`
|
||||
if [ ! "$GW" ]; then
|
||||
if [ -f $DEFROUTFILE ]; then
|
||||
rm $DEFROUTFILE
|
||||
fi
|
||||
else
|
||||
echo $GW >$DEFROUTFILE
|
||||
fi
|
||||
}
|
317
VSetup_functionVol
Normal file
317
VSetup_functionVol
Normal file
@ -0,0 +1,317 @@
|
||||
#!/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:
|
||||
#BasisScript Viitor_Setup
|
||||
#Script mit Funktionen zur Konfiguration und Wartung
|
||||
#des Volume Management (LVM2.0)
|
||||
#
|
||||
#Letzte Änderung von: $Author: $
|
||||
#Datum der letzten Änderung: $Date: $
|
||||
#Version der Datei: $Revision: $
|
||||
#
|
||||
#$Log: $
|
||||
#
|
||||
|
||||
GetLVMGroups() {
|
||||
vgdisplay |grep "VG Name"|awk '{print $3}'
|
||||
}
|
||||
|
||||
GetLVMVGSize() {
|
||||
VOLGROUP=$1
|
||||
SIZE=`vgdisplay $VOLGROUP|grep "VG Size"|awk '{print $3}'|sed -e "s/,/\./"`
|
||||
case `vgdisplay $VOLGROUP|grep "VG Size"|awk '{print $4}'` in
|
||||
GB)
|
||||
SIZE=`echo "$SIZE * 1024"|bc`
|
||||
;;
|
||||
KB)
|
||||
SIZE=`echo "$SIZE / 1024"|bc`
|
||||
;;
|
||||
esac
|
||||
echo $SIZE
|
||||
}
|
||||
|
||||
GetLVMVolumes() {
|
||||
VOLGROUP=$1
|
||||
lvdisplay $VOLGROUP -c|awk -F":" '{print $1}'
|
||||
}
|
||||
|
||||
GetLVMVolumeSize() {
|
||||
VOLGROUP=$1
|
||||
VOLNAME=$2
|
||||
BSIZE=`lvdisplay -c $VOLGROUP|grep $VOLNAME|awk -F":" '{print $7}'`
|
||||
(( BSIZE = $BSIZE / 2 / 1024 ))
|
||||
echo $BSIZE
|
||||
}
|
||||
|
||||
ShowVolumeManagerMenue() {
|
||||
$DIALOGPRG --stdout --clear --title "Viitor VolumeManager Administration" \
|
||||
--menu "Which Funktion do you want to use ?" 0 0 6 \
|
||||
"SELECT" "Volume To Change" \
|
||||
"PCREATE" "New Physical Volume" \
|
||||
"CREATE" "New Volume Group" \
|
||||
"VCREATE" "New Volume" \
|
||||
"EXIT" "Viitor VolumeManager"
|
||||
}
|
||||
|
||||
SelectVMPhysicalNo() {
|
||||
PVPART=""
|
||||
for i in `pvdisplay|grep "PV Name"|awk '{print $3}'`; do
|
||||
PARTNAME=`/bin/ls -ld $i|grep "^[bl]"|awk '{print $NF}'`
|
||||
if [ -h "$i" ]; then
|
||||
PARTNAME=/dev/$PARTNAME
|
||||
fi
|
||||
if [ ! "`pvdisplay $PARTNAME|grep "VG Name"|awk '{print $3}'`" ]; then
|
||||
PVPART=$PVPART" $PARTNAME"
|
||||
fi
|
||||
done
|
||||
NumEntrys=0
|
||||
ENTRY=""
|
||||
for i in $PVPART; do
|
||||
ENTRY=$ENTRY" $i `pvdisplay $i|grep "PV Size"|awk '{print $3,$4}'|sed -e "s/ //"` Off"
|
||||
(( NumEntrys = $NumEntrys + 1 ))
|
||||
done
|
||||
(( NumEntrys = $NumEntrys + 1 ))
|
||||
if [ ! $NumEntrys = "1" ]; then
|
||||
$DIALOGPRG --stdout \
|
||||
--backtitle "ViitorLinux VolumeManager Setup" \
|
||||
--title "Select Physical Volumes" \
|
||||
--checklist "to use with the new Group?" \
|
||||
0 0 $NumEntrys \
|
||||
$ENTRY
|
||||
else
|
||||
$DIALOGPRG --title "ViitorLinux VolumeManager Setup" --clear \
|
||||
--msgbox "There is no unused Physical Volume\nPlease create a new Physical Volume first" 0 0
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
GetNewVGName() {
|
||||
$DIALOGPRG --stdout --title "Viitor VolumeManager Administration" \
|
||||
--inputbox "Please give a new Name vor the new VolumeGroup" 9 35
|
||||
}
|
||||
|
||||
SelectVMPartition() {
|
||||
VMPART=""
|
||||
NumEntrys=0
|
||||
for i in `\ls /dev/{h,s}d? 2>/dev/null`; do
|
||||
DEVNAME=`basename $i`
|
||||
if [ "`cat /sys/block/$DEVNAME/device/type 2>/dev/null`" == "0" ] || \
|
||||
[ "`cat /sys/block/$DEVNAME/device/media 2>/dev/null`" == "disk" ]; then
|
||||
if [ "`cat /sys/block/$DEVNAME/removable 2>/dev/null`" == "0" ]; then
|
||||
for j in `fdisk -l /dev/${DEVNAME}|grep "^\/dev"|sed -e "s/\*//"|awk '{ if ( $5 == "8e" ) print $1}'`; do
|
||||
pvdisplay $j 2>&1 >/dev/null
|
||||
if [ $? = "5" ]; then
|
||||
VMPART="$HD $j hd${NumEntrys}"
|
||||
(( NumEntrys++ ))
|
||||
fi
|
||||
done
|
||||
fi
|
||||
fi
|
||||
done
|
||||
if [ -f /proc/mdstat ]; then
|
||||
for i in `grep md /proc/mdstat|awk '{print $1}'|sed -e "s/md//"`; do
|
||||
pvdisplay /dev/md/$i >/dev/null 2>&1
|
||||
if [ $? = "5" ]; then
|
||||
VMPART=$VMPART" /dev/md/$i Unknown"
|
||||
(( NumEntrys = $NumEntrys + 1 ))
|
||||
fi
|
||||
done
|
||||
fi
|
||||
(( NumEntrys = $NumEntrys + 1 ))
|
||||
if [ $NumEntrys = "1" ]; then
|
||||
return 1
|
||||
else
|
||||
$DIALOGPRG --stdout --clear --title "Viitor VolumeManager Administration" \
|
||||
--menu "Select Partition vor Physical Volume" 0 0 $NumEntrys \
|
||||
$VMPART
|
||||
fi
|
||||
}
|
||||
|
||||
SelectVolumeGroup() {
|
||||
VOLUMEGROUPS=`GetLVMGroups`
|
||||
GROUPARG=""
|
||||
NumEntrys=0
|
||||
for i in $VOLUMEGROUPS; do
|
||||
GROUPARG=$GROUPARG" $i `GetLVMVGSize $i`MB"
|
||||
(( NumEntrys = $NumEntrys + 1 ))
|
||||
done
|
||||
(( NumEntrys = $NumEntrys + 1 ))
|
||||
$DIALOGPRG --stdout --clear --title "Select Volume" \
|
||||
--menu "Please select Volumegroup" 0 0 $NumEntrys \
|
||||
$GROUPARG
|
||||
}
|
||||
|
||||
SelectVolume() {
|
||||
GROUP=`SelectVolumeGroup`
|
||||
if [ ! $? = "0" ]; then
|
||||
return 1
|
||||
fi
|
||||
VOLUMES=`GetLVMVolumes $GROUP`
|
||||
if [ ! $? = "0" ]; then
|
||||
return 1
|
||||
fi
|
||||
VOLARG=""
|
||||
NumEntrys=0
|
||||
for i in $VOLUMES; do
|
||||
VOLARG=$VOLARG" $i `GetLVMVolumeSize $GROUP $i`M"
|
||||
(( NumEntrys = $NumEntrys + 1 ))
|
||||
done
|
||||
(( NumEntrys = $NumEntrys + 1 ))
|
||||
if [ ! $NumEntrys = "1" ]; then
|
||||
VOLUME=`$DIALOGPRG --stdout --clear --title "Select Volume" \
|
||||
--menu "Please select Volume" 0 0 $NumEntrys \
|
||||
$VOLARG`
|
||||
if [ $? = "0" ]; then
|
||||
echo $VOLUME
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
else
|
||||
$DIALOGPRG --title "ViitorLinux VolumeManager Setup" --clear \
|
||||
--msgbox "There are no Volumes in Group $GROUP" \
|
||||
0 0
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
GetNewVolumeSize() {
|
||||
VOLUMENAME=$1
|
||||
VOLUMESIZE=$2
|
||||
$DIALOGPRG --stdout --title "INPUT BOX" \
|
||||
--inputbox "The Volume $VOLUMENAME has a size of $VOLUMESIZE MBytes\n\n \
|
||||
Which new size (in MByte) should the Volume $VOLUMENAME become?:" 11 60
|
||||
}
|
||||
|
||||
|
||||
ResizeVolume() {
|
||||
VOLUME=$1
|
||||
SIZE=$2
|
||||
|
||||
VOLNAME=`basename $VOLUME`
|
||||
GROUPDIR=`dirname $VOLUME`
|
||||
GROUPNAME=`basename $GROUPDIR`
|
||||
$DEBUG lvresize -L "$SIZE"M $VOLUME
|
||||
FILESYS=`mount|grep /dev/mapper/$GROUPNAME-$VOLNAME|awk '{print $5}'`
|
||||
MOUNTPOINT=`mount|grep /dev/mapper/$GROUPNAME-$VOLNAME|awk '{print $3}'`
|
||||
case $FILESYS in
|
||||
reiserfs)
|
||||
$DEBUG reiserfsck --check /dev/mapper/$GROUPNAME_$VOLUME
|
||||
$DEBUG resize_reiserfs /dev/mapper/$GROUPNAME-$VOLUME
|
||||
;;
|
||||
xfs)
|
||||
$DEBUG xfs_growfs $MOUNTPOINT
|
||||
;;
|
||||
*)
|
||||
echo "$FILESYSTEM can not be reiszed!"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
CreateVolume() {
|
||||
VOLGROUP=$1
|
||||
if [ "$DIALOGPRG" == "dialog" ]; then
|
||||
VOLINFO=`dialog --title "ViitorLinux VolumeManager Setup" \
|
||||
--stdout --form \
|
||||
"Insert Volume Information" 10 35 3 \
|
||||
"VolumeName:" 1 1 "" 1 12 15 0 \
|
||||
"VolumeSize:" 2 1 "" 2 12 15 0`
|
||||
if [ ! $? = "0" ]; then
|
||||
return 1
|
||||
fi
|
||||
VOLNAME=`echo $VOLINFO|awk '{print $1}'`
|
||||
VOLSIZE=`echo $VOLINFO|awk '{print $2}'`
|
||||
else
|
||||
VOLINFO=`Xdialog --title "ViitorLinux VolumeManager Setup" \
|
||||
--stdout --2inputsbox \
|
||||
"Insert Volume Information" 15 0 \
|
||||
"VolumeName:" "" \
|
||||
"VolumeSize:" ""`
|
||||
if [ ! $? = "0" ]; then
|
||||
return 1
|
||||
fi
|
||||
VOLNAME=`echo $VOLINFO|awk -F"/" '{print $1}'`
|
||||
VOLSIZE=`echo $VOLINFO|awk -F"/" '{print $2}'`
|
||||
fi
|
||||
if [ $? = "0" ]; then
|
||||
$DEBUG lvcreate -L $VOLSIZE -n $VOLNAME $VOLGROUP
|
||||
fi
|
||||
}
|
||||
|
||||
VolumeMenue() {
|
||||
while FUNC=`ShowVolumeManagerMenue` ; do
|
||||
case $FUNC in
|
||||
SELECT)
|
||||
VOLUME=`SelectVolume`
|
||||
if [ ! $? = "0" ]; then
|
||||
continue
|
||||
fi
|
||||
VOLNAME=`basename $VOLUME`
|
||||
GROUPDIR=`dirname $VOLUME`
|
||||
GROUPNAME=`basename $GROUPDIR`
|
||||
SIZE=`GetLVMVolumeSize $GROUPNAME $VOLNAME`
|
||||
NEWSIZE=`GetNewVolumeSize $VOLUME $SIZE`
|
||||
if [ ! $? = "0" ]; then
|
||||
continue
|
||||
fi
|
||||
if [ ! "$NEWSIZE" -ge "$SIZE" ]; then
|
||||
$DIALOGPRG --title "ERROR" \
|
||||
--msgbox "Couldn't make a Volume smaller"\
|
||||
0 0
|
||||
continue
|
||||
fi
|
||||
ResizeVolume $VOLUME $NEWSIZE
|
||||
|
||||
;;
|
||||
PCREATE)
|
||||
PART=`SelectVMPartition`
|
||||
if [ $? = "0" ]; then
|
||||
$DEBUG pvcreate $PART
|
||||
fi
|
||||
;;
|
||||
CREATE)
|
||||
PHVOLS=`SelectVMPhysicalNo`
|
||||
if [ ! $? = "0" ]; then
|
||||
continue
|
||||
fi
|
||||
PHVOLS=`echo $PHVOLS|sed -e "s/\"//g"`
|
||||
VGNAME=`GetNewVGName`
|
||||
if [ "$GROUPS" ]; then
|
||||
echo "vgcreate $VGNAME $PHVOLS" >/tmp/test
|
||||
$DEBUG /sbin/vgcreate $VGNAME $PHVOLS >>/tmp/test 2>&1
|
||||
else
|
||||
$DIALOGPRG --title "ViitorLinux VolumeManager Setup" --clear \
|
||||
--msgbox "No Physical Volume selected\nPlease select a Physical Volume" 0 0
|
||||
fi
|
||||
;;
|
||||
VCREATE)
|
||||
GROUP=`SelectVolumeGroup`
|
||||
if [ $? = "0" ]; then
|
||||
CreateVolume $GROUP
|
||||
fi
|
||||
;;
|
||||
EXIT)
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
148
Viitor_Setup
Executable file
148
Viitor_Setup
Executable file
@ -0,0 +1,148 @@
|
||||
#!/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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user