package/systemd: fix paths to runtime utilities
PATCH v2 1/1 package/systemd: fix paths to runtime utilities
systemd's configure is looking in $PATH to find utilities that will be needed at runtime.
Usually, those utilties, when installed on the host, will be found in the same path they would be present on the target. For example, /usr/bin/mount on the host would also be /usr/bin/mount on the target, and all is find.
Except when we need to install a host variant of util-linux, which will install mount in $(HOST_DIR), in which case systemd's configure would find that one.
Of course, it is also very well possible that those utilities are not installed on the host in the same location they would be on the target, in case a user has manually installed some of those (e.g. in /usr/local/ or in /opt/)
Forcibly set the path to those utilities, as they are expected to be on the target.
For kexec, we can set it even though we do not depend on it (yet). systemd will appropriately test it at runtime.
For quota, we point to non-existing files, so as to catch errors at runtime. It is to be noted that quotacheck is optional, while quotaon does not seem to be (a service file is always installed, that uses it).
Note: utilties listed in the order they appear in configure.ac
---
Changes v1 -> v2:
- fix variables and paths for mount and umount (Adam)
--- package/systemd/systemd.mk | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
package/systemd/systemd.mk +14 -2
@@ -45,10 +45,16 @@ SYSTEMD_CONF_OPTS += \ SYSTEMD_CFLAGS = $(TARGET_CFLAGS) -fno-lto -# Override path to kmod, used in kmod-static-nodes.service +# Override paths to a few utilities needed at runtime, to +# avoid finding those we would install in $(HOST_DIR). SYSTEMD_CONF_ENV = \ CFLAGS="$(SYSTEMD_CFLAGS)" \ - ac_cv_path_KMOD=/usr/bin/kmod + ac_cv_path_KILL=/usr/bin/kill \ + ac_cv_path_KMOD=/usr/bin/kmod \ + ac_cv_path_KEXEC=/usr/sbin/kexec \ + ac_cv_path_SULOGIN=/usr/sbin/sulogin \ + ac_cv_path_MOUNT_PATH=/usr/bin/mount \ + ac_cv_path_UMOUNT_PATH=/usr/bin/umount define SYSTEMD_RUN_INTLTOOLIZE cd $(@D) && $(HOST_DIR)/usr/bin/intltoolize --force --automake
@@ -182,8 +188,14 @@ endif ifeq ($(BR2_PACKAGE_SYSTEMD_QUOTACHECK),y) SYSTEMD_CONF_OPTS += --enable-quotacheck +SYSTEMD_CONF_ENV += \ + ac_cv_path_QUOTAON=/usr/sbin/quotaon \ + ac_cv_path_QUOTACHECK=/usr/sbin/quotacheck else SYSTEMD_CONF_OPTS += --disable-quotacheck +SYSTEMD_CONF_ENV += \ + ac_cv_path_QUOTAON=/.missing \ + ac_cv_path_QUOTACHECK=/.missing endif ifeq ($(BR2_PACKAGE_SYSTEMD_TMPFILES),y)
Signature · 1 line
2.11.0
Thomas Petazzoni
AppliedPATCH v2 1/1 package/systemd: fix paths to runtime utilities
Hello,
Quoted 34 lines · Yann E. MORIN
systemd's configure is looking in $PATH to find utilities that will be needed at runtime.
Usually, those utilties, when installed on the host, will be found in the same path they would be present on the target. For example,
/usr/bin/mounton the host would also be/usr/bin/mounton the target, and all is find.Except when we need to install a host variant of util-linux, which will install mount in $(HOST_DIR), in which case systemd's configure would find that one.
Of course, it is also very well possible that those utilities are not installed on the host in the same location they would be on the target, in case a user has manually installed some of those (e.g. in
/usr/local/or in/opt/)Forcibly set the path to those utilities, as they are expected to be on the target.
For kexec, we can set it even though we do not depend on it (yet). systemd will appropriately test it at runtime.
For quota, we point to non-existing files, so as to catch errors at runtime. It is to be noted that quotacheck is optional, while quotaon does not seem to be (a service file is always installed, that uses it).
Note: utilties listed in the order they appear in configure.ac
Reported-by Adam Duskett <[email protected]>Signed-off-by "Yann E. MORIN" <[email protected]>Cc Maxime Hadjinlian <[email protected]>Cc Adam Duskett <[email protected]>
Quoted 6 lines
---
Changes v1 -> v2:
- fix variables and paths for mount and umount (Adam)--- package/systemd/systemd.mk | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
Applied to master, thanks. Peter: I believe this should go in the LTS branches.
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v2 1/1 package/systemd: fix paths to runtime utilities
Quoted 4 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni <[email protected]> writes:
Hello,
On Fri, 9 Jun 2017 21:03:47 +0200, Yann E. MORIN wrote:
Quoted 8 lines
Quoted 5 lines
systemd's configure is looking in $PATH to find utilities that will be needed at runtime.
package/systemd/systemd.mk| 16 ++++++++++++++--1 file changed, 14 insertions(+), 2 deletions(-)Applied to master, thanks. Peter: I believe this should go in the LTS branches.
Agreed - Committed to 2017.02.x and 2017.05.x, thanks.
Signature · 1 line
Bye, Peter Korsgaard