Started the addition of Chapter06

This commit is contained in:
Manuel Canales Esparcia 2005-10-02 12:05:57 +00:00
parent e909d9d5b1
commit 97a3ffc864

113
jhalfs
View file

@ -125,7 +125,7 @@ SVN="svn://svn.linuxfromscratch.org"
HTTP=http://ftp.lfs-matrix.net/pub/lfs/lfs-packages/conglomeration
if [ -z $BUILDDIR ] ; then BUILDDIR=/mnt/lfs ; fi
JHALFSDIR=$BUILDDIR/jhalfs
LOGDIR=$JHALFSDIR/logs
LOGDIR=/jhalfs/logs
LOG=000-jhalfs.log
MKFILE=$JHALFSDIR/Makefile
XSL=dump-lfs-scripts.xsl
@ -156,9 +156,9 @@ get_book() {
fi
else
if [ $LFSVRS = development ] ; then
svn co $SVN/LFS/trunk/BOOK lfs-$LFSVRS >>$LOGDIR/$LOG 2>&1
svn co $SVN/LFS/trunk/BOOK lfs-$LFSVRS >>$BUILDDIR$LOGDIR/$LOG 2>&1
else
svn co $SVN/LFS/branches/$LFSVRS/BOOK lfs-$LFSVRS >>$LOGDIR/$LOG 2>&1
svn co $SVN/LFS/branches/$LFSVRS/BOOK lfs-$LFSVRS >>$BUILDDIR$LOGDIR/$LOG 2>&1
fi
echo -ne "done\n"
extract_commands
@ -177,7 +177,7 @@ extract_commands() {
# Dump the commands in shell script form from the LFS book.
xsltproc --nonet --xinclude --stringparam testsuite $TEST -o ./commands/ \
$XSL lfs-$LFSVRS/index.xml >>$LOGDIR/$LOG 2>&1
$XSL lfs-$LFSVRS/index.xml >>$BUILDDIR$LOGDIR/$LOG 2>&1
# Grab the patches and package names.
cd $JHALFSDIR
@ -317,13 +317,18 @@ build_Makefile() {
echo -e "\techo \"export PKGDIR\" >> envars && \\" >> $MKFILE.tmp
fi
# Dump the path to the Binutils or TCL sources directory.
if [ "$i" = "027-binutils-pass1" -o "$i" = "032-tcl" -o "$i" = "036-binutils-pass2" ] ; then
# Dump the path to the Binutils pass1 or TCL sources directory.
if [ "$i" = "027-binutils-pass1" -o "$i" = "032-tcl" ] ; then
echo -e "\techo \"\$(LFS)\$(SRC)/\$\$ROOT\" > sources-dir && \\" >> $MKFILE.tmp
fi
# Dump the path to the Binutils pass2 sources directory.
if [ "$i" = "036-binutils-pass2" ] ; then
echo -e "\techo \"\$(SRC)/\$\$ROOT\" > sources-dir && \\" >> $MKFILE.tmp
fi
# Inser date and disk usage at the top of the log file.
echo -e "\techo -e \"\\\n\`date\`\\\n\\\nKB: \`du -sk --exclude=0??-* \$(LFS)\`\\\n\" >\$(LOGDIR)/$i && \\" >> $MKFILE.tmp
echo -e "\techo -e \"\\\n\`date\`\\\n\\\nKB: \`du -sk --exclude=0??-* \$(LFS)\`\\\n\" >\$(LFS)\$(LOGDIR)/$i && \\" >> $MKFILE.tmp
# For the Adjusting phase we must to cd to the binutils-build directory.
if [ "$i" = "031-adjusting" ] ; then
@ -331,17 +336,17 @@ build_Makefile() {
echo -e "\techo \"export PKGDIR\" >> envars && \\" >> $MKFILE.tmp
fi
# For the Exp0ect build we need to set the TCLPATH envar.
# For the Expect build we need to set the TCLPATH envar.
if [ "$i" = "033-expect" ] ; then
echo -e "\techo \"TCLPATH=\`cat sources-dir\`\" >> envars && \\" >> $MKFILE.tmp
echo -e "\techo \"export TCLPATH\" >> envars && \\" >> $MKFILE.tmp
fi
# Insert the script run
echo -e "\tsu - lfs -c \". /home/lfs/.bashrc && $JHALFSDIR/commands/$file\" >>\$(LOGDIR)/$i 2>&1 && \\" >> $MKFILE.tmp
echo -e "\tsu - lfs -c \". /home/lfs/.bashrc && $JHALFSDIR/commands/$file\" >>\$(LFS)\$(LOGDIR)/$i 2>&1 && \\" >> $MKFILE.tmp
# Inser date and disk usage at the bottom of the log file.
echo -e "\techo -e \"\\\n\`date\`\\\n\\\nKB: \`du -sk --exclude=0??-* \$(LFS)\`\\\n\" >>\$(LOGDIR)/$i && \\" >> $MKFILE.tmp
echo -e "\techo -e \"\\\n\`date\`\\\n\\\nKB: \`du -sk --exclude=0??-* \$(LFS)\`\\\n\" >>\$(LFS)\$(LOGDIR)/$i && \\" >> $MKFILE.tmp
# Include a touch of the target name so make can check
# if it's already been made.
@ -399,6 +404,85 @@ build_Makefile() {
PREV=$i
done
for file in chapter06/* ; do
# Keep the script file name
i=`basename $file`
# First append each name of the script files to a list (this will become
# the names of the targets in the Makefile
chapter6="$chapter6 $i"
# Grab the name of the target
name=`echo $i | sed -e 's@[0-9]\{3\}-@@'`
# Set the dependency for the first target.
if [ -z $PREV ] ; then PREV=055-stripping ; fi
# Drop in the name of the target on a new line, and the previous target
# as a dependency.
echo -e "\n$i: $PREV" >> $MKFILE.tmp
# Find the version of the command files, if it corresponds with the building of
# a specific package
vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
# If $vrs isn't empty, we've got a package...
if [ "$vrs" != "" ] ; then
FILE="$name-$vrs.tar.bz2"
# Insert instructions for unpacking the package and changing directories
echo -e "\t\$(call unpack,$FILE)" >> $MKFILE.tmp
echo -e "\t-ROOT=\`head -n1 /tmp/unpacked | sed 's@/.*@@'\` && \\" >> $MKFILE.tmp
echo -e "\tcd \$(SRC)/\$\$ROOT && \\" >> $MKFILE.tmp
fi
# Inser date and disk usage at the top of the log file.
echo -e "\techo -e \"\\\n\`date\`\\\n\\\nKB: \`du -sk --exclude=0??-* /\`\\\n\" >\$(LOGDIR)/$i && \\" >> $MKFILE.tmp
# For the Re-Adjusting phase we must to cd to the binutils-build directory.
if [ "$i" = "067-readjusting" ] ; then
echo -e "\tcd \$(SRC)/binutils-build && \\" >> $MKFILE.tmp
fi
# Insert the script run
echo -e "\t/jhalfs/commands/$file >>\$(LOGDIR)/$i 2>&1 && \\" >> $MKFILE.tmp
# Inser date and disk usage at the bottom of the log file.
echo -e "\techo -e \"\\\n\`date\`\\\n\\\nKB: \`du -sk --exclude=0??-* \$(LFS)\`\\\n\" >>\$(LOGDIR)/$i && \\" >> $MKFILE.tmp
# Include a touch of the target name so make can check
# if it's already been made.
echo -e "\ttouch \$@" >> $MKFILE.tmp
# Remove the build directory(ies) even if the package build fails, except for
# Binutils and TCL. In that cases the sources directories are removed
# only if the build fails.
if [ "$vrs" != "" ] ; then
echo -e "\tROOT=\`head -n1 /tmp/unpacked | sed 's@/.*@@'\` && \\" >> $MKFILE.tmp
echo -e "\trm -r \$(SRC)/\$\$ROOT && \\" >> $MKFILE.tmp
echo -e "\tif [ -e \$(SRC)/$name-build ]; then \\" >> $MKFILE.tmp
echo -e "\t\trm -r \$(SRC)/$name-build; \\" >> $MKFILE.tmp
echo -e "\tfi;" >> $MKFILE.tmp
fi
# Remove the Binutils pass 2 sources after a sucessfull Re-Adjusting phase.
if [ "$i" = "031-adjusting" ] ; then
echo -e "\tif [ -e \$@ ] ; then \\" >> $MKFILE.tmp
echo -e "\t\trm -r \`cat sources-dir\` && \\" >> $MKFILE.tmp
echo -e "\t\trm -r \$(SRC)/binutils-build && \\" >> $MKFILE.tmp
echo -e "\t\trm sources-dir; \\" >> $MKFILE.tmp
echo -e "\tfi;" >> $MKFILE.tmp
fi
# Check if the package has been sucessfully build.
echo -e "\tif [ ! -e \$@ ] ; then \\" >> $MKFILE.tmp
echo -e "\t\techo \"The build of \$@ has failed\" && exit 1; \\" >> $MKFILE.tmp
echo -e "\tfi;" >> $MKFILE.tmp
# Keep the script file name for Makefile dependencies.
PREV=$i
done
# Stick variables and some defines at the top of the real makefile
echo "export SRC := /sources" > $MKFILE
echo "export LFS := $BUILDDIR" >> $MKFILE
@ -414,7 +498,8 @@ build_Makefile() {
# as a dependency.
echo -e "all: chapter4 chapter5\n" >> $MKFILE
echo -e "chapter4: 020-creatingtoolsdir 021-addinguser 022-settingenvironment\n" >> $MKFILE
echo -e "chapter5: chapter4 $chapter5\n" >> $MKFILE
echo -e "chapter5: chapter4 $chapter5\n" >> $MKFILE >> $MKFILE
echo -e "chapter6: chapter5 $chapter6\n" >> $MKFILE
# Clean targets
echo "clean-all: clean" >> $MKFILE
@ -489,11 +574,11 @@ if [ ! -d $JHALFSDIR ] ; then
mkdir -p $JHALFSDIR
fi
if [ ! -d $LOGDIR ] ; then
mkdir $LOGDIR
if [ ! -d $BUILDDIR$LOGDIR ] ; then
mkdir $BUILDDIR$LOGDIR
fi
>$LOGDIR/$LOG
>$BUILDDIR$LOGDIR/$LOG
if [ "$PWD" != "$JHALFSDIR" ] ; then
cp $0 $XSL $JHALFSDIR/