r3757 - in jhalfs/trunk: . common/libs optimize

pierre at higgs.linuxfromscratch.org pierre at higgs.linuxfromscratch.org
Sat Nov 16 14:35:25 PST 2013


Author: pierre
Date: Sat Nov 16 14:35:25 2013
New Revision: 3757

Log:
- Make the number of parallel jobs configurable in the menuconfig interface
- Allow choosing a working copy of the blfs book

Modified:
   jhalfs/trunk/Config.in
   jhalfs/trunk/common/libs/func_install_blfs
   jhalfs/trunk/common/libs/func_validate_configs.sh
   jhalfs/trunk/jhalfs
   jhalfs/trunk/optimize/opt_config
   jhalfs/trunk/optimize/opt_override

Modified: jhalfs/trunk/Config.in
==============================================================================
--- jhalfs/trunk/Config.in	Sat Nov 16 02:00:16 2013	(r3756)
+++ jhalfs/trunk/Config.in	Sat Nov 16 14:35:25 2013	(r3757)
@@ -21,9 +21,6 @@
 
 #		config	BOOK_HLFS
 #			bool "Hardened Linux From Scratch"
-
-#		config	BOOK_BLFS
-#			bool "Beyond Linux From Scratch"
 	endchoice
 
 	config	PROGNAME
@@ -33,12 +30,10 @@
 		default	"clfs2"		if BOOK_CLFS2
 		default	"clfs3"		if BOOK_CLFS3
 		default	"hlfs"		if BOOK_HLFS
-#		default	"blfs"		if BOOK_BLFS
 
 	config	RUN_ME
 		string
-		default	"./jhalfs run"#	if !BOOK_BLFS
-#		default	"./blfs-tool"	if BOOK_BLFS
+		default	"./jhalfs run"
 	#--- End BOOK/script
 
 	#--- Book version
@@ -60,7 +55,6 @@
 
 		config	WORKING_COPY
 			bool	"Working Copy"
-#			depends on !BOOK_BLFS
 			help
 				#-- A local working copy
 
@@ -428,79 +422,10 @@
 		default	"2.6"		if KERNEL_26
 		default	"2.4"		if KERNEL_24
 
-#         menu	"HLFS Additional Features"
-# 		depends on BOOK_HLFS
-#
-# 		config	SET_SSP
-# 		bool	"Stack-smashing protector"
-# 		default	y
-#
-# 		config	SET_ASLR
-# 		bool	"Address-space layout randomization"
-# 		default	y
-#
-# 		config	SET_PAX
-# 		bool	"PaX-aware ELF executables and kernel"
-# 		default	y
-#
-# 		config	SET_HARDENED_TMP
-# 		bool	"Hardened temporary files creation"
-# 		default	y
-#
-# 		config	SET_WARNINGS
-# 		bool	"Additional warnings"
-# 		default	y
-#
-# 		config	SET_MISC
-# 		bool	"Miscellaneous features"
-# 		default	y
-#
-# 		config	SET_BLOWFISH
-# 		bool	"Blowfish passwords"
-# 		default	y
-# 	endmenu
-
-	config	SSP
-#		depends on SET_SSP
-		string
-		default ",ssp,"
-
-	config	ASLR
-#		depends on SET_ASLR
-		string
-		default ",aslr,"
-
-	config	PAX
-#		depends on SET_PAX
-		string
-		default ",pax,"
-
-	config	HARDENED_TMP
-#		depends on SET_HARDENED_TMP
-		string
-		default ",hardened_tmp,"
-
-	config	WARNINGS
-#		depends on SET_WARNINGS
-		string
-		default ",warnings,"
-
-	config	MISC
-#		depends on SET_MISC
-		string
-		default ",misc,"
-
-	config	BLOWFISH
-#		depends on SET_BLOWFISH
-		string
-		default ",blowfish,"
-	#--- End HLFS specific params
-
 	#--- Custom Tools support
 	config CUSTOM_TOOLS
 		bool	"Add custom tools support"
 		default	n
-#		depends on !BOOK_BLFS
 		help
 			#--- Activating this option additional packages you create
 			#    will be installed after finished the xLFS system build.
@@ -511,7 +436,6 @@
 	config BLFS_TOOL
 		bool	"Add blfs-tool support"
 		default	n
-#		depends on !BOOK_BLFS && !BOOK_CLFS3
 		depends on !BOOK_CLFS3
 		help
 			#--- Activating this option will install additional
@@ -541,12 +465,24 @@
 			help
 				#-- Current development version as in trunk
 
