Commit graph

274 commits

Author SHA1 Message Date
Norbert Lange 32f53bdfb4 package./systemd: disable utmp
From wikipedia:

    utmp maintains a full accounting of the current status of the
    system, system boot time (used by uptime), recording user
    logins at which terminals, logouts, system events etc.

This is seldom use, if at all, on an embedded device, and may expose
users' behaviour to others (by observing who logs in from where, for
example).

Forcibly disable support for utmp.

Signed-off-by: Norbert Lange <nolange79@gmail.com>
[yann.morin.1998@free.fr: split off to its own patch]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-07-18 22:43:25 +02:00
Norbert Lange 96f0d9969e package/systemd: remove SysV compatibility feature
Systemd enables compatibility with SysV services and utmp by default,
none of which is needed for buildroot as the packages' .mk will install
only the files for the chosen init system.

Furthermore, SysV support requires a setup where *both* /etc/init.d and
/etc/rc.d exists (the latter for the usual /etc/rcN.d). However, in
Buildroot, the latter does not exist; so we would not be able to provide
a working SysV support anyway.

So, just forcibly disable SysV support.

Signed-off-by: Norbert Lange <nolange79@gmail.com>
[yann.morin.1998@free.fr:
  - expand commit log
  - disable utmp in its own patch
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-07-18 22:43:25 +02:00
Norbert Lange 0d887cc2b4 system: replace nogroup with nobody
Currently, we define the so-called "overflow group" as 'nogroup'.

However, one practical issue is that systemd-sysusers will otherwise
create a 'nobody' group with gid 999, because that's is what is usual to
define the overflow group: users and groups are defined in LSB (Linux
Standard Base):

    https://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/usernames.html

Quoting: "If the username exists on a system,then they should be in the
suggested corresponding group".

Only Debian and derivatives depart from this custom, naming it 'nogroup'
(hence the rationale for commit 908198e756 (system/skeleton: remove
spurious group 'nobody').

See also commit 9c67af2c52 (system/skeleton: use uid/gid 65534 for
nobody/nogroup), and a related discussion on LWN.net (key is "overflow
UID" which also applies to GID):

    https://lwn.net/Articles/695478/

Use the recommended groupname 'nobody'. Adapt packages accordingly.

Signed-off-by: Norbert Lange <nolange79@gmail.com>
[yann.morin.1998@free.fr:
  - reword commit log
  - extend commit log with more references (commits and LWN)
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-07-18 14:18:33 +02:00
Norbert Lange 3346d78384 package/systemd: cosmetic rearrange list of users
Group the udev users first, to make clear which software
requires them.

Signed-off-by: Norbert Lange <nolange79@gmail.com>
Reviewed-by: Jérémy Rosen <jeremy.rosen@smile.fr>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-07-18 13:43:23 +02:00
Norbert Lange 3f5fa423f4 package/systemd: register NSS plugins in nsswitch.conf
This supports 4 plugins, each will be added at the right spot if
enabled, based on the template coming with systemd.

The sed replacements are carefully written to be idempotent, and to
be robust enough to be combined with the other available packages
(nss_mdns4) in any installation order.

nss-systemd is used for the DynamicUser features, which is a defacto
necessity for systemd. It handles transient users/groups without
touching the /etc/{passwd,group} files on disk. To support the
'SupplementaryGroups' feature, groups should be merged.

nss-myhostname allows resolving the hostname, again without touching
files in /etc.

nss-mymachines adds name resolution from containers supported by
machined. Users from the containers might end up in system groups, so
groups should be merged.

nss-resolve, part of resolved, is required for consistent dns lookups.
As per the documentation (nss-resolve(8)), DNS queries shall not
continue past the resolve service, unless the service is not available.

We anchor nss_resolve to appear after files, if mymachines is also used,
remove that first (and add it back later). Other packages (mdns4) move
around the dns entry, so replacing that is not a good option.

If mdns4 is installed aswell, then resolved will take precedence for
host lookups.

Signed-off-by: Norbert Lange <nolange79@gmail.com>
[yann.morin.1998@free.fr:
  - exp[lain why 'host: resolve' uses !UNAVAIL=return
  - rewrap commit log
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-07-18 09:39:12 +02:00
Bernd Kuhls c3a50eeae2 package/systemd: fix build with libmicrohttpd 0.9.71
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-07-05 14:17:28 +02:00
Norbert Lange 9f1a9ee932 package/systemd: fixup RPATH for more systemd host binaries
All systemd binaries depend on libsystemd-shared and need their RPATH
fixed. Use a glob to catch them all.

We can't use $(wildcard ...) because this is expanded before any file
may exist (it's in the same rule that install those file, and the
expansion in Makefile is done once at the beginning of the recipe).

We need to test each file:
 1. to ignore files that were not build (e.g. because the host is
    missing some dependencies (in which case we don't care; we're only
    interested in systemctl, and that one is already built)
 2. to ensure the glob was expanded (in case no file would match
    systemd-*)

Signed-off-by: Norbert Lange <nolange79@gmail.com>
[yann.morin.1998@free.fr:
  - don't use 'set -e', use the more traditional '|| eixt 1'
  - don't cd into HOST_DIR/bin, but use $(addprefix ...)
  - use positive logic in the test
  - expand commit log
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-06-17 22:35:54 +02:00
Norbert Lange 80d6aea2ec package/systemd: sync user comments to upstream
The necessary system users are documented in the projects README.

Description is matched to the ones in the upstream sysusers.d
files. Remove homedirectory (upstream doesnt care either).

Signed-off-by: Norbert Lange <nolange79@gmail.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-06-15 11:46:32 +02:00
Norbert Lange b9aad0ee4c package/systemd: create "remote" user if the feature is enabled
Signed-off-by: Norbert Lange <nolange79@gmail.com>
Reviewed-by: Jérémy Rosen <jeremy.rosen@smile.fr>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-06-15 11:43:50 +02:00
Norbert Lange b82ee4dbb6 package/systemd: remove unused user accounts
Since V235 the "gateway" and "upload" services use DynamicUsers,
requiring no entries in /etc/passwd.
This functionality requires nss-systemd, which is always
enabled in buildroot.

The "bus-proxy" user was removed in V230.

Signed-off-by: Norbert Lange <nolange79@gmail.com>
Reviewed-by: Jérémy Rosen <jeremy.rosen@smile.fr>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-06-15 11:41:55 +02:00
Norbert Lange 65b63785a6 package/systemd: move preset-all HOOK to fakeroot stage
User can drop in more systemd units or presets
in an rootfs overlay, which will be copied over *after*
the TARGET_FINALIZE_HOOKS are run.

Instead, run preset-all afterwards from ROOTFS_PRE_CMD_HOOKS

Signed-off-by: Norbert Lange <nolange79@gmail.com>
Reviewed-by: Jérémy ROSEN <jeremy.rosen@smile.fr>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-06-07 13:45:38 +02:00
Adam Duskett 3d54d99c6e package/systemd: bump version to 245.6
Signed-off-by: Adam Duskett <Aduskett@gmail.com>
[yann.morin.1998@free.fr: two sapces in hash file]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-06-03 21:35:55 +02:00
Jérémy Rosen 26c32d933e packages/systemd: fix double getty on console
When selecting "console" for the automatic getty, the buildroot logic
would collide with systemd's internal console detection logic, resulting
in two getty being started on the console.

This commit fixes that by doing nothing when "console" is selected and
letting systemd-getty-generator deal with starting the proper getty.

Note that if something other than the console is selected
* Things will work properly, even if the selected terminal is also the
  console
* A getty will still be started on the console.
  This is what systemd has been doing on buildroot since the beginning. it
  could be disabled but I left it for backward compatibility

Fixes: #12361
Signed-off-by: Jérémy Rosen <jeremy.rosen@smile.fr>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-05-23 00:10:18 +02:00
Adam Duskett b285cd9b05 package/systemd: add support for apparmor
If libapparmor is selected, depend on libapparmor and set -Dapparmor=true

Signed-off-by: Adam Duskett <Aduskett@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2020-05-09 13:42:42 +02:00
Yann E. MORIN 94cb814511 package/systemd: bear the kernel options munging
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Adam Duskett <aduskett@gmail.com>
Cc: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2020-05-01 15:50:28 +02:00
Adam Duskett d7e3d37f64 package/systemd: bump version to v245.5
Signed-off-by: Adam Duskett <Aduskett@gmail.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-04-23 23:22:16 +02:00
James Hilliard b53987e09e package/systemd: add fdisk support
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2020-04-12 15:47:09 +02:00
James Hilliard 93d8b5d903 package/systemd: add gnutls support
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2020-04-12 15:47:09 +02:00
James Hilliard a9cc35d8fc package/systemd: add openssl support
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2020-04-12 15:47:09 +02:00
James Hilliard 09d0c7b6ef package/systemd: add p11-kit support
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2020-04-12 15:47:09 +02:00
James Hilliard 427dbae155 package/systemd: enable nss-mymachines when machined is enabled
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2020-04-12 15:47:09 +02:00
James Hilliard 12a808f254 package/systemd: enable nss-resolve when resolve is enabled
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2020-04-12 15:47:09 +02:00
James Hilliard c2ba6105a7 package/systemd: enabled dnssec when available
When libgcrypt is available set default-dnssec to the backwards
compatible allow-downgrade option.

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2020-04-12 15:47:09 +02:00
James Hilliard fa62b5165c package/systemd: add homed support
systemd-homed is a system service that may be used to create, remove,
change or inspect home directories.

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
[Thomas:
  - add missing dependency on kernel headers >= 4.12
  - add missing Config.in comment about dependency]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2020-04-12 15:47:09 +02:00
Yann E. MORIN b57632683b package/systemd: make sure init choice and package have same dependencies
Currently, the dependencies for the init system choice, and the
dependencies for the package, are slightly different, and not in the
same order, the latter making it difficult to assess consistency between
the two.

Fix all that, by cross-duplicating dependencies from the init choice and
the package, and order the dependencies according to the manual (arch
first, toolchain, then the others).

Note that some dependencies are redundant, but kept nonetheless for
correctness:

  - BR2_USE_MMU is implied by BR2_TOOLCHAIN_USES_GLIBC, but systemd does
    use fork();

  - !BR2_STATIC_LIBS is also implied by BR2_TOOLCHAIN_USES_GLIBC, but it
    is also inherited from kmod which we select;

  - BR2_TOOLCHAIN_HAS_THREADS is also implied by BR2_TOOLCHAIN_USES_GLIBC,
    but systemd does use pthread_*() functions.

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-04-05 20:33:36 +02:00
Romain Naour 2196ee25ff package/systemd: add gcc >= 5.x dependency
As reported on the mailing list, there is a build issue with systemd 245
when using gcc < 5.0:

http://lists.busybox.net/pipermail/buildroot/2020-April/278931.html

Build issue:
../src/shared/gpt.c:7:9: error: initializer element is not constant
         { GPT_ROOT_X86,              "root-x86"              },

When testing with a toolchain using gcc 5.4.0 and the build is ok.
http://toolchains.bootlin.com/downloads/releases/toolchains/armv5-eabi--glibc--stable-2017.05-toolchains-1-1.tar.bz2

While searching for "error: initializer element is not constant" message, we
can notice a note about gcc 5 change about "Initializing statics with compound
literals":

https://gcc.gnu.org/gcc-5/porting_to.html

Add a dependency on gcc 5 to avoid using to old compiler.

There is the same issue with host-systemd with host gcc 4.9
(tested with Debian Jessie). So, add a dependency on host gcc >= 5.x.

Fixes:
http://autobuild.buildroot.org/results/520/520dab2253f4cbe408a8177a6587dcb38c6ba215
http://autobuild.buildroot.org/results/e0e/e0e0512de822864d670b5d176798a24ab09eed2d
http://autobuild.buildroot.org/results/f56/f5660b2711627fcee4086e096e4ec4d9ba190ab6

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Adam Duskett <aduskett@gmail.com>
Cc: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Cc: Yann E. MORIN <yann.morin.1998@free.fr>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-04-05 20:33:32 +02:00
Adam Duskett 7c099731e7 package/systemd: bump version to 245.4
Signed-off-by: Adam Duskett <Aduskett@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2020-04-04 22:29:35 +02:00
Yann E. MORIN 1a07ba73e4 package/systemd: drop leftover patch
On master during the stabilisation phase, a new patch was added to
systemd; in parallel, on the next branch, systemd was bumped. Then, when
next was merged into master, there was no merge conflict, so the uneeded
patch was left unnoticed.

That patch was applied upstream, and is present in the version we now
have, so it no longer applies.

Drop that patch.

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-03-09 22:01:13 +01:00
Peter Korsgaard fd99eb5016 Merge branch 'next'
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2020-03-09 15:17:09 +01:00
James Hilliard cb619c5831 package/systemd: add userdb support
systemd-userdbd is a system service that multiplexes user/group lookups
to all local services that provide JSON user/group record definitions
to the system. In addition it synthesizes JSON user/group records from
classic UNIX/glibc NSS user/group records in order to provide full
backwards compatibility.

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2020-03-08 15:16:09 +01:00
James Hilliard ed74dc875d package/systemd: add repart support
systemd-repart grows and adds partitions to a partition table, based on
the configuration files described in repart.d.

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2020-03-08 15:16:05 +01:00
James Hilliard d4ebd8cd4c package/systemd: add dns-over-tls support
Set default-dns-over-tls to opportunistic when dns-over-tls is enabled
as it should be fully backwards compatible. The DNSOverTLS config in
resolved.conf can be used to override default-dns-over-tls.

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2020-03-08 15:06:01 +01:00
James Hilliard 3b634af442 package/systemd: bump to version 245
Disabled new modules for now.

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2020-03-07 22:04:39 +01:00
Yann E. MORIN dabb5181ad package/systemd: also fix rpath for machine-id-setup
Fixes: #12576

Reported-by: Melanie <melanie@trash-mail.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Adam Duskett <aduskett@gmail.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-03-01 19:16:31 +01:00
Yann E. MORIN 0ae12f05ee package/systemd: also fix rpath for nspawn
Fixes:
    http://autobuild.buildroot.org/results/e03ae6a3209eea00459b94cee9c10fd4f2184fec/

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Adam Duskett <aduskett@gmail.com>
Cc: Jérémy Rosen <jeremy.rosen@smile.fr>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-03-01 19:15:50 +01:00
Romain Naour 0fd23c3e28 package/systemd: random-seed: add missing header for GRND_NONBLOCK
GRND_NONBLOCK has been introduced with the 3.17 kernel version [1]
while adding getrandom(2) system call.

The header missing_random.h is needed for random-seed.c when building
with old toolchain, such Sourcery CodeBench ARM 2014.05 (kernel headers
3.13).

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

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?id=c6e9d6f38894798696f23c8084ca7edbf16ee895

Signed-off-by: Romain Naour <romain.naour@smile.fr>
Cc: Yann E. MORIN <yann.morin.1998@free.fr>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-03-01 17:32:29 +01:00
Adam Duskett cfa1bba5b6 package/systemd: bump version to 244.3
For additional post-244 fixes.

Update the hash of the README after commit faba5b2b (Revert "Drop dbus
activation stub service") changed a comment about dbus:

-       dbus >= 1.11.0 (strictly speaking optional, but recommended)
+       dbus >= 1.4.0 (strictly speaking optional, but recommended)
+               NOTE: If using dbus < 1.9.18, you should override the default
+               policy directory (--with-dbuspolicydir=/etc/dbus-1/system.d).

Signed-off-by: Adam Duskett <Aduskett@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2020-02-26 16:34:18 +01:00
Pascal de Bruijn 5ba81d0109 package/systemd: use interface name for networkd config file
By using the interface in the filename for the networkd config file,
we have a clear association between the config file and the interface
it applies to.

This is beneficical for systems that have multiple interfaces.

Signed-off-by: Pascal de Bruijn <p.debruijn@unilogic.nl>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2020-02-03 23:43:49 +01:00
Yann E. MORIN b0d94ad5ad package/systemd: add dependency on host-coreutils
This is needed as systemd has gained a dependency on realpath(1) which
was introduced in coreutils too recently for our supported distro to
have it (Ubuntu 14.04 does not have it from coreutils, although there is
a dedicated package for it).

This also means that we now have a ln that understands --relative, so we
can drop our workaround, that upstream said they would never accept
anyway [0].

[0] https://github.com/systemd/systemd/pull/5682

Fixes:
    http://autobuild.buildroot.org/results/a9a/a9a285e482285d062892bab0d1a2e2f89928c92d/
    http://autobuild.buildroot.org/results/6f5/6f5b1065859d866af6fa719f611c3ea7f4b88760/
    ...

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Adam Duskett <aduskett@gmail.com>
Cc: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2020-01-06 21:44:00 +01:00
Jérémy Rosen 9bdeb0b344 package/systemd: bump to 244.1
Signed-off-by: Jérémy Rosen <jeremy.rosen@smile.fr>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2019-12-19 18:04:49 +01:00
Jérémy Rosen 6c3944a057 package/systemd: fix tty handling
Handling of tty is a bit tricky, we need to aggressively disable what
systemd does with tty1 then update for what buildroot wants to do

Rework the whole tty generation to work with presets

Signed-off-by: Jérémy Rosen <jeremy.rosen@smile.fr>
[yann.morin.1998@free.fr:
  - fold long lines
  - drop spurious empty lines removals
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2019-12-18 18:27:41 +01:00
Jérémy Rosen 231ad359bc package/systemd: use host-systemctl preset all to enable units
since v234 upstream recommands using systemctl preset-all to enable units.
* add a buildroot specific preset file
* use that file to disable getty@tty1
* make systemd depend on host-systemd
* remove all link-creating code that systemd does for us.

Most packages will not be affected by this change, but a few packages
were installing units without manually enabling them. Those packages
will now be automatically enabled.

The fact that those packages were not enabled is almost certainly a bug,
but it is a change of behaviour that needs to be reported

host-systemd also builds udevadm for the host. That means we no longer
need to depend on host-eudev to provide udevadm (that would conflict).

Signed-off-by: Jérémy Rosen <jeremy.rosen@smile.fr>
[yann.morin.1998@free.fr:
  - also remove the hwdb sources on fs generation
  - fix check-package errors
  - few typoes and reformatting in commit log
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2019-12-18 18:27:41 +01:00
Jérémy Rosen 35c11a027c package/systemd: add host variant
Add the infrastructure to build the host version of systemd
* disable all optional features, they can be re-added when needed
* systemd has creative way of dealing with cross compile
  we build a "normal" host systemd, but install it in $HOST_DIR
  we use systemctl --root to correctly act on TARGET_DIR
* we need to adjust RPATH using patchelf because meson can't do it
  correctly by itsel

The first question is: why do we use --prefix=/usr ?

systemd will store its --prefix in all the executables it generates. As
such, systemctl will have a hardcoded 'prefix', where it will manipulate
and create files/symlinks in. When called natively, this is nice and
shinny.

However, for cross-setup, that does not work obviously.

So, systemd has its tools know about the 'root' directory where this
prefix should be related to. We can call systemctl --root=$(TARGET_DIR)
and systemctl wil do the links and such in there.

However, it does so by appending its known prefix to it.

So, if we were to configure host-systemd as we usually do, with
--prefix=$(HOST_DIR), then when we would call host systemctl --root=$(TARGET_DIR)
it would look for files in $(TARGET_DIR)/$(HOST_DIR), which is wrong.

Calling the host systemctl without --root is also wrong, as it would look for
files in $(HOST_DIR)

So, there is no satisfying official support for this case.

The trick then, is to configure systemd with the prefix it would expect
at runtime (on the target!), that is with /usr, but install out-of-tree.

That was it for the first part of the question: why do we use --prefix.

Now, the second question is: why do we need to muck up with the rpath
after installation?

Well, this boils down to meson (and not systemd itself). When it
installs executables, meson will handily insert whatever rpath the
package meson.build would tell it to use. systemd installs libs in
$(prefix)/lib/systemd and has a NEEDED to those libs, so it uses an
RPATH to find those libs, and meson does inject that RPATH into the
installed executables.

However, we Buildroot also want to insert our own RPATH, because systemd
uses util-linux' libs and libcap, installed in $(HOST_DIR), so it needs
our RPATH.

However, meson can not extend the RPATH from the LDFLAGS in the
environment; meson can only set the RPATH from what it knows about from
the package's meson.build.

That, in addition to the --prefix=/usr issue above, means that the
executables installed by host-systemd have an RPATH set to
/usr/lib/systemd. when we would want it to be set to
$(HOST_DIR)/lib:$(HOST_DIR)/lib/systemd

That's what is done in the post-install hook: set the RPATH to the
appropriate values.

Signed-off-by: Jérémy Rosen <jeremy.rosen@smile.fr>
[yann.morin.1998@free.fr:
  - reformatting in commit log
  - declare host variant after target variant
  - simplify comments
  - slight reordering of variable (HOST_SYSTEMD_NINJA_ENV moved)
  - reformatting for mutli-line variable (HOST_SYSTEMD_HOST_TOOLS)
  - don't split HOST_SYSTEMD_CONF_OPTS in two sets
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2019-12-18 16:51:44 +01:00
Adam Duskett 35f1195979 package/systemd: bump to version 244
Other changes:
  - Update hash for README due to added licence directory tools/chromiumos.
  - Add hash for tools/chromiumos/LICENSE
  - Added BSD-3-Clause (tools/chromiumos) in systemd.mk due to the new
    tools/chromiumos directory.
  - Added tools/chromiumos/LICENSE to SYSTEMD_LICENSE_FILES in systemd.mk

Signed-off-by: Adam Duskett <Aduskett@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2019-12-08 16:53:36 +01:00
Adam Duskett ce2a5eff78 package/polkit: bump to version 0.116
Other changes:
  - Add spidermonkey as a dependency.
  - Add 0001-make-netgroup-support-optional.patch to allow building on musl.
  - Add a runtime dependency on dbus.
  - Add --disable-libelongind.
  - Add --disable-libsystemd-login.
  - Update dependencies for systemd pam support.
  - Update dependencies for udisks.

Signed-off-by: Adam Duskett <Aduskett@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2019-12-08 15:56:32 +01:00
Fabrice Fontaine 274a4092ee package/systemd: fix license hash
Bump to 243.4 forgot to update hash of README file (update to the
requirements).

Fixes:
 - http://autobuild.buildroot.org/results/eae13046b90253cdb2bf260e10b316386dff4eb1

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
[yann.morin.1998@free.fr: explain why README was changed]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2019-11-24 20:14:40 +01:00
Jérémy Rosen d3af5d7040 package/systemd: bump to v243.4
Upstream systemd-stable has started tagging point releses.

The commit we currently used has now been tagged as v243.3, and this
brings us to v243.4.

Signed-off-by: Jérémy Rosen <jeremy.rosen@smile.fr>
[yann.morin.1998@free.fr:
  - expand commit log to explain previous version
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2019-11-23 22:23:12 +01:00
Christian Stewart 272695277e package/systemd: hybrid cgroupfs hierarchy for docker compatibility
Docker fails to start with "Devices cgroup isn't mounted" as of systemd 243.
According to the systemd documentation:

  systemd now defaults to the "unified" cgroup hierarchy setup during
  build-time, i.e. -Ddefault-hierarchy=unified is now the build-time default.
  Previously, -Ddefault-hierarchy=hybrid was the default. [...] Downstream
  production distributions might want to continue to use
  -Ddefault-hierarchy=hybrid (or even =legacy) for their builds as unfortunately
  the popular container managers have not caught up with the kernel API changes.

Changing this option to "hybrid" or "legacy" fixes the Docker startup.

Reference: https://github.com/opencontainers/runc/issues/654

Signed-off-by: Christian Stewart <christian@paral.in>
Tested-by: Jérémy Rosen <jeremy.rosen@smile.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2019-11-11 16:28:36 +01:00
Jérémy Rosen 1be112679d package/systemd: bump to 243-78
The systemd project maintains a separate repository on github where patches
are backported on top of released version by the systemd maintainers.

This patch changes the SYSTEMD_SITE to point on that repository and points
to the latest version of v243, which was the previous version used by
systemd.

Unfortunately, upstream does not tag any version,so we use 'git describe'
as a SYSTEMD_VERSION

Signed-off-by: Jérémy Rosen <jeremy.rosen@smile.fr>
Reviewed-by: James Hilliard <james.hilliard1@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2019-11-01 11:37:41 +01:00
Yann E. MORIN 6feba7cba1 packagesystemd: generate the hwdb.bin
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Peter Korsgaard <peter@korsgaard.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Carlos Santos <unixmania@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2019-11-01 08:53:04 +01:00