Commit graph

1413 commits

Author SHA1 Message Date
Pierre Labastie
a9360e10a7 Fix MAKEFLAGS for binutils-pass1
We need a special case for binutils-pass1 in case REALSBU is set
to y. Use variables JOBSBP1 in shell and jobs-bp1 in .xsl.
2023-11-17 15:55:36 +01:00
Pierre Labastie
da4bce358d Fix blfs tools Makefile now that MAKEFLAGS is set
Previously, the "update" target was just added to the end of
the "all" target prerequisites, so that it was run at the end.
But now, we enter make with some -j value in MAKEFLAGS, so that
the "update" target may well be run before the other targets, which
is wrong: for example if it is run before the "xxx-z-libxslt" target,
xsltproc is not found and the update target fails.
To fix, define "update" as the default target, and have it depend
on "all".
2023-11-17 13:59:06 +01:00
Pierre Labastie
d18fc24d5b blfs tools: update JOBS for the new config
Now, we have ALL_CORES set to y or n, and depending on this,
we want either JOBS to be set to $(nproc) or to the value
of N_PARALLEL.
2023-11-17 13:57:15 +01:00
Pierre Labastie
078ef3cf12 Pass sanitized MAKEFLAGS to scriptlets
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.
2023-11-17 13:18:12 +01:00
Pierre Labastie
249d4ade20 Fix (again) the run-in-cgroup.sh script
When using "sh  << EOF", what is between this line and EOF runs
with no attached terminal. But we need a terminal for running the
build. So we have to use "sh -c ". But then nesting of double
quotes, $, etc is too complicated. So run as root, and become back
user only when exec'ing. For some reason $@ does not work, so use
a variable set to $@.
2023-11-16 16:10:46 +01:00
Pierre Labastie
09ac7fc548 Typo
The name of the script is run-in-cgroup.sh, not run-in-cgroup ...
2023-11-16 16:10:07 +01:00
Pierre Labastie
cff36a77ba Fix session management in run-in-cgroup.sh
Still WIP but some progress...
When moving a shell to a cgroup not associated with a session,
then subsequent calls to pam_systemd or pam_elogind create
a new session, and a new cgroup for that session, so that the
cgroup of the calling process is not used (this is a problem
with both systemd and elogind). For systemd, the problem can be
solved by passing --slice <user slice> to systemd-run. For elogind,
we need to first move the shell to a non session cgroup, then run
sudo so that a new session is created, then pass the cpuset to that
session's cgroup. Hopefully, if neither systemd nor elgind is used,
then the former solution should work (to be tested!!!).
2023-11-16 14:37:58 +01:00
Pierre Labastie
8e9343b632 Add forgotten run-with-cgroup.sh script 2023-11-15 19:37:58 +01:00
Pierre Labastie
640cd5746b Fix a typo 2023-11-15 18:24:22 +01:00
Pierre Labastie
cacc6c5433 Allow users to pass a cpuset
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.
2023-11-15 18:24:22 +01:00
Pierre Labastie
63190e6547 Only pass MAKEFLAGS and NINJAJOBS to old books
Also pass them to binutils-pass1 if calculating the SBU
2023-11-15 18:24:22 +01:00
Pierre Labastie
3c43655ec6 Only replace $(nproc) in scriptlets
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).
2023-11-15 18:24:22 +01:00
Pierre Labastie
645ec4780e Reorganize advanced options in Config.in
- Put parallelization menu first
- Fix the logic for variable definitions in this menu
- change jhalfs to reflect the separation of optimization and
  parallelization
