Commit Graph

329 Commits

Author SHA1 Message Date
Arnout Vandecappelle (Essensium/Mind)
d0c778c18c package/systemd: add checklist of upgrade caveats
Bumping the version of systemd is a little more complicated than the
usual package, and it's easy to forget some of the things that need to
be done - and this has happened several times in the past.

Add a checklist of things to worry about when updating systemd.

Note that there are many other complicated packages that also need a lot
of attention when upgrading. However, systemd is a really critical
package so it's more important that we get that one right than, say,
valgrind.

Cc: Norbert Lange <nolange79@gmail.com>
Cc: Jérémy ROSEN <jeremy.rosen@smile.fr>
Cc: Adam Duskett <aduskett@gmail.com>
Cc: James Hilliard <james.hilliard1@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2022-01-13 21:40:24 +01:00
Norbert Lange
99dabffc09 package/systemd: fix pre-creation of directories for coredump
Fix a copy-paste bug in commit be25669078.

Signed-off-by: Norbert Lange <nolange79@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2022-01-09 15:30:12 +01:00
Norbert Lange
8b94dab2ee package/systemd: add systemd-oomd user
add the missing user if oomd is enabled.

Signed-off-by: Norbert Lange <nolange79@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2022-01-09 15:29:28 +01:00
Norbert Lange
0d9b84b7a8 package/systemd: invoke systemd-tmpfilesd on final image
Especially for read-only filesystems it is helpful to
pre-create all folders for non-volatile paths.

This needs to run under fakeroot to allow setting
uids/gids/perms for the target fs.

systemd-tmpfilesd supports specifiers and target rootfs,
but some specifiers resolve to information from the host,
it is necessary to specially handle (skip) entries that
contain problematic specifiers.

Signed-off-by: Norbert Lange <nolange79@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2022-01-09 15:09:39 +01:00
Arnout Vandecappelle (Essensium/Mind)
83319384fd package/systemd: remove BR2_PACKAGE_SYSTEMD_TMPFILES completely
Since tmpfiles is no longer optional, the Config.in symbol serves no
purpose. It was only used in cryptsetup.mk, where we replace it with
BR2_PACKAGE_SYSTEMD.

Advise to do the same in Config.in.legacy.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2022-01-09 13:48:26 +01:00
Norbert Lange
f7a928f883 package/systemd: always enable systemd-tmpfilesd
this tool and service is pretty much expected to be enabled,
making this a certainty will enable future improvements.

The config variable BR2_PACKAGE_SYSTEMD_TMPFILES is still
availabe and always set.

Signed-off-by: Norbert Lange <nolange79@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2022-01-09 13:48:26 +01:00
Norbert Lange
0f9828e5cf package/systemd: adopt odering in nsswitch to newer versions
This modifies the order of the nss modules, reflecting the current
state of the documentation.

nss-mymachines lost support for resolution of users and groups,
and now only does resolution of hostnames. Changed in v246.

Multiple changes in regards to nss-myhostname now recommend placement
after nss-files and before nss-dns. See commits ce266330, f918c67.

nss-resolve handles the nss-files logic itself, and its suggested to
move in front of nss-files. Changed in v249.

Signed-off-by: Norbert Lange <nolange79@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2022-01-09 13:48:26 +01:00
Norbert Lange
eb49354eb3 package/systemd: Update description and kernel options
realign the configuration to the README.

enable CONFIG_AUTOFS_FS (kernel >= 4.18) as well as the someday
to be removed CONFIG_AUTOFS4_FS option.

Signed-off-by: Norbert Lange <nolange79@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2022-01-09 13:48:26 +01:00
Norbert Lange
f90d23112d package/systemd: set cgroups default-hierarchy to unified
Use the unified hierarchy, which is systemds default since v243.
The biggest holdover was docker which now supports the unified
layout.

Note that systemd will automatically fallback to hybrid if the
kernel is too old or the unified hierarchy fails for other reasons.

Signed-off-by: Norbert Lange <nolange79@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2022-01-09 13:48:26 +01:00
Norbert Lange
01a7e1a9f8 package/systemd: add support for creating journal catalog DB
journald supports catalog files, or rather a binary database of
those.
Functionality added includes:

