r2576 - in jhalfs/trunk: . CLFS HLFS LFS common

manuel at linuxfromscratch.org manuel at linuxfromscratch.org
Wed Apr 26 12:59:20 PDT 2006


Author: manuel
Date: 2006-04-26 13:59:19 -0600 (Wed, 26 Apr 2006)
New Revision: 2576

Modified:
   jhalfs/trunk/CLFS/master.sh
   jhalfs/trunk/HLFS/master.sh
   jhalfs/trunk/LFS/master.sh
   jhalfs/trunk/common/common-functions
   jhalfs/trunk/common/config
   jhalfs/trunk/common/func_validate_configs.sh
   jhalfs/trunk/common/makefile-functions
   jhalfs/trunk/master.sh
Log:
Create SBU and disk usage report by default.

Modified: jhalfs/trunk/CLFS/master.sh
===================================================================
--- jhalfs/trunk/CLFS/master.sh	2006-04-25 20:29:58 UTC (rev 2575)
+++ jhalfs/trunk/CLFS/master.sh	2006-04-26 19:59:19 UTC (rev 2576)
@@ -784,6 +784,9 @@
 
   done
 
+  # Add SBU-disk_usage report target if required
+  if [[ "$REPORT" = "1" ]] ; then wrt_report ; fi
+
 }
 
 
@@ -861,6 +864,9 @@
 
   done
 
+  # Add SBU-disk_usage report target if required
+  if [[ "$REPORT" = "1" ]] ; then wrt_report ; fi
+
 }
 
 

Modified: jhalfs/trunk/HLFS/master.sh
===================================================================
--- jhalfs/trunk/HLFS/master.sh	2006-04-25 20:29:58 UTC (rev 2575)
+++ jhalfs/trunk/HLFS/master.sh	2006-04-26 19:59:19 UTC (rev 2576)
@@ -498,6 +498,9 @@
     # Keep the script file name for Makefile dependencies.
     PREV=$this_script
   done  # for file in chapter07/*
+
+  # Add SBU-disk_usage report target if required
+  if [[ "$REPORT" = "1" ]] ; then wrt_report ; fi
 }
 
 

Modified: jhalfs/trunk/LFS/master.sh
===================================================================
--- jhalfs/trunk/LFS/master.sh	2006-04-25 20:29:58 UTC (rev 2575)
+++ jhalfs/trunk/LFS/master.sh	2006-04-26 19:59:19 UTC (rev 2576)
@@ -287,6 +287,9 @@
     # Keep the script file name for Makefile dependencies.
     PREV=${this_script}
   done  # for file in chapter0{7,8,9}/*
+
+  # Add SBU-disk_usage report target if required
+  if [[ "$REPORT" = "1" ]] ; then wrt_report ; fi
 }
 
 

Modified: jhalfs/trunk/common/common-functions
===================================================================
--- jhalfs/trunk/common/common-functions	2006-04-25 20:29:58 UTC (rev 2575)
+++ jhalfs/trunk/common/common-functions	2006-04-26 19:59:19 UTC (rev 2576)
@@ -390,6 +390,24 @@
 }
 
 
