Compare commits

...

17 Commits

Author SHA1 Message Date
Manuel Canales Esparcia 5106d3ed52 Fixed XSL typos. 2006-08-17 17:19:33 +00:00
Manuel Canales Esparcia 2db2151e20 Merged r2969 from trunk. 2006-08-16 20:17:38 +00:00
Manuel Canales Esparcia ae0172be70 Merged r2961 from trunk. 2006-08-15 14:54:30 +00:00
Manuel Canales Esparcia 7d2638a65a Rediffied 1.0 branch paco patch. 2006-08-08 18:01:04 +00:00
Manuel Canales Esparcia 9357c13af5 Ported LUSER code to 1.0 branch. 2006-08-08 17:36:51 +00:00
Manuel Canales Esparcia 50c8292b0a Updated paco patch on 1.0 branch. 2006-08-05 16:13:38 +00:00
Manuel Canales Esparcia 05ccaa9862 Ported r2882 from trunk. 2006-08-05 15:11:06 +00:00
Manuel Canales Esparcia d1435bf3f5 Ported r2879 from trunk. 2006-08-05 11:49:45 +00:00
George Boudreau 4db714a8fe CLFS, corrected install of udev-rules if method=boot, thanks Tor Olav 2006-08-04 14:29:00 +00:00
George Boudreau 0a3f3d7a27 port last of HLFS fixes to 1.0 2006-08-01 21:31:32 +00:00
Manuel Canales Esparcia d82b9352f0 Fixed the paco patch update. 2006-07-30 16:36:54 +00:00
Manuel Canales Esparcia 6921b21e51 Updated paco patch from upstream, adapted to 1.0 branch. 2006-07-30 15:13:03 +00:00
Manuel Canales Esparcia b8020acc2e Typo fix 2006-07-30 14:39:32 +00:00
Manuel Canales Esparcia 83d73fb985 Ported new HLFS code and LFS Udev fix to 1.0 branch. 2006-07-30 11:34:49 +00:00
Manuel Canales Esparcia 95a954c087 Merged r2838 from trunk: spelling fixes pointed by Chris Staub. 2006-07-24 18:43:48 +00:00
Manuel Canales Esparcia bae64d8dae Updated version for 1.0 branch. 2006-07-23 08:45:05 +00:00
Manuel Canales Esparcia 6349f226a4 Created 1.0 branch 2006-07-23 08:39:14 +00:00
19 changed files with 1155 additions and 587 deletions

View File

@ -24,7 +24,7 @@ BOOK_Source() { #
externals: none
modifies: $BLFS_XML directory tree
returns: nothing
output:
output:
on error: exit
on success: text messages
inline_doc
@ -32,7 +32,7 @@ inline_doc
# Redundant definitions but this function may be reused
local BLFS_XML=$1
local DOC_MODE=$2
if [[ -z "$BLFS_XML" ]] ; then
echo -e "\n\tYou must to provide the name of the BLFS book sources directory.\n"
exit 1
@ -45,7 +45,7 @@ inline_doc
echo -e "\n\t$BLFS_XML is not a directory\n"
exit 1
fi
if [[ ! -f $BLFS_XML/use-unzip.xml ]] ; then
if [[ ! -f $BLFS_XML/x/x.xml ]] ; then
echo -e "\n\tLooks like $BLFS_XML is not a BLFS book sources directory\n"
exit 1
fi
@ -61,7 +61,7 @@ inline_doc
echo -e "\tSkipping BLFS sources update.\n"
fi
;;
get )
[[ ! -d $BLFS_XML ]] && mkdir -pv $BLFS_XML
svn co $SVN/BLFS/trunk/BOOK $BLFS_XML 2>&1

View File

@ -23,9 +23,16 @@
0 = none
1 = only Glibc, GCC and Binutils testsuites
2 = all testsuites
3 = alias to 2 -->
3 = alias to 2
-->
<xsl:param name="testsuite" select="1"/>
<!-- Bomb on test suites failures?
0 = no, I want to build the full system and review the logs
1 = yes, bomb at the first test suite failure to can review the build dir
-->
<xsl:param name="bomb-testsuite" select="0"/>
<!-- Install vim-lang package? -->
<xsl:param name="vim-lang" select="1"/>
@ -117,10 +124,22 @@
<xsl:if test="(contains(string(),'test') or
contains(string(),'check')) and
($testsuite = '2' or $testsuite = '3')">
<xsl:value-of select="substring-before(string(),'make')"/>
<xsl:text>make -k</xsl:text>
<xsl:value-of select="substring-after(string(),'make')"/>
<xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
<xsl:choose>
<xsl:when test="$bomb-testsuite = '0'">
<xsl:value-of select="substring-before(string(),'make')"/>
<xsl:text>make -k</xsl:text>
<xsl:value-of select="substring-after(string(),'make')"/>
<xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
<xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1</xsl:text>
<xsl:if test="contains(string(),' -k ')">
<xsl:text> || true</xsl:text>
</xsl:if>
<xsl:text>&#xA;</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:template>
@ -172,11 +191,28 @@
<xsl:choose>
<xsl:when test="$testsuite = '0' or $testsuite = '1'"/>
<xsl:otherwise>
<xsl:apply-templates/>
<xsl:if test="contains(string(),'check')">
<xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true</xsl:text>
<xsl:if test="not(contains(string(),'check'))">
<xsl:apply-templates/>
<xsl:text>&#xA;</xsl:text>
</xsl:if>
<xsl:if test="contains(string(),'check')">
<xsl:choose>
<xsl:when test="$bomb-testsuite = '0'">
<xsl:value-of select="substring-before(string(),'check')"/>
<xsl:text>-k check</xsl:text>
<xsl:value-of select="substring-after(string(),'check')"/>
<xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
<xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1</xsl:text>
<xsl:if test="contains(string(),' -k ')">
<xsl:text> || true</xsl:text>
</xsl:if>
<xsl:text>&#xA;</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:text>&#xA;</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
@ -185,7 +221,19 @@
string() = 'make -k check'">
<xsl:choose>
<xsl:when test="$testsuite != '0'">
<xsl:text>make -k check &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
<xsl:choose>
<xsl:when test="$bomb-testsuite = '0'">
<xsl:text>make -k check &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
<xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1</xsl:text>
<xsl:if test="contains(string(),' -k ')">
<xsl:text> || true</xsl:text>
</xsl:if>
<xsl:text>&#xA;</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:when>
@ -193,7 +241,18 @@
<xsl:choose>
<xsl:when test="$testsuite != '0'">
<xsl:value-of select="substring-before(string(),'&gt;g')"/>
<xsl:text>&gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
<xsl:choose>
<xsl:when test="$bomb-testsuite = '0'">
<xsl:text>&gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>&gt;&gt; $TEST_LOG 2&gt;&amp;1</xsl:text>
<xsl:if test="contains(string(),' -k ')">
<xsl:text> || true</xsl:text>
</xsl:if>
<xsl:text>&#xA;</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:when>
@ -202,10 +261,7 @@
<xsl:choose>
<xsl:when test="$testsuite != '0'">
<xsl:apply-templates/>
<xsl:if test="contains(string(),'test_summary')">
<xsl:text> &gt;&gt; $TEST_LOG</xsl:text>
</xsl:if>
<xsl:text>&#xA;</xsl:text>
<xsl:text> &gt;&gt; $TEST_LOG&#xA;</xsl:text>
</xsl:when>
</xsl:choose>
</xsl:when>

View File

@ -38,6 +38,10 @@ TARGET=
# NOTE: not all combinations are 'bootable' yet.
METHOD=chroot
#--- Unprivileged user and group name
LUSER=clfs
LGROUP=clfs
#--- Location of fstab file (if empty, a template is created)
FSTAB=

View File

