Commit graph

468 commits

Author SHA1 Message Date
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
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
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
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
Xi Ruoyao
1b02a9acff
Replace $(nproc || echo 1) and $(nproc) 2023-09-11 16:04:44 +08: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
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
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
87eb9e9a94 Make the kernel filesystem scriptlets executable
This is so that they can be run from the main Makefile, instead
of having to edit them to put them inside the Makefile.
2022-10-06 10:20:34 +02:00
Pierre Labastie
594ff3d878 Remove the "Abort on testsuite failure" config (4)
Remove the bomb-testsuite param in lfs.xsl, with the associated
code.
This implies not passing this param in func_book_parser.
2022-06-15 15:10:52 +02:00
Pierre Labastie
29615d9e3a Remove the "Abort on testsuite failure" config (3)
Remove the display of BOMB_TEST when validating the config.
2022-06-15 15:09:49 +02:00
Pierre Labastie
ff30640702 Fix an error when not downloading packages
When not downloading packages, the function "get_sources" returns
early because it begins with:
[ "$GETPKG" = y ] || return
The problem is that in this case it returns with an exit code
inherited from the last executed instruction, which is the
test (and therefore "false"). The solution is to change to
return 0.
2022-06-14 18:55:36 +02:00
Pierre Labastie
55e82d2ae0 Various updates for pacman PM
- 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
2022-06-12 22:54:14 +02:00
Pierre Labastie
28ef51b817 Fix spurious quotes in download code
$WGETPARM contains several switches separated by blank spaces.
If quoted in the wget command, it appears as an url with
spaces, not as switches.
2022-05-07 11:56:28 +02:00
Pierre Labastie
dc53def3ee Only use upstream URL when downloading packages
Also fix typos and shell programming. Use "cat file | while read"
instead of a complicated construct for reading only lines and then
breaking lines into their fields... Fix a TODO item
2022-05-07 11:25:43 +02:00
Pierre Labastie
88e5cbc258 Use only upstream's URL in urls.lst 2022-05-07 11:24:06 +02:00
Pierre Labastie
924a237843 Fix $(BUILDDIR)/jhalfs/Makefile
Now that we have only lfs, some lines in the Makefile have been
removed, but still some shell continuation (&& \) were left. This
leads to weird error message (@ non existing command, or so).
Remove the continuation characters.
2022-04-03 21:42:25 +02:00
Pierre Labastie
9b99adace9 Change variable names and logic for BLFS book
Only use BLFS_COMMIT instead of BLFS_BRANCH_ID, BLFS_TREE, BLFS_BOOK
Same for le LFS_BLFS variables
2022-04-01 10:26:17 +02:00
Pierre Labastie
30a444a477 Fix some bugs in func_install_blfs
- do not try to copy downloaded files to $SRC_ARCHIVE: they may
  belong to another user, and so be non writable.
- trunk/BOOK is not used anymore in BLFS/Makefile
- do not make update a second time
2022-04-01 10:25:48 +02:00
Pierre Labastie
8c2b505caf Fix small bugs in func_download_pkgs
- If MISSING_FILES.DMP is left from a preceding attempt, it may
generate a false warning a bout missing files even if they could
all be downloaded.
- do not try to copy a modified file to SRC_ARCHIVE if it already
exists: it may belong to another user...
2022-04-01 10:18:15 +02:00
Pierre Labastie
2bf44e2724 Try to make an information clearer about $COMMIT 2022-04-01 10:13:55 +02:00
Pierre Labastie
2c1a763990 try to fix func_install_blfs to work in all cases
WIP...
2022-03-30 22:35:12 +02:00
Pierre Labastie
8825e69592 Get completely rid of PROGNAME
There is only one PROGNAME: lfs, so no need for a variable.
2022-03-30 17:45:35 +02:00
Pierre Labastie
2bd2fb81d0 Replace $PROGNAME-commands with $COMMANDS
This allows to remove some references to PROGNAME
2022-03-30 14:49:43 +02:00
Pierre Labastie
2fd624d8f6 Get rid of BRANCH_ID, TREE, LFSVRS variables
There is only one variable: COMMIT. Note that this commit
also changes $PROGNAME-$LFSVRS to $BOOK.
2022-03-30 14:26:41 +02:00
Pierre Labastie
9f89fae89a LFS: Simplify git repo management
Use inly one variable, REPO, containing the LFS git repo url. The
BLFS Makefile hardcodes the LFS and BLFS git repo urls, so no need
to pass them.
2022-03-30 12:27:03 +02:00
Pierre Labastie
327a3ee7ba Change mail address for sending reports 2022-03-02 11:46:09 +01:00
Pierre Labastie
0fa52f2403 Remove legacy: Remove almost all occurrences of CLFS/clfs 2022-03-01 21:09:30 +01:00
Pierre Labastie
978286a4b9 Remove legacy: remove everything about HLFS 2022-02-28 13:30:53 +01:00
Pierre Labastie
03b24b2a45 Various fixes for create-sbu_du-report.sh
- Check that there is enough material to calculate a SBU (!)
- Prevent an error if REALSBU does not occur in jhalfs.config
- Remove double square bracket: they change semantics and
  I cannot memorize what the change is (but e.g. file* is not
  expanded even if there is some filexxx in the dir).
