Added BLFS_TOOL support to CLFS2 and some bug fixes.

This commit is contained in:
Manuel Canales Esparcia 2006-12-11 18:21:16 +00:00
parent de22e8004a
commit cd4466fbd9
6 changed files with 53 additions and 15 deletions

View file

@ -408,6 +408,9 @@ build_Makefile() { # Construct a Makefile from the book scripts
final_system_Makefiles # $basicsystem final_system_Makefiles # $basicsystem
bootscripts_Makefiles # $bootscripttools bootscripts_Makefiles # $bootscripttools
bootable_Makefiles # $bootable bootable_Makefiles # $bootable
# Add the BLFS_TOOL targets, if needed. Clean PREV to prevent that
# the first dependency script will depend on *-chowning
[[ "$BLFS_TOOL" = "y" ]] && PREV="" && wrt_blfs_tool_targets
# Add a header, some variables and include the function file # Add a header, some variables and include the function file
# to the top of the real Makefile. # to the top of the real Makefile.
@ -418,7 +421,8 @@ build_Makefile() { # Construct a Makefile from the book scripts
( (
cat << EOF cat << EOF
all: ck_UID mk_SETUP mk_LUSER mk_ROOT create-sbu_du-report all: ck_UID mk_SETUP mk_LUSER create-sbu_du-report mk_BLFS_TOOL mk_ROOT
@sudo make restore-luser-env
@sudo make do-housekeeping @sudo make do-housekeeping
@\$(call echo_finished,$VERSION) @\$(call echo_finished,$VERSION)
@ -441,18 +445,27 @@ mk_LUSER: mk_SETUP
@sudo make restore-luser-env @sudo make restore-luser-env
@touch \$@ @touch \$@
mk_BLFS_TOOL: create-sbu_du-report
@\$(call echo_PHASE,Building BLFS-TOOLS)
@if [ "\$(ADD_BLFS_TOOLS)" = "y" ]; then \\
(sudo \$(SU_LUSER) "mkdir -p $BUILDDIR$TRACKING_DIR"); \\
(sudo \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make SHELL=/bin/bash BLFS_TOOL"); \\
fi;
@touch \$@
mk_ROOT: mk_ROOT:
@echo "$VERSION-sysroot - jhalfs build" > clfs-release && \\ @echo "$VERSION-sysroot - jhalfs build" > clfs-release && \\
sudo mv clfs-release \$(MOUNT_PT)/etc sudo mv clfs-release \$(MOUNT_PT)/etc
@sudo make SHELL=/bin/bash ROOT @sudo make SHELL=/bin/bash ROOT
@touch \$@ @touch \$@
SETUP: $host_prep SETUP: $host_prep
LUSER: $cross_tools $basicsystem $bootscripttools $bootable LUSER: $cross_tools $basicsystem $bootscripttools $bootable
ROOT: $chowning BLFS_TOOL: $blfs_tool
ROOT: $chowning
create-sbu_du-report: ROOT create-sbu_du-report: mk_LUSER
@\$(call echo_message, Building) @\$(call echo_message, Building)
@if [ "\$(ADD_REPORT)" = "y" ]; then \\ @if [ "\$(ADD_REPORT)" = "y" ]; then \\
./create-sbu_du-report.sh logs $VERSION; \\ ./create-sbu_du-report.sh logs $VERSION; \\

View file

@ -329,7 +329,7 @@ menu "--- BOOK Settings"
config BLFS_TOOL config BLFS_TOOL
bool "Add blfs-tool support" bool "Add blfs-tool support"
default n default n
depends on !BOOK_BLFS && !BOOK_CLFS2 && !BOOK_CLFS3 depends on !BOOK_BLFS && !BOOK_CLFS3
help help
#--- Activating this option additional packages needed to #--- Activating this option additional packages needed to
# use blfs-tool will be installed. # use blfs-tool will be installed.
@ -338,7 +338,7 @@ menu "--- BOOK Settings"
# $BUILD_DIR/blfs_root. # $BUILD_DIR/blfs_root.
# After booting the new xLFS system you should to # After booting the new xLFS system you should to
# create an user account and move the blfs-root # create an user account and move the /blfs-root
# directory to the user's home, making he the # directory to the user's home, making he the
# directory and files owner, before start # directory and files owner, before start
# using blfs-tool. # using blfs-tool.

6
README
View file

@ -86,6 +86,12 @@ $Id$
builds you may need to adjust that scripts, that are found into the builds you may need to adjust that scripts, that are found into the
common/blfs-tool-deps directory in the jhalfs sources tree. common/blfs-tool-deps directory in the jhalfs sources tree.
WARNING:: If adding blfs-tool support on a CLFS Sysroot build
you MUST to edit the dependencies scripts to fix the
installation paths.
Be sure to make the adjust carefully or you will end
messing your host system.
After booting the new xLFS system some steps are needed to finish After booting the new xLFS system some steps are needed to finish
blfs-tool installation: blfs-tool installation:

View file

@ -144,17 +144,33 @@ wrt_blfs_tool_targets() { #
# #
# Drop in the name of the target on a new line, and the previous target # 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.
CHROOT_wrt_target "${this_script}" "$PREV" if [ "$PROGNAME" = "clfs2" ]; then
LUSER_wrt_target "${this_script}" "$PREV"
else
CHROOT_wrt_target "${this_script}" "$PREV"
fi
# Insert instructions for unpacking the package and changing directories # Insert instructions for unpacking the package and changing directories
# DocBook-XML is a zip, the build script will handle that. # DocBook-XML is a zip, the build script will handle that.
[[ ! "$name" = "docbook-xml" ]] && CHROOT_Unpack "$pkg_tarball" if [ "$PROGNAME" = "clfs2" ]; then
[[ ! "$name" = "docbook-xml" ]] && LUSER_wrt_unpack "$pkg_tarball"
else
[[ ! "$name" = "docbook-xml" ]] && CHROOT_Unpack "$pkg_tarball"
fi
# Run the script. # Run the script.
CHROOT_wrt_RunAsRoot "$file" if [ "$PROGNAME" = "clfs2" ]; then
LUSER_wrt_RunAsUser "${file}"
else
CHROOT_wrt_RunAsRoot "$file"
fi
# Remove the build directory(ies) except if the package build fails. # Remove the build directory(ies) except if the package build fails.
[[ ! "$name" = "docbook-xml" ]] && CHROOT_wrt_RemoveBuildDirs "$name" if [ "$PROGNAME" = "clfs2" ]; then
[[ ! "$name" = "docbook-xml" ]] && LUSER_RemoveBuildDirs "$name"
else
[[ ! "$name" = "docbook-xml" ]] && CHROOT_wrt_RemoveBuildDirs "$name"
fi
# Touch the tracking file. # Touch the tracking file.
case $name in case $name in
@ -162,7 +178,11 @@ wrt_blfs_tool_targets() { #
unzip ) pkg_ver=unzip-5.52 ;; unzip ) pkg_ver=unzip-5.52 ;;
* ) pkg_ver=$(echo $pkg_tarball | sed -e 's/.tar.*//;s/.tgz//;s/.zip//') ;; * ) pkg_ver=$(echo $pkg_tarball | sed -e 's/.tar.*//;s/.tgz//;s/.zip//') ;;
esac esac
echo "\$(tab_)@touch $TRACKING_DIR/$pkg_ver" >> $MKFILE.tmp if [ "$PROGNAME" = "clfs2" ]; then
echo -e "\t@touch \$(MOUNT_PT)$TRACKING_DIR/$pkg_ver" >> $MKFILE.tmp
else
echo -e "\t@touch $TRACKING_DIR/$pkg_ver" >> $MKFILE.tmp
fi
# Include a touch of the target name so make can check # Include a touch of the target name so make can check
# if it's already been made. # if it's already been made.

View file

@ -22,7 +22,7 @@ inline_doc
# First internal variables, then the ones that change the book's flavour, and lastly system configuration variables # 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 BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB CONFIG GETKERNEL PAGE TIMEZONE LANG LC_ALL LUSER LGROUP BLFS_TOOL REBUILD_MAKEFILE" 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 PAGE TIMEZONE LANG LC_ALL LUSER LGROUP BLFS_TOOL REBUILD_MAKEFILE"
local -r clfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE METHOD ARCH TARGET TARGET32 TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB BOOT_CONFIG CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG LUSER LGROUP BLFS_TOOL REBUILD_MAKEFILE" local -r clfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE METHOD ARCH TARGET TARGET32 TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB BOOT_CONFIG CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG LUSER LGROUP BLFS_TOOL REBUILD_MAKEFILE"
local -r clfs2_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE ARCH TARGET REPORT STRIP FSTAB CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG LUSER LGROUP REBUILD_MAKEFILE" local -r clfs2_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE ARCH TARGET REPORT STRIP FSTAB CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG LUSER LGROUP BLFS_TOOL REBUILD_MAKEFILE"
local -r clfs3_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE ARCH TARGET MIPS_LEVEL REPORT STRIP FSTAB CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG LUSER LGROUP REBUILD_MAKEFILE" local -r clfs3_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE ARCH TARGET MIPS_LEVEL REPORT STRIP FSTAB CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG LUSER LGROUP REBUILD_MAKEFILE"
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 CUSTOM_TOOLS REBUILD_MAKEFILE" 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 CUSTOM_TOOLS REBUILD_MAKEFILE"
local -r blfs_PARAM_LIST="BRANCH_ID BLFS_ROOT BLFS_XML TRACKING_DIR" local -r blfs_PARAM_LIST="BRANCH_ID BLFS_ROOT BLFS_XML TRACKING_DIR"

View file

@ -10,7 +10,6 @@ WHITE = ""
YELLOW = "" YELLOW = ""
OFF = "" OFF = ""
BOLD = ""
REVERSE = "" REVERSE = ""
tab_ = " " tab_ = " "
@ -140,7 +139,7 @@ define echo_report
@echo; \ @echo; \
echo $(BOLD) The report file $(BLUE)$(1)$(BOLD) has been created; \ echo $(BOLD) The report file $(BLUE)$(1)$(BOLD) has been created; \
echo; \ echo; \
echo ${WHITE}Please send the $(BOLD)$(MOUNT_PT)/jhalfs/$(1)$(WHITE); \ echo $(WHITE)Please send the $(BOLD)$(MOUNT_PT)/jhalfs/$(1)$(WHITE); \
echo file to $(BOLD)manuel@linuxfromscratch.org$(WHITE); \ echo file to $(BOLD)manuel@linuxfromscratch.org$(WHITE); \
echo; \ echo; \
echo That will help us to keep more accurate SBU and; \ echo That will help us to keep more accurate SBU and; \