+#----------------------------------#
+wrt_report() {         #
+#----------------------------------#
+(
+cat << EOF
+
+create-sbu_du-report:  $PREV
+	@\$(call echo_message, Building)
+	@./create-sbu_du-report.sh logs $VERSION $TEST
+	@\$(call echo_report,$VERSION-SBU_DU-$(date --iso-8601).report)
+	@touch  \$@
+EOF
+) >> $MKFILE.tmp
+
+chapter789="$chapter789 create-sbu_du-report"
+}
+
+
 #----------------------------#
 run_make() {
 #----------------------------#

Modified: jhalfs/trunk/common/config
===================================================================
--- jhalfs/trunk/common/config	2006-04-25 20:29:58 UTC (rev 2575)
+++ jhalfs/trunk/common/config	2006-04-26 19:59:19 UTC (rev 2576)
@@ -36,6 +36,10 @@
 #      (in CLFS, alias to 2)
 TEST=1
 
+# Create SBU and disk usage report  0(no)/1(yes)
+# NOTE: requires to have bc installed on the host
+REPORT=1
+
 #--- Run the stripping phases  0(no)/1(yes)
 STRIP=1
 

Modified: jhalfs/trunk/common/func_validate_configs.sh
===================================================================
--- jhalfs/trunk/common/func_validate_configs.sh	2006-04-25 20:29:58 UTC (rev 2575)
+++ jhalfs/trunk/common/func_validate_configs.sh	2006-04-26 19:59:19 UTC (rev 2576)
@@ -83,10 +83,10 @@
 inline_doc
 
   # First internal variables, then the ones that change the book's flavour, and lastly system configuration variables
-  local -r blfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE HPKG          DEPEND               TEST"
-  local -r hlfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE HPKG RUNMAKE MODEL GRSECURITY_HOST TEST STRIP FSTAB             CONFIG KEYMAP         PAGE TIMEZONE LANG LC_ALL"
-  local -r clfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE HPKG RUNMAKE METHOD  ARCH  TARGET  TEST STRIP FSTAB BOOT_CONFIG CONFIG KEYMAP VIMLANG PAGE TIMEZONE LANG"
-  local -r  lfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE HPKG RUNMAKE                       TEST STRIP FSTAB             CONFIG        VIMLANG PAGE TIMEZONE LANG"
+  local -r blfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE HPKG         DEPEND                TEST"
+  local -r hlfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE HPKG RUNMAKE MODEL GRSECURITY_HOST TEST REPORT STRIP FSTAB             CONFIG KEYMAP         PAGE TIMEZONE LANG LC_ALL"
+  local -r clfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE HPKG RUNMAKE METHOD  ARCH  TARGET  TEST REPORT STRIP FSTAB BOOT_CONFIG CONFIG KEYMAP VIMLANG PAGE TIMEZONE LANG"
+  local -r  lfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE HPKG RUNMAKE                       TEST REPORT STRIP FSTAB             CONFIG        VIMLANG PAGE TIMEZONE LANG"
 
   local -r ERROR_MSG_pt1='The variable \"${L_arrow}${config_param}${R_arrow}\" value ${L_arrow}${BOLD}${!config_param}${R_arrow} is invalid,'
   local -r ERROR_MSG_pt2=' check the config file ${BOLD}${GREEN}\<$(echo $PROGNAME | tr [a-z] [A-Z])/config\> or \<common/config\>${OFF}'
@@ -131,6 +131,15 @@
         HPKG)      validation_str="x0x x1x";          validate_str; continue ;;
         RUNMAKE)   validation_str="x0x x1x";          validate_str; continue ;;
         TEST)      validation_str="x0x x1x x2x x3x";  validate_str; continue ;;
+        REPORT)    validation_str="x0x x1x";          validate_str;
+            if [[ "${!config_param}" = "1" ]] && [[ `type -p bc` ]]; then
+              continue
+            else
+              echo -e "  ${BOLD}The bc binary was not found${OFF}"
+              echo -e "  The SBU and disk usage report creation will be skiped"
+              REPORT=0
+              continue
+            fi ;;
         STRIP)     validation_str="x0x x1x";          validate_str; continue ;;
         VIMLANG)   validation_str="x0x x1x";          validate_str; continue ;;
         DEPEND)    validation_str="x0x x1x x2x";      validate_str; continue ;;

Modified: jhalfs/trunk/common/makefile-functions
===================================================================
--- jhalfs/trunk/common/makefile-functions	2006-04-25 20:29:58 UTC (rev 2575)
+++ jhalfs/trunk/common/makefile-functions	2006-04-26 19:59:19 UTC (rev 2576)
@@ -30,6 +30,17 @@
   tar -xvf `ls -t $(1) | head -n1` > /tmp/unpacked
 endef
 
+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 file to $(BOLD)manuel at linuxfromscratch.org$(WHITE)
+  @echo
+  @echo That will help us to keep more accurate SBU and
+  @echo disk usage values into the book. Thanks.
+endef
+
 define echo_finished
   @echo $(BOLD)
   @echo --------------------------------------------------------------------------------

Modified: jhalfs/trunk/master.sh
===================================================================
--- jhalfs/trunk/master.sh	2006-04-25 20:29:58 UTC (rev 2575)
+++ jhalfs/trunk/master.sh	2006-04-26 19:59:19 UTC (rev 2576)
@@ -460,6 +460,7 @@
       cp $FILES $JHALFSDIR/
     popd 1> /dev/null
   fi
+  [[ "$REPORT" = "1" ]] && cp $COMMON_DIR/create-sbu_du-report.sh  $JHALFSDIR/
   sed 's,FAKEDIR,'$BOOK',' $PACKAGE_DIR/$XSL > $JHALFSDIR/${XSL}
   export XSL=$JHALFSDIR/${XSL}
 fi




More information about the alfs-log mailing list