From 95ebbb42b7eda5114e7ea751030916f9c9eaa5fb Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Mon, 11 Sep 2023 14:42:45 +0800 Subject: chroot: Set MAKEFLAGS and TESTSUITEFLAGS for parallelism --- chapter07/chroot.xml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/chapter07/chroot.xml b/chapter07/chroot.xml index b8de03dc2..a8cd5f878 100644 --- a/chapter07/chroot.xml +++ b/chapter07/chroot.xml @@ -23,8 +23,21 @@ TERM="$TERM" \ PS1='(lfs chroot) \u:\w\$ ' \ PATH=/usr/bin:/usr/sbin \ + MAKEFLAGS="-j$(nproc)" \ + TESTSUITEFLAGS="-j$(nproc)" \ /bin/bash --login + + Again, replace $(nproc) with the number + of logical cores you want to use for building packages in this chapter + and the following chapters if you don't want to use all available + logical cores. The test suites of some packages (notably Autoconf, + Libtool, and Tar) in &ch-final; are not affected by + MAKEFLAGS, they use a TESTSUITEFLAGS + environment variable instead. So we set it here as well for running + these test suites with multiple cores. + + The -i option given to the env command will clear all the variables in the chroot environment. After that, only the HOME, TERM, PS1, and -- cgit v1.2.3-54-g00ecf