diff options
author | Xi Ruoyao <xry111@xry111.site> | 2023-09-11 14:42:45 +0800 |
---|---|---|
committer | Xi Ruoyao <xry111@xry111.site> | 2023-09-13 17:34:38 +0800 |
commit | 83f9874e14ee09a36ada979ff72084c9b5c424e5 (patch) | |
tree | d1e4c0aa9b8af0ba40f4ae9617bcddc5bcef8c5d | |
parent | da122542429e5a6ec8b3cb4421ea3d590c7c0b6c (diff) |
chroot: Set MAKEFLAGS and TESTSUITEFLAGS for parallelism
-rw-r--r-- | chapter07/chroot.xml | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/chapter07/chroot.xml b/chapter07/chroot.xml index b8de03dc2..7a786686a 100644 --- a/chapter07/chroot.xml +++ b/chapter07/chroot.xml @@ -18,13 +18,26 @@ environment that is, at the moment, populated with nothing but temporary tools:</para> -<screen role="nodump"><userinput>chroot "$LFS" /usr/bin/env -i \ - HOME=/root \ - TERM="$TERM" \ - PS1='(lfs chroot) \u:\w\$ ' \ - PATH=/usr/bin:/usr/sbin \ +<screen role="nodump"><userinput>chroot "$LFS" /usr/bin/env -i \ + HOME=/root \ + TERM="$TERM" \ + PS1='(lfs chroot) \u:\w\$ ' \ + PATH=/usr/bin:/usr/sbin \ + MAKEFLAGS="-j<replaceable>$(nproc || echo 1)</replaceable>" \ + TESTSUITEFLAGS="-j<replaceable>$(nproc || echo 1)</replaceable>" \ /bin/bash --login</userinput></screen> + <para> + Again, replace <replaceable>$(nproc || 1)</replaceable> with the number + of logical cores you want to use for building packages in this chapter + and the following chapters if the <command>nproc</command> command is + not available on the host distro or you want to use a different number. + The test suites of some packages (notably Autoconf, Libtool, and Tar) + in &ch-final; are not affected by <envar>MAKEFLAGS</envar>, they use a + <envar>TESTSUITEFLAGS</envar> environment variable instead. So we set + it here as well for running the test suites with multiple cores. + </para> + <para>The <parameter>-i</parameter> option given to the <command>env</command> command will clear all the variables in the chroot environment. After that, only the <envar>HOME</envar>, <envar>TERM</envar>, <envar>PS1</envar>, and |