- validate new variables
- remove MAKEFLAGS from the validation of optimize variables
- also remove the black list, which has not been used in years.
2023-11-15 18:24:22 +01:00
Pierre Labastie
1352172467 Merge branch 'trunk' into xry111/parallelism 2023-11-13 13:44:32 +01:00
Pierre Labastie
5ed69f823f Dependency on xorg7-* only on last package
Our gen-special.sh transforms a dependency on compound packages
(xorg7-*) on a dependency on the list of packages. This generates
a lot of trials when removing circular dependencies, because if the
dependency on xorg7-* is optional, all packages in the list are tried
in turn, while it is sure that anyway the dependecy must be eliminated.
If the dependency is only on the last package, the circular dep
is eliminated at first try.
2023-10-21 13:37:50 +02:00
Pierre Labastie
6d9bd8e8e8 Add help about kernel config
Now, there is a timeout if the config file is not up to date. Say
so in the help.
2023-09-17 09:41:42 +02:00
Pierre Labastie
1c22535b2e Process two more <replaceable> tags
- one for libreoffice (use the xreflabel to set LO_PREFIX)
- one for abiword (installation of normal.awt-ll_CC files)
2023-09-16 13:39:39 +02:00
Pierre Labastie
9a89ba79de ablfs: new pattern for config recognition
chgrp -v mail ... is found in mutt and shouldn't considered
an install command.
2023-09-16 09:39:53 +02:00
Pierre Labastie
c552eabe63 Always run "teardown" after chroot
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.
2023-09-14 16:03:37 +02:00
Pierre Labastie
200cc0151e All the targets after mk_SUDO depend on "devices"
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
2023-09-12 22:58:55 +02:00
Pierre Labastie
aceacf2f85 Modify kernfs scripts to be able to run them twice
Those scripts could only be run once, because mount errors out
if it tries to mount an already mounted fs (or unmount a non
mounted fs). This changes generation of the scripts so that
any mount is preceded with "mountpoint -q || ", and any umount
is preceded with "mountpoint -q && ".
2023-09-12 22:54:51 +02:00
Pierre Labastie
74601a7f06 Separate parallelization from optimization
Also, add cpu set choice and the possibility to use nproc
2023-09-11 19:22:13 +02:00
Xi Ruoyao
1b02a9acff
Replace $(nproc || echo 1) and $(nproc) 2023-09-11 16:04:44 +08:00
Pierre Labastie
3b27f93764 Apply a timeout to kernel config in LFS
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
2023-09-08 17:01:52 +02:00
Pierre Labastie
06b731490f Allow two names for scriptlet containing "userdel"
It used to be named "revised_chroot", it is now named "cleanup"
Allow both names by testing whether revised something is present.
2023-09-05 13:14:26 +02:00
Pierre Labastie
45f82b1326 Use /usr for XORG_PREFIX unconditionally:
This is possible now that instruction for non /usr XORG_PREFIX
have been made role="nodump".
2023-09-03 23:35:33 +02:00
Pierre Labastie
08614168ec Hide DEL_LA_FILES in internal settings
This prevent normal users to change the default while preserving
the possibility to set it to "n" for tests or whatever.
Fixes ticket #1734
2023-08-30 20:20:59 +02:00
Pierre Labastie
9eb3dbe1c4 Don't build Xorg components that are commented out
gen-special.sh uses the list of files and md5 from the
cat instructions to generate an xml page for each of
the individual components. Until now, there were no commented
out component, so gen-special.sh was not prepared to handle
comments. Now, it removes lines containing comments.
2023-08-30 20:04:38 +02:00
Pierre Labastie
4ba94ad556 Update copyright year 2023-05-24 10:46:14 +02:00
Pierre Labastie
78d04f3f79 Fix "ambiguous redirect" in func_dependencies
We use grep -l ^"${otherlink[*]"\$ to find parentNode, since the
parentNode is the only file with a link line that matches. Problem
is that sometimes the priority line may match too. This makes a
parentNode variable containing several lines, and when redirecting
to $parentNode, creates those "ambiguous redirect" messages.
Fix: use a loop, and only grep on the first line of each file.
2023-04-21 10:49:40 +02:00
Pierre Labastie
72711ab1cd list_lfs.xsl: fixes for dependency checking
Add several packages that shouldn't be removed when doing dependency
checking, two of which are actually not in lfs, but needed for
script: porg tzdata sudo wget
2023-03-23 22:24:06 +01:00
Pierre Labastie
4dfe8f99c4 gen_pkg_book: fixes for dependency checkings
Fix a typo in function definition
use sudo for porg -r and porgball -e
2023-03-23 22:21:26 +01:00
Pierre Labastie
1bf09c15a7 Implementation of dependency checking 4
Implement generation of a modified script if dependency checking is
requested.
2023-03-23 18:38:51 +01:00
Pierre Labastie
42dfc6ef21 Implementation of dependency checking 3
Add an XSL stylesheet for listing packages in LFS. Those are
not listed anywhere else, but they are considered dependencies of
everything, so should never be erased.
2023-03-23 18:37:20 +01:00
Pierre Labastie
dedd502636 Implementation of dependency checking 2
Check the configuration variable in gen_pkg_book
2023-03-23 18:34:50 +01:00
Pierre Labastie
0a1943912e Implementation of dependency checking 1
Generate a switch for configuration
2023-03-23 18:32:24 +01:00
Pierre Labastie
3fa4147515 outputpkgdest: don't mix make and qmake
For outputting DESTDIR=, we need to test whether the text contains
"make". But when it contains "qmake" (or any different word containing
"make" but not exactly "make), we don't want to output anything more
than the text. So strengthen the test.
2023-03-19 10:15:18 +01:00
Pierre Labastie
6ac0d96300 outputpkgdest: fix the case of several <literal>
We output text()[1], literal (literally), text(2). This does
not work if there are several <literal> tags. Change it to
outputing preceding-sibling::text()[1], literal for each
literal tag, then output text()[last()] (which works also
when there are no literal tag, so it removes a choose.
2023-03-19 10:10:24 +01:00
Pierre Labastie
24ad4fd4f4 Fix outputting too many sh <<ROOT_EOF
When installing a bootscript or a unit, this sometimes happen
(e.g. samba).
2023-03-18 22:44:03 +01:00
Pierre Labastie
5126ee3663 porg: fix wrapInstall command 2023-03-07 22:23:37 +01:00
Pierre Labastie
3940a45db3 Have the subshell exit on error for porg install 2023-02-26 22:44:19 +01:00
Pierre Labastie
b39eb29be5 Revert changes to BLFS/Makefile
Changes to book's Makefile have been reverted too...
2023-01-25 13:17:12 +01:00
Pierre Labastie
5c8df43896 Adapt BLFS/Makefile to the new book layout
With the change to python modules and the pythonhosted.xml file
becoming untracked, those changes allow creating/updating this
file.
2023-01-20 10:05:38 +01:00
Pierre Labastie
951d334793 Upadte packInstall for libslirp
Version has a -v, which should be removed in "extract-version"
2023-01-01 14:01:45 +01:00
Pierre Labastie
33ee66c69e Typo in a comment 2022-12-06 15:20:00 +01:00
Pierre Labastie
0f4df7ccfd BLFS tools: don't generate duplicate download code
For additional downloads, the normal book layout is a <bridgehead>
containing "Additional Downloads" followed by one or more
<itemizedlist>, one for each file to download. But on some pages,
there are several <bridgehead>, each followed by one or more
<itemizedlist>. So we have to check that only the <itemizedlist>
correponding to the current <bridgehead> are treated. Otherwise,
the download code may be generated more than once. This imposes
that no other bridgehead is inserted between the one containing
"Additional" (or in some case "Recommended/Optional Download") and
the <itemizedlist>.
2022-11-18 15:45:42 +01:00
Xi Ruoyao
ed335a3113
handle '+' in kernel version string
It appears if the kernel is built from Git repo where HEAD is not a tag.
2022-11-04 22:44:57 +08:00
Pierre Labastie
35f6261ab5 Run the master Makefile with -j1
Also remove some instructions that are only useful for debugging.
2022-11-04 13:19:18 +01:00
Pierre Labastie
fd90f80466 Prevent parallelism in the master Makefile 2022-11-04 13:18:11 +01:00
Pierre Labastie
262e174aa1 systemd: copy /etc/resolv.conf from the host
when entering chroot. This allows using the network in chroot.
2022-10-06 10:39:09 +02:00