ViitorMake/BaseBuild/makeViitor
kueller 93a0fbc08c Anpassungen an V963, Einarbeitung der neuesten CLFS Version
git-svn-id: svn://svn.compuextreme.de/Viitor/V963/ViitorMake@5990 504e572c-2e33-0410-9681-be2bf7408885
2011-02-24 10:11:38 +00:00

180 lines
4.2 KiB
Bash
Executable File

#!/bin/bash
#Framework, welches ein komplettes Linux System aus den Sourcen erstellt
#dieses Framework wird im CVS Repository
#:pserver:cvs.tramp-bbs.de:/opt/cvs zur Verfügung gestellt
#
#Lage dieser Datei im Archiv: $HeadURL$
#
#(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.
#
#Beschreibung:
#Basis Build einer ViitorLinux Distribution
#
#Aufrufparameter:
# -h gibt alle parameter aus
#
#Letzte Änderung von: $Author$
#Datum der letzten Änderung: $Date$
#Version der Datei: $Revision$
#
if [ -f /tmp/debugdyn ]; then
rm /tmp/debugdyn
fi
if [ ! -f $HOME/.ViitorMake ]; then
echo "Please run Scripts/initViitorMake"
echo "From ViitorMake Root Direktory"
echo "This will create a File $HOME/.ViitorMake"
echo "with necessary information for running"
echo "ViitorMake Scripts"
exit 10
fi
source $HOME/.ViitorMake
WDIR=`pwd`
source $VMAKEDIR/functions/functions
source $VMAKEDIR/defsys
TMPPATH=/tmp/makeViitor
umask 022
while getopts :lsdaucb opt_char; do
case $opt_char in
l)
ONLYSTAT=true
;;
b)
export DEBUGDYN=true
touch /tmp/debugdyn
;;
a)
STATARCH=true
;;
u)
USEARCHIVE=true
;;
d)
DEBUGGING=true
;;
s)
ONLYDYN=true
;;
c)
CHECK=true
export CHECK
;;
\?)
echo "USAGE: $0 -dsbc "
echo "-l : Only make static System"
echo "-s : Only make dynamic System"
echo "-a : Generate Static System Archive"
echo "-u : Use static sys archive"
echo "-d : Make static sys with debug"
echo "-b : Make Dynamic System with debug"
echo "-c : Softwaretest beim build aktivieren"
exit 1
;;
esac
done
if [ ! -d $TMPPATH ]; then
mkdir -p $TMPPATH
fi
source $VMAKEDIR/BaseBuild/distdirs
if [ ! "$ONLYDYN" == "true" ]; then
CheckError "Could not generate Distribution dirs"
fi
if [ ! "$ONLYDYN" == "true" ]; then
echo "Building static linux System"
if [ ! -d $LFS/tools ]; then
mkdir $LFS/tools
fi
if [ ! -d $LFS/cross-tools ]; then
mkdir $LFS/cross-tools
fi
if [ ! -h /tools ]; then
ln -sf $LFS/tools /tools
fi
if [ ! -h /cross-tools ]; then
ln -sf $LFS/cross-tools /cross-tools
fi
for i in `cat crosschain/crosschain.dmk|awk '{print $2}'`; do
if [ ! "$DEBUGGING" == "true" ]; then
$VMAKEDIR/genpkg -b $TMPPATH -m $i
else
$VMAKEDIR/genpkg -b $TMPPATH -dm $i
fi
done
for i in `cat toolchain/toolchain.dmk|awk '{print $2}'`; do
if [ ! "$DEBUGGING" == "true" ]; then
$VMAKEDIR/genpkg -b $TMPPATH -m $i
else
$VMAKEDIR/genpkg -b $TMPPATH -dm $i
fi
done
fi
if [ ! -d $LFS/$SRCMNTPOINT ]; then
mkdir $LFS/$SRCMNTPOINT
fi
if [ "$STATARCH" == "true" ]; then
cd $LFS
tar -jcvf $DISTTARGET/static_sys.tbz .
cd -
fi
if [ ! "$ONLYSTAT" == "true" ]; then
if [ "$USEARCHIVE" == "true" ]; then
cd $LFS
tar -jxvf $DISTTARGET/static_sys.tbz .
cd -
fi
if [ "$ONLYDYN" == "true" ]; then
$VMAKEDIR/genpkg -m toolchain/ViitorMake
rm $LFS/root/.bash_profile
$VMAKEDIR/genpkg -m toolchain/bash_profile
fi
mount $SOURCEDEV $LFS/$SRCMNTPOINT
mkdir -vp $LFS/{dev,proc,sys}
install -dv $LFS/{/var,}/tmp -m 1777
mount -o bind /dev $LFS/dev
mount -o bind /proc $LFS/proc
mount -o bind /sys $LFS/sys
mount -t tmpfs none $LFS/tmp
mount -t tmpfs tmpfs $LFS/dev/shm
mount -t devpts devpts $LFS/dev/pts
if [ "$DEBUGGING" == "true" ]; then
echo "Cross and Base tools ready. chroot to $LFS"
read
fi
echo "export VMAKEDIR=/usr/src/ViitorMake" >$LFS/root/.ViitorMake
chroot $LFS /tools/bin/env -i HOME=/root TERM=$TERM \
PS1='\u: \w\$ ' \
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \
/tools/bin/bash \
--login +h
umount $LFS/$SRCMNTPOINT
fi