+		config	BLFS_WORKING_COPY
+			bool	"BLFS working copy"
+			help
+				#-- A local working copy of the BLFS book.
+
 		config	BLFS_BRANCH
 			bool	"BLFS Branch or stable book"
 			help
 				#-- A supported SVN branch or stable book release
 	endchoice
 
+	config	BLFS_WC_LOCATION
+		string	"Location of the local BLFS working copy (mandatory)"
+		default	"**EDIT ME**"
+		depends on BLFS_WORKING_COPY
+		help
+			#-- Full path to the BLFS book working copy"
+
 	config	BLFS_BRANCH_ID
 		string	"BLFS Book Version (mandatory)"
 		default	"**EDIT ME**"
@@ -628,9 +564,7 @@
 	#--- BLFS specific params
 	config	BLFS_ROOT
 		string "Directory root"
-#		default "$HOME/blfs_root" if BOOK_BLFS
-		default "/blfs_root" if BLFS_TOOL
-#		depends on BOOK_BLFS || BLFS_TOOL
+		default "/blfs_root"
 		depends on BLFS_TOOL
 		help
 			#-- Full path to the directory where all required
@@ -639,7 +573,6 @@
 	config	BLFS_XML
 		string "BLFS sources directory"
 		default "blfs-xml"
-#		depends on BOOK_BLFS || BLFS_TOOL
 		depends BLFS_TOOL
 		help
 			#-- The directory name under $BLFS_ROOT where the BLFS
@@ -648,7 +581,6 @@
 	config	TRACKING_DIR
 		string "Installed packages database directory"
 		default "/var/lib/jhalfs/BLFS"
-#		depends on BOOK_BLFS || BLFS_TOOL || CUSTOM_TOOLS
 		depends on BLFS_TOOL || CUSTOM_TOOLS
 		help
 			#-- Full path to the directory where the database of
@@ -670,7 +602,6 @@
 endmenu
 
 menu "--- General Settings"
-#	depends on !BOOK_BLFS
 
 	#--- Set User Account
 	config	CONFIG_USER
@@ -816,7 +747,6 @@
 endmenu
 
 menu "--- Build Settings"
-#	depends on !BOOK_BLFS
 
 	#--- Test Suites
 	config	CONFIG_TESTS
@@ -1021,7 +951,6 @@
 endmenu
 
 menu "--- Advanced Features"
-#	depends on !BOOK_BLFS
 
 	config	REPORT
 		bool "Create SBU and disk usage report"
@@ -1071,23 +1000,29 @@
 	#--- Optimizations
 if !BOOK_CLFS2 && !BOOK_CLFS3
 	config	CONFIG_OPTIMIZE
-		bool	"Use optimization (see help)"
+		bool	"Optimization and parallelization"
 		default	n
 		help
-			#-- Actual optimization flags MUST be defined in ./optimize/*
-			#   files before activating this option.
-			#
-			# WARNING: The use of build optimizations may be dangerous.
-			#   You should know what you are doing and be sure that the
-			#   optimization settings listed below are what you want.
-			#   It there are build issues or the system doesn't work as
-			#   expected, please rebuild without optimizations before
-			#   asking for support.
+			#   Opens a menu for various optimization settings:
+			#   Actual optimization flags MUST be defined in ./optimize/*
+			#   before activating this option.
+			#
+			# WARNING: The use of build optimizations may lead to build issues.
+			#   If the system doesn't work as expected, please rebuild
+			#   without optimizations before asking for support.
+	menu	"Optimization settings"
+		depends on CONFIG_OPTIMIZE
+
+	config	N_PARALLEL
+		int "Number of parallel `make' jobs"
+		default 1
+		help
+			#-- The usual recommandation is (number of CPU cores)+1
+			#   Do not set for meaningful SBU calculations.
 
 	choice
 		prompt "Optimization level "
 		default OPT_1
-		depends	CONFIG_OPTIMIZE
 		help
 			#-- Optimization values are set in optimize/* files
 
@@ -1100,7 +1035,7 @@
 		config	OPT_3
 			bool	"Cross tools (only MAKEFLAGS), temp tools and final system" if BOOK_CLFS
 	endchoice
-
+endmenu
 	config	OPTIMIZE
 		int
 		default	"0"	if !CONFIG_OPTIMIZE
@@ -1111,7 +1046,7 @@
 	#--- End Optimizations
 
 	#-- Internal Settings
-	menu "--- Internal Settings (WARNING: for jhalfs developers only)"
+	menu "Internal Settings (WARNING: for jhalfs developers only)"
 
 		config	SCRIPT_ROOT
 			string	"Scripts root"
@@ -1174,7 +1109,6 @@
 config REBUILD_MAKEFILE
 	bool "Rebuild the Makefile (see help)"
 	default n