@ -41,43 +41,43 @@ cat << EOF
025-addinguser: 024-creatingcrossdir
@\$(call echo_message, Building)
@if [ ! -d /home/clfs ]; then \\
groupadd clfs; \\
useradd -s /bin/bash -g clfs -m -k /dev/null clfs; \\
@if [ ! -d /home/\$(LUSER) ]; then \\
groupadd \$(LGROUP); \\
useradd -s /bin/bash -g \$(LGROUP) -m -k /dev/null \$(LUSER); \\
else \\
touch user-clfs-exist; \\
touch luser-exist; \\
fi;
@chown clfs \$(MOUNT_PT) && \\
chown clfs \$(MOUNT_PT)/tools && \\
chown clfs \$(MOUNT_PT)/cross-tools && \\
chown clfs \$(MOUNT_PT)/sources && \\
@chown \$(LUSER) \$(MOUNT_PT) && \\
chown \$(LUSER) \$(MOUNT_PT)/tools && \\
chown \$(LUSER) \$(MOUNT_PT)/cross-tools && \\
chown \$(LUSER) \$(MOUNT_PT)/sources && \\
touch \$@ && \\
echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
echo --------------------------------------------------------------------------------\$(WHITE)
026-settingenvironment: 025-addinguser
@\$(call echo_message, Building)
@if [ -f /home/clfs/.bashrc -a ! -f /home/clfs/.bashrc.XXX ]; then \\
mv /home/clfs/.bashrc /home/clfs/.bashrc.XXX; \\
@if [ -f /home/\$(LUSER)/.bashrc -a ! -f /home/\$(LUSER)/.bashrc.XXX ]; then \\
mv /home/\$(LUSER)/.bashrc /home/\$(LUSER)/.bashrc.XXX; \\
fi;
@if [ -f /home/clfs/.bash_profile -a ! -f /home/clfs/.bash_profile.XXX ]; then \\
mv /home/clfs/.bash_profile /home/clfs/.bash_profile.XXX; \\
@if [ -f /home/\$(LUSER)/.bash_profile -a ! -f /home/\$(LUSER)/.bash_profile.XXX ]; then \\
mv /home/\$(LUSER)/.bash_profile /home/\$(LUSER)/.bash_profile.XXX; \\
fi;
@echo "set +h" > /home/clfs/.bashrc && \\
echo "umask 022" >> /home/clfs/.bashrc && \\
echo "CLFS=\$(MOUNT_PT)" >> /home/clfs/.bashrc && \\
echo "LC_ALL=POSIX" >> /home/clfs/.bashrc && \\
echo "PATH=/cross-tools/bin:/bin:/usr/bin" >> /home/clfs/.bashrc && \\
echo "export CLFS LC_ALL PATH" >> /home/clfs/.bashrc && \\
echo "" >> /home/clfs/.bashrc && \\
echo "unset CFLAGS" >> /home/clfs/.bashrc && \\
echo "unset CXXFLAGS" >> /home/clfs/.bashrc && \\
echo "" >> /home/clfs/.bashrc && \\
echo "export CLFS_HOST=\"${CLFS_HOST}\"" >> /home/clfs/.bashrc && \\
echo "export CLFS_TARGET=\"${TARGET}\"" >> /home/clfs/.bashrc && \\
echo "export CLFS_TARGET32=\"${TARGET32}\"" >> /home/clfs/.bashrc && \\
echo "source $JHALFSDIR/envars" >> /home/clfs/.bashrc
@chown clfs:clfs /home/clfs/.bashrc && \\
@echo "set +h" > /home/\$(LUSER)/.bashrc && \\
echo "umask 022" >> /home/\$(LUSER)/.bashrc && \\
echo "CLFS=\$(MOUNT_PT)" >> /home/\$(LUSER)/.bashrc && \\
echo "LC_ALL=POSIX" >> /home/\$(LUSER)/.bashrc && \\
echo "PATH=/cross-tools/bin:/bin:/usr/bin" >> /home/\$(LUSER)/.bashrc && \\
echo "export CLFS LC_ALL PATH" >> /home/\$(LUSER)/.bashrc && \\
echo "" >> /home/\$(LUSER)/.bashrc && \\
echo "unset CFLAGS" >> /home/\$(LUSER)/.bashrc && \\
echo "unset CXXFLAGS" >> /home/\$(LUSER)/.bashrc && \\
echo "" >> /home/\$(LUSER)/.bashrc && \\
echo "export CLFS_HOST=\"${CLFS_HOST}\"" >> /home/\$(LUSER)/.bashrc && \\
echo "export CLFS_TARGET=\"${TARGET}\"" >> /home/\$(LUSER)/.bashrc && \\
echo "export CLFS_TARGET32=\"${TARGET32}\"" >> /home/\$(LUSER)/.bashrc && \\
echo "source $JHALFSDIR/envars" >> /home/\$(LUSER)/.bashrc
@chown \$(LUSER):\$(LGROUP) /home/\$(LUSER)/.bashrc && \\
touch envars && \\
touch \$@ && \\
echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
@ -131,9 +131,9 @@ cross_tools_Makefiles() { #
#
# If $pkg_tarball isn't empty, we've got a package...
#
[[ "$pkg_tarball" != "" ]] && wrt_unpack_clfs "$pkg_tarball"
[[ "$pkg_tarball" != "" ]] && wrt_unpack "$pkg_tarball"
#
wrt_run_as_clfs_su "${this_script}" "${file}"
wrt_RunAsUser "${this_script}" "${file}"
#
[[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
#
@ -190,10 +190,10 @@ temptools_Makefiles() { #
# If $pkg_tarball isn't empty, we've got a package...
# Insert instructions for unpacking the package and to set the PKGDIR variable.
#
[[ "$pkg_tarball" != "" ]] && wrt_unpack_clfs "$pkg_tarball"
[[ "$pkg_tarball" != "" ]] && wrt_unpack "$pkg_tarball"
[[ "$pkg_tarball" != "" ]] && [[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
#
wrt_run_as_clfs_su "${this_script}" "${file}"
wrt_RunAsUser "${this_script}" "${file}"
#
[[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
#
@ -262,20 +262,20 @@ boot_Makefiles() { #
# If $pkg_tarball isn't empty, we've got a package...
# Insert instructions for unpacking the package and changing directories
#
[[ "$pkg_tarball" != "" ]] && wrt_unpack_clfs "$pkg_tarball"
[[ "$pkg_tarball" != "" ]] && wrt_unpack "$pkg_tarball"
[[ "$pkg_tarball" != "" ]] && [[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
#
# Select a script execution method
case $this_script in
*changingowner*) wrt_run_as_clfs_root "${this_script}" "${file}" ;;
*devices*) wrt_run_as_clfs_root "${this_script}" "${file}" ;;
*changingowner*) wrt_RunAsRoot "${this_script}" "${file}" ;;
*devices*) wrt_RunAsRoot "${this_script}" "${file}" ;;
*fstab*) if [[ -n "$FSTAB" ]]; then
wrt_copy_fstab "${this_script}"
else
wrt_run_as_clfs_su "${this_script}" "${file}"
wrt_RunAsUser "${this_script}" "${file}"
fi
;;
*) wrt_run_as_clfs_su "${this_script}" "${file}" ;;
*) wrt_RunAsUser "${this_script}" "${file}" ;;
esac
#
# Housekeeping...remove any build directory(ies) except if the package build fails.
@ -332,7 +332,7 @@ chroot_Makefiles() { #
#
if [ "$pkg_tarball" != "" ] ; then
case $this_script in
*util-linux) wrt_unpack_clfs "$pkg_tarball" ;;
*util-linux) wrt_unpack "$pkg_tarball" ;;
*) wrt_unpack2 "$pkg_tarball" ;;
esac
[[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
@ -340,9 +340,9 @@ chroot_Makefiles() { #
#
# Select a script execution method
case $this_script in
*kernfs) wrt_run_as_clfs_root "${this_script}" "${file}" ;;
*util-linux) wrt_run_as_clfs_su "${this_script}" "${file}" ;;
*) wrt_run_as_chroot1 "${this_script}" "${file}" ;;
*kernfs) wrt_RunAsRoot "${this_script}" "${file}" ;;
*util-linux) wrt_RunAsUser "${this_script}" "${file}" ;;
*) wrt_run_as_chroot1 "${this_script}" "${file}" ;;
esac
#
# Housekeeping...remove the build directory(ies), except if the package build fails.
@ -757,7 +757,7 @@ bm_bootscripts_Makefiles() { #
this_script=`basename $file`
case $this_script in
*udev*) continue ;; # This is not a script but a commentary
*udev) continue ;; # This is not a script but a commentary
*console*) continue ;; # Use the files that came with the bootscripts
*) ;;
esac
@ -773,8 +773,8 @@ bm_bootscripts_Makefiles() { #
-e 's@64@@' \
-e 's@n32@@'`
case $name in
*bootscripts*) name=bootscripts-cross-lfs
;;
*bootscripts*) name=bootscripts-cross-lfs ;;
*udev-rules) name=udev-cross-lfs ;;
esac
pkg_tarball=$(get_package_tarball_name $name)
@ -1012,6 +1012,8 @@ $HEADER
SRC= /sources
MOUNT_PT= $BUILDDIR
PKG_LST= $PKG_LST
LUSER= $LUSER
LGROUP= $LGROUP
include makefile-functions
@ -1020,15 +1022,20 @@ EOF
# Add chroot commands
if [ "$METHOD" = "chroot" ] ; then
chroot=`cat chroot/*chroot* | sed -e '/#!\/tools\/bin\/bash/d' \
-e '/^export/d' \
-e '/^logout/d' \
-e 's@ \\\@ @g' | tr -d '\n' | sed -e 's/ */ /g' \
-e 's|\\$|&&|g' \
-e 's|exit||g' \
-e 's|$| -c|' \
-e 's|"$$CLFS"|$(MOUNT_PT)|'\
-e 's|set -e||'`
CHROOT_LOC="`whereis -b chroot | cut -d " " -f2`"
chroot=`cat chroot/*chroot* | \
sed -e "s@chroot@$CHROOT_LOC@" \
-e '/#!\/tools\/bin\/bash/d' \
-e '/^export/d' \
-e '/^logout/d' \
-e 's@ \\\@ @g' | \
tr -d '\n' | \
sed -e 's/ */ /g' \
-e 's|\\$|&&|g' \
-e 's|exit||g' \
-e 's|$| -c|' \
-e 's|"$$CLFS"|$(MOUNT_PT)|'\
-e 's|set -e||'`
echo -e "CHROOT1= $chroot\n" >> $MKFILE
fi
@ -1046,7 +1053,7 @@ chapter3: chapter2 $cross_tools
chapter4: chapter3 $temptools
chapter5: chapter4 $chroottools $testsuitetools
chapter5: chapter4 $chroottools restore-luser-env $testsuitetools
chapter6: chapter5 $basicsystem
@ -1063,20 +1070,20 @@ restart:
@echo "This feature does not exist for the CLFS makefile. (yet)"
clean-chapter2:
-if [ ! -f user-clfs-exist ]; then \\
userdel clfs; \\
rm -rf /home/clfs; \\
-if [ ! -f luser-exist ]; then \\
userdel \$(LUSER); \\
rm -rf /home/\$(LUSER); \\
fi;
rm -rf \$(MOUNT_PT)/tools
rm -f /tools
rm -rf \$(MOUNT_PT)/cross-tools
rm -f /cross-tools
rm -f envars user-clfs-exist
rm -f envars luser-exist
rm -f 02* logs/02*.log
clean-chapter3:
rm -rf \$(MOUNT_PT)/tools/*
rm -f $cross_tools restore-clfs-env sources-dir
rm -f $cross_tools sources-dir
cd logs && rm -f $cross_tools && cd ..
clean-chapter4:
@ -1090,15 +1097,15 @@ clean-chapter4:
cd logs && rm -f $temptools && cd ..
restore-clfs-env:
restore-luser-env:
@\$(call echo_message, Building)
@if [ -f /home/clfs/.bashrc.XXX ]; then \\
mv -f /home/clfs/.bashrc.XXX /home/clfs/.bashrc; \\
@if [ -f /home/\$(LUSER)/.bashrc.XXX ]; then \\
mv -f /home/\$(LUSER)/.bashrc.XXX /home/\$(LUSER)/.bashrc; \\
fi;
@if [ -f /home/clfs/.bash_profile.XXX ]; then \\
mv /home/clfs/.bash_profile.XXX /home/clfs/.bash_profile; \\
@if [ -f /home/\$(LUSER)/.bash_profile.XXX ]; then \\
mv /home/\$(LUSER)/.bash_profile.XXX /home/\$(LUSER)/.bash_profile; \\
fi;
@chown clfs:clfs /home/clfs/.bash* && \\
@chown \$(LUSER):\$(LGROUP) /home/\$(LUSER)/.bash* && \\
touch \$@ && \\
echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
echo --------------------------------------------------------------------------------\$(WHITE)
@ -1109,9 +1116,9 @@ do-housekeeping:
@-umount \$(MOUNT_PT)/dev
@-umount \$(MOUNT_PT)/sys
@-umount \$(MOUNT_PT)/proc
@-if [ ! -f user-clfs-exist ]; then \\
userdel clfs; \\
rm -rf /home/clfs; \\
@-if [ ! -f luser-exist ]; then \\
userdel \$(LUSER); \\
rm -rf /home/\$(LUSER); \\
fi;
EOF
@ -1129,7 +1136,7 @@ makeboot: 023-creatingtoolsdir 024-creatingcrossdir 025-addinguser 026-settingen
$cross_tools\
$temptools \
$chroottools \
$boottools
$boottools restore-luser-env
@\$(call echo_boot_finished,$VERSION)
makesys: $testsuitetools $basicsystem $bootscripttools $bootabletools
@ -1145,21 +1152,21 @@ restart:
@echo "This feature does not exist for the CLFS makefile. (yet)"
clean-jhalfs:
-if [ ! -f user-clfs-exist ]; then \\
userdel clfs; \\
rm -rf /home/clfs; \\
-if [ ! -f luser-exist ]; then \\
userdel \$(LUSER); \\
rm -rf /home/\$(LUSER); \\
fi;
rm -rf \$(MOUNT_PT)/tools
rm -f /tools
rm -rf \$(MOUNT_PT)/cross-tools
rm -f /cross-tools
rm -f envars user-clfs-exist
rm -f envars luser-exist
rm -f 02* logs/02*.log
clean-makeboot:
rm -rf /tools/*
rm -f $cross_tools && rm -f $temptools && rm -f $chroottools && rm -f $boottools
rm -f restore-clfs-env sources-dir
rm -f restore-luser-env sources-dir
cd logs && rm -f $cross_tools && rm -f $temptools && rm -f $chroottools && rm -f $boottools && cd ..
clean-makesys:
@ -1175,15 +1182,15 @@ clean-makesys:
cd logs && rm -f $basicsystem && rm -f $bootscripttools && rm -f $bootabletools && cd ..
restore-clfs-env:
restore-luser-env:
@\$(call echo_message, Building)
@if [ -f /home/clfs/.bashrc.XXX ]; then \\
mv -fv /home/clfs/.bashrc.XXX /home/clfs/.bashrc; \\
@if [ -f /home/\$(LUSER)/.bashrc.XXX ]; then \\
mv -fv /home/\$(LUSER)/.bashrc.XXX /home/\$(LUSER)/.bashrc; \\
fi;
@if [ -f /home/clfs/.bash_profile.XXX ]; then \\
mv -v /home/clfs/.bash_profile.XXX /home/clfs/.bash_profile; \\
@if [ -f /home/\$(LUSER)/.bash_profile.XXX ]; then \\
mv -v /home/\$(LUSER)/.bash_profile.XXX /home/\$(LUSER)/.bash_profile; \\
fi;
@chown clfs:clfs /home/clfs/.bash* && \\
@chown \$(LUSER):\$(LGROUP) /home/\$(LUSER)/.bash* && \\
touch \$@ && \\
echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
echo --------------------------------------------------------------------------------\$(WHITE)

View File

@ -12,6 +12,10 @@ MODEL=glibc
#--- The host system has grsecurity options enabled? 0(no)/1(yes)
GRSECURITY_HOST=0
#--- Unprivileged user and group name
LUSER=hlfs
LGROUP=hlfs
#--- Location of fstab file (if empty, a template is created)
FSTAB=

View File

@ -26,9 +26,16 @@
0 = none
1 = only chapter06 Glibc, GCC and Binutils testsuites
2 = all chapter06 testsuites
3 = all chapter05 and chapter06 testsuites-->
3 = alias to 2
-->
<xsl:param name="testsuite" select="1"/>
<!-- Bomb on test suites failures?
0 = no, I want to build the full system and review the logs
1 = yes, bomb at the first test suite failure to can review the build dir
-->
<xsl:param name="bomb-testsuite" select="0"/>
<!-- Time zone -->
<xsl:param name="timezone" select="GMT"/>
@ -94,32 +101,30 @@
</xsl:otherwise>
</xsl:choose>
<xsl:if test="(sect2[@role='installation'] and
not(@id='bootable-kernel')) or
@id='ch-tools-adjusting' or
@id='ch-system-readjusting'">
not(@id='bootable-kernel'))">
<xsl:text>cd $PKGDIR&#xA;</xsl:text>
<xsl:if test="@id='ch-tools-uclibc' or @id='ch-system-uclibc'">
<xsl:text>pushd ../; tar -xvf gettext-&gettext-version;.*; popd; &#xA;</xsl:text>
</xsl:if>
<xsl:if test="@id='ch-tools-glibc' or @id='ch-system-glibc'">
<xsl:text>tar -xvf ../glibc-libidn-&glibc-version;.*&#xA;</xsl:text>
<!-- NEW toolchain format, from inside ./sources dir unpack binutils and gcc -->
<xsl:if test="@id='ch-tools-embryo-toolchain' or
@id='ch-tools-cocoon-toolchain' or
@id='ch-system-butterfly-toolchain'">
<xsl:text>tar -xvf gcc-core-&gcc-version;.*; &#xA;</xsl:text>
<xsl:text>tar -xvf gcc-g++-&gcc-version;.*; &#xA;</xsl:text>
<xsl:text>tar -xvf binutils-&binutils-version;.*; &#xA;</xsl:text>
</xsl:if>
<xsl:if test="@id='ch-tools-gcc' or @id='ch-system-gcc'">
<xsl:text>pushd ../; tar -xvf gcc-g++-&gcc-version;.*; popd; &#xA;</xsl:text>
</xsl:if>
<xsl:if test="@id='ch-tools-gcc' and $testsuite = '3'">
<xsl:text>pushd ../; tar -xvf gcc-testsuite-&gcc-version;.*; popd; &#xA;</xsl:text>
</xsl:if>
<xsl:if test="@id='ch-system-gcc' and $testsuite != '0'">
<xsl:text>pushd ../; tar -xvf gcc-testsuite-&gcc-version;.*; popd; &#xA;</xsl:text>
<!-- ONLY butterfly has a testsuite -->
<xsl:if test="@id='ch-system-butterfly-toolchain' and $testsuite != '0'">
<xsl:text>tar -xvf gcc-testsuite-&gcc-version;.*; &#xA;</xsl:text>
</xsl:if>
<!-- END new toolchain format -->
<xsl:if test="@id='bootable-bootscripts'">
<xsl:text>pushd ../; tar -xvf blfs-bootscripts-&blfs-bootscripts-version;.* ; popd; &#xA;</xsl:text>
</xsl:if>
</xsl:if>
<xsl:if test="@id='ch-system-kernfs'">
<xsl:text>export HLFS=$LFS&#xA;</xsl:text>
</xsl:if>
<xsl:apply-templates select=".//para/userinput | .//screen"/>
<xsl:text>exit</xsl:text>
</exsl:document>
@ -135,22 +140,22 @@
<xsl:template match="para/userinput">
<xsl:if test="(contains(string(),'test') or
contains(string(),'check')) and
(($testsuite = '1' and
(ancestor::sect1[@id='ch-system-gcc'] or
ancestor::sect1[@id='ch-system-glibc'])) or
($testsuite = '2' and
ancestor::chapter[@id='chapter-building-system']) or
$testsuite = '3')">
contains(string(),'check')) and
($testsuite = '2' or $testsuite = '3')">
<xsl:choose>
<xsl:when test="ancestor::sect1[@id='ch-system-gcc']">
<xsl:text>make -k check &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:when test="$bomb-testsuite = '0'">
<xsl:value-of select="substring-before(string(),'make')"/>
<xsl:text>make -k</xsl:text>
<xsl:value-of select="substring-after(string(),'make')"/>
<xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
<xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1</xsl:text>
<xsl:if test="contains(string(),' -k ')">
<xsl:text> || true</xsl:text>
</xsl:if>
<xsl:text>&#xA;</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
@ -219,37 +224,71 @@
<xsl:choose>
<xsl:when test="$testsuite = '0' or $testsuite = '1'"/>
<xsl:otherwise>
<xsl:apply-templates/>
<xsl:if test="contains(string(),'check')">
<xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true</xsl:text>
<xsl:if test="not(contains(string(),'check'))">
<xsl:apply-templates/>
<xsl:text>&#xA;</xsl:text>
</xsl:if>
<xsl:if test="contains(string(),'check')">
<xsl:choose>
<xsl:when test="$bomb-testsuite = '0'">
<xsl:value-of select="substring-before(string(),'check')"/>
<xsl:text>-k check</xsl:text>
<xsl:value-of select="substring-after(string(),'check')"/>
<xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
<xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1</xsl:text>
<xsl:if test="contains(string(),' -k ')">
<xsl:text> || true</xsl:text>
</xsl:if>
<xsl:text>&#xA;</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:text>&#xA;</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<!-- Fixing toolchain test suites run -->
<xsl:when test="string() = 'make check' or
string() = 'make -k check'">
<xsl:choose>
<xsl:when test="(($testsuite = '1' or $testsuite = '2') and
ancestor::chapter[@id='chapter-building-system']) or
$testsuite = '3'">
<xsl:text>make -k check &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
</xsl:when>
</xsl:choose>
</xsl:when>
<xsl:when test="contains(string(),'make check') and
ancestor::sect1[@id='ch-system-binutils']">
<!-- Fixing butterfly toolchain test suites run -->
<xsl:when test="string() = 'make -k check' or string() = 'make check'">
<xsl:choose>
<xsl:when test="$testsuite != '0'">
<xsl:value-of select="substring-before(string(),'make check')"/>
<xsl:text>make -k check &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
<xsl:apply-templates/>
<xsl:choose>
<xsl:when test="$bomb-testsuite = '0'">
<xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1</xsl:text>
<xsl:if test="contains(string(),' -k ')">
<xsl:text> || true</xsl:text>
</xsl:if>
<xsl:text>&#xA;</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:when>
<!-- Fixing Glbc test suite -->
<xsl:when test="contains(string(),'glibc-check-log')">
<xsl:choose>
<xsl:when test="$testsuite != '0'">
<xsl:value-of select="substring-before(string(),'&gt; glibc-')"/>
<xsl:choose>
<xsl:when test="$bomb-testsuite = '0'">
<xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1</xsl:text>
<xsl:if test="contains(string(),' -k ')">
<xsl:text> || true</xsl:text>
</xsl:if>
<xsl:text>&#xA;</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:when>
<xsl:when test="contains(string(),'hardened-specs') and
ancestor::sect1[@id='ch-system-binutils']
and $testsuite = '0'"/>
<!-- Don't stop on strip run and chapter05 GCC installation test-->
<xsl:when test="contains(string(),'strip ') or
ancestor::sect2[@id='testing-gcc'] and
@ -265,6 +304,12 @@
</xsl:choose>
</xsl:template>
<xsl:template match="literal">
<xsl:if test="@condition=$model or not(@condition)">
<xsl:apply-templates/>
</xsl:if>
</xsl:template>
<xsl:template match="replaceable">
<xsl:choose>
<xsl:when test="ancestor::sect1[@id='ch-system-glibc'] or

View File

@ -7,24 +7,85 @@ set -e # Enable error trapping
### FUNCTIONS ###
###################################
#----------------------------#
process_toolchain() { # embryo,cocoon and butterfly need special handling
#----------------------------#
local toolchain=$1
local this_script=$2
local tc_phase
echo "${tab_}${tab_}${GREEN}toolchain ${L_arrow}${toolchain}${R_arrow}"
#
# Safe method to remove existing toolchain dirs
pkg_tarball=$(get_package_tarball_name "binutils")
wrt_remove_existing_dirs "$pkg_tarball"
pkg_tarball=$(get_package_tarball_name "gcc-core")
wrt_remove_existing_dirs "$pkg_tarball"
#
# Manually remove the toolchain directories..
tc_phase=`echo $toolchain | sed -e 's@[0-9]\{3\}-@@' -e 's@-toolchain@@'`
(
cat << EOF
@rm -rf \$(MOUNT_PT)\$(SRC)/${tc_phase}-toolchain && \\
rm -rf \$(MOUNT_PT)\$(SRC)/${tc_phase}-build
EOF
) >> $MKFILE.tmp
case ${toolchain} in
*butterfly*)
(
cat << EOF
@echo "export PKGDIR=\$(SRC)" > envars
EOF
) >> $MKFILE.tmp
[[ "$TEST" != "0" ]] && wrt_test_log2 "${this_script}"
wrt_run_as_chroot1 "$toolchain" "$this_script"
;;
*)
(
cat << EOF
@echo "export PKGDIR=\$(MOUNT_PT)\$(SRC)" > envars
EOF
) >> $MKFILE.tmp
wrt_RunAsUser "$toolchain" "$this_script"
;;
esac
#
# Safe method to remove packages unpacked while inside the toolchain script
pkg_tarball=$(get_package_tarball_name "binutils")
wrt_remove_existing_dirs "$pkg_tarball"
pkg_tarball=$(get_package_tarball_name "gcc-core")
wrt_remove_existing_dirs "$pkg_tarball"
#
# Manually remove the toolchain directories..
tc_phase=`echo $toolchain | sed -e 's@[0-9]\{3\}-@@' -e 's@-toolchain@@'`
(
cat << EOF
@rm -r \$(MOUNT_PT)\$(SRC)/${tc_phase}-toolchain && \\
rm -r \$(MOUNT_PT)\$(SRC)/${tc_phase}-build
EOF
) >> $MKFILE.tmp
}
#----------------------------#
chapter3_Makefiles() { # Initialization of the system
#----------------------------#
local TARGET LOADER
echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter3${R_arrow}"
# Define a few model dependant variables
if [[ ${MODEL} = "uclibc" ]]; then
TARGET="tools-linux-uclibc"; LOADER="ld-uClibc.so.0"
TARGET="pc-linux-gnu"; LOADER="ld-uClibc.so.0"
else
TARGET="tools-linux-gnu"; LOADER="ld-linux.so.2"
TARGET="pc-linux-gnu"; LOADER="ld-linux.so.2"
fi
# NOTE: We use the lfs username and groupname also in HLFS
# If /home/lfs is already present in the host, we asume that the
# lfs user and group are also presents in the host, and a backup
# If /home/$LUSER is already present in the host, we asume that the
# hlfs user and group are also presents in the host, and a backup
# of their bash init files is made.
(
cat << EOF
@ -43,38 +104,38 @@ cat << EOF
021-addinguser: 020-creatingtoolsdir
@\$(call echo_message, Building)
@if [ ! -d /home/lfs ]; then \\
groupadd lfs; \\
useradd -s /bin/bash -g lfs -m -k /dev/null lfs; \\
@if [ ! -d /home/\$(LUSER) ]; then \\
groupadd \$(LGROUP); \\
useradd -s /bin/bash -g \$(LGROUP) -m -k /dev/null \$(LUSER); \\
else \\
touch user-lfs-exist; \\
touch luser-exist; \\
fi;
@chown lfs \$(MOUNT_PT)/tools && \\
chown lfs \$(MOUNT_PT)/sources && \\
@chown \$(LUSER) \$(MOUNT_PT)/tools && \\
chown \$(LUSER) \$(MOUNT_PT)/sources && \\
touch \$@ && \\
echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
echo --------------------------------------------------------------------------------\$(WHITE)
022-settingenvironment: 021-addinguser
@\$(call echo_message, Building)
@if [ -f /home/lfs/.bashrc -a ! -f /home/lfs/.bashrc.XXX ]; then \\
mv /home/lfs/.bashrc /home/lfs/.bashrc.XXX; \\
@if [ -f /home/\$(LUSER)/.bashrc -a ! -f /home/\$(LUSER)/.bashrc.XXX ]; then \\
mv /home/\$(LUSER)/.bashrc /home/\$(LUSER)/.bashrc.XXX; \\
fi;
@if [ -f /home/lfs/.bash_profile -a ! -f /home/lfs/.bash_profile.XXX ]; then \\
mv /home/lfs/.bash_profile /home/lfs/.bash_profile.XXX; \\
@if [ -f /home/\$(LUSER)/.bash_profile -a ! -f /home/\$(LUSER)/.bash_profile.XXX ]; then \\
mv /home/\$(LUSER)/.bash_profile /home/\$(LUSER)/.bash_profile.XXX; \\
fi;
@echo "set +h" > /home/lfs/.bashrc && \\
echo "umask 022" >> /home/lfs/.bashrc && \\
echo "HLFS=\$(MOUNT_PT)" >> /home/lfs/.bashrc && \\
echo "LC_ALL=POSIX" >> /home/lfs/.bashrc && \\
echo "PATH=/tools/bin:/bin:/usr/bin" >> /home/lfs/.bashrc && \\
echo "export HLFS LC_ALL PATH" >> /home/lfs/.bashrc && \\
echo "" >> /home/lfs/.bashrc && \\
echo "target=$(uname -m)-${TARGET}" >> /home/lfs/.bashrc && \\
echo "ldso=/tools/lib/${LOADER}" >> /home/lfs/.bashrc && \\
echo "export target ldso" >> /home/lfs/.bashrc && \\
echo "source $JHALFSDIR/envars" >> /home/lfs/.bashrc && \\
chown lfs:lfs /home/lfs/.bashrc && \\
@echo "set +h" > /home/\$(LUSER)/.bashrc && \\
echo "umask 022" >> /home/\$(LUSER)/.bashrc && \\
echo "HLFS=\$(MOUNT_PT)" >> /home/\$(LUSER)/.bashrc && \\
echo "LC_ALL=POSIX" >> /home/\$(LUSER)/.bashrc && \\
echo "PATH=/tools/bin:/bin:/usr/bin" >> /home/\$(LUSER)/.bashrc && \\
echo "export HLFS LC_ALL PATH" >> /home/\$(LUSER)/.bashrc && \\
echo "" >> /home/\$(LUSER)/.bashrc && \\
echo "target=$(uname -m)-${TARGET}" >> /home/\$(LUSER)/.bashrc && \\
echo "ldso=/tools/lib/${LOADER}" >> /home/\$(LUSER)/.bashrc && \\
echo "export target ldso" >> /home/\$(LUSER)/.bashrc && \\
echo "source $JHALFSDIR/envars" >> /home/\$(LUSER)/.bashrc && \\
chown \$(LUSER):\$(LGROUP) /home/\$(LUSER)/.bashrc && \\
touch envars && \\
touch \$@ && \\
echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
@ -113,14 +174,11 @@ chapter5_Makefiles() { # Bootstrap or temptools phase
# the names of the targets in the Makefile
chapter5="$chapter5 $this_script"
# Grab the name of the target (minus the -headers or -cross in the case of gcc
# and binutils in chapter 5)
name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@' -e 's@-cross@@' -e 's@-headers@@'`
# Grab the name of the target
name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@'`
# Adjust 'name'
case $name in
linux-libc) name="linux-libc-headers" ;;
gcc) name="gcc-core" ;;
uclibc) name="uClibc" ;;
esac
@ -133,66 +191,39 @@ chapter5_Makefiles() { # Bootstrap or temptools phase
#
# Drop in the name of the target on a new line, and the previous target
# as a dependency. Also call the echo_message function.
wrt_target "$this_script" "$PREV"
# This is a very special script and requires manual processing
# NO Optimization allowed
if [[ ${name} = "embryo-toolchain" ]] || \
[[ ${name} = "cocoon-toolchain" ]]; then
wrt_target "$this_script" "$PREV"
process_toolchain "${this_script}" "${file}"
wrt_touch
PREV=$this_script
continue
fi
#
wrt_target "$this_script" "$PREV"
# Find the version of the command files, if it corresponds with the building of
# a specific package
pkg_tarball=$(get_package_tarball_name $name)
# If $pkg_tarball isn't empty, we've got a package...
if [ "$pkg_tarball" != "" ] ; then
# Insert instructions for unpacking the package and to set the PKGDIR variable.
case $this_script in
*binutils* ) wrt_unpack "$pkg_tarball" 1 ;; # Do not delete an existing package directories
*) wrt_unpack "$pkg_tarball" ;;
esac
# If the testsuites must be run, initialize the log file
[[ "$TEST" = "3" ]] && wrt_test_log "${this_script}"
wrt_unpack "$pkg_tarball"
# If using optimizations, write the instructions
[[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
fi
case $this_script in
*binutils* ) # Dump the path to sources directory for later removal
(
cat << EOF
@ROOT=\`head -n1 \$(MOUNT_PT)\$(SRC)/\$(PKG_LST) | sed 's@^./@@;s@/.*@@'\` && \\
echo "\$(MOUNT_PT)\$(SRC)/\$\$ROOT" >> sources-dir
EOF
) >> $MKFILE.tmp
;;
*adjusting* ) # For the Adjusting phase we must to cd to the binutils-build directory.
echo -e '\t@echo "export PKGDIR=$(MOUNT_PT)$(SRC)/binutils-build" > envars' >> $MKFILE.tmp
;;
esac
# Insert date and disk usage at the top of the log file, the script run
# and date and disk usage again at the bottom of the log file.
wrt_run_as_su "${this_script}" "${file}"
wrt_RunAsUser "$this_script" "${file}"
# Remove the build directory(ies) except if the package build fails
# (so we can review config.cache, config.log, etc.)
# For Binutils the sources must be retained for some time.
if [ "$pkg_tarball" != "" ] ; then
case "${this_script}" in
*binutils*) : ;; # do NOTHING
*gcc*) wrt_remove_build_dirs "gcc" ;;
*) wrt_remove_build_dirs "$name" ;;
esac
wrt_remove_build_dirs "$name"
fi
# Remove the Binutils pass 1 sources after a successful Adjusting phase.
case "${this_script}" in
*adjusting*)
(
cat << EOF
@rm -r \`cat sources-dir\` && \\
rm -r \$(MOUNT_PT)\$(SRC)/binutils-build && \\
rm sources-dir
EOF
) >> $MKFILE.tmp
;;
esac
# Include a touch of the target name so make can check if it's already been made.
wrt_touch
#
@ -209,7 +240,6 @@ EOF
#----------------------------#
chapter6_Makefiles() { # sysroot or chroot build phase
#----------------------------#
local TARGET LOADER
local file
local this_script
# Set envars and scripts for iteration targets
@ -237,14 +267,6 @@ chapter6_Makefiles() { # sysroot or chroot build phase
fi
echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter6$N${R_arrow}"
#
# Set these definitions early and only once
#
if [[ ${MODEL} = "uclibc" ]]; then
TARGET="pc-linux-uclibc"; LOADER="ld-uClibc.so.0"
else
TARGET="pc-linux-gnu"; LOADER="ld-linux.so.2"
fi
for file in chapter06$N/* ; do
# Keep the script file name
@ -262,17 +284,7 @@ chapter6_Makefiles() { # sysroot or chroot build phase
# Grab the name of the target
name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@'`
#
# Sed replacement to fix some rm command that could fail.
# That should be fixed in the book sources.
#
case $name in
glibc) sed 's/rm /rm -f /' -i chapter06$N/$this_script ;;
gcc) sed 's/rm /rm -f /' -i chapter06$N/$this_script ;;
esac
case $name in
gcc) name="gcc-core" ;;
uclibc) name="uClibc" ;;
esac
@ -301,37 +313,37 @@ chapter6_Makefiles() { # sysroot or chroot build phase
#--------------------------------------------------------------------#
#
# Drop in the name of the target on a new line, and the previous target
# as a dependency. Also call the echo_message function.
# as a dependency. Also call the echo_message function.
if [[ ${name} = "butterfly-toolchain" ]]; then
wrt_target "${this_script}${N}" "$PREV"
process_toolchain "${this_script}" "${file}"
wrt_touch
PREV=$this_script
continue
fi
wrt_target "${this_script}${N}" "$PREV"
# If $pkg_tarball isn't empty, we've got a package...
# Insert instructions for unpacking the package and changing directories
if [ "$pkg_tarball" != "" ] ; then
wrt_unpack2 "$pkg_tarball"
wrt_target_vars
# If the testsuites must be run, initialize the log file
# butterfly-toolchain tests are enabled in 'process_tookchain' function
case $name in
binutils | gcc-core | glibc )
[[ "$TEST" != "0" ]] && wrt_test_log2 "${this_script}"
glibc ) [[ "$TEST" != "0" ]] && wrt_test_log2 "${this_script}"
;;
* )
[[ "$TEST" = "2" ]] || [[ "$TEST" = "3" ]] && wrt_test_log2 "${this_script}"
* ) [[ "$TEST" > "1" ]] && wrt_test_log2 "${this_script}"
;;
esac
# If using optimizations, write the instructions
[[ "$OPTIMIZE" != "0" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
fi
case $this_script in
*readjusting*) # For the Re-Adjusting phase we must to cd to the binutils-build directory.
echo -e '\t@echo "export PKGDIR=$(SRC)/binutils-build" > envars' >> $MKFILE.tmp
;;
esac
# In the mount of kernel filesystems we need to set LFS and not to use chroot.
# In the mount of kernel filesystems we need to set HLFS and not to use chroot.
case "${this_script}" in
*kernfs*)
wrt_run_as_root "${this_script}" "${file}"
wrt_RunAsRoot "${this_script}" "${file}"
;;
*) # The rest of Chapter06
wrt_run_as_chroot1 "${this_script}" "${file}"
@ -343,19 +355,6 @@ chapter6_Makefiles() { # sysroot or chroot build phase
wrt_remove_build_dirs "$name"
fi
#
# Remove the Binutils pass 2 sources after a successful Re-Adjusting phase.
case "${this_script}" in
*readjusting*)
(
cat << EOF
@rm -r \`cat sources-dir\` && \\
rm -r \$(MOUNT_PT)\$(SRC)/binutils-build && \\
rm sources-dir
EOF
) >> $MKFILE.tmp
;;
esac
# Include a touch of the target name so make can check if it's already been made.
wrt_touch
#
@ -389,7 +388,6 @@ chapter7_Makefiles() { # Create a bootable system.. kernel, bootscripts..e
case $this_script in
*usage) continue ;; # Contains example commands
*grub) continue ;;
*reboot) continue ;;
*console) continue ;; # Use the file generated by lfs-bootscripts
*kernel)
@ -487,6 +485,8 @@ $HEADER
SRC= /sources
MOUNT_PT= $BUILDDIR
PKG_LST= $PKG_LST
LUSER= $LUSER
LGROUP= $LGROUP
include makefile-functions
@ -495,17 +495,22 @@ EOF
# Add chroot commands
CHROOT_LOC="`whereis -b chroot | cut -d " " -f2`"
i=1
for file in chapter06/*chroot* ; do
chroot=`cat $file | sed -e '/#!\/bin\/sh/d' \
-e '/^export/d' \
-e '/^logout/d' \
-e 's@ \\\@ @g' | tr -d '\n' | sed -e 's/ */ /g' \
-e 's|\\$|&&|g' \
-e 's|exit||g' \
-e 's|$| -c|' \
-e 's|"$$HLFS"|$(MOUNT_PT)|'\
-e 's|set -e||'`
chroot=`cat $file | \
sed -e "s@chroot@$CHROOT_LOC@" \
-e '/#!\/bin\/sh/d' \
-e '/^export/d' \
-e '/^logout/d' \
-e 's@ \\\@ @g' | \
tr -d '\n' | \
sed -e 's/ */ /g' \
-e 's|\\$|&&|g' \
-e 's|exit||g' \
-e 's|$| -c|' \
-e 's|"$$HLFS"|$(MOUNT_PT)|'\
-e 's|set -e||'`
echo -e "CHROOT$i= $chroot\n" >> $MKFILE
i=`expr $i + 1`
done
@ -519,7 +524,7 @@ all: chapter3 chapter5 chapter6 chapter7 do-housekeeping
chapter3: 020-creatingtoolsdir 021-addinguser 022-settingenvironment
chapter5: chapter3 $chapter5 restore-lfs-env
chapter5: chapter3 $chapter5 restore-luser-env
chapter6: chapter5 $chapter6
@ -533,18 +538,18 @@ clean: clean-chapter7 clean-chapter6 clean-chapter5 clean-chapter3
restart: restart_code all
clean-chapter3:
-if [ ! -f user-lfs-exist ]; then \\
userdel lfs; \\
rm -rf /home/lfs; \\
-if [ ! -f luser-exist ]; then \\
userdel \$(LUSER); \\
rm -rf /home/\$(LUSER); \\
fi;
rm -rf \$(MOUNT_PT)/tools
rm -f /tools
rm -f envars user-lfs-exist
rm -f envars luser-exist
rm -f 02* logs/02*.log
clean-chapter5:
rm -rf \$(MOUNT_PT)/tools/*
rm -f $chapter5 restore-lfs-env sources-dir
rm -f $chapter5 restore-luser-env sources-dir
cd logs && rm -f $chapter5 && cd ..
clean-chapter6:
@ -561,15 +566,15 @@ clean-chapter7:
rm -f $chapter7
cd logs && rm -f $chapter7 && cd ..
restore-lfs-env:
restore-luser-env:
@\$(call echo_message, Building)
@if [ -f /home/lfs/.bashrc.XXX ]; then \\
mv -f /home/lfs/.bashrc.XXX /home/lfs/.bashrc; \\
@if [ -f /home/\$(LUSER)/.bashrc.XXX ]; then \\
mv -f /home/\$(LUSER)/.bashrc.XXX /home/\$(LUSER)/.bashrc; \\
fi;
@if [ -f /home/lfs/.bash_profile.XXX ]; then \\
mv /home/lfs/.bash_profile.XXX /home/lfs/.bash_profile; \\
@if [ -f /home/\$(LUSER)/.bash_profile.XXX ]; then \\
mv /home/\$(LUSER)/.bash_profile.XXX /home/\$(LUSER)/.bash_profile; \\
fi;
@chown lfs:lfs /home/lfs/.bash* && \\
@chown \$(LUSER):\$(LGROUP) /home/\$(LUSER)/.bash* && \\
touch \$@ && \\
echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
echo --------------------------------------------------------------------------------\$(WHITE)
@ -580,25 +585,25 @@ do-housekeeping:
@-umount \$(MOUNT_PT)/dev
@-umount \$(MOUNT_PT)/sys
@-umount \$(MOUNT_PT)/proc
@-if [ ! -f user-lfs-exist ]; then \\
userdel lfs; \\
rm -rf /home/lfs; \\
@-if [ ! -f luser-exist ]; then \\
userdel \$(LUSER); \\
rm -rf /home/\$(LUSER); \\
fi;
restart_code:
@echo ">>> This feature is experimental, BUGS may exist"
@echo ">>> This feature is experimental, BUGS may exist"
@if [ ! -L /tools ]; then \\
echo -e "\\nERROR::\\n /tools is NOT a symlink.. /tools must point to \$(MOUNT_PT)/tools\\n" && false;\\
fi;
@if [ ! -e /tools ]; then \\
echo -e "\\nERROR::\\nThe target /tools points to does not exist.\\nVerify the target.. \$(MOUNT_PT)/tools\\n" && false;\\
fi;
@if ! stat -c %N /tools | grep "\$(MOUNT_PT)/tools" >/dev/null ; then \\
echo -e "\\nERROR::\\nThe symlink \\"/tools\\" does not point to \\"\$(MOUNT_PT)/tools\\".\\nCorrect the problem and rerun\\n" && false;\\
fi;
fi;
@if [ -f ???-kernfs ]; then \\
mkdir -pv \$(MOUNT_PT)/{proc,sys};\\

View File

@ -6,14 +6,18 @@
#
#####
#--- Unprivileged user and group name
LUSER=lfs
LGROUP=lfs
#--- Location of fstab file (if empty, a template is created)
FSTAB=
#--- Fully qualified path to a kernel config file
# If no config file is specified the kernel is NOT compiled
# If no config file is specified the kernel is NOT compiled
CONFIG=
# Get the kernel package and patches even if no configutation file
# Get the kernel package and patches even if no configuration file
# has been supplied? 0(no)/1(yes)
GETKERNEL=0

View File

@ -17,9 +17,16 @@
0 = none
1 = only chapter06 Glibc, GCC and Binutils testsuites
2 = all chapter06 testsuites
3 = all chapter05 and chapter06 testsuites-->
3 = all chapter05 and chapter06 testsuites
-->
<xsl:param name="testsuite" select="1"/>
<!-- Bomb on test suites failures?
0 = no, I want to build the full system and review the logs
1 = yes, bomb at the first test suite failure to can review the build dir
-->
<xsl:param name="bomb-testsuite" select="0"/>
<!-- Install vim-lang package? -->
<xsl:param name="vim-lang" select="1"/>
@ -109,10 +116,22 @@
(($testsuite = '2' and
ancestor::chapter[@id='chapter-building-system']) or
$testsuite = '3')">
<xsl:value-of select="substring-before(string(),'make')"/>
<xsl:text>make -k</xsl:text>
<xsl:value-of select="substring-after(string(),'make')"/>
<xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
<xsl:choose>
<xsl:when test="$bomb-testsuite = '0'">
<xsl:value-of select="substring-before(string(),'make')"/>
<xsl:text>make -k</xsl:text>
<xsl:value-of select="substring-after(string(),'make')"/>
<xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
<xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1</xsl:text>
<xsl:if test="contains(string(),' -k ')">
<xsl:text> || true</xsl:text>
</xsl:if>
<xsl:text>&#xA;</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:template>
@ -132,6 +151,12 @@
<xsl:value-of select="substring-after(string(),'patch')"/>
<xsl:text>&#xA;</xsl:text>
</xsl:when>
<!-- Fix Udev reinstallation after a build failure -->
<xsl:when test="contains(string(),'firmware,udev')">
<xsl:text>if [[ ! -d /lib/udev/devices ]] ; then&#xA;</xsl:text>
<xsl:apply-templates/>
<xsl:text>&#xA;fi&#xA;</xsl:text>
</xsl:when>
<!-- Setting $LANG for /etc/profile -->
<xsl:when test="ancestor::sect1[@id='ch-scripts-profile'] and
contains(string(),'export LANG=')">
@ -154,11 +179,28 @@
<xsl:choose>
<xsl:when test="$testsuite = '0' or $testsuite = '1'"/>
<xsl:otherwise>
<xsl:apply-templates/>
<xsl:if test="contains(string(),'check')">
<xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true</xsl:text>
<xsl:if test="not(contains(string(),'check'))">
<xsl:apply-templates/>
<xsl:text>&#xA;</xsl:text>
</xsl:if>
<xsl:if test="contains(string(),'check')">
<xsl:choose>
<xsl:when test="$bomb-testsuite = '0'">
<xsl:value-of select="substring-before(string(),'check')"/>
<xsl:text>-k check</xsl:text>
<xsl:value-of select="substring-after(string(),'check')"/>
<xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
<xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1</xsl:text>
<xsl:if test="contains(string(),' -k ')">
<xsl:text> || true</xsl:text>
</xsl:if>
<xsl:text>&#xA;</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:text>&#xA;</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
@ -169,7 +211,19 @@
<xsl:when test="(($testsuite = '1' or $testsuite = '2') and
ancestor::chapter[@id='chapter-building-system']) or
$testsuite = '3'">
<xsl:text>make -k check &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
<xsl:choose>
<xsl:when test="$bomb-testsuite = '0'">
<xsl:text>make -k check &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
<xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1</xsl:text>
<xsl:if test="contains(string(),' -k ')">
<xsl:text> || true</xsl:text>
</xsl:if>
<xsl:text>&#xA;</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:when>
@ -188,10 +242,7 @@
ancestor::chapter[@id='chapter-building-system']) or
$testsuite = '3'">
<xsl:apply-templates/>
<xsl:if test="contains(string(),'test_summary')">
<xsl:text> &gt;&gt; $TEST_LOG</xsl:text>
</xsl:if>
<xsl:text>&#xA;</xsl:text>
<xsl:text> &gt;&gt; $TEST_LOG&#xA;</xsl:text>
</xsl:when>
</xsl:choose>
</xsl:when>

View File

@ -13,7 +13,7 @@ chapter4_Makefiles() {
#----------------------------#
echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter4${R_arrow}"
# If /home/lfs is already present in the host, we asume that the
# If /home/$LUSER is already present in the host, we asume that the
# lfs user and group are also presents in the host, and a backup
# of their bash init files is made.
(
@ -29,13 +29,13 @@ chapter4_Makefiles() {
021-addinguser: 020-creatingtoolsdir
@\$(call echo_message, Building)
@if [ ! -d /home/lfs ]; then \\
groupadd lfs; \\
useradd -s /bin/bash -g lfs -m -k /dev/null lfs; \\
@if [ ! -d /home/\$(LUSER) ]; then \\
groupadd \$(LGROUP); \\
useradd -s /bin/bash -g \$(LGROUP) -m -k /dev/null \$(LUSER); \\
else \\
touch user-lfs-exist; \\
touch luser-exist; \\
fi;
@chown lfs \$(MOUNT_PT)/tools && \\
@chown \$(LUSER) \$(MOUNT_PT)/tools && \\
chmod a+wt \$(MOUNT_PT)/sources && \\
touch \$@ && \\
echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
@ -43,20 +43,20 @@ chapter4_Makefiles() {
022-settingenvironment: 021-addinguser
@\$(call echo_message, Building)
@if [ -f /home/lfs/.bashrc -a ! -f /home/lfs/.bashrc.XXX ]; then \\
mv /home/lfs/.bashrc /home/lfs/.bashrc.XXX; \\
@if [ -f /home/\$(LUSER)/.bashrc -a ! -f /home/\$(LUSER)/.bashrc.XXX ]; then \\
mv /home/\$(LUSER)/.bashrc /home/\$(LUSER)/.bashrc.XXX; \\
fi;
@if [ -f /home/lfs/.bash_profile -a ! -f /home/lfs/.bash_profile.XXX ]; then \\
mv /home/lfs/.bash_profile /home/lfs/.bash_profile.XXX; \\
@if [ -f /home/\$(LUSER)/.bash_profile -a ! -f /home/\$(LUSER)/.bash_profile.XXX ]; then \\
mv /home/\$(LUSER)/.bash_profile /home/\$(LUSER)/.bash_profile.XXX; \\
fi;
@echo "set +h" > /home/lfs/.bashrc && \\
echo "umask 022" >> /home/lfs/.bashrc && \\
echo "LFS=\$(MOUNT_PT)" >> /home/lfs/.bashrc && \\
echo "LC_ALL=POSIX" >> /home/lfs/.bashrc && \\
echo "PATH=/tools/bin:/bin:/usr/bin" >> /home/lfs/.bashrc && \\
echo "export LFS LC_ALL PATH" >> /home/lfs/.bashrc && \\
echo "source $JHALFSDIR/envars" >> /home/lfs/.bashrc && \\
chown lfs:lfs /home/lfs/.bashrc && \\
@echo "set +h" > /home/\$(LUSER)/.bashrc && \\
echo "umask 022" >> /home/\$(LUSER)/.bashrc && \\
echo "LFS=\$(MOUNT_PT)" >> /home/\$(LUSER)/.bashrc && \\
echo "LC_ALL=POSIX" >> /home/\$(LUSER)/.bashrc && \\
echo "PATH=/tools/bin:/bin:/usr/bin" >> /home/\$(LUSER)/.bashrc && \\
echo "export LFS LC_ALL PATH" >> /home/\$(LUSER)/.bashrc && \\
echo "source $JHALFSDIR/envars" >> /home/\$(LUSER)/.bashrc && \\
chown \$(LUSER):\$(LGROUP) /home/\$(LUSER)/.bashrc && \\
touch envars && \\
touch \$@ && \\
echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
@ -122,8 +122,8 @@ chapter5_Makefiles() {
# and date and disk usage again at the bottom of the log file.
# The changingowner script must be run as root.
case "${this_script}" in
*changingowner) wrt_run_as_root "${this_script}" "$file" ;;
*) wrt_run_as_su "${this_script}" "$file" ;;
*changingowner) wrt_RunAsRoot "${this_script}" "$file" ;;
*) wrt_RunAsUser "${this_script}" "$file" ;;
esac
# Remove the build directory(ies) except if the package build fails
@ -165,9 +165,6 @@ chapter6_Makefiles() {
done
# Remove Bzip2 binaries before make install
sed -e 's@make install@rm -vf /usr/bin/bz*\n&@' -i chapter06$N/*-bzip2
# Let some Udev pre-installation commands to fail
sed -e 's@/lib/udev/devices/fd@& || true@' \
-e 's/mknod -m.*/& || true/' -i chapter06$N/*-udev
fi
echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter6$N${R_arrow}"
@ -234,7 +231,7 @@ chapter6_Makefiles() {
# In the mount of kernel filesystems we need to set LFS
# and not to use chroot.
case "${this_script}" in
*kernfs) wrt_run_as_root "${this_script}" "$file" ;;
*kernfs) wrt_RunAsRoot "${this_script}" "$file" ;;
*) wrt_run_as_chroot1 "${this_script}" "$file" ;;
esac
@ -368,6 +365,8 @@ $HEADER
SRC= /sources
MOUNT_PT= $BUILDDIR
PKG_LST= $PKG_LST
LUSER= $LUSER
LGROUP= $LGROUP
include makefile-functions
@ -376,11 +375,20 @@ EOF
# Add chroot commands
CHROOT_LOC="`whereis -b chroot | cut -d " " -f2`"
i=1
for file in chapter06/*chroot* ; do
chroot=`cat $file | sed -e '/#!\/bin\/sh/d' -e 's@ \\\@ @g' | tr -d '\n' | sed \
-e 's/ */ /g' -e 's|\\$|&&|g' -e 's|exit||g' -e 's|$| -c|' \
-e 's|"$$LFS"|$(MOUNT_PT)|' -e 's|set -e||'`
chroot=`cat $file | \
sed -e "s@chroot@$CHROOT_LOC@" \
-e '/#!\/bin\/sh/d' \
-e 's@ \\\@ @g' | \
tr -d '\n' | \
sed -e 's/ */ /g' \
-e 's|\\$|&&|g' \
-e 's|exit||g' \
-e 's|$| -c|' \
-e 's|"$$LFS"|$(MOUNT_PT)|' \
-e 's|set -e||'`
echo -e "CHROOT$i= $chroot\n" >> $MKFILE
i=`expr $i + 1`
done
@ -394,7 +402,7 @@ all: chapter4 chapter5 chapter6 chapter789 do_housekeeping
chapter4: 020-creatingtoolsdir 021-addinguser 022-settingenvironment
chapter5: chapter4 $chapter5 restore-lfs-env
chapter5: chapter4 $chapter5 restore-luser-env
chapter6: chapter5 $chapter6
@ -408,18 +416,18 @@ clean: clean-chapter789 clean-chapter6 clean-chapter5 clean-chapter4
restart: restart_code all
clean-chapter4:
-if [ ! -f user-lfs-exist ]; then \\
userdel lfs; \\
rm -rf /home/lfs; \\
-if [ ! -f luser-exist ]; then \\
userdel \$(LUSER); \\
rm -rf /home/\$(LUSER); \\
fi;
rm -rf \$(MOUNT_PT)/tools
rm -f /tools
rm -f envars user-lfs-exist
rm -f envars luser-exist
rm -f 02* logs/02*.log
clean-chapter5:
rm -rf \$(MOUNT_PT)/tools/*
rm -f $chapter5 restore-lfs-env sources-dir
rm -f $chapter5 restore-luser-env sources-dir
cd logs && rm -f $chapter5 && cd ..
clean-chapter6:
@ -436,15 +444,15 @@ clean-chapter789:
rm -f $chapter789
cd logs && rm -f $chapter789 && cd ..
restore-lfs-env:
restore-luser-env:
@\$(call echo_message, Building)
@if [ -f /home/lfs/.bashrc.XXX ]; then \\
mv -f /home/lfs/.bashrc.XXX /home/lfs/.bashrc; \\
@if [ -f /home/\$(LUSER)/.bashrc.XXX ]; then \\
mv -f /home/\$(LUSER)/.bashrc.XXX /home/\$(LUSER)/.bashrc; \\
fi;
@if [ -f /home/lfs/.bash_profile.XXX ]; then \\
mv /home/lfs/.bash_profile.XXX /home/lfs/.bash_profile; \\
@if [ -f /home/\$(LUSER)/.bash_profile.XXX ]; then \\
mv /home/\$(LUSER)/.bash_profile.XXX /home/\$(LUSER)/.bash_profile; \\
fi;
@chown lfs:lfs /home/lfs/.bash* && \\
@chown \$(LUSER):\$(LGROUP) /home/\$(LUSER)/.bash* && \\
touch \$@ && \\
echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
echo --------------------------------------------------------------------------------\$(WHITE)
@ -455,9 +463,9 @@ do_housekeeping:
@-umount \$(MOUNT_PT)/dev/shm
@-umount \$(MOUNT_PT)/dev/pts
@-umount \$(MOUNT_PT)/dev
@-if [ ! -f user-lfs-exist ]; then \\
userdel lfs; \\
rm -rf /home/lfs; \\
@-if [ ! -f luser-exist ]; then \\
userdel \$(LUSER); \\
rm -rf /home/\$(LUSER); \\
fi;
restart_code:

21
README
View File

@ -74,7 +74,7 @@ $Id$
# This points to a local archive of existing packages. If the version in
the archive is incorrect jhalfs will access the net and download the
necessary version and store it here for later use. DO NOT set this to
$BUILDDIR/sources. If you do not set this variable to a valide directory
$BUILDDIR/sources. If you do not set this variable to a valid directory
ALL package tarballs will be downloaded from the 'net.
-D /mnt/partition4
@ -137,9 +137,10 @@ $Id$
A. Yes, it is. This tool, jhalfs, is for those who understand the LFS books
and wish to automate the build. 99% of any problems that arise can be
solved by reading the book(s).
Q. "It doesn't work!"
A. Yes it does, try ./lfs --help
Remember you must either be 'root' to run this script or have 'sudo' privileges.
Q. "It still doesn't work"
A. jhalfs was designed to work against the developement versions of the LFS
@ -148,9 +149,9 @@ $Id$
latest version of jhalfs to see if that solves your problem.
Q. "How do I specify the build location?"
A. The original LFS document worked against the well know location /mnt/lfs.
A. The original LFS document worked against the well known location /mnt/lfs.
This script automates the build of all of the LFS series of books and uses
a generic location $BUILDDIR with a default value a /mnt/build_dir.
a generic location $BUILDDIR with a default value of /mnt/build_dir.
You may change this value to suit your needs.
The layout below $BUILDDIR is as follows.
@ -175,13 +176,21 @@ $Id$
A. The best way to set the value of SRC_ARCHIVE is
export SRC_ARCHIVE=/wherever/you/store/downloaded/packages
OR
you can change the setting in .common/config.
you can change the setting in common/config.
Q. "Why have 2 copies of the files?"
A. The package files must be visible during the chroot phase and this is a
simple and reliable method of doing so. This method also handles the CLFS
build method where the final build may be done on a separate machine.
Q. "What is the function of LUSER and LGROUP? There is no cmd line switch"
A. If you are running jhalfs from a low or non-priveledged account you may not
have the priv to create/delete accounts. These variables are adjustable
when invoking make.
make LUSER=myaccount LGROUP=mygroup
Then only changes to your account will be the creation of a NEW .bashrc after
saving your original to .bashrc.XXX
Q. "When I try to build 'xxx' with clfs the makefile fails at the mid-point"
A. There could be numerous reasons for the failure but the most likely reason
is you are doing a cross-build using the 'chroot' method and the target is
@ -194,7 +203,7 @@ $Id$
only the temptools phase. You must run ./clfs using the 'boot' method and
not the 'chroot.' You must transfer the toolchain to a sparc platform, reboot
the sparc box and continue the build.
Of all the LFS series of books the Cross-LFS requires the greatest
Of all the LFS series of books Cross-LFS requires the greatest
understanding of host/target hardware combination. Please read the book
carefully and don't skip the easy parts (there are none..)

View File

@ -1,25 +1,34 @@
###########################################
# #
# README FILE FOR JHALFS PACO PATCH #
# By: Tor Olav Stava #
# (torstava@broadpark.no #
# #
###########################################
##### NOTES #####
Patch author: Tor Olav Stava (t-ol-sta@online.no)
Any comments directly regarding the patch should be directed to the author
or the ALFS mailing list.
The patch author is not a member of the ALFS team, and all work is done
on a voluntary basis.
##### GENERAL DESCRIPTION #####
This patch will enable the paco pacKAGE oRGANIZER to be used with jhalfs.
At the moment only the LFS, BLFS, and HLFS-glibc parts are supported.
At the moment only the LFS and HLFS-glibc parts are supported.
NEWS:
Preliminary support for CLFS is ready. It's not fully tested, so if you
discover any bugs please notify the patch author. Also, Paco may or may not work
on your specific architecture. Check the Paco homepage for details.
##### QUICK START #####
1. Apply the paco.patch.
(patch -Np0 -i contrib/jhalfs-paco.patch)
2. Edit the configuration files to your preferences.
(common/config and LFS/config or HLFS/config or CLFS/config)
3. Run the wanted script.
(Only ./lfs or ./clfs or ./hlfs --model glibc if you want to use paco)
4. Run make.
##### PREREQUISITES #####
@ -30,23 +39,15 @@ If you don't know what LFS is about, then head over to
http://www.linuxfromscratch.org/lfs and start from there.
##### QUICK START #####
##### NOTES #####
1. Apply the paco.patch.
(patch -Np0 -i contrib/jhalfs-paco.patch)
Paco-1.10.10 is currently recommended.
Remember to update the common/config file is using a newer version.
2. Edit the configuration files to your preferences.
(common/config and LFS/config or HLFS/config)
3. Run the wanted script.
(Only ./lfs ./hlfs --model glibc, and ./blfs if you want to use paco)
4. Download the paco source package to the $BUILDDIR/sources dir.
paco-1.10.8 or later is recommended.
If using a newer paco version, remember to update also the
PACO_VERSION variable.
5. Run make.
Patch author: Tor Olav Stava (torstava@broadpark.no)
Any comments directly regarding the patch should be directed to the author
or the ALFS mailing list. The patch author is not a member of the ALFS team,
and all work is done on a voluntary basis.
##### LINKS #####
@ -68,3 +69,22 @@ http://www.linuxfromscratch.org/mail.html
paco Mailing List:
http://lists.sourceforge.net/lists/listinfo/paco-general
##### TODO #####
- Bughunting/testing CLFS part
- Support for HLFS-uClibc
- Support for BLFS (when it's ready)
- Spread the Word
##### HISTORY #####
2006-08-02
- Preliminary support for CLFS done
- Some code cleanup
2006-07-30
- Automatical download of Paco source package done
- Updated patch to support new HLFS layout

6
TODO
View File

@ -5,7 +5,7 @@
MASTER SCRIPT
-------------
- The BLFS moudule should can be called in conjunction with any of
- The BLFS module should be called in conjunction with any of
LFS, CLFS or HLFS modules.
Before working on that we need to fix the BLFS support.
@ -31,9 +31,9 @@ BLFS MODULE (See BLFS/TODO)
OTHERS
------
- Add a Cunstomization file discussing how to hack the generated scripts
- Add a Customization file discussing how to hack the generated scripts
and Makefiles, using the Cracklib support for Shadow in LFS as an example.
NOTE: that could require an special command line switch to regenerate the
NOTE: that could require a special command line switch to regenerate the
Makefile if additional scripts are manually added to the *-commands/*/ dirs.
- To create a script to install jhalfs system-wide, if possible.

