Now that MAKEFLAGS is defined at the beginning of the scriptlet,
there is no need to pass MAKEFLAGS as an envar to the scriptlet.
But still NINJAJOBS is not defined. In most cases, when we want
to use all cores, this is not a problem. But if N_PARALLEL is
defined, it needs to be passed. Note that we also pass
MAKEFLAGS in this case, because we use the old "wrt_xxx" function,
but it is not used.
Now that we have MAKEFLAGS in the environment, "make" in chroot
is run with MAKEFLAGS set. This cause it to pass the -j value
into MAKEFLAGS to inferiors (scriptlets), but it is passed with
a --jobserver-auth value added. If we do not precede the command
running the scriptlet with a +, it passes --jobserver-auth=-2,-2
meaning that the jobserver is disabled, and "make" in the scriptlet
understands that it should only run one job at a time (defeating
the value of the -j flag). But even if we do precede the command
running the scriptlet with a +, it passes --jobserver-auth=3,4,
which shows it is running, but this jobserver will authorize only
one job at a time since the parent make contains the target
.NOTPARALLEL!
To work around this problem, tje only solution is to change the
MAKEFLAGS at the beginning of the scriptlet. Fortunately, lfs.xsl
knows what we want as job number (either $(nproc) or a fixed number),
so use it to set MAKEFLAGS.
If using a new book, MAKEFLAGS is set to -j$(nproc), so that if
we want to easure timings with 4 processors and our computer has
more than that, we need to restrict the number of processors.
Jhalfs allows to do that using th cpuset cgroup controller, so that
it only restrits the make job and not the whole machine. For that
use a small scripts written by Xi Ruoyao that restarts make this
the cpuset set.
There is no more $(nproc || echo 1). Note that we may replace
it with $(nproc) if using all cores, so don't replace it in
the comment-test template (otherwise we have infinite recursion).
If the shell exits with an error, teardown is not run in target
chroot, which may lead to unwanted effects, such as preventing
unmounting the $BUILD_DIR. Tell make to ignore the error.
Now that devices.sh can be run even if the fs are already mounted
all the targets after mounting the virtual kernel fs can depend
on "devices". This way, if for some reason a partial build is
restarted after a reboot, the virtual kernel fs are automatically
re-mounted.
Fixes#1737
If the kernel-config file is not up to date (missing options or
whatever), the kernel "make" will hang, waiting for input. So
run "make oldconfig" explicitly, with a timeout.
Fixes: #1736
Instead of having them inside the Makefile, which implies editing
them (automatically), which is not robust if anything changes:
it got broken when a test for a mountpoint was added...
- update versions and instructions in packageManager.xml.pacman.
Also remove the pages for old books.
- Fix packInstall.sh.pacman, so that restarting after a failure
is possible
- Change LFS/lfs.xsl so that destdir install use symlinks for
/lib, /sbin, and /bin. Remove also absolete commands for old
books
- fix gcc script in book parser
LFS/lfs.xsl does not generate correct commands for stripping if
STRIP=n. LFS/master.sh had already been corrected to not run
stripping if STRIP=n, but only for the first pass. Do this for
all passes.
The recent addition of instructions for adding locales not
installed by make install-localedata has broken the generation
of the scriptlet, because there is a missing linefeed.
Use xsl:for-each to add a linefeed after each <userinput>
text.
The command for unmounting the kernel vfs is now
umount -Rv $LFS
So we have first to use that command in teardown (change in
kernfs.xsl). Second, since the command tries to umount
$LFS, but the Makefile is on $LFS, it fails. Ignore the
error in the Makefile (change in master.sh)
We count the number of files in lfs-commands to know whether
we have an old or a new book. But this shouldn't include the
custom-tools dir, so only count chapter*.
/var/run and /var/lock are created as symlinks in creatingdirs. But
if a package install something into those dirs (with DESTDIR install),
they get overwritten with true directories if using a package
manager. Note that without PM, anything installed into those dirs
is lost at next reboot. So remove those dirs before packaging.
- add createfiles instructions of packageManager.xml for new book too
- remove unneeded chown when installing pacman (not needed thanks to
the above)
- Use a dedicated user "builder" for running makepkg: user "tester" is
removed at the end of chapter 8, but is needed in following chapters.
We cannot use only the fact that it is not in chapter-temporary-tools
since now we have several chapter for the temporary system.
so use a list of chapters (non negated).
- major number can be on 4 digits, so use it in packInstall
- minor number (for package manager) can be greater than 10
- code on 2 digits
- change various files accordingly
- Prefer SysV over Sys V in Config.in
- do not generate the package list for lfs, it is not needed anymore
- prevent an (ignored) error in LFS/master.sh
- log new files under the scriptlet name (allows to log files for the same
package from different builds)
- keep the full name in log_new_file functions (fix a undetected bug in
CLFS/HLFS)