-#	depends on !BOOK_BLFS
 	help
 		#-- Rebuild the Makefile
 		#

Modified: jhalfs/trunk/common/libs/func_install_blfs
==============================================================================
--- jhalfs/trunk/common/libs/func_install_blfs	Sat Nov 16 02:00:16 2013	(r3756)
+++ jhalfs/trunk/common/libs/func_install_blfs	Sat Nov 16 14:35:25 2013	(r3757)
@@ -26,7 +26,12 @@
 sed -i s at trunk/BOOK@$BLFS_TREE@ \
     ${BUILDDIR}${BLFS_ROOT}/Makefile
 
-# Downloads the book, initialize the tracking file and the package database
+# If we have a working copy, copy it:
+if [[ "$BLFS_WORKING_COPY" = "y" ]]; then
+  cp -r $BLFS_WC_LOCATION ${BUILDDIR}${BLFS_ROOT}/blfs-xml
+fi
+# Downloads the book if necessary, initialize the tracking file and the
+# package database.
 # sudo is needed if $BUILDDIR/var/lib is owned by root and /var/lib/jhalfs
 # has to be created
 sudo make -j1 -C $BUILDDIR$BLFS_ROOT TRACKING_DIR=$BUILDDIR$TRACKING_DIR \

Modified: jhalfs/trunk/common/libs/func_validate_configs.sh
==============================================================================
--- jhalfs/trunk/common/libs/func_validate_configs.sh	Sat Nov 16 02:00:16 2013	(r3756)
+++ jhalfs/trunk/common/libs/func_validate_configs.sh	Sat Nov 16 14:35:25 2013	(r3757)
@@ -53,13 +53,13 @@
   local -r  clfs_PARAM_LIST="$CLFS_book  $GENERAL_common $CLFS_build  $ADVANCED_chroot $ADVANCED_common"
   local -r clfs2_PARAM_LIST="$CLFS2_book $GENERAL_common $CLFS2_build                  $ADVANCED_common"
   local -r clfs3_PARAM_LIST="$CLFS3_book $GENERAL_common $CLFS3_build                  $ADVANCED_common"
-  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"
 
-  # Additional variables (add DEP_DBXSL when required again)
-  local -r blfs_tool_PARAM_LIST="BLFS_BRANCH_ID BLFS_ROOT BLFS_XML TRACKING_DIR \
-                                 DEP_LIBXML DEP_LIBXSLT DEP_TIDY \
-                                 DEP_DBXML DEP_LYNX DEP_SUDO DEP_WGET \
-                                 DEP_SVN DEP_GPM DEP_OPENSSL DEP_PYTHON"
+  # Additional variables
+  local -r blfs_tool_PARAM_LIST="\
+     BLFS_TREE BLFS_BRANCH_ID BLFS_ROOT BLFS_XML TRACKING_DIR \
+     DEP_LIBXML DEP_LIBXSLT DEP_TIDY DEP_DBXML DEP_LYNX DEP_SUDO DEP_WGET \
+     DEP_SVN DEP_GPM DEP_OPENSSL DEP_PYTHON"
   local -r custom_tool_PARAM_LIST="TRACKING_DIR"
 
   # Internal variables
@@ -184,10 +184,6 @@
                echo
                ;;
 
-      # BLFS params.
-      BRANCH_ID | BLFS_ROOT | BLFS_XML )  echo "`eval echo $PARAM_VALS`" ;;
-      TRACKING_DIR ) validate_dir -z -d -w ;;
-
       # Display non-validated envars found in ${PROGNAME}_PARAM_LIST
       * ) echo -e "`eval echo $PARAM_VALS`" ;;
 

Modified: jhalfs/trunk/jhalfs
==============================================================================
--- jhalfs/trunk/jhalfs	Sat Nov 16 02:00:16 2013	(r3756)
+++ jhalfs/trunk/jhalfs	Sat Nov 16 14:35:25 2013	(r3757)
@@ -200,7 +200,6 @@
 
 #--- Envars not sourced from configuration
 case $PROGNAME in
-# TODO: clfs is now on git
       clfs ) declare -r GIT="git://git.cross-lfs.org/cross-lfs" ;;
       clfs2 ) declare -r GIT="git://git.cross-lfs.org/clfs-sysroot" ;;
       clfs3 ) declare -r GIT="git://git.cross-lfs.org/clfs-embedded" ;;
@@ -251,15 +250,35 @@
 # blfs-tool envars
 BLFS_TOOL=${BLFS_TOOL:-n}
 if [[ "${BLFS_TOOL}" = "y" ]] ; then
