Commit graph

224 commits

Author SHA1 Message Date
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
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
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
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
1352172467 Merge branch 'trunk' into xry111/parallelism 2023-11-13 13:44:32 +01: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
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
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
Pierre Labastie
3722d3164c Call kernel filesystem scripts from Makefile
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...
2022-10-06 10:26:29 +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
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
84d0d39a97 Do not run "stripping" if STRIP=n during ICA
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.
2022-05-21 19:07:38 +02:00
Pierre Labastie
93814d176b Typo in LFS/master.sh (in a comment) 2022-05-21 19:07:16 +02:00
Pierre Labastie
d3dbebe625 master.sh: use the new wrt_makeflags function
It now take three arguments:
- name of the package
- MAKEFLAGS
- NINJAJOBS
2022-05-07 20:47:52 +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
4c36783ec4 oRemove legacy: do not run tests in temporary tools (2) 2022-02-28 14:11:30 +01:00
Pierre Labastie
9d665db456 Remove legacy: remove tests in temporary tools
There is no way to run them now since we are in a cross build
configuration
2022-02-28 13:45:00 +01:00
Pierre Labastie
20051e00f7 Use only CHROOT1 in LFS/master.sh
There is only one chroot command in newer LFS, and using the first one
with previous versions does not hurt.
2022-02-05 18:48:32 +01:00
Pierre Labastie
fd4a7982f2 Remove $Id$ comments, they are useless with git 2021-10-31 10:22:30 +01:00
DJ Lucas
b5d1c50492 Fix iproute2 install with package management. 2021-09-06 17:04:11 -05:00
DJ Lucas
33a4e41462 Fix package management and put back optional stripping again for backwards compatibility. 2021-08-17 18:23:24 -05:00
Thomas Trepl (Moody)
756863be9b strippingagain.xml has been renamed 2021-08-13 08:18:05 +02:00
Thomas Trepl (Moody)
c1060c9add strippingagain.xml has been renamed 2021-08-13 07:51:13 +02:00
Thomas Trepl (Moody)
bcae37dc8b Rename ch-system-strippingagain to ch-system-stripping 2021-08-13 07:46:58 +02:00
Pierre Labastie
cfdb089dcf Fix generation of full locales
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.
2021-05-11 09:59:19 +02:00
Pierre Labastie
47dfc81bdc Account for the change in umount command in LFS
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)
2021-03-09 21:58:44 +01:00
Pierre Labastie
5562bf14e0 Fix make exiting with an error if $(MOUNT_PT)/var/lib does not exist 2020-09-30 05:43:59 +00:00
Pierre Labastie
088130f04a Fix changing the ownership of $BUILDDIR/var/lib to LUSER when it has been
created by func_install_blfs. Fixes ticket #1729
2020-09-17 15:30:29 +00:00
Pierre Labastie
56c1fff69a Create os-release also for SysV
This has been in the book for a few months, but jhalfs was not updated.
It is now...
2020-08-22 11:49:09 +00:00
Pierre Labastie
6f74ca146f LFS/master.sh: only count chapter* dirs in lfs-commands
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*.
2020-07-10 13:29:15 +00:00
Pierre Labastie
88a8275eb8 lfs.xsl: mode=pkgmngt: use $pos and not position() when calling
start-script
2020-07-09 17:04:30 +00:00
Pierre Labastie
46c6113b28 Prevent overwriting /var/run and lock symlinks with PM
/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.
2020-07-09 17:02:10 +00:00
Pierre Labastie
3484658167 Various fixes for recent pacman with new book
- 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.
2020-07-07 15:27:54 +00:00
Pierre Labastie
f017b22731 LFS/lfs.xsl: fix cases when using DESTDIR
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).
2020-07-06 05:51:22 +00:00
Pierre Labastie
3ac3ae199f Change numberings of scriptlets:
- 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
2020-07-06 05:38:54 +00:00
Pierre Labastie
49f8b03399 Fix package management for new book, and add a patch for porg 2020-06-24 06:26:05 +00:00
Pierre Labastie
13e52a5572 Add the multilib book: fixes ticket #1722 2020-06-20 17:16:22 +00:00
Pierre Labastie
706e5bf46a Various small fixes/improvements:
- 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)
2020-06-20 17:01:23 +00:00
Pierre Labastie
9a4c530f55 Clean LFS/master.sh from unused
functions
2020-06-20 16:45:26 +00:00
Pierre Labastie
0a0753d579 Remove spaces at the end of lines 2020-06-19 14:25:52 +00:00
Pierre Labastie
3da8c49659 Update ICA for new LFS/master.sh 2020-06-14 07:08:19 +00:00
Pierre Labastie
b33c6ee52d Fix the case of the kernel for otimization 2020-06-11 20:43:33 +00:00
Pierre Labastie
ebe1ba613c Adapt for the cross 2 branch. Note that ICA is broken now. Keeping some old
code to use for fixing ICA, but committing now so that testing can begin!
2020-06-10 20:01:17 +00:00
Pierre Labastie
36f5dce727 Fix lfs.xsl for cross2, and change scriptlet numbering for trunk and cross2 2020-06-09 07:28:05 +00:00