Be sure that a clean environmentis used for lfs user in chapter05.

This commit is contained in:
Manuel Canales Esparcia 2005-09-29 18:50:18 +00:00
parent c355ad10e0
commit 44f88e31e9
2 changed files with 32 additions and 6 deletions

View file

@ -44,6 +44,10 @@
<!-- Creating dirs and files -->
<exsl:document href="{$dirname}/{$order}-{$filename}" method="text">
<xsl:text>#!/bin/sh&#xA;&#xA;</xsl:text>
<xsl:if test="sect2[@role='installation'] and
ancestor::chapter[@id='chapter-temporary-tools']">
<xsl:text>cd $PKGDIR &amp;&amp;&#xA;</xsl:text>
</xsl:if>
<xsl:apply-templates select=".//para/userinput | .//screen"/>
</exsl:document>
</xsl:if>

34
jhalfs
View file

@ -291,14 +291,26 @@ build_Makefile() {
# Insert instructions for unpacking the package and changing directories
echo -e "\t\$(call unpack-lfs,$FILE) && \\" >> $MKFILE.tmp
echo -e "\tROOT=\`head -n1 /tmp/unpacked | sed 's@/.*@@'\` && \\" >> $MKFILE.tmp
echo -e "\tcd \$(LFS)\$(SRC)/\$\$ROOT && \\" >> $MKFILE.tmp
echo -e "\tchown -R lfs \$(LFS)\$(SRC)/\$\$ROOT && \\" >> $MKFILE.tmp
echo -e "\techo \"PKGDIR=\$(LFS)\$(SRC)/\$\$ROOT\" > envars && \\" >> $MKFILE.tmp
echo -e "\techo \"export PKGDIR\" >> envars && \\" >> $MKFILE.tmp
fi
# Insert the script run
echo -e "\tsu lfs -c \". /home/lfs/.bashrc && $JHALFSDIR/commands/$file\" && \\" >> $MKFILE.tmp
echo -e "\tsu - lfs -c \". /home/lfs/.bashrc && $JHALFSDIR/commands/$file\" && \\" >> $MKFILE.tmp
# Include a touch of the target name so make can check if it's already been made.
# 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), including if the build has failed.
if [ "$vrs" != "" ] ; then
echo -e "\trm -r \$(LFS)\$(SRC)/\$\$ROOT && \\" >> $MKFILE.tmp
echo -e "\tif [ -e \$(LFS)\$(SRC)/*-build ]; then \\" >> $MKFILE.tmp
echo -e "\t\t rm -r \$(LFS)\$(SRC)/*-build; \\" >> $MKFILE.tmp
echo -e "\tfi;" >> $MKFILE.tmp
fi
done
# Stick a variable and some defines at the top of the real makefile
@ -318,15 +330,22 @@ build_Makefile() {
echo -e "chapter5: $chapter5\n" >> $MKFILE
# Clean targets
echo "clean: clean-chapter5 clean-chapter4" >> $MKFILE
echo "clean-chapter4:" >> $MKFILE
echo -e "\tuserdel lfs && \\" >> $MKFILE
echo -e "\trm -r /home/lfs && \\" >> $MKFILE
echo -e "\trm -r \$(LFS)/tools && \\" >> $MKFILE
echo -e "\trm /tools" >> $MKFILE
echo -e "\trm $JHALFSDIR/02*\n" >> $MKFILE
echo -e "\trm 02*\n" >> $MKFILE
# The chapter4 sub-targets are hard-coded to can create the lfs user and
# environment, and to make the scripts executables (as part of 021-addinguser).
echo "clean-chapter5:" >> $MKFILE
echo -e "\trm -r \$(LFS)/tools/* && \\" >> $MKFILE
echo -e "\trm -f $chapter5\n" >> $MKFILE
# The chapter4 sub-targets are hard-coded to can create the lfs user,
# to make the scripts executables, and to create a clean environment
# for the lfs user.
echo "020-creatingtoolsdir:" >> $MKFILE
echo -e "\tmkdir \$(LFS)/tools && \\" >> $MKFILE
echo -e "\tln -s \$(LFS)/tools / && \\" >> $MKFILE
@ -349,7 +368,10 @@ build_Makefile() {
echo -e "\techo \"LC_ALL=POSIX\" >> /home/lfs/.bashrc && \\" >> $MKFILE
echo -e "\techo \"PATH=/tools/bin:/bin:/usr/bin\" >> /home/lfs/.bashrc && \\" >> $MKFILE
echo -e "\techo \"export LFS LC_ALL PATH\" >> /home/lfs/.bashrc && \\" >> $MKFILE
# Source the file where we place changing variables.
echo -e "\techo \". $JHALFSDIR/envars\" >> /home/lfs/.bashrc && \\" >> $MKFILE
echo -e "\tchown lfs /home/lfs/.bash* && \\" >> $MKFILE
echo -e "\ttouch envars && \\" >> $MKFILE
echo -e "\ttouch \$@\n" >> $MKFILE