The systemd package is a system and service manager for Linux operating systems.
Systemd 209 merged several libraries into libsystemd, but some packages that use systemd
still expect those separate libraries. Apply a patch to allow
backwards compatibility with these packages by installing
Pkg-config files for the old libraries:
patch -Np1 -i ../systemd-213-compat-1.patch
Prevent the Makefile from trying to
run setcap on
systemd-detect-virt,
which will fail if the kernel or file system does not support
extended capabilities:
sed -i '/virt-install-hook /d' Makefile.in
The timesyncd.conf file contains a
reference to a non-existent timesyncd.conf(5) man page. Remove that reference
to avoid possible confusion:
sed -i '/timesyncd.conf/d' src/timesync/timesyncd.conf.in
By default, systemd-fsck will run
/sbin/fsck with the -l option, which applies an flock on the file system being checked. This can
conflict with an flock that systemd
itself puts on the file system, which could result in problems
booting. fsck will be
fixed to avoid this problem in a future release of Util-linux, but
for now we will work around the issue by simply preventing
systemd-fsck from
using -l:
sed -i '/-l/d' src/fsck/fsck.c
Prepare systemd for compilation:
./configure --prefix=/usr \ --sysconfdir=/etc --localstatedir=/var \ --libexecdir=/usr/lib --docdir=/usr/share/doc/systemd-213 \ --with-rootprefix="" --with-rootlibdir=/lib \ --enable-split-usr --disable-gudev --with-kbd-loadkeys=/bin/loadkeys \ --with-kbd-setfont=/bin/setfont --with-dbuspolicydir=/etc/dbus-1/system.d \ --with-dbusinterfacedir=/usr/share/dbus-1/interfaces \ --with-dbussessionservicedir=/usr/share/dbus-1/services \ --with-dbussystemservicedir=/usr/share/dbus-1/system-services \ cc_cv_CFLAGS__flto=no
The meaning of the configure options:
--with-root*
These switches ensure that core programs and shared libraries are installed in the subdirectories of the root partition.
--enable-split-usr
This switch ensures that systemd will work on systems where /bin, /lib and /sbin directories are not symlinks to their /usr counterparts.
--disable-gudev
This switch prevents systemd from building libgudev as it requires Glib, which is not
installed in CLFS.
--with-dbus*
These switches ensure that D-Bus configuration files get installed to the correct locations.
cc_cv_CFLAGS__flto=no
This prevents the build system from using GCC's Link-time
optimization (LTO), to ensure that systemd's binaries will
not try to link to libgcc_s.
Compile the package:
make
Prevent a broken test case from running:
sed -e "s:test/udev-test.pl::g" \ -e "s:test-bus-cleanup\$(EXEEXT) ::g" \ -e "s:test-bus-gvariant\$(EXEEXT) ::g" \ -i Makefile
To test the results, issue:
make check
Install the package:
make install
Install documentation files that are not installed by default:
install -v -m644 man/*.html /usr/share/doc/systemd-213
Move the nss_myhostname library to
/lib:
mv -v /usr/lib/libnss_myhostname.so.2 /lib
Remove an unnecessary directory:
rm -rfv /usr/lib/rpm
Create symlinks for backwards-compatibility with Sysvinit:
for tool in runlevel reboot shutdown poweroff halt telinit; do ln -sfv ../bin/systemctl /sbin/$tool done ln -sfv ../lib/systemd/systemd /sbin/init
Modify a configuration file which references a group that doesn't exist:
sed -i "s@root lock@root root@g" /usr/lib/tmpfiles.d/legacy.conf
Create /etc/machine-id which is
needed by Journald:
systemd-machine-id-setup
Create a file to identify the operating system. systemd will use this file on boot to put information on the screen.
cat > /etc/os-release << "EOF" # Begin /etc/os-release NAME=Cross-LFS ID=clfs PRETTY_NAME=Cross Linux From Scratch ANSI_COLOR=0;33 VERSION=3.0.0-SYSTEMD VERSION_ID=20141018 # End /etc/os-release EOF
Plugin for the GNU Name Service Switch (NSS) functionality of Glibc, provding hostname resolution for the locally configured system hostname