-   A config option allows enabling the binary database.

-   If BR2_ENABLE_LOCALE_PURGE is enabled, the catalogs not in the
    language whitelist are deleted first. This is done independently
    of the new option, since the catalogs are removed later anyway.

-   If the option is enabled, the database is built and moved to
    /usr/share/factory. This makes sure that /usr contains the entire
    system. A symlink is created in /var pointing to that file.

-   The catalog source files are deleted. They serve no purpose on the
    target once the database exists.

-   All of the above is done in a ROOTFS_PRE_CMD_HOOK rather than in the
    build/install step, because other packages than systemd itself may
    also install catalogs. This also makes sure that it is possible to
    do a re-build, because the catalog files are not removed in
    $(TARGET_DIR) itself, only in the temporary copy for rootfs creation.

-   The service normally used for creating the DB during boot is
    deleted. If the DB is not enabled, we also don't want to waste time
    and space on re-generating every boot. Conversely, if the DB is
    enabled, it is already there so doesn't need to be re-done on every
    boot either.

The new option depends on !BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW because
if the rootfs is not RW, /var is overmounted with a tmpfs. The factory
should handle this, but this only half-works [1].

[1] http://lists.busybox.net/pipermail/buildroot/2020-July/287016.html

Signed-off-by: Norbert Lange <nolange79@gmail.com>
Reviewed-by: Jérémy Rosen <jeremy.rosen@smile.fr>
Reviewed-by: Adam Duskett <aduskett@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2022-01-09 09:43:28 +01:00
Arnout Vandecappelle (Essensium/Mind)
2fc0d98699 Revert "systemd: ensure tmpfiles.d/legacy.conf is installed"
legacy.conf no longer exists, it's now legacy.conf.in that has to be
preprocessed. The preprocessing is only done if sysv-compat is enabled.

This reverts commit 0e71f51119.
2022-01-08 21:40:44 +01:00
Joseph Kogut
0e71f51119 systemd: ensure tmpfiles.d/legacy.conf is installed
Systemd doesn't install tmpfiles.d/legacy.conf when sysv compatiblity
isn't enabled. This config sets up /var/lock, which many programs such
as uboot's fw_printenv/setenv still depend on by default.

Signed-off-by: Joseph Kogut <joseph.kogut@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2022-01-08 20:08:02 +01:00
Norbert Lange
be25669078 package/systemd: pre-create directories for services
various services need directories in /var when they are started,
and create them if necessary. Creating those before, allows
those services to start even if /var is read-only.

Signed-off-by: Norbert Lange <nolange79@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2022-01-08 19:33:39 +01:00
Romain Naour
315ba5c26d package/systemd: bump to version 250.1
Remove upstream patch

Fixes a build issue with toolchains using kernel headers < 5.6,
when the openat2(2) syscall is not available [2].

Add a new patch to fix homework-mount with linux-headers < 5.2.