View File

@ -56,7 +56,7 @@ ${BOLD} -B, --book VER${OFF}
dev*, trunk, SVN = aliases for the Development version of {C,H}LFS
branch-NAME = a branch of name NAME
VERSION = the version of a stable released book
To know what branches and stable books works with this version of jhalfs
To know what branches and stable books work with this version of jhalfs
please see http://wiki.linuxfromscratch.org/alfs/wiki/SupportedBooks
${BOLD} -D --directory DIR${OFF}
@ -82,19 +82,19 @@ ${BOLD} -T, --testsuites N ${OFF}
1 = only final system Glibc, GCC and Binutils testsuites
2 = all final system testsuites
3 = all temporary tools and final system testsuites
In CLFS, 3 is an alias to 2
In CLFS and HLFS, 3 is an alias to 2
${BOLD} -W, --working-copy DIR${OFF}
use the local working copy placed in DIR as the $(echo $PROGNAME | tr [a-z] [A-Z]) book
${BOLD} -C, --comparasion TYPE${OFF}
${BOLD} -C, --comparison TYPE${OFF}
do iterative comparison analysis. This extends the total build time
considerably because the entire final system will rebuild itself
the number of times specified by ITERATIONS in common/config.
Types allowed are:
ICA = do ICA as designed by Greg Schafer
farce = do the farce analysis designed by Ken Moffat
both = perfom both ICA and farce analysis
both = perform both ICA and farce analysis
${BOLD} -F, --fstab FILE${OFF}
use FILE as the /etc/fstab file for the ${BOLD}$(echo $PROGNAME | tr [a-z] [A-Z])${OFF} system. If not specified,
@ -108,7 +108,7 @@ ${BOLD} -M, --run-make${OFF}
run make on the generated Makefile
${BOLD} -R --rebuild${OFF}
clean the build directory before perfoming any other task. The directory
clean the build directory before performing any other task. The directory
is cleaned only if it was populated by a previous jhalfs run.
-EOF-
@ -146,7 +146,7 @@ ${DD_BORDER}
}
version="
${BOLD} \"jhalfs\"${OFF} builder tool (development) \$Rev$
${BOLD} \"jhalfs\"${OFF} builder tool (branch 1.0.x) \$Rev$
\$Date$
${BOLD} \"${PROGNAME}\"${OFF} script module
@ -241,8 +241,9 @@ get_package_tarball_name() { #
# hopefully this will not cause problems.
#
case $script_name in
tcl) echo $(grep "^tcl" $JHALFSDIR/pkg_tarball_list | head -n1 ) ;;
*) echo $(grep "^$script_name-[[:digit:]]" $JHALFSDIR/pkg_tarball_list | head -n1 ) ;;
tcl) echo $(grep "^tcl" $JHALFSDIR/pkg_tarball_list | head -n1 ) ;;
linux-headers) echo $(grep "^linux-headers.*.bz2" $JHALFSDIR/pkg_tarball_list | head -n1 ) ;;
*) echo $(grep "^$script_name-[[:digit:]]" $JHALFSDIR/pkg_tarball_list | head -n1 ) ;;
esac
}
@ -297,27 +298,7 @@ cat << EOF
@\$(call unpack,$FILE)
@ROOT=\`head -n1 \$(MOUNT_PT)\$(SRC)/\$(PKG_LST) | sed 's@^./@@;s@/.*@@'\` && \\
echo "export PKGDIR=\$(MOUNT_PT)\$(SRC)/\$\$ROOT" > envars && \\
chown -R lfs \$(MOUNT_PT)\$(SRC)/\$\$ROOT
EOF
) >> $MKFILE.tmp
}
#----------------------------------#
wrt_unpack_clfs() { # Unpack and set 'ROOT' var
#----------------------------------#
local FILE=$1
local optSAVE_PREVIOUS=$2
if [ "${optSAVE_PREVIOUS}" != "1" ]; then
wrt_remove_existing_dirs "$FILE"
fi
(
cat << EOF
@\$(call unpack,$FILE)
@ROOT=\`head -n1 \$(MOUNT_PT)\$(SRC)/\$(PKG_LST) | sed 's@^./@@;s@/.*@@'\` && \\
echo "export PKGDIR=\$(MOUNT_PT)\$(SRC)/\$\$ROOT" > envars && \\
chown -R clfs \$(MOUNT_PT)\$(SRC)/\$\$ROOT
chown -R \$(LUSER) \$(MOUNT_PT)\$(SRC)/\$\$ROOT
EOF
) >> $MKFILE.tmp
}
@ -367,7 +348,7 @@ wrt_test_log() { # Initialize testsuite log file
(
cat << EOF
@echo "export TEST_LOG=$TESTLOGDIR/$TESTLOGFILE" >> envars && \\
su - lfs -c "echo -e '\n\`date\`\n' >$TESTLOGDIR/$TESTLOGFILE"
su - \$(LUSER) -c "echo -e '\n\`date\`\n' >$TESTLOGDIR/$TESTLOGFILE"
EOF
) >> $MKFILE.tmp
}
@ -398,13 +379,13 @@ EOF
#----------------------------------#
wrt_run_as_su() { # Execute script inside time { }, footer to log file
wrt_RunAsUser() { # Execute script inside time { }, footer to log file
#----------------------------------#
local this_script=$1
local file=$2
(
cat << EOF
@( time { su - lfs -c "source /home/lfs/.bashrc && $JHALFSDIR/${PROGNAME}-commands/$file" >>logs/$this_script 2>&1 ; } ) 2>>logs/$this_script && \\
@( time { su - \$(LUSER) -c "source /home/\$(LUSER)/.bashrc && $JHALFSDIR/${PROGNAME}-commands/$file" >>logs/$this_script 2>&1 ; } ) 2>>logs/$this_script && \\
echo -e "\nKB: \`du -skx --exclude=${SCRIPT_ROOT} \$(MOUNT_PT)\`\n" >>logs/$this_script
EOF
) >> $MKFILE.tmp
@ -412,41 +393,24 @@ EOF
#----------------------------------#
wrt_run_as_root() { # Some scripts must be run as root..
wrt_RunAsRoot() { # Some scripts must be run as root..
#----------------------------------#
local ENV_MOUNT
local this_script=$1
local file=$2
case ${PROGNAME} in
lfs ) MOUNT_ENV="LFS" ;;
blfs ) MOUNT_ENV="BLFS" ;;
clfs ) MOUNT_ENV="CLFS" ;;
clfs2 ) MOUNT_ENV="CLFS" ;;
hlfs ) MOUNT_ENV="HLFS" ;;
*) echo "undefined progname $PROGNAME"; exit 1
esac
(
cat << EOF
@( time { export LFS=\$(MOUNT_PT) && ${PROGNAME}-commands/$file >>logs/$this_script 2>&1 ; } ) 2>>logs/$this_script && \\
echo -e "\nKB: \`du -skx --exclude=${SCRIPT_ROOT} \$(MOUNT_PT)\`\n" >>logs/$this_script
EOF
) >> $MKFILE.tmp
}
#----------------------------------#
wrt_run_as_clfs_su() { # Execute script inside time { }, footer to log file
#----------------------------------#
local this_script=$1
local file=$2
(
cat << EOF
@( time { su - clfs -c "source /home/clfs/.bashrc && $JHALFSDIR/${PROGNAME}-commands/$file" >>logs/$this_script 2>&1 ; } ) 2>>logs/$this_script && \\
echo -e "\nKB: \`du -skx --exclude=${SCRIPT_ROOT} \$(MOUNT_PT)\`\n" >>logs/$this_script
EOF
) >> $MKFILE.tmp
}
#----------------------------------#
wrt_run_as_clfs_root() { # Some scripts must be run as root..
#----------------------------------#
local this_script=$1
local file=$2
(
cat << EOF
@( time { export CLFS=\$(MOUNT_PT) && ${PROGNAME}-commands/$file >>logs/$this_script 2>&1 ; } ) 2>>logs/$this_script && \\
@( time { export ${MOUNT_ENV}=\$(MOUNT_PT) && ${PROGNAME}-commands/$file >>logs/$this_script 2>&1 ; } ) 2>>logs/$this_script && \\
echo -e "\nKB: \`du -skx --exclude=${SCRIPT_ROOT} \$(MOUNT_PT)\`\n" >>logs/$this_script
EOF
) >> $MKFILE.tmp
@ -467,7 +431,6 @@ EOF
}
#----------------------------------#
wrt_run_as_chroot1() { #
#----------------------------------#
@ -526,9 +489,9 @@ wrt_remove_build_dirs() { #
(
cat << EOF
@ROOT=\`head -n1 \$(MOUNT_PT)\$(SRC)/\$(PKG_LST) | sed 's@^./@@;s@/.*@@'\` && \\
rm -r \$(MOUNT_PT)\$(SRC)/\$\$ROOT && \\
rm -rf \$(MOUNT_PT)\$(SRC)/\$\$ROOT && \\
if [ -e \$(MOUNT_PT)\$(SRC)/$name-build ]; then \\
rm -r \$(MOUNT_PT)\$(SRC)/$name-build; \\
rm -rf \$(MOUNT_PT)\$(SRC)/$name-build; \\
fi;
EOF
) >> $MKFILE.tmp
@ -542,9 +505,9 @@ wrt_remove_build_dirs2() { #
(
cat << EOF
@ROOT=\`head -n1 \$(SRC)/\$(PKG_LST) | sed 's@^./@@;s@/.*@@'\` && \\
rm -r \$(SRC)/\$\$ROOT && \\
rm -rf \$(SRC)/\$\$ROOT && \\
if [ -e \$(SRC)/$name-build ]; then \\
rm -r \$(SRC)/$name-build; \\
rm -rf \$(SRC)/$name-build; \\
fi;
EOF
) >> $MKFILE.tmp
@ -714,6 +677,7 @@ extract_commands() { #
--xinclude \
--stringparam method $METHOD \
--stringparam testsuite $TEST \
--stringparam bomb-testsuite $BOMB_TEST \
--stringparam vim-lang $VIMLANG \
--stringparam timezone $TIMEZONE \
--stringparam page $PAGE \
@ -727,6 +691,7 @@ extract_commands() { #
--xinclude \
--stringparam model $MODEL \
--stringparam testsuite $TEST \
--stringparam bomb-testsuite $BOMB_TEST \
--stringparam timezone $TIMEZONE \
--stringparam page $PAGE \
--stringparam lang $LANG \
@ -740,6 +705,7 @@ extract_commands() { #
xsltproc --nonet \
--xinclude \
--stringparam testsuite $TEST \
--stringparam bomb-testsuite $BOMB_TEST \
--stringparam vim-lang $VIMLANG \
--stringparam timezone $TIMEZONE \
--stringparam page $PAGE \
@ -903,8 +869,8 @@ get_sources() { # Download file, write name to MISSING_FILES.DMP if
done
if [[ -s MISSING_FILES.DMP ]]; then
echo -e "\n\n${tab_}${RED} One or more files were not retrieved or have a bad MD5SUMS.\n${tab_} Check ${L_arrow}$BUILDDIR/sources/MISSING_FILES.DMP${R_arrow} for names ${OFF}\n"
# Do not allow the automatic exection of the Makefile.
echo -e "\n\n${tab_}${RED} One or more files were not retrieved or have bad MD5SUMS.\n${tab_} Check ${L_arrow}$BUILDDIR/sources/MISSING_FILES.DMP${R_arrow} for names ${OFF}\n"
# Do not allow the automatic execution of the Makefile.
echo "${tab_}${BOLD}${RED}*** ${YELLOW}Automatic execution of the generated makefile has been inhibited. ${RED}***${OFF}${nl_}"
RUNMAKE=0
fi

View File

@ -16,7 +16,7 @@ BUILDDIR=/mnt/build_dir
REPORT=1
#=== Getting packages ===
# Files will be retrieved from the local archive SRC_ARCHIVE
# Files will be retrieved from the local archive SRC_ARCHIVE
# (if defined) or the 'net and will be stored in $BUILDDIR/sources
#--- Download the source packages 0(no)/1(yes)
GETPKG=0
@ -48,9 +48,14 @@ OPTIMIZE=0
# 1 = only chapter06 Glibc, GCC and Binutils testsuites
# 2 = all chapter06 testsuites
# 3 = all chapter05 and chapter06 testsuites
# (in CLFS, alias to 2)
# (in CLFS and HLFS, alias to 2)
TEST=1
#--- Bomb on test suites failures?
# 0 = no, I want to build the full system and review the logs
# 1 = yes, bomb at the first test suite failure to can review the build dir
BOMB_TEST=0
#--- Run the stripping phases 0(no)/1(yes)
STRIP=1

View File

@ -84,9 +84,9 @@ validate_config() { # Are the config values sane (within reason)
inline_doc
# First internal variables, then the ones that change the book's flavour, and lastly system configuration variables
local -r hlfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE MODEL GRSECURITY_HOST TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB CONFIG GETKERNEL KEYMAP PAGE TIMEZONE LANG LC_ALL"
local -r clfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE METHOD ARCH TARGET TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB BOOT_CONFIG CONFIG GETKERNEL KEYMAP VIMLANG PAGE TIMEZONE LANG"
local -r lfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG"
local -r hlfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE MODEL GRSECURITY_HOST TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB CONFIG GETKERNEL KEYMAP PAGE TIMEZONE LANG LC_ALL LUSER LGROUP"
local -r clfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE METHOD ARCH TARGET TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB BOOT_CONFIG CONFIG GETKERNEL KEYMAP VIMLANG PAGE TIMEZONE LANG LUSER LGROUP"
local -r lfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG LUSER LGROUP"
local -r ERROR_MSG_pt1='The variable \"${L_arrow}${config_param}${R_arrow}\" value ${L_arrow}${BOLD}${!config_param}${R_arrow} is invalid,'
local -r ERROR_MSG_pt2=' check the config file ${BOLD}${GREEN}\<$(echo $PROGNAME | tr [a-z] [A-Z])/config\> or \<common/config\>${OFF}'
@ -202,6 +202,7 @@ inline_doc
RUN_FARCE) [[ "$COMPARE" = "1" ]] && validate_against_str "x0x x1x" ;;
ITERATIONS) [[ "$COMPARE" = "1" ]] && validate_against_str "x2x x3x x4x x5x" ;;
TEST) validate_against_str "x0x x1x x2x x3x" ;;
BOMB_TEST) [[ ! "$TEST" = "0" ]] && validate_against_str "x0x x1x" ;;
OPTIMIZE) validate_against_str "x0x x1x x2x" ;;
STRIP) validate_against_str "x0x x1x" ;;
VIMLANG) validate_against_str "x0x x1x" ;;
@ -210,6 +211,12 @@ inline_doc
METHOD) validate_against_str "xchrootx xbootx" ;;
ARCH) validate_against_str "xx86x xx86_64x xx86_64-64x xsparcx xsparc64x xsparc64-64x xmipsx xmips64x xmips64-64x xppcx xppc64x xalphax" ;;
TARGET) validate_target ;;
LUSER) echo -e "`eval echo $PARAM_VALS`"
[[ "${!config_param}" = "**EDIT ME**" ]] && write_error_and_die
;;
LGROUP) echo -e "`eval echo $PARAM_VALS`"
[[ "${!config_param}" = "**EDIT ME**" ]] && write_error_and_die
;;
GRSECURITY_HOST) validate_against_str "x0x x1x" ;;
# BOOK validation. Very ugly, need be fixed

View File

@ -65,7 +65,7 @@ define echo_finished
@echo
@echo -e \\t- Exit from the chroot.
@echo
@echo -e \\t- Set-up the boot loader, except if building CLFS with METHOO=boot.
@echo -e \\t- Set-up the boot loader, except if building CLFS with METHOD=boot.
@echo -e \\tYou can set-up the host bootloader or the new boot-loader
@echo -e \\tinstalled on the new system.
@echo -e \\tIf the last, you must to mount the virtual filesystems, re-enter

View File

@ -1,8 +1,8 @@
Index: LFS/master.sh
===================================================================
--- LFS/master.sh (revision 2829)
--- LFS/master.sh (revision 2906)
+++ LFS/master.sh (working copy)
@@ -176,6 +176,11 @@
@@ -173,6 +173,11 @@
# Keep the script file name
this_script=`basename $file`
@ -14,7 +14,7 @@ Index: LFS/master.sh
# We'll run the chroot commands differently than the others, so skip them in the
# dependencies and target creation.
case "${this_script}" in
@@ -183,6 +188,18 @@
@@ -180,6 +185,18 @@
*stripping*) [[ "${STRIP}" = "0" ]] && continue ;;
esac
@ -33,10 +33,10 @@ Index: LFS/master.sh
# Grab the name of the target
name=`echo ${this_script} | sed -e 's@[0-9]\{3\}-@@'`
@@ -235,7 +252,9 @@
@@ -232,7 +249,9 @@
# and not to use chroot.
case "${this_script}" in
*kernfs) wrt_run_as_root "${this_script}" "$file" ;;
*kernfs) wrt_RunAsRoot "${this_script}" "$file" ;;
- *) wrt_run_as_chroot1 "${this_script}" "$file" ;;
+ *) wrt_paco_prep
+ wrt_run_as_chroot1 "${this_script}" "$file"
@ -44,7 +44,7 @@ Index: LFS/master.sh
esac
# Remove the build directory(ies) except if the package build fails.
@@ -255,6 +274,16 @@
@@ -252,6 +271,16 @@
PREV=${this_script}${N}
# Set system_build envar for iteration targets
system_build=$chapter6
@ -61,19 +61,16 @@ Index: LFS/master.sh
done # end for file in chapter06/*
}
@@ -315,8 +344,18 @@
@@ -312,8 +341,15 @@
else
wrt_run_as_chroot2 "$this_script" "$file"
fi
+ wrt_paco_log "lfs-sysconf"
;;
+ *kernel) wrt_paco_prep
+ wrt_run_as_chroot2 "$this_script" "$file"
+ wrt_paco_log "$pkg_tarball"
+ ;;
+ *bootscripts) wrt_paco_prep
+ wrt_run_as_chroot2 "$this_script" "$file"
+ wrt_paco_log "$pkg_tarball"
+ *kernel | *bootscripts )
+ wrt_paco_prep
+ wrt_run_as_chroot2 "$this_script" "$file"
+ wrt_paco_log "$pkg_tarball"
+ ;;
*) wrt_run_as_chroot2 "$this_script" "$file"
+ wrt_paco_log "lfs-sysconf"
@ -82,9 +79,9 @@ Index: LFS/master.sh
Index: LFS/lfs.xsl
===================================================================
--- LFS/lfs.xsl (revision 2829)
--- LFS/lfs.xsl (revision 2906)
+++ LFS/lfs.xsl (working copy)
@@ -32,6 +32,9 @@
@@ -39,6 +39,9 @@
<!-- Locale settings -->
<xsl:param name="lang" select="C"/>
@ -94,7 +91,7 @@ Index: LFS/lfs.xsl
<xsl:template match="/">
<xsl:apply-templates select="//sect1"/>
</xsl:template>
@@ -200,6 +203,33 @@
@@ -239,6 +242,33 @@
<xsl:apply-templates/>
<xsl:text> || true&#xA;</xsl:text>
</xsl:when>
@ -128,6 +125,232 @@ Index: LFS/lfs.xsl
<!-- The rest of commands -->
<xsl:otherwise>
<xsl:apply-templates/>
Index: CLFS/master.sh
===================================================================
--- CLFS/master.sh (revision 2906)
+++ CLFS/master.sh (working copy)
@@ -495,6 +495,11 @@
# Keep the script file name
this_script=`basename $file`
+ # If $this_script corresponds to a paco script, then skip it
+ case "${this_script}" in
+ *paco) continue ;;
+ esac
+
# Test if the stripping phase must be skipped.
# Skip alsp temp-perl for iterative runs
case $this_script in
@@ -502,6 +507,18 @@
*temp-perl*) [[ -n "$N" ]] && continue ;;
esac
+ # Install paco as the first package in ch6, before installing
+ # linux-libc-headers, except in iterartive builds
+ if [[ -z "$N" ]]; then
+ case $this_script in
+ *linux-headers)
+ TMP_SCRIPT="$this_script"
+ this_script=`echo $this_script | sed -e 's/linux-headers/a-paco/'`
+ wrt_paco_inst "$this_script"
+ this_script="$TMP_SCRIPT" ;;
+ esac
+ fi
+
# Grab the name of the target, strip id number, XXX-script
name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@' \
-e 's@temp-@@' \
@@ -554,7 +571,9 @@
[[ "$OPTIMIZE" != "0" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
fi
#
+ wrt_paco_prep
wrt_run_as_chroot1 "${this_script}" "${file}"
+ wrt_paco_log "$pkg_tarball"
#
[[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
#
@@ -569,6 +588,16 @@
PREV=${this_script}${N}
# Set system_build envar for iteration targets
system_build=$basicsystem
+
+ # Reinstalling paco after readsjusting the toolchain.
+ case "${this_script}" in
+ *adjusting)
+ TMP_SCRIPT="$this_script"
+ this_script=`echo ${this_script} | sed -e 's/adjusting/x-paco/'`
+ wrt_paco_inst "$this_script"
+ this_script="$TMP_SCRIPT" ;;
+ esac
+
done # for file in final-system/* ...
}
@@ -605,6 +634,11 @@
# Keep the script file name
this_script=`basename $file`
+ # If $this_script corresponds to a paco script, then skip it
+ case "${this_script}" in
+ *paco) continue ;;
+ esac
+
# Test if the stripping phase must be skipped
# Skip alsp temp-perl for iterative runs
case $this_script in
@@ -612,6 +646,18 @@
*temp-perl*) [[ -n "$N" ]] && continue ;;
esac
+ # Install paco as the first package in ch6, before installing
+ # linux-libc-headers, except in iterartive builds
+ if [[ -z "$N" ]]; then
+ case $this_script in
+ *linux-headers)
+ TMP_SCRIPT="$this_script"
+ this_script=`echo $this_script | sed -e 's/linux-headers/a-paco/'`
+ wrt_paco_inst "$this_script"
+ this_script="$TMP_SCRIPT" ;;
+ esac
+ fi
+
# Grab the name of the target, strip id number, XXX-script
name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@' \
-e 's@temp-@@' \
@@ -666,7 +712,9 @@
[[ "$OPTIMIZE" != "0" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
fi
#
+ wrt_paco_prep
wrt_run_as_root2 "${this_script}" "${file}"
+ wrt_paco_log "$pkg_tarball"
#
[[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs2 "${name}"
#
@@ -681,6 +729,16 @@
PREV=${this_script}${N}
# Set system_build envar for iteration targets
system_build=$basicsystem
+
+ # Reinstalling paco after readsjusting the toolchain.
+ case "${this_script}" in
+ *adjusting)
+ TMP_SCRIPT="$this_script"
+ this_script=`echo ${this_script} | sed -e 's/adjusting/x-paco/'`
+ wrt_paco_inst "$this_script"
+ this_script="$TMP_SCRIPT" ;;
+ esac
+
done # for file in final-system/* ...
}
@@ -729,7 +787,17 @@
#
[[ "$pkg_tarball" != "" ]] && wrt_unpack2 "$pkg_tarball"
#
+ case $this_script in
+ *bootscripts* | *udev-rules )
+ wrt_paco_prep ;;
+ esac
wrt_run_as_chroot1 "${this_script}" "${file}"
+ case $this_script in
+ *bootscripts* | *udev-rules )
+ wrt_paco_log "$pkg_tarball" ;;
+ *)
+ wrt_paco_log "clfs-sysconf" ;;
+ esac
#
[[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
#
@@ -791,7 +859,17 @@
#
[[ "$pkg_tarball" != "" ]] && wrt_unpack3 "$pkg_tarball"
#
+ case $this_script in
+ *bootscripts* | *udev-rules )
+ wrt_paco_prep ;;
+ esac
wrt_run_as_root2 "${this_script}" "${file}"
+ case $this_script in
+ *bootscripts* | *udev-rules )
+ wrt_paco_log "$pkg_tarball" ;;
+ *)
+ wrt_paco_log "clfs-sysconf" ;;
+ esac
#
[[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs2 "${name}"
#
@@ -863,8 +941,13 @@
else
wrt_run_as_chroot1 "${this_script}" "${file}"
fi
+ wrt_paco_log "clfs-sysconf"
;;
- *) wrt_run_as_chroot1 "${this_script}" "${file}" ;;
+ *kernel) wrt_paco_prep
+ wrt_run_as_chroot1 "${this_script}" "${file}"
+ wrt_paco_log "$pkg_tarball" ;;
+ *) wrt_run_as_chroot1 "${this_script}" "${file}"
+ wrt_paco_log "clfs-sysconf" ;;
esac
#
# Housekeeping...remove any build directory(ies) except if the package build fails.
@@ -942,8 +1025,13 @@
else
wrt_run_as_root2 "${this_script}" "${file}"
fi
+ wrt_paco_log "clfs-sysconf"
;;
- *) wrt_run_as_root2 "${this_script}" "${file}" ;;
+ *kernel) wrt_paco_prep
+ wrt_run_as_root2 "${this_script}" "${file}"
+ wrt_paco_log "$pkg_tarball" ;;
+ *) wrt_run_as_root2 "${this_script}" "${file}"
+ wrt_paco_log "clfs-sysconf" ;;
esac
#
# Housekeeping...remove any build directory(ies) except if the package build fails.
Index: CLFS/clfs.xsl
===================================================================
--- CLFS/clfs.xsl (revision 2906)
+++ CLFS/clfs.xsl (working copy)
@@ -45,6 +45,9 @@
<!-- Locale settings -->
<xsl:param name="lang" select="C"/>
+ <!-- Use paco? -->
+ <xsl:param name="use_paco" select="1"/>
+
<xsl:template match="/">
<xsl:apply-templates select="//sect1"/>
</xsl:template>
@@ -106,6 +109,25 @@
<xsl:text>tar -xvf ../vim-&vim-version;-lang.* --strip-components=1&#xA;</xsl:text>
</xsl:if>
</xsl:if>
+ <!-- paco begin -->
+ <!-- General rule -->
+ <xsl:if test="$use_paco != '0' and
+ @id='ch-scripts-bootscripts' or
+ @id='ch-scripts-udev-rules' or
+ @id='ch-bootable-kernel' or
+ (../@id='chapter-building-system' and
+ @id!='ch-system-temp-perl' and
+ contains(string(),'make') and
+ contains(string(),'install'))">
+ <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
+ </xsl:if>
+ <!-- Linux headers -->
+ <xsl:if test="$use_paco != '0' and
+ @id='ch-system-linux-headers' and
+ contains(string(),'install')">
+ <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
+ </xsl:if>
+ <!-- paco end -->
<xsl:apply-templates select=".//para/userinput | .//screen"/>
<xsl:text>exit</xsl:text>
</exsl:document>
Index: common/paco-build-hlfs.sh
===================================================================
--- common/paco-build-hlfs.sh (revision 0)
@ -147,24 +370,33 @@ Index: common/paco-build-hlfs.sh
+make logme
Index: common/config
===================================================================
--- common/config (revision 2829)
--- common/config (revision 2906)
+++ common/config (working copy)
@@ -86,6 +86,14 @@
@@ -91,6 +91,23 @@
#--- Run farce testing 0(no)/1(yes)
RUN_FARCE=0
+#==== PACO VARIABLES ====
+#--- Use paco? 0(no)/1(yes)
+USE_PACO=1
+PACO_VERSION=1.10.8
+PACO_VERSION=1.10.10
+
+#--- Name of the Paco source package
+PACO_FILE=paco-$PACO_VERSION.tar.*
+PACO_FILE=paco-$PACO_VERSION.tar.bz2 # (use .tar.gz if preferred)
+
+#--- Sourceforge mirror to use for Paco source download
+# Europe: heanet, belnet, puzzle, surfnet, switch, kent
+# North America: superb-east, superb-west, umn, easynews
+# South America: ufpr
+# Asia: nchc, jaist
+# Australia: optusnet
+PACO_MIRROR1=heanet
+PACO_MIRROR2=kent
+
#==== INTERNAL VARIABLES ====
# Don't edit it unless you know what you are doing
@@ -103,3 +111,9 @@
@@ -108,3 +125,9 @@
#--- farce report log directory
FARCELOGDIR=$LOGDIR/farce
@ -176,18 +408,18 @@ Index: common/config
+LD_PRELOAD=/usr/lib/libpaco-log.so
Index: common/func_validate_configs.sh
===================================================================
--- common/func_validate_configs.sh (revision 2829)
--- common/func_validate_configs.sh (revision 2906)
+++ common/func_validate_configs.sh (working copy)
@@ -84,9 +84,9 @@
inline_doc
# First internal variables, then the ones that change the book's flavour, and lastly system configuration variables
- local -r hlfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE MODEL GRSECURITY_HOST TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB CONFIG GETKERNEL KEYMAP PAGE TIMEZONE LANG LC_ALL"
- local -r clfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE METHOD ARCH TARGET TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB BOOT_CONFIG CONFIG GETKERNEL KEYMAP VIMLANG PAGE TIMEZONE LANG"
- local -r lfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG"
+ local -r hlfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE USE_PACO GETPKG RUNMAKE MODEL GRSECURITY_HOST TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB CONFIG GETKERNEL KEYMAP PAGE TIMEZONE LANG LC_ALL"
+ local -r clfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE USE_PACO GETPKG RUNMAKE METHOD ARCH TARGET TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB BOOT_CONFIG CONFIG GETKERNEL KEYMAP VIMLANG PAGE TIMEZONE LANG"
+ local -r lfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE USE_PACO GETPKG RUNMAKE TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG"
- local -r hlfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE MODEL GRSECURITY_HOST TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB CONFIG GETKERNEL KEYMAP PAGE TIMEZONE LANG LC_ALL LUSER LGROUP"
- local -r clfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE METHOD ARCH TARGET TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB BOOT_CONFIG CONFIG GETKERNEL KEYMAP VIMLANG PAGE TIMEZONE LANG LUSER LGROUP"
- local -r lfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG LUSER LGROUP"
+ local -r hlfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE USE_PACO GETPKG RUNMAKE MODEL GRSECURITY_HOST TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB CONFIG GETKERNEL KEYMAP PAGE TIMEZONE LANG LC_ALL LUSER LGROUP"
+ local -r clfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE USE_PACO GETPKG RUNMAKE METHOD ARCH TARGET TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB BOOT_CONFIG CONFIG GETKERNEL KEYMAP VIMLANG PAGE TIMEZONE LANG LUSER LGROUP"
+ local -r lfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE USE_PACO GETPKG RUNMAKE TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG LUSER LGROUP"
local -r ERROR_MSG_pt1='The variable \"${L_arrow}${config_param}${R_arrow}\" value ${L_arrow}${BOLD}${!config_param}${R_arrow} is invalid,'
local -r ERROR_MSG_pt2=' check the config file ${BOLD}${GREEN}\<$(echo $PROGNAME | tr [a-z] [A-Z])/config\> or \<common/config\>${OFF}'
@ -203,38 +435,44 @@ Index: common/paco-functions
===================================================================
--- common/paco-functions (revision 0)
+++ common/paco-functions (revision 0)
@@ -0,0 +1,209 @@
@@ -0,0 +1,311 @@
+#!/bin/bash
+
+#----------------------------#
+wrt_paco_inst() { #
+#----------------------------#
+
+# Not using Paco with uClibc, even if requested
+if [ $PROGNAME = "hlfs" ]; then
+ if [ $MODEL = "uclibc" ]; then
+ USE_PACO=0
+ fi
+fi
+local paco_script="$1"
+
+check_build_model
+
+if [ $USE_PACO != 0 ]; then
+ paco_script="$1"
+ paco_file="chapter06/$paco_script"
+ chapter6="$chapter6 $paco_script"
+ case $PROGNAME in
+ clfs )
+ paco_file="final-system/$paco_script"
+ basicsystem="$basicsystem $paco_script" ;;
+ * )
+ paco_file="chapter06/$paco_script"
+ chapter6="$chapter6 $paco_script" ;;
+ esac
+
+ # Copy the paco build script to the correct directory and make it executable
+ cp $JHALFSDIR/paco-build-$PROGNAME.sh $JHALFSDIR/${PROGNAME}-commands/$paco_file &&
+ chmod +x $JHALFSDIR/${PROGNAME}-commands/$paco_file
+
+ # Write target, dependency and unpack
+ wrt_target "$paco_script" "$PREV"
+ wrt_unpack2 "$PACO_FILE"
+ if [ $CLFS_BOOT = 1 ]; then
+ wrt_target_boot "$paco_script" "$PREV"
+ wrt_unpack3 "$PACO_FILE"
+ wrt_run_as_root2 "${paco_script}" "${paco_file}"
+ wrt_remove_build_dirs2 "paco"
+ else
+ wrt_target "$paco_script" "$PREV"
+ wrt_unpack2 "$PACO_FILE"
+ wrt_run_as_chroot1 "${paco_script}" "${paco_file}"
+ wrt_remove_build_dirs "paco"
+ fi
+
+ # Run the script
+ wrt_run_as_chroot1 "${paco_script}" "${paco_file}"
+
+ # Clean up
+ wrt_remove_build_dirs "paco"
+ wrt_touch
+
+ # Override the PREV variable
@ -247,22 +485,24 @@ Index: common/paco-functions
+wrt_paco_prep() { # Export Paco variables
+#----------------------------------# and remove tmpfile
+
+# Not using Paco with uClibc, even if requested
+if [ $PROGNAME = "hlfs" ]; then
+ if [ $MODEL = "uclibc" ]; then
+ USE_PACO=0
+ fi
+fi
+local TMPFILEPATH
+
+check_build_model
+
+check_log_package
+
+if [ $USE_PACO != 0 ] && [ $LOG_PACKAGE != 0 ]; then
+ if [ $CLFS_BOOT = 1 ]; then
+ TMPFILEPATH="$PACO_TMPFILE"
+ else
+ TMPFILEPATH="\$(MOUNT_PT)$PACO_TMPFILE"
+ fi
+(
+cat << EOF
+ @echo "export PACO_INCLUDE=$PACO_INCLUDE" >> envars && \\
+ echo "export PACO_EXCLUDE=\$(SRC):$PACO_EXCLUDE" >> envars && \\
+ echo "export PACO_TMPFILE=$PACO_TMPFILE" >> envars && \\
+ rm -f \$(MOUNT_PT)$PACO_TMPFILE
+ rm -f $TMPFILEPATH
+EOF
+) >> $MKFILE.tmp
+fi
@ -274,19 +514,29 @@ Index: common/paco-functions
+#----------------------------------# and remove tempfile
+local PACKAGE
+
+# Extract package name and version from the tarball name
+PACKAGE=`echo $1 | sed -e 's/.tar.*//'`
+
+# Not using Paco with uClibc, even if requested
+if [ $PROGNAME = "hlfs" ]; then
+ if [ $MODEL = "uclibc" ]; then
+ USE_PACO=0
+ fi
+fi
+check_build_model
+
+# Check if the package should be logged
+check_log_package
+
+
+if [ $USE_PACO != 0 ]; then
+ if [ $LOG_PACKAGE != 0 ]; then
+ # Only use this if doing CLFS boot build
+ if [ $CLFS_BOOT = 1 ]; then
+(
+cat << EOF
+ @if [ -e $PACO_TMPFILE ]; then \\
+ paco -lp+ $PACKAGE < $PACO_TMPFILE && \\
+ rm -f $PACO_TMPFILE; \\
+ fi;
+EOF
+) >> $MKFILE.tmp
+ # All else should use these commands
+ else
+(
+cat << EOF
+ @if [ -e \$(MOUNT_PT)$PACO_TMPFILE ]; then \\
@ -295,91 +545,106 @@ Index: common/paco-functions
+ fi;
+EOF
+) >> $MKFILE.tmp
+ fi
+ fi
+ # Add missing files to the logs if needed
+ wrt_paco_add_log
+fi
+}
+
+
+#----------------------------------#
+fnc_add_log() { #
+#----------------------------------#
+
+MISSING_FILE=$1
+
+if [ $CLFS_BOOT = 1 ]; then
+ echo -e "\t@$MISSING_FILE | paco -lp+ $PACKAGE" >> $MKFILE.tmp
+else
+ echo -e "\t@\$(CHROOT1) '$MISSING_FILE | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
+fi
+}
+
+
+#----------------------------------#
+wrt_paco_add_log() { #
+#----------------------------------#
+# Some packages create files using bash redirection, which the LD_PRELOAD lib don't notice
+# These rules will add the missing files to the proper logs.
+# Most of these is not needed for HLFS, but they do no harm.
+if [ $USE_PACO != 0 ]; then
+ case $this_script in
+ case $this_script in
+ *glibc)
+ echo -e "\t@\$(CHROOT1) 'find /lib -type l | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
+ echo -e "\t@\$(CHROOT1) 'find /etc/{nsswitch.conf,ld.so.conf} | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
+ fnc_add_log "find /lib -type l"
+ fnc_add_log "find /etc/{nsswitch.conf,ld.so.conf}"
+ ;;
+ *ncurses)
+ LIBS="/usr/lib/{libcurses.so,libncurses.so,libform.so,libpanel.so,libmenu.so}"
+ echo -e "\t@\$(CHROOT1) 'find $LIBS | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
+ fnc_add_log "find /usr/lib/{libcurses.so,libncurses.so,libform.so,libpanel.so,libmenu.so}"
+ ;;
+ *bash)
+ echo -e "\t@\$(CHROOT1) 'echo /bin/sh | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
+ fnc_add_log "echo /bin/sh"
+ ;;
+ *flex)
+ echo -e "\t@\$(CHROOT1) 'echo /usr/bin/lex | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
+ fnc_add_log "echo /usr/bin/lex"
+ ;;
+ *shadow)
+ echo -e "\t@\$(CHROOT1) 'echo /etc/login.defs | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
+ fnc_add_log "echo /etc/login.defs"
+ ;;
+ *hotplug)
+ echo -e "\t@\$(CHROOT1) 'echo /var/log/hotplug | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
+ echo -e "\t@\$(CHROOT1) 'echo /var/run/usb | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
+ fnc_add_log "echo /var/log/hotplug"
+ fnc_add_log "echo /var/run/usb"
+ ;;
+ *sysklogd)
+ echo -e "\t@\$(CHROOT1) 'echo /etc/syslog.conf | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
+ fnc_add_log "echo /etc/syslog.conf"
+ ;;
+ *sysvinit)
+ echo -e "\t@\$(CHROOT1) 'echo /etc/inittab | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
+ fnc_add_log "echo /etc/inittab"
+ ;;
+ *udev)
+ echo -e "\t@\$(CHROOT1) 'find /lib/udev/devices | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
+ echo -e "\t@\$(CHROOT1) 'echo /lib/firmware | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
+ echo -e "\t@\$(CHROOT1) 'find /etc/udev/rules.d -type f | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
+ fnc_add_log "find /lib/udev/devices"
+ fnc_add_log "echo /lib/firmware"
+ fnc_add_log "find /etc/udev/rules.d -type f"
+ ;;
+ *util-linux)
+ echo -e "\t@\$(CHROOT1) 'echo /var/lib/hwclock | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
+ echo -e "\t@\$(CHROOT1) 'echo /etc/nologin.txt | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
+ fnc_add_log "echo /var/lib/hwclock"
+ fnc_add_log "echo /etc/nologin.txt"
+ ;;
+ *vim)
+ echo -e "\t@\$(CHROOT1) 'echo /etc/vimrc | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
+ fnc_add_log "echo /etc/vimrc"
+ ;;
+ # Rules below here will log configuration files created in LFS and HLFS
+ # They will end up in a log named {h}lfs-sysconf
+ # Rules below here will log configuration files created in {C,H}LFS
+ # They will end up in a log named {c,h}lfs-sysconf
+ *setclock)
+ echo -e "\t@\$(CHROOT2) 'echo /etc/sysconfig/clock | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
+ fnc_add_log "echo /etc/sysconfig/clock"
+ ;;
+ *inputrc)
+ echo -e "\t@\$(CHROOT2) 'echo /etc/inputrc | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
+ fnc_add_log "echo /etc/inputrc"
+ ;;
+ *profile)
+ echo -e "\t@\$(CHROOT2) 'echo /etc/profile | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
+ fnc_add_log "echo /etc/profile"
+ ;;
+ *hostname)
+ echo -e "\t@\$(CHROOT2) 'echo /etc/sysconfig/network | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
+ fnc_add_log "echo /etc/sysconfig/network"
+ ;;
+ *localnet)
+ echo -e "\t@\$(CHROOT2) 'echo /etc/sysconfig/network | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
+ fnc_add_log "echo /etc/sysconfig/network"
+ ;;
+ *hosts)
+ echo -e "\t@\$(CHROOT2) 'echo /etc/hosts | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
+ fnc_add_log "echo /etc/hosts"
+ ;;
+ *network)
+ echo -e "\t@\$(CHROOT2) 'echo /etc/sysconfig/network-devices/ifconfig.eth0/ipv4 | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
+ echo -e "\t@\$(CHROOT2) 'echo /etc/resolv.conf | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
+ fnc_add_log "echo /etc/sysconfig/network-devices/ifconfig.eth0/ipv4"
+ fnc_add_log "echo /etc/resolv.conf"
+ ;;
+ *fstab)
+ echo -e "\t@\$(CHROOT2) 'echo /etc/fstab | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
+ fnc_add_log "echo /etc/fstab"
+ ;;
+ *theend) # LFS
+ echo -e "\t@\$(CHROOT2) 'echo /etc/$PROGNAME-release | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
+ *theend) # LFS and CLFS
+ fnc_add_log "echo /etc/$PROGNAME-release"
+ ;;
+ *finished) # HLFS
+ echo -e "\t@\$(CHROOT2) 'echo /etc/$PROGNAME-release | paco -lp+ $PACKAGE'" >> $MKFILE.tmp
+ fnc_add_log "echo /etc/$PROGNAME-release"
+ ;;
+ esac
+fi
@ -398,7 +663,10 @@ Index: common/paco-functions
+ *createfiles) LOG_PACKAGE=0 ;;
+ *pwdgroup) LOG_PACKAGE=0 ;;
+ *devices) LOG_PACKAGE=0 ;;
+ *stripping) LOG_PACKAGE=0 ;;
+ *strippingagain) LOG_PACKAGE=0 ;;
+ *adjusting) LOG_PACKAGE=0 ;;
+ *temp-perl) LOG_PACKAGE=0 ;;
+ *readjusting) LOG_PACKAGE=0 ;;
+ *setclock) LOG_PACKAGE=0 ;;
+ *inputrc) LOG_PACKAGE=0 ;;
@ -413,6 +681,72 @@ Index: common/paco-functions
+ *) LOG_PACKAGE=1 ;;
+esac
+}
+
+#----------------------------------#
+get_paco_src() { #
+#----------------------------------#
+# Download the paco sources
+# We don't do any MD5SUM checking as of yet
+# http://jaist.dl.sourceforge.net/sourceforge/paco/paco-1.10.10.tar.bz2
+
+local PACO_URL1="http://$PACO_MIRROR1.dl.sourceforge.net/sourceforge/paco/$PACO_FILE"
+local PACO_URL2="http://$PACO_MIRROR2.dl.sourceforge.net/sourceforge/paco/$PACO_FILE"
+
+# Test if paco is to be used
+[[ ! "$USE_PACO" = "1" ]] && return
+
+# If the file exists in the archive copy it to the $BUILDDIR/sources dir.
+if [ ! -z ${SRC_ARCHIVE} ] &&
+ [ -d ${SRC_ARCHIVE} ] &&
+ [ -f ${SRC_ARCHIVE}/$PACO_FILE ]; then
+ cp ${SRC_ARCHIVE}/$PACO_FILE .
+ echo "$PACO_FILE: -- copied from $SRC_ARCHIVE"
+ fromARCHIVE=1
+else
+ echo "${BOLD}${YELLOW}$PACO_FILE: not found in ${SRC_ARCHIVE}${OFF}"
+ fromARCHIVE=0
+ # If the file does not exist yet in /sources download a fresh one
+ if [ ! -f $PACO_FILE ] ; then
+ if ! wget $PACO_URL1 && ! wget $PACO_URL2 ; then
+ gs_wrt_message "$PACO_FILE not found in the SRC_ARCHIVE or on any server..SKIPPING"
+ continue
+ fi
+ fi
+fi
+
+# Copy the freshly downloaded file to the source archive.
+if [ ! -z ${SRC_ARCHIVE} ] &&
+ [ -d ${SRC_ARCHIVE} ] &&
+ [ -w ${SRC_ARCHIVE} ] &&
+ [ "$fromARCHIVE" = "0" ] ; then
+ echo "Storing file:<$PACO_FILE> in the package archive"
+ cp -f $PACO_FILE ${SRC_ARCHIVE}
+fi
+}
+
+
+#----------------------------------#
+check_build_model() { #
+#----------------------------------#
+# Check what script we're running, and set some switches accordingly
+
+CLFS_BOOT=0
+
+case $PROGNAME in
+ hlfs)
+ # Not using Paco with uClibc, even if requested
+ if [ "$MODEL" = "uclibc" ]; then
+ USE_PACO=0
+ fi
+ ;;
+ clfs)
+ # CLFS boot method require it's own commands
+ if [ "$METHOD" = "boot" ]; then
+ CLFS_BOOT=1
+ fi
+ ;;
+esac
+}
Index: common/paco-build-lfs.sh
===================================================================
--- common/paco-build-lfs.sh (revision 0)
@ -428,9 +762,24 @@ Index: common/paco-build-lfs.sh
+make &&
+make install &&
+make logme
Index: common/paco-build-clfs.sh
===================================================================
--- common/paco-build-clfs.sh (revision 0)
+++ common/paco-build-clfs.sh (revision 0)
@@ -0,0 +1,10 @@
+#!/bin/sh
+set -e
+
+cd $PKGDIR
+./configure --sysconfdir=/etc \
+ --enable-scripts \
+ --disable-gpaco &&
+make &&
+make install &&
+make logme
Index: common/common-functions
===================================================================
--- common/common-functions (revision 2829)
--- common/common-functions (revision 2906)
+++ common/common-functions (working copy)
@@ -69,6 +69,9 @@
in the configuration file has the proper packages and patches for the
@ -442,7 +791,15 @@ Index: common/common-functions
${BOLD} -O, --optimize${OFF}
Optimize [0-2]
0 = no optimization
@@ -733,6 +736,7 @@
@@ -683,6 +686,7 @@
--stringparam page $PAGE \
--stringparam lang $LANG \
--stringparam keymap $KEYMAP \
+ --stringparam use_paco $USE_PACO \
-o ./${PROGNAME}-commands/ $XSL $BOOK/$ARCH-index.xml >>$LOGDIR/$LOG 2>&1
;;
hlfs)
@@ -698,6 +702,7 @@
--stringparam lc_all $LC_ALL \
--stringparam keymap $KEYMAP \
--stringparam grsecurity_host $GRSECURITY_HOST \
@ -450,7 +807,7 @@ Index: common/common-functions
-o ./${PROGNAME}-commands/ $XSL $BOOK/index.xml >>$LOGDIR/$LOG 2>&1
;;
lfs)
@@ -744,6 +748,7 @@
@@ -710,6 +715,7 @@
--stringparam timezone $TIMEZONE \
--stringparam page $PAGE \
--stringparam lang $LANG \
@ -458,11 +815,21 @@ Index: common/common-functions
-o ./${PROGNAME}-commands/ $XSL $BOOK/index.xml >>$LOGDIR/$LOG 2>&1
;;
*) exit 1 ;;
@@ -776,6 +782,9 @@
# Generate URLs file
create_urls
+ # If Paco is to be used, then download the sources
+ get_paco_src
+
IFS=$'\x0A' # Modify the 'internal field separator' to break on 'LF' only
for line in `cat urls.lst`; do
IFS=$saveIFS # Restore the system defaults
Index: HLFS/hlfs.xsl
===================================================================
--- HLFS/hlfs.xsl (revision 2829)
--- HLFS/hlfs.xsl (revision 2906)
+++ HLFS/hlfs.xsl (working copy)
@@ -39,6 +39,9 @@
@@ -46,6 +46,9 @@
<xsl:param name="lang" select="C"/>
<xsl:param name="lc_all" select="C"/>
@ -472,7 +839,7 @@ Index: HLFS/hlfs.xsl
<xsl:template match="/">
<xsl:apply-templates select="//sect1"/>
</xsl:template>
@@ -191,6 +194,10 @@
@@ -192,6 +195,10 @@
<!-- Fixing bootscripts installation -->
<xsl:when test="ancestor::sect1[@id='bootable-bootscripts'] and
string() = 'make install'">
@ -483,7 +850,7 @@ Index: HLFS/hlfs.xsl
<xsl:text>make install&#xA;</xsl:text>
<xsl:text>cd ../blfs-bootscripts-&blfs-bootscripts-version;&#xA;</xsl:text>
</xsl:when>
@@ -257,6 +264,25 @@
@@ -280,6 +287,25 @@
<xsl:apply-templates/>
<xsl:text> || true&#xA;</xsl:text>
</xsl:when>
@ -494,15 +861,15 @@ Index: HLFS/hlfs.xsl
+ contains(string(),'make') and
+ contains(string(),'install')">
+ <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
+ <xsl:apply-templates/>
+ <xsl:apply-templates/>
+ <xsl:text>&#xA;</xsl:text>
+ </xsl:when>
+ <!-- Linux-libc-headers -->
+ <xsl:when test="$use_paco != '0' and $model != 'uclibc' and
+ ancestor::sect1[@id='ch-system-linux-libc-headers'] and
+ ancestor::sect1[@id='ch-system-linux-headers'] and
+ contains(string(),'install ')">
+ <xsl:text>export LD_PRELOAD=/usr/lib/libpaco-log.so&#xA;</xsl:text>
+ <xsl:apply-templates/>
+ <xsl:apply-templates/>
+ <xsl:text>&#xA;</xsl:text>
+ </xsl:when>
+ <!-- paco end -->
@ -511,9 +878,19 @@ Index: HLFS/hlfs.xsl
<xsl:apply-templates/>
Index: HLFS/master.sh
===================================================================
--- HLFS/master.sh (revision 2829)
--- HLFS/master.sh (revision 2906)
+++ HLFS/master.sh (working copy)
@@ -250,6 +250,11 @@
@@ -40,7 +40,9 @@
EOF
) >> $MKFILE.tmp
[[ "$TEST" != "0" ]] && wrt_test_log2 "${this_script}"
+ wrt_paco_prep
wrt_run_as_chroot1 "$toolchain" "$this_script"
+ wrt_paco_log "`echo $toolchain | sed -e 's@[0-9]\{3\}-@@'`"
;;
*)
@@ -272,6 +274,11 @@
# Keep the script file name
this_script=`basename $file`
@ -525,7 +902,7 @@ Index: HLFS/master.sh
# Skip this script depending on jhalfs.conf flags set.
case $this_script in
# We'll run the chroot commands differently than the others, so skip them in the
@@ -259,6 +264,18 @@
@@ -281,6 +288,18 @@
*-stripping* ) [[ "$STRIP" = "0" ]] && continue ;;
esac
@ -533,9 +910,9 @@ Index: HLFS/master.sh
+ # linux-libc-headers, except in iterartive builds
+ if [[ -z "$N" ]]; then
+ case $this_script in
+ *linux-libc-headers)
+ *linux-headers)
+ TMP_SCRIPT="$this_script"
+ this_script=`echo $this_script | sed -e 's/linux-libc-headers/a-paco/'`
+ this_script=`echo $this_script | sed -e 's/linux-headers/a-paco/'`
+ wrt_paco_inst "$this_script"
+ this_script="$TMP_SCRIPT" ;;
+ esac
@ -544,8 +921,8 @@ Index: HLFS/master.sh
# Grab the name of the target
name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@'`
@@ -334,7 +351,9 @@
wrt_run_as_root "${this_script}" "${file}"
@@ -346,7 +365,9 @@
wrt_RunAsRoot "${this_script}" "${file}"
;;
*) # The rest of Chapter06
+ wrt_paco_prep
@ -554,7 +931,7 @@ Index: HLFS/master.sh
;;
esac
#
@@ -367,6 +386,16 @@
@@ -366,6 +387,16 @@
PREV=${this_script}${N}
# Set system_build envar for iteration targets
system_build=$chapter6
@ -571,7 +948,7 @@ Index: HLFS/master.sh
done # end for file in chapter06/*
}
@@ -426,9 +455,19 @@
@@ -424,9 +455,19 @@
else # Initialize the log and run the script
wrt_run_as_chroot2 "${this_script}" "${file}"
fi
@ -593,7 +970,7 @@ Index: HLFS/master.sh
Index: master.sh
===================================================================
--- master.sh (revision 2829)
--- master.sh (revision 2906)
+++ master.sh (working copy)
@@ -149,6 +149,8 @@

