Merged r3043:3145 from experimental:

New Makefile code and other improvements.
This commit is contained in:
Manuel Canales Esparcia 2006-10-02 19:32:06 +00:00
parent 6f75d64303
commit 045b2dc1ce
24 changed files with 1551 additions and 867 deletions

File diff suppressed because it is too large Load diff

View file

@ -11,7 +11,7 @@ host_prep_Makefiles() { # Initialization of the system
#----------------------------#
local CLFS_HOST
echo "${tab_}${GREEN}Processing... ${L_arrow}host prep files${R_arrow}"
echo "${tab_}${GREEN}Processing... ${L_arrow}host prep files ( SETUP ) ${R_arrow}"
# defined here, only for ease of reading
CLFS_HOST="$(echo $MACHTYPE | sed "s/$(echo $MACHTYPE | cut -d- -f2)/cross/")"
@ -35,7 +35,7 @@ cat << EOF
else \\
touch luser-exist; \\
fi;
@chown \$(LUSER) \$(MOUNT_PT) && \\
@chown -R \$(LUSER) \$(MOUNT_PT) && \\
chown \$(LUSER) \$(MOUNT_PT)/sources
@touch \$@ && \\
echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
@ -64,7 +64,9 @@ cat << EOF
echo "export CLFS_TARGET32=\"${TARGET32}\"" >> /home/\$(LUSER)/.bashrc && \\
echo "source $JHALFSDIR/envars" >> /home/\$(LUSER)/.bashrc
@chown \$(LUSER):\$(LGROUP) /home/\$(LUSER)/.bashrc && \\
touch envars
touch envars && \\
chown \$(LUSER):\$(LGROUP) envars && \\
chmod -R a+wt \$(MOUNT_PT)
@touch \$@ && \\
echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
echo --------------------------------------------------------------------------------\$(WHITE)
@ -122,13 +124,15 @@ cat << EOF
EOF
) >> $MKFILE.tmp
host_prep=" 023-creatingtoolsdir 025-addinguser 026-settingenvironment 027-create-directories 028-creating-sysfile"
}
#-----------------------------#
cross_tools_Makefiles() { #
#-----------------------------#
echo "${tab_}${GREEN}Processing... ${L_arrow}cross tools${R_arrow}"
echo "${tab_}${GREEN}Processing... ${L_arrow}cross tools ( LUSER ) ${R_arrow}"
for file in cross-tools/* ; do
# Keep the script file name
@ -175,18 +179,18 @@ cross_tools_Makefiles() { #
#
# 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"
LUSER_wrt_target "${this_script}" "$PREV"
#
# If $pkg_tarball isn't empty, we've got a package...
if [ "$pkg_tarball" != "" ] ; then
wrt_unpack "$pkg_tarball"
LUSER_wrt_unpack "$pkg_tarball"
# If using optimizations, write the instructions
[[ "$OPTIMIZE" != "0" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
fi
#
wrt_RunAsUser "${this_script}" "${file}"
LUSER_wrt_RunAsUser "${file}"
#
[[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
[[ "$pkg_tarball" != "" ]] && LUSER_RemoveBuildDirs "${name}"
#
# Include a touch of the target name so make can check if it's already been made.
wrt_touch
@ -206,7 +210,7 @@ cross_tools_Makefiles() { #
#-----------------------------#
final_system_Makefiles() { #
#-----------------------------#
echo "${tab_}${GREEN}Processing... ${L_arrow}final system${R_arrow}"
echo "${tab_}${GREEN}Processing... ${L_arrow}final system ( LUSER ) ${R_arrow}"
for file in final-system/* ; do
# Keep the script file name
@ -240,18 +244,18 @@ final_system_Makefiles() { #
#
# 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"
LUSER_wrt_target "${this_script}" "$PREV"
#
# If $pkg_tarball isn't empty, we've got a package...
if [ "$pkg_tarball" != "" ] ; then
wrt_unpack "$pkg_tarball"
LUSER_wrt_unpack "$pkg_tarball"
# If using optimizations, write the instructions
[[ "$OPTIMIZE" != "0" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
fi
#
wrt_RunAsUser "${this_script}" "${file}"
LUSER_wrt_RunAsUser "${file}"
#
[[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
[[ "$pkg_tarball" != "" ]] && LUSER_RemoveBuildDirs "${name}"
#
# Include a touch of the target name so make can check if it's already been made.
wrt_touch
@ -270,7 +274,7 @@ final_system_Makefiles() { #
#-----------------------------#
bootscripts_Makefiles() { #
#-----------------------------#
echo "${tab_}${GREEN}Processing... ${L_arrow}bootscripts${R_arrow}"
echo "${tab_}${GREEN}Processing... ${L_arrow}bootscripts ( LUSER ) ${R_arrow}"
for file in bootscripts/* ; do
# Keep the script file name
@ -306,14 +310,14 @@ bootscripts_Makefiles() { #
#
# 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"
LUSER_wrt_target "${this_script}" "$PREV"
#
# If $pkg_tarball isn't empty, we've got a package...
[[ "$pkg_tarball" != "" ]] && wrt_unpack "$pkg_tarball"
[[ "$pkg_tarball" != "" ]] && LUSER_wrt_unpack "$pkg_tarball"
#
wrt_RunAsUser "${this_script}" "${file}"
LUSER_wrt_RunAsUser "${file}"
#
[[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
[[ "$pkg_tarball" != "" ]] && LUSER_RemoveBuildDirs "${name}"
#
# Include a touch of the target name so make can check if it's already been made.
wrt_touch
@ -333,7 +337,7 @@ bootscripts_Makefiles() { #
#-----------------------------#
bootable_Makefiles() { #
#-----------------------------#
echo "${tab_}${GREEN}Processing... ${L_arrow}make bootable${R_arrow}"
echo "${tab_}${GREEN}Processing... ${L_arrow}make bootable ( LUSER ) ${R_arrow}"
for file in bootable/* ; do
# Keep the script file name
@ -342,6 +346,7 @@ bootable_Makefiles() { #
# A little housekeeping on the scripts
case $this_script in
*grub | *aboot | *colo | *silo | *arcload | *lilo | *reboot* ) continue ;;
*fstab) [[ ! -z ${FSTAB} ]] && cp ${FSTAB} $BUILDDIR/sources/fstab ;;
*kernel) # if there is no kernel config file do not build the kernel
[[ -z $CONFIG ]] && continue
# Copy the config file to /sources with a standardized name
@ -351,7 +356,12 @@ bootable_Makefiles() { #
#
# First append each name of the script files to a list (this will become
# the names of the targets in the Makefile
bootable="$bootable $this_script"
# NOTE: new makfile format forces the last script, *chowning, into a separate
# phase.
case ${this_script} in
*chowning) chowning=${this_script} ;;
*) bootable="$bootable $this_script" ;;
esac
#
# Grab the name of the target, strip id number and misc words.
name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@' -e 's@-build@@' `
@ -368,27 +378,27 @@ bootable_Makefiles() { #
#
# 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"
LUSER_wrt_target "${this_script}" "$PREV"
#
# If $pkg_tarball isn't empty, we've got a package...
[[ "$pkg_tarball" != "" ]] && wrt_unpack "$pkg_tarball"
[[ "$pkg_tarball" != "" ]] && LUSER_wrt_unpack "$pkg_tarball"
#
# Select a script execution method
case $this_script in
*fstab*) if [[ -n "$FSTAB" ]]; then
wrt_copy_fstab "${this_script}"
LUSER_wrt_CopyFstab
else
wrt_RunAsUser "${this_script}" "${file}"
LUSER_wrt_RunAsUser "${file}"
fi
;;
*chowning) wrt_RunAsRoot "${this_script}" "${file}"
;;
*) wrt_RunAsUser "${this_script}" "${file}"
*) LUSER_wrt_RunAsUser "${file}"
;;
esac
#
# Housekeeping...remove any build directory(ies) except if the package build fails.
[[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
[[ "$pkg_tarball" != "" ]] && LUSER_RemoveBuildDirs "${name}"
#
# Include a touch of the target name so make can check if it's already been made.
wrt_touch
@ -402,9 +412,6 @@ bootable_Makefiles() { #
done
# Add SBU-disk_usage report target if required
if [[ "$REPORT" = "y" ]] ; then wrt_report ; fi
}
@ -446,6 +453,8 @@ SU_LUSER = su - \$(LUSER) -c
PRT_DU = echo -e "\nKB: \`du -skx --exclude=jhalfs \$(MOUNT_PT)\`\n"
LUSER_HOME = /home/\$(LUSER)
export PATH := \${PATH}:/usr/sbin
include makefile-functions
EOF
@ -454,27 +463,44 @@ EOF
# Drop in the main target 'all:' and the chapter targets with each sub-target
# as a dependency.
(
cat << EOF
all: chapter2 chapter3 chapter4 chapter5 chapter6 restore-luser-env do-housekeeping
cat << EOF
all: ck_UID mk_SETUP mk_LUSER mk_ROOT create-sbu_du-report
@sudo make do-housekeeping
@\$(call echo_finished,$VERSION)
chapter2: 023-creatingtoolsdir 025-addinguser 026-settingenvironment 027-create-directories 028-creating-sysfile
ck_UID:
@if [ \`id -u\` = "0" ]; then \\
echo "--------------------------------------------------"; \\
echo "You cannot run this makefile from the root account"; \\
echo "--------------------------------------------------"; \\
exit 1; \\
fi
chapter3: chapter2 $cross_tools
mk_SETUP:
@\$(call echo_SU_request)
@sudo make SETUP
@touch \$@
chapter4: chapter3 $basicsystem
mk_LUSER: mk_SETUP
@\$(call echo_SULUSER_request)
@(sudo \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make LUSER" )
@sudo make restore-luser-env
@touch \$@
chapter5: chapter4 $bootscripttools
mk_ROOT:
@sudo make ROOT
@touch \$@
chapter6: chapter5 $bootable
SETUP: $host_prep
clean-all: clean
rm -rf ./{clfs2-commands,logs,Makefile,*.xsl,makefile-functions,packages,patches}
LUSER: $cross_tools $basicsystem $bootscripttools $bootable
ROOT: $chowning
clean:
restart:
@echo "This feature does not exist for the CLFS makefile. (yet)"
@echo "This feature does not exist for the CLFS-2 makefile. (yet)"
restore-luser-env:
@\$(call echo_message, Building)
@ -498,6 +524,21 @@ do-housekeeping:
EOF
) >> $MKFILE
# Add SBU-disk_usage report target
echo "create-sbu_du-report:" >> $MKFILE
if [[ "$REPORT" = "y" ]] ; then
(
cat << EOF
@\$(call echo_message, Building)
@./create-sbu_du-report.sh logs $VERSION
@\$(call echo_report,$VERSION-SBU_DU-$(date --iso-8601).report)
@touch \$@
EOF
) >> $MKFILE
else echo -e "\t@true\n\n" >> $MKFILE; fi
# Bring over the items from the Makefile.tmp
cat $MKFILE.tmp >> $MKFILE
rm $MKFILE.tmp

View file

@ -325,6 +325,19 @@ menu "--- BOOK Settings"
bool "libxslt (required)"
default y
config DEP_TIDY
bool "tidy (required)"
default y
config DEP_DBXML
bool "DocBook XML DTD (required)"
default y
config DEP_UNZIP
bool "UnZip (required to install DocBook XML DTD)"
default y
depends on DEP_DBXML
config DEP_DBXSL
bool "DocBook XSL (required)"
default y
@ -707,6 +720,7 @@ menu "--- Advanced Features"
#--- End ICA/farce
#--- Optimizations
if !BOOK_CLFS2
config CONFIG_OPTIMIZE
bool "Use optimization (see help)"
default n
@ -740,6 +754,7 @@ menu "--- Advanced Features"
default "0" if !CONFIG_OPTIMIZE
default "1" if OPT_1
default "2" if OPT_2
endif
#--- End Optimizations
#-- Internal Settings

View file

@ -7,16 +7,30 @@ 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
local this_file=$2
local tc_phase
local binutil_tarball
local gcc_core_tarball
local TC_MountPT
local remove_existing
echo "${tab_}${tab_}${GREEN}toolchain ${L_arrow}${toolchain}${R_arrow}"
tc_phase=`echo $toolchain | sed -e 's@[0-9]\{3\}-@@' -e 's@-toolchain@@'`
case $tc_phase in
embryo | \
cocoon) # Vars for LUSER phase
remove_existing="remove_existing_dirs"
TC_MountPT="\$(MOUNT_PT)\$(SRC)"
;;
butterfly) # Vars for CHROOT phase
remove_existing="remove_existing_dirs2"
TC_MountPT="\$(SRC)"
;;
esac
#
# Safe method to remove existing toolchain dirs
@ -24,56 +38,49 @@ process_toolchain() { # embryo,cocoon and butterfly need special handling
gcc_core_tarball=$(get_package_tarball_name "gcc-core")
(
cat << EOF
@\$(call remove_existing_dirs,$binutil_tarball)
@\$(call remove_existing_dirs,$gcc_core_tarball)
@\$(call ${remove_existing},$binutil_tarball)
@\$(call ${remove_existing},$gcc_core_tarball)
EOF
) >> $MKFILE.tmp
#
# 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
@rm -rf ${TC_MountPT}/${tc_phase}-toolchain && \\
rm -rf ${TC_MountPT}/${tc_phase}-build
EOF
) >> $MKFILE.tmp
case ${toolchain} in
*butterfly*)
(
cat << EOF
@echo "export PKGDIR=\$(SRC)" > envars
@echo "export PKGDIR=${TC_MountPT}" > envars
EOF
) >> $MKFILE.tmp
[[ "$TEST" != "0" ]] && wrt_test_log2 "${this_script}"
wrt_run_as_chroot1 "$toolchain" "$this_script"
case ${tc_phase} in
butterfly)
[[ "$TEST" != "0" ]] && CHROOT_wrt_test_log "${toolchain}"
CHROOT_wrt_RunAsRoot "$this_file"
;;
*)
(
cat << EOF
@echo "export PKGDIR=\$(MOUNT_PT)\$(SRC)" > envars
EOF
) >> $MKFILE.tmp
wrt_RunAsUser "$toolchain" "$this_script"
*) LUSER_wrt_RunAsUser "$this_file"
;;
esac
#
(
cat << EOF
@\$(call remove_existing_dirs,$binutil_tarball)
@\$(call remove_existing_dirs,$gcc_core_tarball)
@\$(call ${remove_existing},$binutil_tarball)
@\$(call ${remove_existing},$gcc_core_tarball)
EOF
) >> $MKFILE.tmp
#
# 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
@rm -rf ${TC_MountPT}/${tc_phase}-toolchain && \\
rm -rf ${TC_MountPT}/${tc_phase}-build
EOF
) >> $MKFILE.tmp
@ -84,13 +91,13 @@ EOF
chapter3_Makefiles() { # Initialization of the system
#----------------------------#
echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter3${R_arrow}"
echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter3 ( SETUP ) ${R_arrow}"
# Define a few model dependant variables
if [[ ${MODEL} = "uclibc" ]]; then
TARGET="pc-linux-gnu"; LOADER="ld-uClibc.so.0"
else
TARGET="pc-linux-gnu"; LOADER="ld-linux.so.2"
TARGET="pc-linux-gnu"; LOADER="ld-linux.so.2"
fi
# If /home/$LUSER is already present in the host, we asume that the
@ -120,6 +127,7 @@ cat << EOF
touch luser-exist; \\
fi;
@chown \$(LUSER) \$(MOUNT_PT)/tools && \\
chown -R \$(LUSER) \$(MOUNT_PT)/\$(SCRIPT_ROOT) && \\
chown \$(LUSER) \$(MOUNT_PT)/sources && \\
touch \$@ && \\
echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
@ -145,13 +153,15 @@ cat << EOF
echo "export target ldso" >> /home/\$(LUSER)/.bashrc && \\
echo "source $JHALFSDIR/envars" >> /home/\$(LUSER)/.bashrc && \\
chown \$(LUSER):\$(LGROUP) /home/\$(LUSER)/.bashrc && \\
chmod -R a+wt \$(MOUNT_PT) && \\
touch envars && \\
chown \$(LUSER) envars && \\
touch \$@ && \\
echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
echo --------------------------------------------------------------------------------\$(WHITE)
EOF
) >> $MKFILE.tmp
chapter3=" 020-creatingtoolsdir 021-addinguser 022-settingenvironment"
}
#----------------------------#
@ -160,7 +170,7 @@ chapter5_Makefiles() { # Bootstrap or temptools phase
local file
local this_script
echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter5${R_arrow}"
echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter5 ( LUSER ) ${R_arrow}"
for file in chapter05/* ; do
# Keep the script file name
@ -205,32 +215,32 @@ chapter5_Makefiles() { # Bootstrap or temptools phase
# NO Optimization allowed
if [[ ${name} = "embryo-toolchain" ]] || \
[[ ${name} = "cocoon-toolchain" ]]; then
wrt_target "$this_script" "$PREV"
LUSER_wrt_target "$this_script" "$PREV"
process_toolchain "${this_script}" "${file}"
wrt_touch
PREV=$this_script
continue
fi
#
wrt_target "$this_script" "$PREV"
LUSER_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.
wrt_unpack "$pkg_tarball"
LUSER_wrt_unpack "$pkg_tarball"
# If using optimizations, write the instructions
[[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
fi
# 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_RunAsUser "$this_script" "${file}"
LUSER_wrt_RunAsUser "${file}"
# Remove the build directory(ies) except if the package build fails
# (so we can review config.cache, config.log, etc.)
if [ "$pkg_tarball" != "" ] ; then
wrt_remove_build_dirs "$name"
LUSER_RemoveBuildDirs "$name"
fi
# Include a touch of the target name so make can check if it's already been made.
@ -275,7 +285,7 @@ chapter6_Makefiles() { # sysroot or chroot build phase
sed -e '/groupadd/d' -i chapter06$N/*-udev
fi
echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter6$N${R_arrow}"
echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter6$N ( CHROOT ) ${R_arrow}"
for file in chapter06$N/* ; do
# Keep the script file name
@ -324,25 +334,25 @@ 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.
if [[ ${name} = "butterfly-toolchain" ]]; then
wrt_target "${this_script}${N}" "$PREV"
CHROOT_wrt_target "${this_script}${N}" "$PREV"
process_toolchain "${this_script}" "${file}"
wrt_touch
PREV=$this_script
continue
fi
wrt_target "${this_script}${N}" "$PREV"
CHROOT_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"
CHROOT_Unpack "$pkg_tarball"
# If the testsuites must be run, initialize the log file
# butterfly-toolchain tests are enabled in 'process_tookchain' function
case $name in
glibc ) [[ "$TEST" != "0" ]] && wrt_test_log2 "${this_script}"
glibc ) [[ "$TEST" != "0" ]] && CHROOT_wrt_test_log "${this_script}"
;;
* ) [[ "$TEST" > "1" ]] && wrt_test_log2 "${this_script}"
* ) [[ "$TEST" > "1" ]] && CHROOT_wrt_test_log "${this_script}"
;;
esac
# If using optimizations, write the instructions
@ -351,17 +361,17 @@ chapter6_Makefiles() { # sysroot or chroot build phase
# In the mount of kernel filesystems we need to set HLFS and not to use chroot.
case "${this_script}" in
*kernfs*)
*kernfs* | *changingowner*)
wrt_RunAsRoot "${this_script}" "${file}"
;;
*) # The rest of Chapter06
wrt_run_as_chroot1 "${this_script}" "${file}"
CHROOT_wrt_RunAsRoot "${file}"
;;
esac
#
# Remove the build directory(ies) except if the package build fails.
if [ "$pkg_tarball" != "" ] ; then
wrt_remove_build_dirs "$name"
CHROOT_wrt_RemoveBuildDirs "$name"
fi
#
# Include a touch of the target name so make can check if it's already been made.
@ -385,7 +395,7 @@ chapter7_Makefiles() { # Create a bootable system.. kernel, bootscripts..e
local file
local this_script
echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter7${R_arrow}"
echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter7 ( BOOT ) ${R_arrow}"
for file in chapter07/*; do
# Keep the script file name
this_script=`basename $file`
@ -398,12 +408,12 @@ chapter7_Makefiles() { # Create a bootable system.. kernel, bootscripts..e
*usage) continue ;; # Contains example commands
*grub) continue ;;
*console) continue ;; # Use the file generated by lfs-bootscripts
*kernel)
# If no .config file is supplied, the kernel build is skipped
[[ -z $CONFIG ]] && continue
cp $CONFIG $BUILDDIR/sources/kernel-config
;;
*fstab) [[ ! -z ${FSTAB} ]] && cp ${FSTAB} $BUILDDIR/sources/fstab
;;
*kernel) # If no .config file is supplied, the kernel build is skipped
[[ -z $CONFIG ]] && continue
cp $CONFIG $BUILDDIR/sources/kernel-config
;;
esac
# First append then name of the script file to a list (this will become
@ -416,11 +426,11 @@ chapter7_Makefiles() { # Create a bootable system.. kernel, bootscripts..e
#
# 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"
CHROOT_wrt_target "$this_script" "$PREV"
case "${this_script}" in
*bootscripts*)
wrt_unpack2 $(get_package_tarball_name "lfs-bootscripts")
CHROOT_Unpack $(get_package_tarball_name "lfs-bootscripts")
blfs_bootscripts=$(get_package_tarball_name "blfs-bootscripts" | sed -e 's/.tar.*//' )
echo -e "\t@echo \"\$(MOUNT_PT)\$(SRC)/$blfs_bootscripts\" >> sources-dir" >> $MKFILE.tmp
;;
@ -429,13 +439,13 @@ chapter7_Makefiles() { # Create a bootable system.. kernel, bootscripts..e
case "${this_script}" in
*fstab*) # Check if we have a real /etc/fstab file
if [[ -n "$FSTAB" ]] ; then
wrt_copy_fstab "$this_script"
else # Initialize the log and run the script
wrt_run_as_chroot2 "${this_script}" "${file}"
CHROOT_wrt_CopyFstab
else
CHROOT_wrt_RunAsRoot "$file"
fi
;;
*) # All other scripts
wrt_run_as_chroot2 "${this_script}" "${file}"
CHROOT_wrt_RunAsRoot "${file}"
;;
esac
@ -444,8 +454,8 @@ chapter7_Makefiles() { # Create a bootable system.. kernel, bootscripts..e
*bootscripts*)
(
cat << EOF
@ROOT=\`head -n1 \$(MOUNT_PT)\$(SRC)/\$(PKG_LST) | sed 's@^./@@;s@/.*@@'\` && \\
rm -r \$(MOUNT_PT)\$(SRC)/\$\$ROOT
@ROOT=\`head -n1 \$(SRC)/\$(PKG_LST) | sed 's@^./@@;s@/.*@@'\` && \\
rm -r \$(SRC)/\$\$ROOT
@rm -r \`cat sources-dir\` && \\
rm sources-dir
EOF
@ -512,7 +522,9 @@ crTESTLOGDIR = /\$(SCRIPT_ROOT)/test-logs
SU_LUSER = su - \$(LUSER) -c
LUSER_HOME = /home/\$(LUSER)
PRT_DU = echo -e "\nKB: \`du -skx --exclude=jhalfs \$(MOUNT_PT)\`\n"
PRT_DU_CR = echo -e "\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) \$(MOUNT_PT)\`\n"
PRT_DU_CR = echo -e "\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) / \`\n"
export PATH := \${PATH}:/usr/sbin
include makefile-functions
@ -545,52 +557,64 @@ EOF
# as a dependency.
(
cat << EOF
all: chapter3 chapter5 chapter6 chapter7 do-housekeeping
all: ck_UID mk_SETUP mk_LUSER mk_SUDO mk_CHROOT mk_BOOT create-sbu_du-report
@sudo make do-housekeeping
@\$(call echo_finished,$VERSION)
chapter3: 020-creatingtoolsdir 021-addinguser 022-settingenvironment
ck_UID:
@if [ \`id -u\` = "0" ]; then \\
echo "--------------------------------------------------"; \\
echo "You cannot run this makefile from the root account"; \\
echo "--------------------------------------------------"; \\
exit 1; \\
fi
chapter5: chapter3 $chapter5 restore-luser-env
mk_SETUP:
@\$(call echo_SU_request)
@sudo make SETUP
@touch \$@
chapter6: chapter5 $chapter6
mk_LUSER: mk_SETUP
@\$(call echo_SULUSER_request)
@(sudo \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make LUSER" )
@sudo make restore-luser-env
@touch \$@
chapter7: chapter6 $chapter7
mk_SUDO: mk_LUSER
@sudo make SUDO
@touch \$@
clean-all: clean
rm -rf ./{hlfs-commands,logs,Makefile,*.xsl,makefile-functions,packages,patches}
clean: clean-chapter7 clean-chapter6 clean-chapter5 clean-chapter3
restart: restart_code all
clean-chapter3:
-if [ ! -f luser-exist ]; then \\
userdel \$(LUSER); \\
rm -rf /home/\$(LUSER); \\
mk_CHROOT: mk_SUDO
@if [ ! -e \$(MOUNT_PT)/bin ]; then \\
mkdir \$(MOUNT_PT)/bin; \\
cd \$(MOUNT_PT)/bin && \\
ln -sf /tools/bin/bash bash; ln -sf bash sh; \\
sudo chown -R 0:0 \$(MOUNT_PT)/bin; \\
fi;
rm -rf \$(MOUNT_PT)/tools
rm -f /tools
rm -f envars luser-exist
rm -f 02* logs/02*.log
@sudo sed -e 's|^ln -sv |ln -svf |' -i \$(CMDSDIR)/chapter06/064-createfiles
@\$(call echo_CHROOT_request)
@( sudo \$(CHROOT1) "cd \$(SCRIPT_ROOT) && make CHROOT")
@touch \$@
clean-chapter5:
rm -rf \$(MOUNT_PT)/tools/*
rm -f $chapter5 restore-luser-env sources-dir
cd logs && rm -f $chapter5 && cd ..
mk_BOOT: mk_CHROOT
@\$(call echo_CHROOT_request)
@( sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make BOOT")
@touch \$@
clean-chapter6:
-umount \$(MOUNT_PT)/sys
-umount \$(MOUNT_PT)/proc
-umount \$(MOUNT_PT)/dev/shm
-umount \$(MOUNT_PT)/dev/pts
-umount \$(MOUNT_PT)/dev
rm -rf \$(MOUNT_PT)/{bin,boot,dev,etc,home,lib,media,mnt,opt,proc,root,sbin,srv,sys,tmp,usr,var}
rm -f $chapter6
cd logs && rm -f $chapter6 && cd ..
clean-chapter7:
rm -f $chapter7
cd logs && rm -f $chapter7 && cd ..
SETUP: $chapter3
LUSER: $chapter5
SUDO: 060-kernfs 062-changingowner
CHROOT: $chapter6
BOOT: $chapter7
#restart: restart_code all
restore-luser-env:
@\$(call echo_message, Building)
@ -611,6 +635,7 @@ do-housekeeping:
@-umount \$(MOUNT_PT)/dev
@-umount \$(MOUNT_PT)/sys
@-umount \$(MOUNT_PT)/proc
@-rm /tools
@-if [ ! -f luser-exist ]; then \\
userdel \$(LUSER); \\
rm -rf /home/\$(LUSER); \\
@ -660,6 +685,21 @@ restart_code:
EOF
) >> $MKFILE
# Add SBU-disk_usage report target
echo "create-sbu_du-report:" >> $MKFILE
if [[ "$REPORT" = "y" ]] ; then
(
cat << EOF
@\$(call echo_message, Building)
@./create-sbu_du-report.sh logs $VERSION
@\$(call echo_report,$VERSION-SBU_DU-$(date --iso-8601).report)
@touch \$@
EOF
) >> $MKFILE
else echo -e "\t@true\n\n" >> $MKFILE; fi
# Bring over the items from the Makefile.tmp
cat $MKFILE.tmp >> $MKFILE
rm $MKFILE.tmp

View file

@ -7,10 +7,13 @@
###################################
#############################################################
#----------------------------#
chapter4_Makefiles() {
chapter4_Makefiles() { #
#----------------------------#
echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter4${R_arrow}"
echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter4 ( SETUP ) ${R_arrow}"
# 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
@ -35,7 +38,8 @@ chapter4_Makefiles() {
touch luser-exist; \\
fi;
@chown \$(LUSER) \$(MOUNT_PT)/tools && \\
chmod a+wt \$(MOUNT_PT)/sources && \\
chown -R \$(LUSER) \$(MOUNT_PT)/\$(SCRIPT_ROOT) && \\
chmod -R a+wt \$(MOUNT_PT) && \\
touch \$@ && \\
echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
echo --------------------------------------------------------------------------------\$(WHITE)
@ -57,17 +61,22 @@ chapter4_Makefiles() {
echo "source $JHALFSDIR/envars" >> /home/\$(LUSER)/.bashrc && \\
chown \$(LUSER):\$(LGROUP) /home/\$(LUSER)/.bashrc && \\
touch envars && \\
chown \$(LUSER) envars && \\
touch \$@ && \\
echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
echo --------------------------------------------------------------------------------\$(WHITE)
EOF
) >> $MKFILE.tmp
) > $MKFILE.tmp
chapter4=" 020-creatingtoolsdir 021-addinguser 022-settingenvironment"
}
#----------------------------#
chapter5_Makefiles() {
#----------------------------#
echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter5${R_arrow}"
echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter5 ( LUSER ) ${R_arrow}"
for file in chapter05/* ; do
# Keep the script file name
@ -86,7 +95,13 @@ chapter5_Makefiles() {
# First append each name of the script files to a list (this will become
# the names of the targets in the Makefile
chapter5="$chapter5 ${this_script}"
# DO NOT append the changingowner script.
# A hack is necessary: create script in chap5 BUT run as a dependency for
# chap6 CHROOT
case "${this_script}" in
*changingowner) : ;;
*) chapter5="$chapter5 ${this_script}" ;;
esac
# Grab the name of the target (minus the -pass1 or -pass2 in the case of gcc
# and binutils in chapter 5)
@ -101,7 +116,7 @@ chapter5_Makefiles() {
#
# 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"
LUSER_wrt_target "${this_script}" "$PREV"
# Find the version of the command files, if it corresponds with the building of
# a specific package
@ -110,9 +125,9 @@ chapter5_Makefiles() {
# 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.
wrt_unpack "$pkg_tarball"
LUSER_wrt_unpack "$pkg_tarball"
# If the testsuites must be run, initialize the log file
[[ "$TEST" = "3" ]] && wrt_test_log "${this_script}"
[[ "$TEST" = "3" ]] && LUSER_wrt_test_log "${this_script}"
# If using optimizations, write the instructions
[[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
fi
@ -122,13 +137,13 @@ chapter5_Makefiles() {
# The changingowner script must be run as root.
case "${this_script}" in
*changingowner) wrt_RunAsRoot "${this_script}" "$file" ;;
*) wrt_RunAsUser "${this_script}" "$file" ;;
*) LUSER_wrt_RunAsUser "$file" ;;
esac
# Remove the build directory(ies) except if the package build fails
# (so we can review config.cache, config.log, etc.)
if [ "$pkg_tarball" != "" ] ; then
wrt_remove_build_dirs "$name"
LUSER_RemoveBuildDirs "$name"
fi
# Include a touch of the target name so make can check
@ -144,9 +159,11 @@ chapter5_Makefiles() {
done # end for file in chapter05/*
}
#----------------------------#
chapter6_Makefiles() {
#----------------------------#
# Set envars and scripts for iteration targets
LOGS="" # Start with an empty global LOGS envar
if [[ -z "$1" ]] ; then
@ -166,7 +183,7 @@ chapter6_Makefiles() {
sed -e 's@make install@rm -vf /usr/bin/bz*\n&@' -i chapter06$N/*-bzip2
fi
echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter6$N${R_arrow}"
echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter6$N ( CHROOT ) ${R_arrow}"
for file in chapter06$N/* ; do
# Keep the script file name
@ -208,19 +225,19 @@ chapter6_Makefiles() {
#
# 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}${N}" "$PREV"
CHROOT_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"
CHROOT_Unpack "$pkg_tarball"
# If the testsuites must be run, initialize the log file
case $name in
binutils | gcc | glibc )
[[ "$TEST" != "0" ]] && wrt_test_log2 "${this_script}"
[[ "$TEST" != "0" ]] && CHROOT_wrt_test_log "${this_script}"
;;
* )
[[ "$TEST" = "2" ]] || [[ "$TEST" = "3" ]] && wrt_test_log2 "${this_script}"
[[ "$TEST" = "2" ]] || [[ "$TEST" = "3" ]] && CHROOT_wrt_test_log "${this_script}"
;;
esac
# If using optimizations, write the instructions
@ -231,12 +248,12 @@ chapter6_Makefiles() {
# and not to use chroot.
case "${this_script}" in
*kernfs) wrt_RunAsRoot "${this_script}" "$file" ;;
*) wrt_run_as_chroot1 "${this_script}" "$file" ;;
*) CHROOT_wrt_RunAsRoot "$file" ;;
esac
# Remove the build directory(ies) except if the package build fails.
if [ "$pkg_tarball" != "" ] ; then
wrt_remove_build_dirs "$name"
CHROOT_wrt_RemoveBuildDirs "$name"
fi
# Include a touch of the target name so make can check
@ -257,7 +274,7 @@ chapter6_Makefiles() {
#----------------------------#
chapter789_Makefiles() {
#----------------------------#
echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter7/8/9${R_arrow}"
echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter7/8/9 ( BOOT ) ${R_arrow}"
for file in chapter0{7,8,9}/* ; do
# Keep the script file name
@ -274,6 +291,7 @@ chapter789_Makefiles() {
*grub) continue ;;
*reboot) continue ;;
*console) continue ;; # Use the file generated by lfs-bootscripts
*fstab) [[ ! -z ${FSTAB} ]] && cp ${FSTAB} $BUILDDIR/sources/fstab ;;
*kernel) [[ -z ${CONFIG} ]] && continue
cp ${CONFIG} $BUILDDIR/sources/kernel-config ;;
esac
@ -288,37 +306,37 @@ chapter789_Makefiles() {
#
# 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"
CHROOT_wrt_target "${this_script}" "$PREV"
# Find the bootscripts and kernel package names
case "${this_script}" in
*bootscripts)
name="lfs-bootscripts"
pkg_tarball=$(get_package_tarball_name $name)
wrt_unpack2 "$pkg_tarball"
CHROOT_Unpack "$pkg_tarball"
;;
*kernel)
name="linux"
pkg_tarball=$(get_package_tarball_name $name)
wrt_unpack2 "$pkg_tarball"
CHROOT_Unpack "$pkg_tarball"
;;
esac
# Check if we have a real /etc/fstab file
case "${this_script}" in
*fstab) if [[ -n $FSTAB ]]; then
wrt_copy_fstab "${this_script}"
CHROOT_wrt_CopyFstab
else
wrt_run_as_chroot2 "$this_script" "$file"
CHROOT_wrt_RunAsRoot "$file"
fi
;;
*) wrt_run_as_chroot2 "$this_script" "$file"
*) CHROOT_wrt_RunAsRoot "$file"
;;
esac
case "${this_script}" in
*bootscripts) wrt_remove_build_dirs "dummy" ;;
*kernel) wrt_remove_build_dirs "dummy" ;;
*bootscripts) CHROOT_wrt_RemoveBuildDirs "dummy" ;;
*kernel) CHROOT_wrt_RemoveBuildDirs "dummy" ;;
esac
# Include a touch of the target name so make can check
@ -333,19 +351,20 @@ chapter789_Makefiles() {
PREV=${this_script}
done # for file in chapter0{7,8,9}/*
# Add SBU-disk_usage report target if required
if [[ "$REPORT" = "y" ]] ; then wrt_report ; fi
}
#----------------------------#
build_Makefile() {
build_Makefile() { #
#----------------------------#
echo "Creating Makefile... ${BOLD}START${OFF}"
cd $JHALFSDIR/${PROGNAME}-commands
# Start with a clean Makefile.tmp file
>$MKFILE.tmp
>$MKFILE
chapter4_Makefiles
chapter5_Makefiles
@ -353,7 +372,8 @@ build_Makefile() {
# Add the iterations targets, if needed
[[ "$COMPARE" = "y" ]] && wrt_compare_targets
chapter789_Makefiles
# Add the BLFS_TOOL targets, if needed
[[ "$BLFS_TOOL" = "y" ]] && wrt_blfs_tool_targets
# Add a header, some variables and include the function file
# to the top of the real Makefile.
@ -361,6 +381,7 @@ build_Makefile() {
cat << EOF
$HEADER
SRC = /sources
MOUNT_PT = $BUILDDIR
PKG_LST = $PKG_LST
@ -381,16 +402,16 @@ crTESTLOGDIR = /\$(SCRIPT_ROOT)/test-logs
SU_LUSER = su - \$(LUSER) -c
LUSER_HOME = /home/\$(LUSER)
PRT_DU = echo -e "\nKB: \`du -skx --exclude=jhalfs \$(MOUNT_PT)\`\n"
PRT_DU_CR = echo -e "\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) \$(MOUNT_PT)\`\n"
PRT_DU = echo -e "\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) \$(MOUNT_PT) \`\n"
PRT_DU_CR = echo -e "\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) / \`\n"
export PATH := \${PATH}:/usr/sbin
include makefile-functions
EOF
) > $MKFILE
# Add chroot commands
CHROOT_LOC="`whereis -b chroot | cut -d " " -f2`"
i=1
@ -414,53 +435,71 @@ EOF
# as a dependency.
(
cat << EOF
all: chapter4 chapter5 chapter6 chapter789 do_housekeeping
all: ck_UID mk_SETUP mk_LUSER mk_SUDO mk_CHROOT mk_BOOT create-sbu_du-report mk_BLFS_TOOL
@sudo make do_housekeeping
@\$(call echo_finished,$VERSION)
chapter4: 020-creatingtoolsdir 021-addinguser 022-settingenvironment
ck_UID:
@if [ \`id -u\` = "0" ]; then \\
echo "--------------------------------------------------"; \\
echo "You cannot run this makefile from the root account"; \\
echo "--------------------------------------------------"; \\
exit 1; \\
fi
chapter5: chapter4 $chapter5 restore-luser-env
mk_SETUP:
@\$(call echo_SU_request)
@sudo make SETUP
@touch \$@
chapter6: chapter5 $chapter6
mk_LUSER: mk_SETUP
@\$(call echo_SULUSER_request)
@( sudo \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make LUSER" )
@sudo make restore-luser-env
@touch \$@
chapter789: chapter6 $chapter789
mk_SUDO: mk_LUSER
@sudo make SUDO
touch \$@
#
# The convoluted piece of code below is necessary to provide 'make' with a valid shell in the
# chroot environment. (Unless someone knows a different way)
# Manually create the /bin directory and provide link to the /tools dir.
# Also change the original symlink creation to include (f)orce to prevent failure due to
# pre-existing links.
#
mk_CHROOT: mk_SUDO
@if [ ! -e \$(MOUNT_PT)/bin ]; then \\
mkdir \$(MOUNT_PT)/bin; \\
cd \$(MOUNT_PT)/bin && \\
ln -sf /tools/bin/bash bash; ln -sf bash sh; \\
sudo chown -R 0:0 \$(MOUNT_PT)/bin; \\
fi;
@sudo sed -e 's|^ln -sv |ln -svf |' -i \$(CMDSDIR)/chapter06/063-createfiles
@\$(call echo_CHROOT_request)
@( sudo \$(CHROOT1) "cd \$(SCRIPT_ROOT) && make CHROOT")
@touch \$@
clean-all: clean
rm -rf ./{lfs-commands,logs,Makefile,*.xsl,makefile-functions,packages,patches}
mk_BOOT: mk_CHROOT
@\$(call echo_CHROOT_request)
@( sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make BOOT")
@touch \$@
SETUP: $chapter4
LUSER: $chapter5
SUDO: 057-changingowner 059-kernfs
CHROOT: $chapter6
BOOT: $chapter789
clean: clean-chapter789 clean-chapter6 clean-chapter5 clean-chapter4
restart: restart_code all
clean-chapter4:
-if [ ! -f luser-exist ]; then \\
userdel \$(LUSER); \\
rm -rf /home/\$(LUSER); \\
fi;
rm -rf \$(MOUNT_PT)/tools
rm -f /tools
rm -f envars luser-exist
rm -f 02* logs/02*.log
clean-chapter5:
rm -rf \$(MOUNT_PT)/tools/*
rm -f $chapter5 restore-luser-env sources-dir
cd logs && rm -f $chapter5 && cd ..
clean-chapter6:
-umount \$(MOUNT_PT)/sys
-umount \$(MOUNT_PT)/proc
-umount \$(MOUNT_PT)/dev/shm
-umount \$(MOUNT_PT)/dev/pts
-umount \$(MOUNT_PT)/dev
rm -rf \$(MOUNT_PT)/{bin,boot,dev,etc,home,lib,media,mnt,opt,proc,root,sbin,srv,sys,tmp,usr,var}
rm -f $chapter6
cd logs && rm -f $chapter6 && cd ..
clean-chapter789:
rm -f $chapter789
cd logs && rm -f $chapter789 && cd ..
restore-luser-env:
@\$(call echo_message, Building)
@if [ -f /home/\$(LUSER)/.bashrc.XXX ]; then \\
@ -480,6 +519,7 @@ do_housekeeping:
@-umount \$(MOUNT_PT)/dev/shm
@-umount \$(MOUNT_PT)/dev/pts
@-umount \$(MOUNT_PT)/dev
@-rm /tools
@-if [ ! -f luser-exist ]; then \\
userdel \$(LUSER); \\
rm -rf /home/\$(LUSER); \\
@ -528,10 +568,40 @@ restart_code:
EOF
) >> $MKFILE
# Add SBU-disk_usage report target
echo "create-sbu_du-report:" >> $MKFILE
if [[ "$REPORT" = "y" ]] ; then
(
cat << EOF
@\$(call echo_message, Building)
@./create-sbu_du-report.sh logs $VERSION
@\$(call echo_report,$VERSION-SBU_DU-$(date --iso-8601).report)
@touch \$@
EOF
) >> $MKFILE
else echo -e "\t@true\n\n" >> $MKFILE; fi
# Add BLFS_TOOL targets
echo "mk_BLFS_TOOL:" >> $MKFILE
if [[ "$BLFS_TOOL" = "y" ]] ; then
(
cat << EOF
@\$(call echo_CHROOT_request)
@ sudo mkdir $BUILDDIR$TRACKING_DIR
@( sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make BLFS_TOOL")
@touch \$@
BLFS_TOOL: $blfs_tool
EOF
) >> $MKFILE
else echo -e "\t@true\n\n" >> $MKFILE; fi
# Bring over the items from the Makefile.tmp
cat $MKFILE.tmp >> $MKFILE
rm $MKFILE.tmp
echo "Creating Makefile... ${BOLD}DONE${OFF}"
}

18
README.HLFS Normal file
View file

@ -0,0 +1,18 @@
$Id$
::::NOTICE::::
Hardened Linux From Scratch is a highly volatile project. Extreme design
changes can occur and the build could be broken for extended periods of
time.
As of Sept.15.2006 jhalfs cannot build the svn book. This is a book
problem and not jhalfs.
Automation failures:
1.Directory /dev and devices nodes /dev/null, /dev/console needed to be
created in kernfs
2.Linux-headers does not contain /net.
3.Remove the creation of /null and /console node from the devices script.

View file

@ -72,6 +72,11 @@ source configuration
[[ $? > 0 ]] && echo "file:configuration did not load.." && exit 1
[[ $VERBOSITY > 0 ]] && echo "OK"
[[ $VERBOSITY > 0 ]] && echo -n "Loading function <func_check_version.sh>..."
source $COMMON_DIR/func_check_version.sh
[[ $? > 0 ]] && echo " function module did not load.." && exit 2
[[ $VERBOSITY > 0 ]] && echo "OK"
[[ $VERBOSITY > 0 ]] && echo -n "Loading function <func_validate_configs.sh>..."
source $COMMON_DIR/func_validate_configs.sh
[[ $? > 0 ]] && echo " function module did not load.." && exit 2
@ -94,6 +99,45 @@ case $BRANCH_ID in
* ) TREE=tags/${BRANCH_ID}/BOOK ;;
esac
# Check for minimun dependencies versions
xsltprocVer=`xsltproc -V | head -n1 `
libxmlVer=$(echo $xsltprocVer | cut -d " " -f3)
libxsltVer=$(echo $xsltprocVer | cut -d " " -f5)
tidyVer=`tidy -V | cut -d " " -f9`
# Version numbers are packed strings not xx.yy.zz format.
check_version "2.06.20" "${libxmlVer:0:1}.${libxmlVer:1:2}.${libxmlVer:3:2}" "LIBXML2"
check_version "1.01.14" "${libxsltVer:0:1}.${libxsltVer:1:2}.${libxsltVer:3:2}" "LIBXSLT"
check_version "2004" "${tidyVer}" "TIDY"
XML_FILE="<?xml version='1.0' encoding='ISO-8859-1'?>
<?xml-stylesheet type='text/xsl' href='http://docbook.sourceforge.net/release/xsl/1.69.1/xhtml/docbook.xsl'?>
<!DOCTYPE article PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'
'http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd'>
<article>
<title>Test file</title>
<sect1>
<title>Some title</title>
<para>Some text</para>
</sect1>
</article>"
if `echo $XML_FILE | xmllint -noout -postvalid - 2>/dev/null` ; then
check_version "4.4" "4.4" "DocBook XML DTD"
else
echo "Warning: not found a working DocBook XML DTD 4.4 installation"
exit 2
fi
if `echo $XML_FILE | xsltproc --noout - 2>/dev/null` ; then
check_version "1.69.1" "1.69.1" "DocBook XSL"
else
echo "Warning: not found a working DocBook XSL 1.69.1 installation"
exit 2
fi
echo "${SD_BORDER}${nl_}"
# For consistency with other books
validate_config
echo "${SD_BORDER}${nl_}"

View file

@ -0,0 +1,22 @@
#!/bin/sh
# $Id$
set -e
patch -Np1 -i ../tidy-051026-prevent_PRE_newlines-1.patch
sh build/gnuauto/setup.sh
./configure --prefix=/usr
make
make install
cd htmldoc
tidy -xml-help > tidy-help.xml
tidy -xml-config > tidy-config.xml
xsltproc -o tidy.1 tidy1.xsl tidy-help.xml
xsltproc -o quickref.html quickref-html.xsl tidy-config.xml
cd ..
install -v -m644 htmldoc/tidy.1 /usr/share/man/man1
install -v -m755 -d /usr/share/doc/tidy-051026
install -v -m644 htmldoc/quickref.html /usr/share/doc/tidy-051026
exit

View file

@ -0,0 +1,10 @@
#!/bin/sh
# $Id$
set -e
make -f unix/Makefile LOCAL_UNZIP=-D_FILE_OFFSET_BITS=64 linux
make prefix=/usr install
exit

View file

@ -0,0 +1,108 @@
#!/bin/sh
# $Id$
set -e
cd /sources
mkdir docbook-xml
cd docbook-xml
unzip ../docbook-xml-4.4.zip
install -v -d -m755 /usr/share/xml/docbook/xml-dtd-4.4
install -v -d -m755 /etc/xml
chown -R root:root .
cp -v -af docbook.cat *.dtd ent/ *.mod \
/usr/share/xml/docbook/xml-dtd-4.4
if [ ! -e /etc/xml/docbook ]; then
xmlcatalog --noout --create /etc/xml/docbook
fi
xmlcatalog --noout --add "public" \
"-//OASIS//DTD DocBook XML V4.4//EN" \
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" \
/etc/xml/docbook
xmlcatalog --noout --add "public" \
"-//OASIS//DTD DocBook XML CALS Table Model V4.4//EN" \
"file:///usr/share/xml/docbook/xml-dtd-4.4/calstblx.dtd" \
/etc/xml/docbook
xmlcatalog --noout --add "public" \
"-//OASIS//DTD XML Exchange Table Model 19990315//EN" \
"file:///usr/share/xml/docbook/xml-dtd-4.4/soextblx.dtd" \
/etc/xml/docbook
xmlcatalog --noout --add "public" \
"-//OASIS//ELEMENTS DocBook XML Information Pool V4.4//EN" \
"file:///usr/share/xml/docbook/xml-dtd-4.4/dbpoolx.mod" \
/etc/xml/docbook
xmlcatalog --noout --add "public" \
"-//OASIS//ELEMENTS DocBook XML Document Hierarchy V4.4//EN" \
"file:///usr/share/xml/docbook/xml-dtd-4.4/dbhierx.mod" \
/etc/xml/docbook
xmlcatalog --noout --add "public" \
"-//OASIS//ELEMENTS DocBook XML HTML Tables V4.4//EN" \
"file:///usr/share/xml/docbook/xml-dtd-4.4/htmltblx.mod" \
/etc/xml/docbook
xmlcatalog --noout --add "public" \
"-//OASIS//ENTITIES DocBook XML Notations V4.4//EN" \
"file:///usr/share/xml/docbook/xml-dtd-4.4/dbnotnx.mod" \
/etc/xml/docbook
xmlcatalog --noout --add "public" \
"-//OASIS//ENTITIES DocBook XML Character Entities V4.4//EN" \
"file:///usr/share/xml/docbook/xml-dtd-4.4/dbcentx.mod" \
/etc/xml/docbook
xmlcatalog --noout --add "public" \
"-//OASIS//ENTITIES DocBook XML Additional General Entities V4.4//EN" \
"file:///usr/share/xml/docbook/xml-dtd-4.4/dbgenent.mod" \
/etc/xml/docbook
xmlcatalog --noout --add "rewriteSystem" \
"http://www.oasis-open.org/docbook/xml/4.4" \
"file:///usr/share/xml/docbook/xml-dtd-4.4" \
/etc/xml/docbook
xmlcatalog --noout --add "rewriteURI" \
"http://www.oasis-open.org/docbook/xml/4.4" \
"file:///usr/share/xml/docbook/xml-dtd-4.4" \
/etc/xml/docbook
if [ ! -e /etc/xml/catalog ]; then
xmlcatalog --noout --create /etc/xml/catalog
fi
xmlcatalog --noout --add "delegatePublic" \
"-//OASIS//ENTITIES DocBook XML" \
"file:///etc/xml/docbook" \
/etc/xml/catalog
xmlcatalog --noout --add "delegatePublic" \
"-//OASIS//DTD DocBook XML" \
"file:///etc/xml/docbook" \
/etc/xml/catalog
xmlcatalog --noout --add "delegateSystem" \
"http://www.oasis-open.org/docbook/" \
"file:///etc/xml/docbook" \
/etc/xml/catalog
xmlcatalog --noout --add "delegateURI" \
"http://www.oasis-open.org/docbook/" \
"file:///etc/xml/docbook" \
/etc/xml/catalog
for DTDVERSION in 4.1.2 4.2 4.3
do
xmlcatalog --noout --add "public" \
"-//OASIS//DTD DocBook XML V$DTDVERSION//EN" \
"http://www.oasis-open.org/docbook/xml/$DTDVERSION/docbookx.dtd" \
/etc/xml/docbook
xmlcatalog --noout --add "rewriteSystem" \
"http://www.oasis-open.org/docbook/xml/$DTDVERSION" \
"file:///usr/share/xml/docbook/xml-dtd-4.4" \
/etc/xml/docbook
xmlcatalog --noout --add "rewriteURI" \
"http://www.oasis-open.org/docbook/xml/$DTDVERSION" \
"file:///usr/share/xml/docbook/xml-dtd-4.4" \
/etc/xml/docbook
xmlcatalog --noout --add "delegateSystem" \
"http://www.oasis-open.org/docbook/xml/$DTDVERSION/" \
"file:///etc/xml/docbook" \
/etc/xml/catalog
xmlcatalog --noout --add "delegateURI" \
"http://www.oasis-open.org/docbook/xml/$DTDVERSION/" \
"file:///etc/xml/docbook" \
/etc/xml/catalog
done
cd ..
rm -rf docbook-xml
exit

View file

@ -29,51 +29,15 @@ HEADER="# This file is automatically generated by jhalfs
# Generated on `date \"+%F %X %Z\"`"
#------------------------------------------------------#
# NEW Makefile scripting functions #
#------------------------------------------------------#
unset get_package_tarball_name
#----------------------------------#
wrt_target() { # Create target and initialize log file
get_package_tarball_name() { #
#----------------------------------#
local i=$1
local PREV=$2
case $i in
iteration* ) local LOGFILE=$this_script.log ;;
* ) local LOGFILE=$this_script ;;
esac
(
cat << EOF
$i: $PREV
@\$(call echo_message, Building)
@./progress_bar.sh \$@ \$\$PPID &
@echo -e "\n\`date\`\n\nKB: \`du -skx --exclude=${SCRIPT_ROOT} \$(MOUNT_PT)\`\n" >logs/$LOGFILE
EOF
) >> $MKFILE.tmp
}
#----------------------------------#
wrt_target_boot() { # Create target and initialize log file
#----------------------------------#
local i=$1
local PREV=$2
case $i in
iteration* ) local LOGFILE=$this_script.log ;;
* ) local LOGFILE=$this_script ;;
esac
(
cat << EOF
$i: $PREV
@\$(call echo_message, Building)
@./progress_bar.sh \$@ \$\$PPID &
@echo -e "\n\`date\`\n\nKB: \`du -skx --exclude=${SCRIPT_ROOT}\`\n" >logs/$LOGFILE
EOF
) >> $MKFILE.tmp
}
#----------------------------#
get_package_tarball_name() { #
#----------------------------#
local script_name=$1
# The use of 'head' is necessary to limit the return value to the FIRST match..
@ -88,87 +52,49 @@ get_package_tarball_name() { #
}
unset wrt_RunaAsRoot
#----------------------------------#
wrt_test_log() { # Initialize testsuite log file
wrt_RunAsRoot() { # Some scripts must be run as root..
#----------------------------------#
local TESTLOGFILE=$1
(
cat << EOF
@echo "export TEST_LOG=$TESTLOGDIR/$TESTLOGFILE" >> envars && \\
su - \$(LUSER) -c "echo -e '\n\`date\`\n' >$TESTLOGDIR/$TESTLOGFILE"
EOF
) >> $MKFILE.tmp
}
local ENV_MOUNT
local this_script=$1
local file=$2
#----------------------------------#
wrt_test_log2() { #
#----------------------------------#
local TESTLOGFILE=$1
(
cat << EOF
@echo "export TEST_LOG=/$SCRIPT_ROOT/test-logs/$TESTLOGFILE" >> envars && \\
echo -e "\n\`date\`\n" >test-logs/$TESTLOGFILE
EOF
) >> $MKFILE.tmp
}
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
#----------------------------------#
wrt_target_vars() { # Target vars for hlfs (cross-build method)
#----------------------------------#
(
cat << EOF
@echo "export target=$(uname -m)-${TARGET}" >> envars && \\
echo "export ldso=/lib/${LOADER}" >> envars
EOF
) >> $MKFILE.tmp
}
#----------------------------------#
wrt_copy_fstab() { #
#----------------------------------#
local i=$1
(
cat << EOF
@cp -v $FSTAB \$(MOUNT_PT)/etc/fstab >>logs/$i 2>&1
EOF
) >> $MKFILE.tmp
}
#----------------------------------#
wrt_copy_fstab2() { #
#----------------------------------#
local i=$1
(
cat << EOF
@cp -v /sources/fstab /etc/fstab >>logs/$i 2>&1
EOF
) >> $MKFILE.tmp
}
#----------------------------------#
wrt_report() { #
#----------------------------------#
(
cat << EOF
create-sbu_du-report: $PREV
@\$(call echo_message, Building)
@./create-sbu_du-report.sh logs $VERSION
@\$(call echo_report,$VERSION-SBU_DU-$(date --iso-8601).report)
@touch \$@
@( time { export ${MOUNT_ENV}=\$(MOUNT_PT) && ${PROGNAME}-commands/`dirname $file`/\$@ >>logs/\$@ 2>&1 ; } ) 2>>logs/\$@ && \\
\$(PRT_DU_CR) >>logs/\$@
EOF
) >> $MKFILE.tmp
chapter789="$chapter789 create-sbu_du-report"
}
unset wrt_unpack
#------------------------------------------------------#
#------------------------------------------------------#
#----------------------------------#
wrt_unpack() { # Unpack and set 'ROOT' var
ROOT_RunAsRoot() { #
#----------------------------------#
local file=$1
(
cat << EOF
@( time { source envars && \$(CMDSDIR)/$file >>logs/$this_script 2>&1 ; } ) 2>>logs/$this_script && \\
\$(PRT_DU_CR) >>logs/$this_script
EOF
) >> $MKFILE.tmp
}
#----------------------------------#
ROOT_Unpack() { # An alias, for clairity
#----------------------------------#
local FILE=$1
local optSAVE_PREVIOUS=$2
@ -184,36 +110,130 @@ EOF
(
cat << EOF
@\$(call unpack,$FILE)
@\$(call get_pkg_root)
@\$(call get_pkg_root_LUSER)
EOF
) >> $MKFILE.tmp
}
unset wrt_unpack2
#------------------------------------------------------#
#------------------------------------------------------#
#----------------------------------#
wrt_unpack2() { #
LUSER_wrt_target() { # Create target and initialize log file
#----------------------------------#
local i=$1
local PREV=$2
(
cat << EOF
$i: $PREV
@\$(call echo_message, Building)
@./progress_bar.sh \$@ \$\$PPID &
@echo -e "\n\`date\`\n\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) \$(MOUNT_PT)\`\n" >logs/\$@
EOF
) >> $MKFILE.tmp
}
#----------------------------------#
LUSER_wrt_RunAsUser() { # Execute script inside time { }, footer to log file
#----------------------------------#
local file=$1
(
cat << EOF
@( time { source ~/.bashrc && \$(CMDSDIR)/`dirname $file`/\$@ >> logs/\$@ 2>&1; } ) 2>> logs/\$@ && \\
\$(PRT_DU) >> logs/\$@
EOF
) >> $MKFILE.tmp
}
#----------------------------------#
LUSER_wrt_unpack() { # Unpack and set 'ROOT' var
#----------------------------------#
local FILE=$1
local optSAVE_PREVIOUS=$2
if [ "${optSAVE_PREVIOUS}" != "1" ]; then
if [[ "${optSAVE_PREVIOUS}" != "1" ]]; then
(
cat << EOF
@\$(call remove_existing_dirs,$FILE)
EOF
) >> $MKFILE.tmp
fi
(
cat << EOF
@\$(call unpack2,$FILE)
@\$(call get_pkg_root,nouser)
cat << EOF
@\$(call unpack,$FILE)
@\$(call get_pkg_root_LUSER)
EOF
) >> $MKFILE.tmp
}
#----------------------------------#
LUSER_wrt_CopyFstab() { #
#----------------------------------#
(
cat << EOF
@( time { cp -v \$(MOUNT_PT)/sources/fstab \$(MOUNT_PT)/etc/fstab >>logs/\$@ 2>&1 ; } ) 2>>logs/\$@
EOF
) >> $MKFILE.tmp
}
#----------------------------------#
wrt_unpack3() { #
LUSER_wrt_test_log() { # Initialize testsuite log file
#----------------------------------#
local TESTLOGFILE=$1
(
cat << EOF
@echo "export TEST_LOG=$TESTLOGDIR/$TESTLOGFILE" >> envars && \\
echo -e '\n\`date\`\n' >$TESTLOGDIR/$TESTLOGFILE
EOF
) >> $MKFILE.tmp
}
#----------------------------------#
LUSER_RemoveBuildDirs() { #
#----------------------------------#
local name=$1
(
cat << EOF
@\$(call remove_build_dirs,$name)
EOF
) >> $MKFILE.tmp
}
#-----------------------------------------------------------------#
#-----------------------------------------------------------------#
#----------------------------------#
CHROOT_wrt_target() { # Create target and initialize log file
#----------------------------------#
local i=$1
local PREV=$2
case $i in
iteration* ) local LOGFILE="${this_script}.log" ;;
* ) local LOGFILE="${this_script}" ;;
esac
(
cat << EOF
$i: $PREV
@\$(call echo_message, Building)
@./progress_bar.sh \$@ \$\$PPID &
@echo -e "\n\`date\`\n\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) / \`\n" >logs/$LOGFILE
EOF
) >> $MKFILE.tmp
}
#----------------------------------#
CHROOT_Unpack() { #
#----------------------------------#
local FILE=$1
local optSAVE_PREVIOUS=$2
@ -234,20 +254,46 @@ EOF
}
unset wrt_remove_build_dirs
#----------------------------------#
wrt_remove_build_dirs() { #
CHROOT_wrt_test_log() { #
#----------------------------------#
local name=$1
local TESTLOGFILE=$1
(
cat << EOF
@\$(call remove_build_dirs,$name)
cat << EOF
@echo "export TEST_LOG=/\$(SCRIPT_ROOT)/test-logs/$TESTLOGFILE" >> envars && \\
echo -e "\n\`date\`\n" >test-logs/$TESTLOGFILE
EOF
) >> $MKFILE.tmp
}
#----------------------------------#
wrt_remove_build_dirs2() { #
CHROOT_wrt_RunAsRoot() { #
#----------------------------------#
local file=$1
(
cat << EOF
@( time { source envars && \$(crCMDSDIR)/$file >>logs/$this_script 2>&1 ; } ) 2>>logs/$this_script && \\
\$(PRT_DU_CR) >>logs/$this_script
EOF
) >> $MKFILE.tmp
}
#----------------------------------#
CHROOT_wrt_CopyFstab() { #
#----------------------------------#
(
cat << EOF
@( time { cp -v /sources/fstab /etc/fstab >>logs/${this_script} 2>&1 ; } ) 2>>logs/${this_script}
EOF
) >> $MKFILE.tmp
}
#----------------------------------#
CHROOT_wrt_RemoveBuildDirs() { #
#----------------------------------#
local name=$1
(
@ -258,7 +304,6 @@ EOF
}
unset wrt_touch
#----------------------------------#
wrt_touch() { #
@ -270,128 +315,73 @@ EOF
) >> $MKFILE.tmp
}
unset wrt_RunAsUser
#----------------------------------#
wrt_RunAsUser() { # Execute script inside time { }, footer to log file
#----------------------------------#
local this_script=$1
local file=$2
(
cat << EOF
@( time { \$(SU_LUSER) "source \$(LUSER_HOME)/.bashrc && \$(CMDSDIR)/`dirname $file`/\$@" >> logs/\$@ 2>&1; } ) 2>> logs/\$@ && \\
\$(PRT_DU) >> logs/\$@
EOF
) >> $MKFILE.tmp
#----------------------------------#
wrt_blfs_tool_targets() { #
#----------------------------------#
echo "${tab_}${GREEN}Processing... ${L_arrow}BLFS_TOOL ${R_arrow}"
for file in blfs-tool-deps/* ; do
# Keep the script file name
this_script=`basename $file`
# Grab the name of the target
name=`echo ${this_script} | sed -e 's@[0-9]\{3\}-@@'`
# Find the package.
case $name in
tidy ) pkg_tarball=${TIDY_PKG} ;;
unzip ) pkg_tarball=${UNZIP_PKG} ;;
* ) pkg_tarball=$(get_package_tarball_name $name) ;;
esac
# Append each name of the script files to a list (this will become
# the names of the targets in the Makefile)
blfs_tool="$blfs_tool ${this_script}"
#--------------------------------------------------------------------#
# >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
#--------------------------------------------------------------------#
#
# Drop in the name of the target on a new line, and the previous target
# as a dependency. Also call the echo_message function.
CHROOT_wrt_target "${this_script}" "$PREV"
# Insert instructions for unpacking the package and changing directories
# DocBook-XML is a zip, the build script will handle that.
[[ ! "$name" = "docbook-xml" ]] && CHROOT_Unpack "$pkg_tarball"
# Run the script.
CHROOT_wrt_RunAsRoot "$file"
# Remove the build directory(ies) except if the package build fails.
[[ ! "$name" = "docbook-xml" ]] && CHROOT_wrt_RemoveBuildDirs "$name"
# Touch the tracking file.
case $name in
tidy ) pkg_ver=tidy-051026 ;;
unzip ) pkg_ver=unzip-5.52 ;;
* ) pkg_ver=$(echo $pkg_tarball | sed -e 's/.tar.*//;s/.tgz//;s/.zip//') ;;
esac
echo -e "\t@touch $TRACKING_DIR/$pkg_ver" >> $MKFILE.tmp
# Include a touch of the target name so make can check
# if it's already been made.
wrt_touch
#
#--------------------------------------------------------------------#
# >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
#--------------------------------------------------------------------#
# Keep the script file name for Makefile dependencies.
PREV=${this_script}
done
}
#----------------------------------#
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 ${MOUNT_ENV}=\$(MOUNT_PT) && ${PROGNAME}-commands/`dirname $file`/\$@ >>logs/\$@ 2>&1 ; } ) 2>>logs/\$@ && \\
\$(PRT_DU_CR) >>logs/\$@
EOF
) >> $MKFILE.tmp
}
#----------------------------------#
wrt_run_as_root2() { #
#----------------------------------#
local this_script=$1
local file=$2
(
cat << EOF
@( time { source envars && ${PROGNAME}-commands/`dirname $file`/\$@ >>logs/\$@ 2>&1 ; } ) 2>>logs/\$@ && \\
echo -e "\nKB: \`du -skx --exclude=${SCRIPT_ROOT} \`\n" >>logs/\$@
EOF
) >> $MKFILE.tmp
}
unset wrt_run_as_chroot1
#----------------------------------#
wrt_run_as_chroot1() { #
#----------------------------------#
local this_script=$1
local file=$2
(
cat << EOF
@( time { \$(CHROOT1) 'cd \$(SCRIPT_ROOT) && source envars && \$(crCMDSDIR)/$file >>logs/${this_script} 2>&1' ; } ) 2>>logs/${this_script} && \\
\$(PRT_DU_CR) >> logs/${this_script}
EOF
) >> $MKFILE.tmp
}
unset wrt_run_as_chroot2
#----------------------------------#
wrt_run_as_chroot2() { #
#----------------------------------#
local this_script=$1
local file=$2
(
cat << EOF
@( time { \$(CHROOT2) 'cd \$(SCRIPT_ROOT) && source envars && \$(crCMDSDIR)/`dirname $file`/\$@ >>logs/\$@ 2>&1' ; } ) 2>>logs/\$@ && \\
\$(PRT_DU_CR) >> logs/\$@
EOF
) >> $MKFILE.tmp
}
unset wrt_target
#----------------------------------#
wrt_target() { # Create target and initialize log file
#----------------------------------#
local i=$1
local PREV=$2
case $i in
iteration* ) local LOGFILE="\$@.log" ;;
* ) local LOGFILE="\$@" ;;
esac
(
cat << EOF
$i: $PREV
@\$(call echo_message, Building)
@./progress_bar.sh \$@ \$\$PPID &
@echo -e "\n\`date\`\n\nKB: \`du -skx --exclude=${SCRIPT_ROOT} \$(MOUNT_PT)\`\n" >logs/$LOGFILE
EOF
) >> $MKFILE.tmp
}
#----------------------------------#
wrt_target_boot() { # Create target and initialize log file
#----------------------------------#
local i=$1
local PREV=$2
case $i in
iteration* ) local LOGFILE="\$@.log" ;;
* ) local LOGFILE="\$@" ;;
esac
(
cat << EOF
$i: $PREV
@\$(call echo_message, Building)
@./progress_bar.sh \$@ \$\$PPID &
@echo -e "\n\`date\`\n\nKB: \`du -skx --exclude=${SCRIPT_ROOT}\`\n" >logs/$LOGFILE
EOF
) >> $MKFILE.tmp
}
#------------------------------------------------------#
# END Makefile scripting functions #
#------------------------------------------------------#
@ -401,8 +391,8 @@ run_make() { #
# Test if make must be run.
if [ "$RUNMAKE" = "y" ] ; then
# Test to make sure we're running the build as root
if [ "$UID" != "0" ] ; then
echo "You must be logged in as root to successfully build the system."
if [ "$UID" = "0" ] ; then
echo "You must not be logged in as root to build the system."
exit 1
fi
# Build the system
@ -427,7 +417,7 @@ clean_builddir() { #
fi
# Test to make sure that the build directory was populated by jhalfs
if [ ! -d $JHALFSDIR ] || [ ! -d $BUILDDIR/sources ] ; then
echo "Looks like $BUILDDIR was not populated by a previous jhalfs run."
echo "Looks like $BUILDDIR was not populated by a previous jhalfs-X run."
exit 1
else
# Clean the build directory
@ -586,6 +576,7 @@ extract_commands() { #
# Done. Moving on...
get_sources
}
#----------------------------#
@ -615,6 +606,9 @@ create_package_list() { #
cat << EOF
$LIBXML_PKG
$LIBXSLT_PKG
$TIDY_PKG
$UNZIP_PKG
$DBXML_PKG
$DBXSL_PKG
$LINKS_PKG
$SUDO_PKG
@ -799,6 +793,7 @@ create_urls() { #
if [[ "${BLFS_TOOL}" = "y" ]]; then
add_blfs_deps_urls
fi
}
#----------------------------# Hardcoded URLs and MD5.
@ -815,6 +810,19 @@ add_blfs_deps_urls() { # No easy way to extract it.
echo "${LIBXSLT_URL} ${BLFS_SERVER}libxslt/${LIBXSLT_PKG} ${LIBXSLT_MD5}" >> urls.lst
fi
if [[ "${DEP_TIDY}" = "y" ]] ; then
echo "${TIDY_URL} ${BLFS_SERVER}tidy/${TIDY_PKG} ${TIDY_MD5}" >> urls.lst
echo "${TIDY_PATCH_URL} ${BLFS_SERVER}tidy/${TIDY_PATCH} ${TIDY_PATCH_MD5}" >> urls.lst
fi
if [[ "${DEP_UNZIP}" = "y" ]] ; then
echo "${UNZIP_URL} ${BLFS_SERVER}unzip/${UNZIP_PKG} ${UNZIP_MD5}" >> urls.lst
fi
if [[ "${DEP_DBXML}" = "y" ]] ; then
echo "${DBXML_URL} ${BLFS_SERVER}docbook-xml/${DBXML_PKG} ${DBXML_MD5}" >> urls.lst
fi
if [[ "${DEP_DBXSL}" = "y" ]] ; then
echo "${DBXSL_URL} ${BLFS_SERVER}docbook-xsl/${DBXSL_PKG} ${DBXSL_MD5}" >> urls.lst
fi
@ -858,28 +866,40 @@ copy_blfs_deps_scripts() { # method avoid to place the test on all
mv blfs-tool-deps/902-libxslt ${PROGNAME}-commands/blfs-tool-deps
fi
if [[ "${DEP_TIDY}" = "y" ]] ; then
mv blfs-tool-deps/903-tidy ${PROGNAME}-commands/blfs-tool-deps
fi
if [[ "${DEP_UNZIP}" = "y" ]] ; then
mv blfs-tool-deps/904-unzip ${PROGNAME}-commands/blfs-tool-deps
fi
if [[ "${DEP_DBXML}" = "y" ]] ; then
mv blfs-tool-deps/905-docbook-xml ${PROGNAME}-commands/blfs-tool-deps
fi
if [[ "${DEP_DBXSL}" = "y" ]] ; then
mv blfs-tool-deps/903-docbook-xsl ${PROGNAME}-commands/blfs-tool-deps
mv blfs-tool-deps/906-docbook-xsl ${PROGNAME}-commands/blfs-tool-deps
fi
if [[ "${DEP_LINKS}" = "y" ]] ; then
mv blfs-tool-deps/905-links ${PROGNAME}-commands/blfs-tool-deps
mv blfs-tool-deps/908-links ${PROGNAME}-commands/blfs-tool-deps
fi
if [[ "${DEP_SUDO}" = "y" ]] ; then
mv blfs-tool-deps/906-sudo ${PROGNAME}-commands/blfs-tool-deps
mv blfs-tool-deps/909-sudo ${PROGNAME}-commands/blfs-tool-deps
fi
if [[ "${DEP_WGET}" = "y" ]] ; then
mv blfs-tool-deps/907-wget ${PROGNAME}-commands/blfs-tool-deps
mv blfs-tool-deps/910-wget ${PROGNAME}-commands/blfs-tool-deps
fi
if [[ "${DEP_SVN}" = "y" ]] ; then
mv blfs-tool-deps/908-subversion ${PROGNAME}-commands/blfs-tool-deps
mv blfs-tool-deps/911-subversion ${PROGNAME}-commands/blfs-tool-deps
fi
if [[ "${DEP_GPM}" = "y" ]] ; then
mv blfs-tool-deps/904-gpm ${PROGNAME}-commands/blfs-tool-deps
mv blfs-tool-deps/907-gpm ${PROGNAME}-commands/blfs-tool-deps
fi
rm -rf blfs-tool-deps

View file

@ -108,7 +108,7 @@ for log in $BUILDLOGS ; do
echo -e "Approximate SBU time is:\t$SBU" >> "$REPORT"
# Dump disk usage values
echo -e "\nDisk usage before unpacking the package:\t\t\t$DU1 KB or $DU1MB MB" >> "$REPORT"
echo -e "\nDisk usage before unpacking the package:\t\t$DU1 KB or $DU1MB MB" >> "$REPORT"
echo -e "Disk usage before deleting the source and build dirs:\t$DU2 KB or $DU2MB MB" >> "$REPORT"
echo -e "Required space to build the package:\t\t\t$REQUIRED1 KB or $REQUIRED2 MB\n" >> "$REPORT"

View file

@ -22,6 +22,7 @@ inline_doc
declare -i major minor revision change
declare -i ref_major ref_minor ref_revision ref_change
declare -r spaceSTR=" "
ref_version=$1
tst_version=$2
@ -30,20 +31,16 @@ inline_doc
# This saves us the save/restore hassle of the system IFS value
local IFS
# if echo $ref_version | grep [[:alpha:]] 2>&1 >/dev/null ||
# echo $tst_version | grep [[:alpha:]] 2>&1 >/dev/null ;then
# echo "Cannot test for text, 0.0.0a, version types, assuming 'success' "
# return
# fi
write_error_and_die() {
echo -e "\n\t\t$TXT version -->${tst_version}<-- is too old.
This script requires ${ref_version} or greater\n"
exit 1
}
echo -ne "$TXT:\t${L_arrow}${BOLD}${tst_version}${OFF}${R_arrow}"
IFS=".-(" # Split up w.x.y.z as well as w.x.y-rc (catch release candidates)
echo -ne "${TXT}${dotSTR:${#TXT}} ${L_arrow}${BOLD}${tst_version}${OFF}${R_arrow}"
# echo -ne "$TXT:\t${L_arrow}${BOLD}${tst_version}${OFF}${R_arrow}"
IFS=".-(p" # Split up w.x.y.z as well as w.x.y-rc (catch release candidates)
set -- $ref_version # set postional parameters to minimum ver values
ref_major=$1; ref_minor=$2; ref_revision=$3
#
@ -51,15 +48,111 @@ inline_doc
major=$1; minor=$2; revision=$3
#
# Compare against minimum acceptable version..
(( major > ref_major )) && echo " ..OK" && return
(( major > ref_major )) && echo " ${spaceSTR:${#tst_version}}${GREEN}OK${OFF}" && return
(( major < ref_major )) && write_error_and_die
# major=ref_major
(( minor < ref_minor )) && write_error_and_die
(( minor > ref_minor )) && echo " ..OK" && return
(( minor > ref_minor )) && echo " ${spaceSTR:${#tst_version}}${GREEN}OK${OFF}" && return
# minor=ref_minor
(( revision >= ref_revision )) && echo " ..OK" && return
(( revision >= ref_revision )) && echo " ${spaceSTR:${#tst_version}}${GREEN}OK${OFF}" && return
# oops.. write error msg and die
write_error_and_die
}
# local -r PARAM_VALS='${config_param}${dotSTR:${#config_param}} ${L_arrow}${BOLD}${!config_param}${OFF}${R_arrow}'
#----------------------------#
check_prerequisites() { #
#----------------------------#
# LFS/HLFS/CLFS prerequisites
if [ ! "${PROGNAME}" = "hlfs" ]; then
check_version "2.6.2" "`uname -r`" "KERNEL"
check_version "2.0.5" "$BASH_VERSION" "BASH"
check_version "3.0.0" "`gcc -dumpversion`" "GCC"
libcVer="`/lib/libc.so.6 | head -n1`"
libcVer="${libcVer##*version }"
check_version "2.2.5" ${libcVer%%,*} "GLIBC"
check_version "2.12" "$(ld --version | head -n1 | cut -d" " -f4)" "BINUTILS"
check_version "1.14" "$(tar --version | head -n1 | cut -d" " -f4)" "TAR"
bzip2Ver="$(bzip2 --version 2>&1 < /dev/null | head -n1 | cut -d" " -f8)"
check_version "1.0.2" "${bzip2Ver%%,*}" "BZIP2"
check_version "5.0" "$(chown --version | head -n1 | cut -d")" -f2)" "COREUTILS"
check_version "2.8" "$(diff --version | head -n1 | cut -d" " -f4)" "DIFF"
check_version "4.1.20" "$(find --version | head -n1 | cut -d" " -f4)" "FIND"
check_version "3.0" "$(gawk --version | head -n1 | cut -d" " -f3)" "GAWK"
check_version "2.5" "$(grep --version | head -n1 | cut -d" " -f4)" "GREP"
check_version "1.2.4" "$(gzip --version 2>&1 | head -n1 | cut -d" " -f2)" "GZIP"
check_version "3.79.1" "$(make --version | head -n1 | cut -d " " -f3)" "MAKE"
check_version "2.5.4" "$(patch --version | head -n1 | cut -d" " -f2)" "PATCH"
check_version "3.0.2" "$(sed --version | head -n1 | cut -d" " -f4)" "SED"
else
# HLFS prerequisites
check_version "2.6.2" "$(uname -r)" "KERNEL"
check_version "3.0" "$BASH_VERSION" "BASH"
check_version "3.0" "$(gcc -dumpversion)" "GCC"
check_version "1.14" "$(tar --version | head -n1 | cut -d" " -f4)" "TAR"
fi
# Check for minimum sudo version
SUDO_LOC="$(whereis -b sudo | cut -d" " -f2)"
if [ -x $SUDO_LOC ]; then
sudoVer="$(sudo -V | head -n1 | cut -d" " -f3)"
check_version "1.6.8" "${sudoVer}" "SUDO"
else
echo "${nl_}\"${RED}sudo${OFF}\" ${BOLD}must be installed on your system for jhalfs to run"
exit 1
fi
# Check for minimum libxml2 and libxslt versions
xsltprocVer=$(xsltproc -V | head -n1 )
libxmlVer=$(echo $xsltprocVer | cut -d " " -f3)
libxsltVer=$(echo $xsltprocVer | cut -d " " -f5)
# Version numbers are packed strings not xx.yy.zz format.
check_version "2.06.20" "${libxmlVer:0:1}.${libxmlVer:1:2}.${libxmlVer:3:2}" "LIBXML2"
check_version "1.01.14" "${libxsltVer:0:1}.${libxsltVer:1:2}.${libxsltVer:3:2}" "LIBXSLT"
# The next versions checks are required only when BLFS_TOOL is set and
# this dependencies has not be selected for installation
if [[ "$BLFS_TOOL" = "y" ]] ; then
if [[ -z "$DEP_TIDY" ]] ; then
tidyVer=$(tidy -V | cut -d " " -f9)
check_version "2004" "${tidyVer}" "TIDY"
fi
# Check if the proper DocBook-XML-DTD and DocBook-XSL are correctly installed
XML_FILE="<?xml version='1.0' encoding='ISO-8859-1'?>
<?xml-stylesheet type='text/xsl' href='http://docbook.sourceforge.net/release/xsl/1.69.1/xhtml/docbook.xsl'?>
<!DOCTYPE article PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'
'http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd'>
<article>
<title>Test file</title>
<sect1>
<title>Some title</title>
<para>Some text</para>
</sect1>
</article>"
if [[ -z "$DEP_DBXML" ]] ; then
if `echo $XML_FILE | xmllint -noout -postvalid - 2>/dev/null` ; then
check_version "4.4" "4.4" "DocBook XML DTD"
else
echo "Warning: not found a working DocBook XML DTD 4.4 installation"
exit 2
fi
fi
if [[ -z "$DEP_DBXSL" ]] ; then
if `echo $XML_FILE | xsltproc --noout - 2>/dev/null` ; then
check_version "1.69.1" "1.69.1" "DocBook XSL"
else
echo "Warning: not found a working DocBook XSL 1.69.1 installation"
exit 2
fi
fi
fi # end BLFS_TOOL=Y
}

View file

@ -11,7 +11,7 @@ wrt_compare_targets() { #
wrt_system_build "$N" "$PREV_IT"
fi
this_script=$ITERATION
wrt_target "$ITERATION" "$PREV"
CHROOT_wrt_target "$ITERATION" "$PREV"
wrt_compare_work "$ITERATION" "$PREV_IT"
wrt_logs "$N"
PREV_IT=$ITERATION
@ -26,13 +26,27 @@ wrt_system_build() { #
local PREV_IT=$2
if [[ "$PROGNAME" = "clfs" ]] && [[ "$METHOD" = "chroot" ]] ; then
final_system_Makefiles $RUN
chroot_final_system_Makefiles $RUN
elif [[ "$PROGNAME" = "clfs" ]] && [[ "$METHOD" = "boot" ]] ; then
bm_final_system_Makefiles $RUN
boot_final_system_Makefiles $RUN
else
chapter6_Makefiles $RUN
fi
if [[ "$PROGNAME" = "clfs" ]] ; then
basicsystem="$basicsystem $PREV_IT $system_build"
else
chapter6="$chapter6 $PREV_IT $system_build"
fi
if [[ "$RUN" = "$ITERATIONS" ]] ; then
if [[ "$PROGNAME" = "clfs" ]] ; then
basicsystem="$basicsystem iteration-$RUN"
else
chapter6="$chapter6 iteration-$RUN"
fi
fi
echo -e "\nsystem_build_$RUN: $PREV_IT $system_build" >> $MKFILE.tmp
}
@ -44,15 +58,10 @@ wrt_compare_work() { #
local PRUNEPATH="/dev /home /${SCRIPT_ROOT} /lost+found /media /mnt /opt /proc \
/sources /root /srv /sys /tmp /tools /usr/local /usr/src /var/log/paco"
if [[ "$PROGNAME" = "clfs" ]] && [[ "$METHOD" = "boot" ]] ; then
local ROOT_DIR=/
local DEST_TOPDIR=/${SCRIPT_ROOT}
local ICALOGDIR=/${SCRIPT_ROOT}/logs/ICA
local FARCELOGDIR=/${SCRIPT_ROOT}/logs/farce
else
local ROOT_DIR=$BUILDDIR
local DEST_TOPDIR=$BUILDDIR/${SCRIPT_ROOT}
fi
local ROOT_DIR=/
local DEST_TOPDIR=/${SCRIPT_ROOT}
local ICALOGDIR=/${SCRIPT_ROOT}/logs/ICA
local FARCELOGDIR=/${SCRIPT_ROOT}/logs/farce
if [[ "$RUN_ICA" = "y" ]] ; then
local DEST_ICA=$DEST_TOPDIR/ICA && \

View file

@ -26,7 +26,7 @@ inline_doc
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 BLFS_TOOL"
local -r blfs_PARAM_LIST="BRANCH_ID BLFS_ROOT BLFS_XML TRACKING_DIR"
local -r blfs_tool_PARAM_LIST="BLFS_BRANCH_ID BLFS_ROOT BLFS_XML TRACKING_DIR DEP_LIBXML DEP_LIBXSLT DEP_DBXSL DEP_LINKS DEP_SUDO DEP_WGET DEP_SVN DEP_GPM"
local -r blfs_tool_PARAM_LIST="BLFS_BRANCH_ID BLFS_ROOT BLFS_XML TRACKING_DIR DEP_LIBXML DEP_LIBXSLT DEP_TIDY DEP_UNZIP DEP_DBXML DEP_DBXSL DEP_LINKS DEP_SUDO DEP_WGET DEP_SVN DEP_GPM"
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='rerun make and fix your configuration settings${OFF}'

View file

@ -1,18 +1,53 @@
# $Id$
BOLD= ""
RED= ""
GREEN= ""
ORANGE= ""
BLUE= ""
WHITE= ""
BOLD = ""
RED = ""
GREEN = ""
ORANGE = ""
BLUE = ""
WHITE = ""
YELLOW = ""
OFF = ""
BOLD = ""
REVERSE = ""
define echo_PHASE
@clear
@echo $(BOLD)--------------------------------------------------------------------------------
@echo Executing $(BLUE)$(1)$(WHITE) scripts
@echo $(BOLD)--------------------------------------------------------------------------------
#echo $(WHITE)
endef
define echo_SU_request
@echo $(BOLD)--------------------------------------------------------------------------------
@echo $(BLUE)$@
@echo $(WHITE)ROOT privilege is required to perform a number commands
@echo sudo will request a password to all high privilege cmds to execute correctly
endef
define echo_SULUSER_request
@clear
@echo $(BOLD)--------------------------------------------------------------------------------
@echo $(BOLD)$(BLUE)$@
@echo $(WHITE)You are going to log into the user account $(BOLD)$(YELLOW)$(LUSER)$(OFF)
@echo su requires a password
endef
define echo_CHROOT_request
@clear
@echo $(BOLD)--------------------------------------------------------------------------------
@echo $(BOLD)$(BLUE)$@
@echo $(WHITE)You are going to CHROOT into $(MOUNT_PT) $(BOLD)$(YELLOW)$(LUSER)$(OFF)
@echo a password is required
endef
define echo_message
@echo $(BOLD)
@echo --------------------------------------------------------------------------------
@echo $(BOLD)$(1) target $(BLUE)$@$(BOLD)
@echo $(WHITE)
@echo $(BOLD)--------------------------------------------------------------------------------
@echo $(BOLD)$(1) target $(BLUE)$@$(BOLD)$(WHITE)
endef
define remove_existing_dirs
@ -23,7 +58,7 @@ define remove_existing_dirs
endef
define remove_existing_dirs2
@PKG_PATH=\`ls -t $(SRC)/$(1) | head -n1\` && \
@PKG_PATH=`ls -t $(SRC)/$(1) | head -n1` && \
ROOT=`tar -tf $$PKG_PATH | head -n1 | sed -e 's@^./@@;s@/.*@@'` && \
rm -rf $(SRC)/$$ROOT && \
rm -rf $(SRC)/$${ROOT%-*}-build
@ -44,7 +79,7 @@ endef
define housekeeping
@touch $@ && \
sleep .25 && \
echo -e "\n\n "$(BOLD)Target $(BLUE)$@ $(BOLD)OK && \
echo -e "\n" $(BOLD)Target $(BLUE)$@ $(WHITE)$(BOLD)OK && \
echo --------------------------------------------------------------------------------$(WHITE)
endef
@ -64,6 +99,11 @@ define get_pkg_root2
echo "export PKGDIR=$(SRC)/$$ROOT" > envars
endef
define get_pkg_root_LUSER
@ROOT=`head -n1 $(SRCSDIR)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
echo "export PKGDIR=$(SRCSDIR)/$$ROOT" > envars
endef
define unpack
@cd $(SRCSDIR) && \
tar -xvf `ls -t $(1) | head -n1` > $(PKG_LST)

View file

@ -36,7 +36,7 @@ write_or_exit() {
}
# initialize screen
write_or_exit "${RESET_LINE}${TS_POSITION}0 min. 0 sec. "
write_or_exit "${RESET_LINE}${TS_POSITION}0 min. 0 sec"
# loop forever..
while true ; do

30
jhalfs
View file

@ -159,7 +159,8 @@ if [[ "${BLFS_TOOL}" = "y" ]] ; then
branch-* ) BLFS_TREE=branches/${BLFS_BRANCH_ID#branch-}/BOOK ;;
* ) BLFS_TREE=tags/${BLFS_BRANCH_ID}/BOOK ;;
esac
# dependencies envars, to can update it more easy.
# Dependencies envars, to can update it more easy.
# Tidy and Unzip version are harcoded also in wrt_blfs_tool_targets()
# libxml2
LIBXML_PKG="libxml2-2.6.26.tar.gz"
LIBXML_URL="ftp://xmlsoft.org/libxml2/${LIBXML_PKG}"
@ -168,6 +169,22 @@ if [[ "${BLFS_TOOL}" = "y" ]] ; then
LIBXSLT_PKG="libxslt-1.1.17.tar.gz"
LIBXSLT_URL="ftp://xmlsoft.org/libxslt/${LIBXSLT_PKG}"
LIBXSLT_MD5="fde6a7a93c0eb14cba628692fa3a1000"
# tidy
TIDY_PKG="tidy_src_051026.tgz"
TIDY_URL="http://tidy.sourceforge.net/src/${TIDY_PKG}"
TIDY_MD5="1e39fafd6808978871346658c8da1454"
# tidy patch
TIDY_PATCH="tidy-051026-prevent_PRE_newlines-1.patch"
TIDY_PATCH_URL="http://www.linuxfromscratch.org/patches/blfs/svn/${TIDY_PATCH}"
TIDY_PATCH_MD5="82f67f7af58fc2c945b3410ae655cc1a"
# unzip
UNZIP_PKG="unzip552.tar.gz"
UNZIP_URL="ftp://ftp.info-zip.org/pub/infozip/src/${UNZIP_PKG}"
UNZIP_MD5="9d23919999d6eac9217d1f41472034a9"
# DocBook XML DTD
DBXML_PKG="docbook-xml-4.4.zip"
DBXML_URL="http://www.docbook.org/xml/4.4/${DBXML_PKG}"
DBXML_MD5="cbb04e9a700955d88c50962ef22c1634"
# DocBook XSL
DBXSL_PKG="docbook-xsl-1.69.1.tar.bz2"
DBXSL_URL="http://prdownloads.sourceforge.net/docbook/${DBXSL_PKG}"
@ -241,13 +258,9 @@ source $COMMON_DIR/func_validate_configs.sh
### MAIN ###
###################################
# Check for minimum bash,tar,gcc and kernel versions
# Check for build prereequisites.
echo
check_version "2.6.2" "`uname -r`" "KERNEL"
check_version "3.0" "$BASH_VERSION" "BASH"
check_version "3.0" "`gcc -dumpversion`" "GCC"
tarVer=`tar --version | head -n1 | cut -d " " -f4`
check_version "1.15.0" "${tarVer}" "TAR"
check_prerequisites
echo "${SD_BORDER}${nl_}"
validate_config
@ -359,6 +372,7 @@ if [[ "${BLFS_TOOL}" = "y" ]] ; then
sed -i 's,tracking-dir,'$TRACKING_DIR',' ${BUILDDIR}${BLFS_ROOT}/{update_book.sh,gen-makefile.sh}
# Copy the dependencies build scripts
cp -r $COMMON_DIR/blfs-tool-deps $JHALFSDIR/
rm -rf $JHALFSDIR/blfs-tool-deps/.svn
fi
get_book
@ -369,7 +383,7 @@ if [[ "${BLFS_TOOL}" = "y" ]] ; then
echo -n "Downloading the BLFS document, $BLFS_BRANCH_ID version... "
if [[ ! -d ${BUILDDIR}${BLFS_ROOT}/${BLFS_XML} ]] ; then
mkdir -p ${BUILDDIR}${BLFS_ROOT}/${BLFS_XML}
svn co $SVN/BLFS/$TREE ${BUILDDIR}${BLFS_ROOT}/${BLFS_XML} >>$LOGDIR/$LOG 2>&1
svn co $SVN/BLFS/$BLFS_TREE ${BUILDDIR}${BLFS_ROOT}/${BLFS_XML} >>$LOGDIR/$LOG 2>&1
else
pushd ${BUILDDIR}${BLFS_ROOT}/${BLFS_XML} 1> /dev/null
svn up >>$LOGDIR/$LOG 2>&1