We use the filter builtin function of make to retrieve the right
shell to use during the CHROOT phase, which is the same as the
one in CHROOT1.
Also do not assume envars exist when removing it at the beginning
of the SUDO phase.
This involves changing the way make targets are built. Specially
the make target is changed when encountering a specific file
(for example the make target becomes sudo when rencountering kernfs)
This allows more flexibility.
Those scriptlets need to use a temporary bash, which is in /tools/bin
for current LFS. But if we use a new method (cross-compiling + sysroot)
it ends into /bin. So we have to set the correct `#!' header
in both cases.
We rely on the pesence of a "creatingtoolsdir" sect1 to know that
bash is in /tools
- take targets from scriptlet names
- neutralize some commands or bash builtins so that they are not
used even if they are in the scriptlets, if not needed
- do not set PREV in chapter 5 anymore
- Improve save and restore user, so that if the LUSER exists,
its home is saved while building temporary tools, and restored
afterwards
Using the chapter ancestor is not enough. It's better to use the sect1 id
and test that it starts with ch-tools: package-manager does not have this
ancestor. Also the virtual kernel filesystems are done before chroot,
so directly test this one.
This works for the current lfs book. We'll need something new if we
change the order of pages.
In the generated scriptlets, we need to know if we are on host
or chrooted. Presently, we
rely on /tools being a symlink or not. But we may want to remove this
ugly symlink in future versions of LFS, so anticipate and use the
chapter ancestor.
This is a major change for LFS. We won't be using the makefile for
the final preparations, but we'll extract the book instructions and
use them (the "use part not in this commit).
Since getting figures for those scriptlets is not important, and we
cannot use start and end scripts, which need already set up user and
dirs, do not use them
This is to allow root to execute ": > envars". On a non empty envars
owned by lfs, in a directory world writable with sticky bit and not owned
by lfs, this may be forbiden by the fs/protected_regular sysctl.
See https://www.kernel.org/doc/Documentation/sysctl/fs.txt
The "create-sbu_du.sh" script expects all the logs containing
"Totalseconds" also contains two lines starting with "KB:" with disk usage
stats. Generates those lines for all the logs. Hopefully, the stats are
fairly accurate now...
- add sect1info sections to packagemanager.xml.xxx + various fixes
- add templates in LFS/lfs.xsl for script start and script end:
- script start: define variables containing package information
print disk usage
unpack and change dir
- script end: print disk usage
remove build dir
- remove the corresponding operations from master.sh
- Do not symlink /{usr/,}lib64->lib
- Do not symlink /usr/{man,info}->share
- Create /lib64 on x86_64
- Create /usr/lib/pkgconfig
- do not create /usr/lib/rpcsvc
- check that a directory exists before testing its emptyness
(for example, attr removes empty manx dirs)
- add variables LOCAL (y is hw clock set to local time) and LOG_LEVEL (sysv)
- generate /etc/sysconfig/console (sysv) or /etc/vconsole.conf (systemd)
- generate /etc/adjtime (only systemd)
- remove UNICODE and FONTMAP variables (jhalfs makes unicode default)
when the user fstab and/or kernel config are the same as the ones in
$BUILDDIR/sources: avoid to cp on itself
- set SRC_ARCHIVE=/dev/null in BLFS tools download script if SRC_ARCHIVE is
empty
- the tzdata DESTDIR should not be tzdata, because some package managers use
$PACKAGE as their working directory, and this may conflicts with this one.
tzdata DESTDIR is now 001-tzdata
- when reading md5sums, the current code assumes that there is only one
<para><literal> node reachable from ../.. (relative to <ulink>). This is true
for the "official" book, but not necessarily for the snippets written for
package management. The following change only assumes that the md5sum
<para><literal> for a given <ulink> is the first one after <para><ulink>,
which does not change anything for the book, and is better for user
written snippets.
- Do not put the chroot commands in $PROGNAME-commands, but rather
in a separate directory chroot-scripts
- Use the commands in the chroot-scripts directory to generate the CHROOT
variables in Makefile
- The commands are extracted to $PROGNAME-commands only if they do not
have role="nodump attribute and they do not begin with "chroot" (for
compatibility with previous books where chroot commands did not have
the role="nodump" attribute.
- Ignore error when useradd does not support "-k /dev/null" (happens at
least on Suse)
- strip "-libstdc++" from the script name to allow building gcc-libstdc++
with package gcc
and installing just the minimal set for tests, after glibc build.
If the second option is chosen, the locale specified in LANG is also
installed, if not in the minimal set.