View File

@ -14,7 +14,7 @@ simple_error() { # Basic error trap.... JUST DIE
}
see_ya() {
echo -e "\n\t${BOLD}Goodbye and thank you for choosing ${L_arrow}jhalfs${R_arrow}\n"
echo -e "\n${L_arrow}${BOLD}jhalfs branch-1.0${R_arrow} exit${OFF}\n"
}
##### Simple error TRAPS
# ctrl-c SIGINT
@ -193,7 +193,7 @@ while test $# -gt 0 ; do
WC=1
BOOK=$1
else
echo -e "\nLooks like $1 isn't a LFS working copy."
echo -e "\nLooks like $1 isn't an LFS working copy."
exit 1
fi
;;
@ -211,14 +211,14 @@ while test $# -gt 0 ; do
WC=1
BOOK=$1
else
echo -e "\nLooks like $1 isn't a HLFS working copy."
echo -e "\nLooks like $1 isn't an HLFS working copy."
exit 1
fi
;;
esac
;;
--comparasion | -C )
--comparison | -C )
test $# = 1 && eval "$exit_missing_arg"
shift
case $1 in
@ -346,7 +346,7 @@ while test $# -gt 0 ; do
TARGET32="powerpc-unknown-linux-gnu"
;;
* )
echo -e "\n$1 is an unknown or unsopported arch."
echo -e "\n$1 is an unknown or unsupported arch."
exit 1
;;
esac
@ -411,7 +411,7 @@ BOOK=${BOOK:=$PROGNAME-$LFSVRS}
#===================================================
# Check for minumum gcc and kernel versions
# Check for minimum gcc and kernel versions
#check_requirements 1 # 0/1 0-do not display values.
echo
check_version "2.6.2" "`uname -r`" "KERNEL"
@ -494,7 +494,7 @@ if [[ "$PWD" != "$JHALFSDIR" ]]; then
fi
#
if [[ -n "$FILES" ]]; then
# pushd/popd necessary to deal with mulitiple files
# pushd/popd necessary to deal with multiple files
pushd $PACKAGE_DIR 1> /dev/null
cp $FILES $JHALFSDIR/
popd 1> /dev/null
@ -502,7 +502,7 @@ if [[ "$PWD" != "$JHALFSDIR" ]]; then
#
if [[ "$REPORT" = "1" ]]; then
cp $COMMON_DIR/create-sbu_du-report.sh $JHALFSDIR/
# After be sure that all look sane, dump the settings to a file
# After being sure that all looks sane, dump the settings to a file
# This file will be used to create the REPORT header
validate_config > $JHALFSDIR/jhalfs.config
fi