Create SBU and disk usage report by default.

This commit is contained in:
Manuel Canales Esparcia 2006-04-26 19:59:19 +00:00
parent 9ea3d54a4f
commit 453bef0e39
8 changed files with 59 additions and 4 deletions

View file

@ -784,6 +784,9 @@ bootable_Makefiles() { #
done done
# Add SBU-disk_usage report target if required
if [[ "$REPORT" = "1" ]] ; then wrt_report ; fi
} }
@ -861,6 +864,9 @@ bm_bootable_Makefiles() { #
done done
# Add SBU-disk_usage report target if required
if [[ "$REPORT" = "1" ]] ; then wrt_report ; fi
} }

View file

@ -498,6 +498,9 @@ EOF
# Keep the script file name for Makefile dependencies. # Keep the script file name for Makefile dependencies.
PREV=$this_script PREV=$this_script
done # for file in chapter07/* done # for file in chapter07/*
# Add SBU-disk_usage report target if required
if [[ "$REPORT" = "1" ]] ; then wrt_report ; fi
} }

View file

@ -287,6 +287,9 @@ chapter789_Makefiles() {
# Keep the script file name for Makefile dependencies. # Keep the script file name for Makefile dependencies.
PREV=${this_script} PREV=${this_script}
done # for file in chapter0{7,8,9}/* done # for file in chapter0{7,8,9}/*
# Add SBU-disk_usage report target if required
if [[ "$REPORT" = "1" ]] ; then wrt_report ; fi
} }

View file

@ -390,6 +390,24 @@ EOF
} }
#----------------------------------#
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() { run_make() {
#----------------------------# #----------------------------#

View file

@ -36,6 +36,10 @@ RUNMAKE=0
# (in CLFS, alias to 2) # (in CLFS, alias to 2)
TEST=1 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) #--- Run the stripping phases 0(no)/1(yes)
STRIP=1 STRIP=1

View file

@ -83,10 +83,10 @@ validate_config() { # Are the config values sane (within reason)
inline_doc 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 blfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE HPKG DEPEND TEST" 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 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 STRIP FSTAB BOOT_CONFIG CONFIG KEYMAP VIMLANG PAGE TIMEZONE LANG" 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 STRIP FSTAB CONFIG 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_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}' 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 @@ inline_doc
HPKG) validation_str="x0x x1x"; validate_str; continue ;; HPKG) validation_str="x0x x1x"; validate_str; continue ;;
RUNMAKE) 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 ;; 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 ;; STRIP) validation_str="x0x x1x"; validate_str; continue ;;
VIMLANG) validation_str="x0x x1x"; validate_str; continue ;; VIMLANG) validation_str="x0x x1x"; validate_str; continue ;;
DEPEND) validation_str="x0x x1x x2x"; validate_str; continue ;; DEPEND) validation_str="x0x x1x x2x"; validate_str; continue ;;

View file

@ -30,6 +30,17 @@ define unpack3
tar -xvf `ls -t $(1) | head -n1` > /tmp/unpacked tar -xvf `ls -t $(1) | head -n1` > /tmp/unpacked
endef 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@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 define echo_finished
@echo $(BOLD) @echo $(BOLD)
@echo -------------------------------------------------------------------------------- @echo --------------------------------------------------------------------------------

View file

@ -460,6 +460,7 @@ if [[ "$PWD" != "$JHALFSDIR" ]]; then
cp $FILES $JHALFSDIR/ cp $FILES $JHALFSDIR/
popd 1> /dev/null popd 1> /dev/null
fi fi
[[ "$REPORT" = "1" ]] && cp $COMMON_DIR/create-sbu_du-report.sh $JHALFSDIR/
sed 's,FAKEDIR,'$BOOK',' $PACKAGE_DIR/$XSL > $JHALFSDIR/${XSL} sed 's,FAKEDIR,'$BOOK',' $PACKAGE_DIR/$XSL > $JHALFSDIR/${XSL}
export XSL=$JHALFSDIR/${XSL} export XSL=$JHALFSDIR/${XSL}
fi fi