Commit graph

1421 commits

Author SHA1 Message Date
Pierre Labastie
824efcac1c Merge branch 'trunk' into xry111/parallelism 2023-11-21 10:23:18 +01:00
Pierre Labastie
c1f02f262e LFS: remove alternate server code
It's been broken for years, and nobody has complained, so I'd say
it is not useful. If a user wants to use a mirror instead of upstream,
better use a wget-list directly on this server...
2023-11-21 10:19:20 +01:00
Pierre Labastie
05b955b62c BLFS: remove support for ftp and alternate server
ftp urls have been removed from book, and in case you have to use
an alternate server, better download directly to /sources/yourself.
2023-11-21 10:12:28 +01:00
Pierre Labastie
23b0161d6c BLFS tools: update qt?-prefix for recent books 2023-11-18 10:36:47 +01:00
Pierre Labastie
c5f4ef3d5e BLFS tools: update qt?-prefix for recent books 2023-11-18 07:47:29 +01:00
Pierre Labastie
67ca47e5f8 Stupid typo 2023-11-17 16:31:22 +01:00
Pierre Labastie
924076f0b5 blfs tools: fix JOBS
If all cores are used, it should be set to 0, which will use nproc
after the cpuset has been defined, and not nproc (which is the number
of cores/threads on the machine).
2023-11-17 16:10:01 +01:00
Pierre Labastie
04a608ba8e Pass NINJAJOBS if N_PARALLEL is defined
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.
2023-11-17 15:57:55 +01:00
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