2022-02-19 15:08:37 +01:00
Pierre Labastie
0f3b1c317c create-sbu_du-report.sh: check that J_VALUE is never empty 2022-02-17 23:53:51 +01:00
Pierre Labastie
2e35653630 makefile-functions: make sudo/chroot messages less confusing 2022-02-05 20:08:56 +01:00
Pierre Labastie
f81d8bdb6f func_install_blfs: gen_pkg_book needs the tracking file
The tracking file is needed for gen_pkg_book.sh as a first argument.
Since it is called to generate the initial scriptlets, it needs
to be passed the full path of the tracking file, including
$BUILD_DIR. The $TOPDIR is now the second argument (and still
needs to be passed too).
2021-12-20 10:30:18 +01:00
Pierre Labastie
b734bfb4c6 install_blfs: update trackdir also in gen_pkg_book.sh
Now gen_pkf_book.sh depends on trackfile. This can be passed
as an argument, but to ease calling it standalone, we need to
set the default to the actual file used.
2021-12-19 17:30:10 +01:00
Pierre Labastie
837362b50f Ticket #1732: add Docbook XSL and XML to check_alfs_tools
This is an oversight of when we moved to profiling and when we
removed the docbook xsl stylesheets from the LFS directory.
Docbook XML DTD and XSL stylesheets are needed, so test them
at start. This has the effect of removing the need for check_blfs_tools.
2021-12-13 16:05:39 +01:00
Pierre Labastie
e57e0291c3 Change spacing in func_check_version output
This is needed to be able to fit "Docbook XSL stylesheets" in.
2021-12-13 16:03:46 +01:00
Pierre Labastie
267b19da59 Adapt func_install_blfs.sh to the removal of envars
Add to the configuration file in $BUILD_DIR/blfs_root
2021-11-21 19:23:11 +01:00
Pierre Labastie
fd4a7982f2 Remove $Id$ comments, they are useless with git 2021-10-31 10:22:30 +01:00
Pierre Labastie
4c32ca80bd Adapt to condxml branch: func_book_parser
When running git-version.sh, unconditionally add a $INITSYS
argument, which is needed for the new condxml, and
is harmless if this argument is not needed.
2021-10-14 10:23:24 +02:00
Pierre Labastie
2718053f55 Custom tools: prevent a warning if no md5sum for patches 2021-10-14 08:53:29 +02:00
Pierre Labastie
840b9ba06e Fix wrong VERSION variable for dev book
Using version from the ENTITY version line in gneral.ent is not
good anymore, since version is in version.ent for the dev book.
But it _is_ in general.ent for releases...
Use a different approach: take the profiled .xml, and use the
version in lsb-release.
2021-09-16 06:30:58 +02:00
Pierre Labastie
e68c306380 Add the -j value to the sbu report 2021-08-28 22:50:40 +02:00
Pierre Labastie
52cced4e53 Add the number of parallel jobs to var validation
This allows to have it also in the SBU report
2021-08-28 19:53:16 +02:00
Pierre Labastie
97b270f9bd LFS: Generate version.ent before profiling the book 2021-08-03 14:33:11 +02:00