-  BLFS_BRANCH_ID=${BLFS_BRANCH_ID:=development}
-  case $BLFS_BRANCH_ID in
-    development )  BLFS_TREE=trunk/BOOK ;;
-         *EDIT* )  echo " You forgot to set the BLFS branch or stable book version."
-                   echo " Please rerun make and fix the configuration."
-                   exit 2 ;;
-       branch-* )  BLFS_TREE=branches/${BLFS_BRANCH_ID#branch-} ;;
-              * )  BLFS_TREE=tags/${BLFS_BRANCH_ID} ;;
-  esac
+  BLFS_SVN=${BLFS_SVN:-n}
+  BLFS_WORKING_COPY=${BLFS_WORKING_COPY:-n}
+  BLFS_BRANCH=${BLFS_BRANCH:-n}
+  if [[ "${BLFS_SVN}" = "y" ]]; then
+    BLFS_BRANCH_ID=development
+    BLFS_TREE=trunk/BOOK
+  elif [[ "${BLFS_WORKING_COPY}" = "y" ]]; then
+    [[ -d "$BLFS_WC_LOCATION" ]] &&
+    [[ -d "$BLFS_WC_LOCATION/postlfs" ]] || {
+      echo " BLFS tools: This is not a working copy: $BLFS_WC_LOCATION."
+      echo " Please rerun make and fix the configuration."
+      exit 2
+      }
+    BLFS_TREE=$(cd $BLFS_WC_LOCATION; svn info | grep URL | sed 's at .*BLFS/@@')
+    BLFS_BRANCH_ID=$(echo $BLFS_TREE | sed -e 's at trunk/BOOK at development@' \
+                                           -e 's at branches/@branch-@' \
+                                           -e 's at tags/@@' \
+                                           -e 's@/BOOK@@')
+  elif [["${BLFS_BRANCH}" = "y" ]] ; then
+    case $BLFS_BRANCH_ID in
+           *EDIT* )  echo " You forgot to set the BLFS branch or stable book version."
+                     echo " Please rerun make and fix the configuration."
+                     exit 2 ;;
+   branch-systemd )  BLFS_TREE=branches/systemd ;;
+         branch-* )  BLFS_TREE=branches/${BLFS_BRANCH_ID#branch-}/BOOK ;;
+      6.2* | 7.4* )  BLFS_TREE=tags/${BLFS_BRANCH_ID} ;;
+                * )  BLFS_TREE=tags/${BLFS_BRANCH_ID}/BOOK ;;
+    esac
+  fi
   [[ $VERBOSITY > 0 ]] && echo -n "Loading blfs tools installation function..."
   source $COMMON_DIR/libs/func_install_blfs
   [[ $? > 0 ]] && echo "function module did not load.." && exit 1
@@ -302,6 +321,8 @@
   source optimize/opt_config
   [[ $? > 0 ]] && echo " optimize/opt_config did not load.." && exit
   [[ $VERBOSITY > 0 ]] && echo "OK"
+  # The number of parallel jobs is taken from configuration now
+  MAKEFLAGS="-j${N_PARALLEL}"
   # Validate optimize settings, if required
   validate_opt_settings
 fi

Modified: jhalfs/trunk/optimize/opt_config
==============================================================================
--- jhalfs/trunk/optimize/opt_config	Sat Nov 16 02:00:16 2013	(r3756)
+++ jhalfs/trunk/optimize/opt_config	Sat Nov 16 14:35:25 2013	(r3757)
@@ -7,15 +7,8 @@
 #$Id$
 #
 
-#--- Extra flags passed to the packages make commands
-#    "unset" will cause the variable to be not set
-#    instead of just set to null.
-MAKEFLAGS="-j3"
-
-#--- List of packages that have issues with jobs control.
+#--- List of packages that have issues with parallelization.
 #    This list may be different for you.
-#    If your MAKEFLAGS don't contains a -jX option, you can set
-#    a empty list here.
 BLACK_LIST="attr autoconf coreutils dejagnu gettext gperf groff man-db vim"
 #    Rationale for attr, coreutils, gperf: the tests do not pass with -jX
 #    CLFS packages

Modified: jhalfs/trunk/optimize/opt_override
==============================================================================
--- jhalfs/trunk/optimize/opt_override	Sat Nov 16 02:00:16 2013	(r3756)
+++ jhalfs/trunk/optimize/opt_override	Sat Nov 16 14:35:25 2013	(r3757)
@@ -1,5 +1,3 @@
-binutils       noOpt
 gcc            noOpt
-glibc          noOpt
 grub           noOpt
 zlib           defOpt_fPIC



More information about the alfs-log mailing list