[1] cd88d010e8
[2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=fddb5d430ad9fa91b49b1d34d0202ffe2fa0e179

Signed-off-by: Romain Naour <romain.naour@smile.fr>
Cc: Norbert Lange <nolange79@gmail.com>
Cc: Yann E. MORIN <yann.morin.1998@free.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2022-01-08 10:59:10 +01:00
Fabrice Fontaine
de562463b0 package/systemd: fix build with openssl and gnutls
Combination of cryptolib=openssl and dns-over-tls=gnutls is disallowed
since version 250 and
e37ad765c8
resulting in the following build failure since commit
e9fb26cbb8:

../output-1/build/systemd-250/meson.build:1482:16: ERROR: Problem encountered: Sorry, -Ddns-over-tls=gnutls is not supported when openssl is used as the cryptolib

Fixes:
 - http://autobuild.buildroot.org/results/2fcd4ad64b32cc4835866c9d99e05ab8c9bc794a

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2021-12-30 13:21:48 +01:00
James Hilliard
e9fb26cbb8 package/systemd: bump to version 250
Drop disable urlify patch that is now upstream.

Backport missing-syscall: define all MOUNT_ATTR_* if missing patch.

Update license info based on LICENSES/README.md.

Most licenses are moved to SPDX LICENSES folder.

Add libcryptsetup-plugins support.

The efi-ld option expects either "bfd" or "gold", since we don't
support "gold" set it to "bfd" which is also the default fallback.

Set link-boot-shared to true since we build systemd at the same time
as the boot tools.

See link-boot-shared details:
7964702007

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2021-12-29 18:37:21 +01:00
James Hilliard
e9df5b0fc3 package/python-markupsafe: bump to version 2.0.1
Drop python2 support.

Remove python3-markupsafe host build as python2 host builds for
markupsafe are not supported, python3 host builds are moved to
python-markupsafe.

Remove python3-jinja2 host build as python2 host builds for
jinja2 are not supported, python3 host builds are moved to
python-jinja2.

Remove python3-mako host build as python2 host builds for
mako are not supported, python3 host builds are moved to
python-mako.

Propagate reverse python3 dependency.

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2021-11-17 22:34:32 +01:00
Romain Naour
d51189ffe5 package/systemd: enable selinux xdg module for refpolicy
Without the selinux xgd module enabled by systemd package, refpolicy
fail to build due to policy/modules/system/systemd.te [1]

policy/modules/system/systemd.te:288:ERROR 'attribute xdg_config_type is not declared' at token ';' on line 508447:

Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/1710552468
https://gitlab.com/buildroot.org/buildroot/-/jobs/1710552470

[1] https://github.com/SELinuxProject/refpolicy/blob/RELEASE_2_20210908/policy/modules/system/systemd.te#L288

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Adam Duskett <aduskett@gmail.com>
Cc: Antoine Tenart <atenart@kernel.org>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2021-11-05 22:34:40 +01:00
James Hilliard
63b3a3c6d7 package/systemd: bump to version 249.5
Remove efi-ldsdir meson config option which is no longer used.

Meson config variable systemd-analyze is renamed to analyze.

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2021-10-27 22:28:03 +02:00
Kory Maincent
3efb5e31fc board, boot, package: remove usage of startup.nsh in EFI partition
The startup.nsh file is useless to boot EFI payloads. We just need to
follow the naming detection specified in the UEFI spec.
The EFI payload need to be placed in the boot/efi folder in the EFI partition
and follow the architecture naming as described below:
32bit : bootia32.efi
x64 : bootx64.efi
aarch32 : bootarm.efi
aarch64 : bootaa64.efi

This naming is already right in the packages involved (systemd, grub2,
gummiboot), therefore we just need to drop the generation of the
startup.nsh file.

The usage of the startup.nsh in genimage is also dropped to avoid errors in
the image generation.

Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
Tested-by: Erico Nunes <nunes.erico@gmail.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2021-09-27 21:27:02 +02:00
James Hilliard
ecd20b1633 package/systemd: bump to version 249.4
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2021-09-11 20:43:41 +02:00
Adam Duskett
5a62f90e36 package/polkit: bump version to 0.119 and use duktape
Unfortunately, as of commit 3e1d61868fa8bfc586099302e931433270e5d17d, polkit
requires mozjs >= 78, which means spidermonkey is too old. As such, this patch
is larger than usual.

Spidermonkey has a few major issues:
  - The source directory after compilation is enormous (2.7G!)
  - The shared library is 24MB stripped!
  - It requires python2 to build, which is EOLed, and Buildroot is working
    towards removing. See: https://elinux.org/Buildroot:Python2Packages

Instead of going through the arduous task of updating Spidermonkey, there is a
better solution: use duktape.

There has been a pending patch for over a year that incorporates duktape as an
optional backend for polkit found here:
https://gitlab.freedesktop.org/polkit/polkit/-/merge_requests/35

As Thomas Petazzoni put it:
  "As I am subscribed to notifications on this merge request, I have been
  following the intermittent discussions taking place on this topic.
  And indeed, discussions have been sparse, and the polkit maintainer reaction
  has not been very supportive. It even feels like they are trying to find
  every possible argument or small issue not to merge the duktape integration."

Many people have come out to support using duktape, and many users, including
myself, have used polkit with duktape for as long as the above merge request has
been around without issues; merging in the above merge request is an acceptable
exception to the typical Buildroot package policies.

As Thomas also suggested, I have forked polkit on Github
(https://github.com/aduskett/polkit-duktape), with the above duktape
merge request applied, and a release made with the same tag as upstream (0.119).

I refrained from also adding 0001-make-netgroup-support-optional.patch as it is
outside of the scope of why the fork exists.

Changes:
  - refactor 0001-make-netgroup-support-optional.patch to work with 0.119 and
    duktape.
  - Remove upstream incorporated 0002-jsauthority-memleak.patch
  - Remove upstream 0003-polkit-0.116-pkttyagent-sigttou-bg-job.patch
  - Remove any trace of spidermonkey from polkit, udisks, and systemd-polkit
  - Add duktape as a dependency of polkit
  - Change POLKIT_SITE to the above polkit-duktape GitHub repository.

Signed-off-by: Adam Duskett <aduskett@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2021-07-24 23:29:21 +02:00
James Hilliard
fbd9566220 package/systemd: bump to version 249.1
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2021-07-20 23:41:56 +02:00
James Hilliard
6e4b8fe00f package/systemd: disable urlify unless supported
The urlify feature in the systemd pager is only supported by the full
less package and not busybox less, enable only for builds with full
less support.

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2021-07-20 20:26:45 +02:00
James Hilliard
d2ef0058c9 package/systemd: bump to version 249
Add config option for systemd-sysext.

Add config option for systemd-oomd.

Add new host-python3-jinja2 dependency.

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2021-07-17 10:01:51 +02:00
Michael Nosthoff
5d4dc98c58 package/systemd: fix homed dependency warning
Fixes:

showing "enable home daemon"
and "homed support needs a toolchain w/ threads, dynamic library, kernel headers >= 4.12"
when BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_12

introduced by fa62b5165c

Signed-off-by: Michael Nosthoff <buildroot@heine.tech>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2021-04-17 09:07:26 +02:00
Fabrice Fontaine
511fbda0be package/systemd: fix /etc/resolv.conf link on per-package build
Fixes:
 - https://bugs.buildroot.org/show_bug.cgi?id=13271

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2021-04-13 21:11:48 +02:00
Fabrice Fontaine
ac3bbc4e03 package/systemd: add SYSTEMD_CPE_ID_VENDOR
cpe:2.3🅰️freedesktop:systemd is a valid CPE identifier for this
package:

  https://nvd.nist.gov/products/cpe/search/results?namingFormat=2.3&keyword=cpe%3A2.3%3Aa%3Afreedesktop%3Asystemd

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2021-03-04 19:55:29 +01:00
Norbert Lange
697180b5ac package/systemd: bump to version 247.3
Drop upstream patch.

Use the new mode=release switch, this should automatically
disable features deemed not ready for use.

Signed-off-by: Norbert Lange <nolange79@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2021-02-04 18:17:58 +01:00
Bartosz Bilas
9c5ef6018e package/systemd: don't fail if getty service directory already exists
Add -p argument that ignore that specified directory already exists.

Signed-off-by: Bartosz Bilas <b.bilas@grinn-global.com>
[yann.morin.1998@free.fr:
  - split to its own patch
  - rewrite commit title
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2021-01-03 10:02:12 +01:00
Francois Gervais
70f35db9f7 package/systemd: add a menu entry to enable portable services
Signed-off-by: Francois Gervais <fgervais@distech-controls.com>
Reviewed-by: Norbert Lange <nolange79@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2020-12-15 22:00:55 +01:00
Romain Naour
8d5076fdba package/systemd: fix update-done service for read-only filesystem
Backport an upstream patch to fix a regresion introduced in
246.5 by [1].

[1] 8019995e9a

Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/830981805

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2020-11-11 10:09:05 +01:00
Arnout Vandecappelle (Essensium/Mind)
15b4d396b9 systemd: sort SYSTEMD_CONF_OPTS
The meson options were in some semi-sorted order with no logic in it.
Sort them alphabetically instead.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2020-11-03 22:17:55 +01:00
Arnout Vandecappelle (Essensium/Mind)
8bc9350963 systemd: clear telinit path
Since we don't enable sysv any support, it makes no sense to set the
path to telinit either.

The path we were setting was anyway wrong: we set a path into
TARGET_DIR, but this path is only used at runtime, on the target, where
TARGET_DIR doesn't exist (it should have been /usr/sbin/telinit).

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2020-11-03 22:17:55 +01:00
Norbert Lange
acb62b3336 package/systemd: add missing path options
If paths are not set, then meson will search the host system for the
binaries (or the target, where those binaries are not yet installed).
So add the missing paths.

Signed-off-by: Norbert Lange <nolange79@gmail.com>
Reviewed-by: Adam Duskett <aduskett@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2020-11-03 22:17:55 +01:00
Michael Nosthoff
e46fe9a6f2 package/systemd: group all journal-remote tools under a single option
The -Dremote=true flag enables three tools: systemd-journal-gatewayd,
systemd-journal-remote and systemd-journal-upload.

It is not possible with simple means to install them seperately. So use
the systemd-journal-remote option to enable or disable them all together.

Drop systemd-journal-gatewayd option and add it to legacy.

Fixes: 

Signed-off-by: Michael Nosthoff <buildroot@heine.tech>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2020-10-14 20:41:32 +02:00
Michael Nosthoff
c572e797a0 package/systemd: use libqrencode independently of remote tools
systemds libqrencode support is independent from journal-gatewayd. In
v247 it will additionally be used in homectl for recovery key
generation.

Signed-off-by: Michael Nosthoff <buildroot@heine.tech>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2020-10-14 19:39:19 +02:00
Alexander Egorenkov
faf4e982fd package/systemd: add support for IBM s390x and Z arch
Signed-off-by: Alexander Egorenkov <egorenar@linux.ibm.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-09-24 22:56:09 +02:00
Norbert Lange
ea2c2190b3 package/systemd: bump version to 246.5
Signed-off-by: Norbert Lange <nolange79@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2020-09-14 21:13:11 +02:00
Titouan Christophe
f5b89563d7 package/systemd: disable zstd for host-systemd
systemd 246 added support for zstd compression of large fields in
journal files [1]. Since zstd is only used at runtime, we don't
need it to enable its support in host-systemd.

[1] https://github.com/systemd/systemd/blob/v246/NEWS#L323-L331

Signed-off-by: Titouan Christophe <titouan.christophe@railnova.eu>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-09-04 22:13:31 +02:00
Antoine Tenart
b5704f2ec8 package/systemd: select SELinux modules
Select the systemd and udev SELinux modules so that they will be
compiled in the refpolicy. This way, if an SELinux policy is generated,
Systemd will be supported.

Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2020-09-04 10:52:39 +02:00
Peter Korsgaard
c287d789b7 Merge branch 'next'
A number of merge conflicts, but hopefully they are all sorted out now.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2020-09-02 18:14:46 +02:00
Carlos Santos
d648d81dd5 packages/{eudev, systemd}: move common users to package/udev
Use UDEV_USERS, now that it's suported by virtual packages.

Signed-off-by: Carlos Santos <unixmania@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2020-08-30 18:07:33 +02:00
Carlos Santos
8bafc6dc8a package/util-linux: build programs and libraries in separate packages
The different tools and libraries in util-linux have a lot of optional
dependencies. When we want to support those optional dependencies, we
can easily generate dependency cycles. For instance, findmount and lsblk
need udev to work correctly, but eudev and systemd both depend libblkid,
which comes from util-linux.

Normal distros (e.g. Debian) solve this by first building a minimal
package that has no dependencies at all, then build the packages that
depend on util-linux, and finally rebuild util-linux with all bells and
whistles. Solve it in Buildroot by means of the following changes:

- Split util-linux into two packages:
  - util-linux-libs, providing lib{blkid,fdisk,mount,smartcols,uuid}.
  - util-linux, providing both the aforementioned libs and the programs.
- Add a blind selection for util-linux-libs, i.e. it is indirectly
  selected according to the util-linux options.
- Make host and target util-linux have a build dependencies on the -libs
  packages.
- Make eudev and systemd have build dependencies on util-linux-libs.
  This can be extended to other packages in the future but is not needed
  right now because the configuration options are backward-compatible.
- Make util-linux have an optional build dependency on the package that
  provides libudev (either eudev or systemd), if it is selected.

Installing util-linux overrides files installed by util-linux-libs but
this is not a problem: it's allowed for a package to overwrite files
from another package, as long as there is a dependency between the two.

util-linux-libs has a Config.in symbol for the package as a whole, but
not for the individual libraries: it simply reuses the symbols of the
full package.

The build dependency of util-linux on util-linux-libs ensures that
util-linux overwrites the files installed by util-linux-libs and not
vice versa. In practice this dependency shouldn't be needed: the only
reason for util-linux-libs to be built is to break a circular
dependency. In that case, there is already a transitive dependency of
util-linux on util-linux-libs, so adding it explicitly is redundant.
Still, better safe than sorry.

host-util-linux-libs is not needed at the moment. It can be added if we
have a dependency cycle problem later.

With this approach we don't need to patch configuration files neither
change packages other than eudev and systemd.

Other packages that require util-linux libraries and whose libraries may
be used by util-linux programs can be updated later. We also don't need
to change any existing defconfig, since all configuration options are
kept in the util-linux package.

Fixes: https://bugs.busybox.net/show_bug.cgi?id=11811

Signed-off-by: Carlos Santos <unixmania@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2020-08-30 16:18:44 +02:00
Fabrice Fontaine
b6466ec414 package/systemd: disable audit for host package
Disable audit for host package to avoid getting the following error if
it is found on host:

[84/662] Generating audit_type-list.txt with a meson_exe.py custom command
In file included from <command-line>:32:
./../src/basic/missing_audit.h:7:10: fatal error: libaudit.h: No such file or directory
    7 | #include <libaudit.h>
      |          ^~~~~~~~~~~~

Fixes:
 - http://autobuild.buildroot.org/results/67782c225c08387c1bbcbea9eee3ca12bc6577cd

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2020-08-29 18:34:54 +02:00
Fabrice Fontaine
04b54138e6 package/systemd: disable cryptsetup for host package
Build with cryptsetup and without libblkid will fail on:

../src/shared/dissect-image.c:1336:34: error: 'N_DEVICE_NODE_LIST_ATTEMPTS' undeclared (first use in this function)
 1336 |         for (unsigned i = 0; i < N_DEVICE_NODE_LIST_ATTEMPTS; i++) {
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~

This bug has been reported upstream:
https://github.com/systemd/systemd/pull/16901
and is not an issue for the target variant as libblkid is select by
BR2_PACKAGE_UTIL_LINUX_MOUNT

As cryptsetup does not seem needed for host-systemd, just disable it

Fixes:
 - http://autobuild.buildroot.org/results/67782c225c08387c1bbcbea9eee3ca12bc6577cd

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2020-08-29 18:34:38 +02:00
Norbert Lange
b37fa74380 package/systemd: disable portabled
portabled is a container-like service, but so far its still a preview
and basically unknown as the portablectl is hidden in
/usr/lib/systemd.

Disable it for now.

See https://systemd.io/PORTABLE_SERVICES/

Signed-off-by: Norbert Lange <nolange79@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2020-08-05 15:48:56 +02:00
Norbert Lange
c2c32f865c package/systemd: remove util-linux nologin dependency
if the tool is not enabled, then configure /bin/false
as fallback.

Signed-off-by: Norbert Lange <nolange79@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2020-08-05 15:48:17 +02:00
Norbert Lange
42a96d8a00 package/systemd: remove util-linux binaries dependency
None of the tools in this set are necessary.

Signed-off-by: Norbert Lange <nolange79@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2020-08-05 15:47:42 +02:00
Norbert Lange
5ca0214027 package/systemd: remove libblkid dependency
this dependency is optional, it is used to
allow udev to add information to blockdevices.
Aslong as MOUNT or FSCK are enabled, it will end up enabled
anyway, but this seems more clear and correct.

Signed-off-by: Norbert Lange <nolange79@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2020-08-05 15:42:56 +02:00