diff --git a/LFS/master.sh b/LFS/master.sh index d28b5cb..8402fc1 100644 --- a/LFS/master.sh +++ b/LFS/master.sh @@ -302,6 +302,17 @@ build_Makefile() { # i=`expr $i + 1` done + # If CPUSET is defined and not equal to "all", then we define a first target + # that calls a script which re-enters make calling target all + if [ -n "$CPUSET" ] && [ "$CPUSET" != all ]; then +( + cat << EOF + +all-with-cpuset: + @CPUSPEC="\$(CPUSET)" ./run-in-cgroup \$(MAKE) all +EOF +) >> $MKFILE + fi # Drop in the main target 'all:' and the chapter targets with each sub-target # as a dependency. Also prevent running targets in parallel. ( diff --git a/common/libs/func_wrt_Makefile b/common/libs/func_wrt_Makefile index 78bb3e1..c694e76 100644 --- a/common/libs/func_wrt_Makefile +++ b/common/libs/func_wrt_Makefile @@ -44,6 +44,7 @@ ADD_CUSTOM_TOOLS = $CUSTOM_TOOLS ADD_BLFS_TOOLS = $BLFS_TOOL PKGMNGT = $PKGMNGT WRAP_INSTALL = $WRAP_INSTALL +CPUSET = $CPUSET export PATH := \${PATH}:/usr/sbin diff --git a/jhalfs b/jhalfs index fe2c30c..9f2518c 100755 --- a/jhalfs +++ b/jhalfs @@ -323,7 +323,7 @@ if [[ "$REBUILD_MAKEFILE" = "n" ]] ; then true >"$LOGDIR/$LOG" # Copy common helper files - cp "$COMMON_DIR"/{makefile-functions,progress_bar.sh} "$JHALFSDIR/" + cp "$COMMON_DIR"/{makefile-functions,progress_bar.sh,run-in-cgroup.sh} "$JHALFSDIR/" # Copy needed stylesheets cp "$COMMON_DIR"/{packages.xsl,chroot.xsl,kernfs.xsl} "$JHALFSDIR/"