From cd4466fbd96028cd40950d3f32a6046d5c608c6d Mon Sep 17 00:00:00 2001 From: Manuel Canales Esparcia Date: Mon, 11 Dec 2006 18:21:16 +0000 Subject: [PATCH] Added BLFS_TOOL support to CLFS2 and some bug fixes. --- CLFS2/master.sh | 23 ++++++++++++++++----- Config.in | 4 ++-- README | 6 ++++++ common/libs/func_blfs_deps | 30 +++++++++++++++++++++++----- common/libs/func_validate_configs.sh | 2 +- common/makefile-functions | 3 +-- 6 files changed, 53 insertions(+), 15 deletions(-) diff --git a/CLFS2/master.sh b/CLFS2/master.sh index 0d7af1c..72c92de 100644 --- a/CLFS2/master.sh +++ b/CLFS2/master.sh @@ -408,6 +408,9 @@ build_Makefile() { # Construct a Makefile from the book scripts final_system_Makefiles # $basicsystem bootscripts_Makefiles # $bootscripttools 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 # to the top of the real Makefile. @@ -418,7 +421,8 @@ build_Makefile() { # Construct a Makefile from the book scripts ( 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 @\$(call echo_finished,$VERSION) @@ -441,18 +445,27 @@ mk_LUSER: mk_SETUP @sudo make restore-luser-env @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: @echo "$VERSION-sysroot - jhalfs build" > clfs-release && \\ sudo mv clfs-release \$(MOUNT_PT)/etc @sudo make SHELL=/bin/bash ROOT @touch \$@ -SETUP: $host_prep -LUSER: $cross_tools $basicsystem $bootscripttools $bootable -ROOT: $chowning +SETUP: $host_prep +LUSER: $cross_tools $basicsystem $bootscripttools $bootable +BLFS_TOOL: $blfs_tool +ROOT: $chowning -create-sbu_du-report: ROOT +create-sbu_du-report: mk_LUSER @\$(call echo_message, Building) @if [ "\$(ADD_REPORT)" = "y" ]; then \\ ./create-sbu_du-report.sh logs $VERSION; \\ diff --git a/Config.in b/Config.in index 79d5691..fcf16f1 100644 --- a/Config.in +++ b/Config.in @@ -329,7 +329,7 @@ menu "--- BOOK Settings" config BLFS_TOOL bool "Add blfs-tool support" default n - depends on !BOOK_BLFS && !BOOK_CLFS2 && !BOOK_CLFS3 + depends on !BOOK_BLFS && !BOOK_CLFS3 help #--- Activating this option additional packages needed to # use blfs-tool will be installed. @@ -338,7 +338,7 @@ menu "--- BOOK Settings" # $BUILD_DIR/blfs_root. # 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 and files owner, before start # using blfs-tool. diff --git a/README b/README index 4efb9ad..9d10203 100644 --- a/README +++ b/README @@ -86,6 +86,12 @@ $Id$ builds you may need to adjust that scripts, that are found into the 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 blfs-tool installation: diff --git a/common/libs/func_blfs_deps b/common/libs/func_blfs_deps index b82b9b6..922cd7e 100644 --- a/common/libs/func_blfs_deps +++ b/common/libs/func_blfs_deps @@ -144,17 +144,33 @@ wrt_blfs_tool_targets() { # # # 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" + 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 # 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. - 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. - [[ ! "$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. case $name in @@ -162,7 +178,11 @@ wrt_blfs_tool_targets() { # unzip ) pkg_ver=unzip-5.52 ;; * ) pkg_ver=$(echo $pkg_tarball | sed -e 's/.tar.*//;s/.tgz//;s/.zip//') ;; 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 # if it's already been made. diff --git a/common/libs/func_validate_configs.sh b/common/libs/func_validate_configs.sh index 02385ed..a375ef6 100644 --- a/common/libs/func_validate_configs.sh +++ b/common/libs/func_validate_configs.sh @@ -22,7 +22,7 @@ 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 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 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 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" diff --git a/common/makefile-functions b/common/makefile-functions index 5783cc9..9a098a5 100644 --- a/common/makefile-functions +++ b/common/makefile-functions @@ -10,7 +10,6 @@ WHITE = "" YELLOW = "" OFF = "" -BOLD = "" REVERSE = "" tab_ = " " @@ -140,7 +139,7 @@ define echo_report @echo; \ echo $(BOLD) The report file $(BLUE)$(1)$(BOLD) has been created; \ 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; \ echo That will help us to keep more accurate SBU and; \