2008-05-03 17:01:13 +00:00
|
|
|
|
#!/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<72>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 <20>nderung von: $Author$
|
|
|
|
|
#Datum der letzten <20>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
|
2010-03-02 19:04:07 +00:00
|
|
|
|
mount -o bind /dev $LFS/dev
|
2010-03-02 18:58:41 +00:00
|
|
|
|
mount -o bind /proc $LFS/proc
|
|
|
|
|
mount -o bind /sys $LFS/sys
|
|
|
|
|
mount -t tmpfs none $LFS/tmp
|
2008-05-03 17:01:13 +00:00
|
|
|
|
|
|
|
|
|
if [ "$DEBUGGING" == "true" ]; then
|
|
|
|
|
echo "Cross and Base tools ready. chroot to $LFS"
|
|
|
|
|
read
|
|
|
|
|
fi
|
2010-01-27 10:37:28 +00:00
|
|
|
|
echo "export VMAKEDIR=/usr/src/ViitorMake" >$LFS/root/.ViitorMake
|
2008-05-03 17:01:13 +00:00
|
|
|
|
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
|