Skip to contentSkip to conversation

package/cryptsetup: disable tmpfiles.d for host build

PATCH New John Keeping 2 participants 4 messages May 7, 2021 – May 10, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/cryptsetup: disable tmpfiles.d for host build

When building host-cryptsetup, if tmpfiles.d support is enabled then the install step tries to install /usr/lib/tmpfiles.d/cryptsetup.conf globally on the host system.

Even if the tmpfiles.d config were installed correctly in the host directory, nothing would ever run these rules, so disable this feature via configure.

---
 package/cryptsetup/cryptsetup.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
package/cryptsetup/cryptsetup.mk +2 -1
index 719885b59c..cd5883d0b4 100644
@@ -43,7 +43,8 @@ HOST_CRYPTSETUP_DEPENDENCIES = \
 
 HOST_CRYPTSETUP_CONF_OPTS = --with-crypto_backend=openssl \
 	--disable-kernel_crypto \
-	--enable-blkid
+	--enable-blkid \
+	--with-tmpfilesdir=no
 
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
Signature · 1 line
2.31.1
#1 lore raw

PATCH 1/1 package/cryptsetup: disable tmpfiles.d for host build

Quoted 11 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"John" == John Keeping <[email protected]> writes:

When building host-cryptsetup, if tmpfiles.d support is enabled then the install step tries to install /usr/lib/tmpfiles.d/cryptsetup.conf globally on the host system.

Even if the tmpfiles.d config were installed correctly in the host directory, nothing would ever run these rules, so disable this feature via configure.

Committed, thanks.

I see we also don't pass that configure flag for the target variant?

Signature · 1 line
Bye, Peter Korsgaard
#2 lore raw

PATCH 1/1 package/cryptsetup: disable tmpfiles.d for host build

Quoted 10 lines · On Sat, 08 May 2021 18:23:48 +0200 Peter Korsgaard <[email protected]> wrote:
Quoted 9 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"John" == John Keeping <[email protected]> writes:

When building host-cryptsetup, if tmpfiles.d support is enabled then the install step tries to install /usr/lib/tmpfiles.d/cryptsetup.conf globally on the host system.

Even if the tmpfiles.d config were installed correctly in the host directory, nothing would ever run these rules, so disable this feature via configure.

Quoted 5 lines
Quoted 1 line

Committed, thanks.

I see we also don't pass that configure flag for the target variant?

Good point.

For the target, DESTDIR is applied to the path so there's no obvious failure. But the location is discovered via pkg-config the behaviour will change depending on whether cryptsetup is built before or after systemd, so I think we need the patch below.

-- >8 --
Subject: [PATCH] package/cryptsetup: fix tmpfiles.d setup

The configure script uses pkg-config to detect the location of tmpfiles.d but imposes an unspecified ordering dependency on systemd. Instead of relying on systemd being built before cryptsetup, set the directory path explcitly, and ensure it is not set when systemd-tmpfiles is disabled.

---
 package/cryptsetup/cryptsetup.mk | 6 ++++++
 1 file changed, 6 insertions(+)
package/cryptsetup/cryptsetup.mk +6 -0
index cd5883d0b4..eee84a7958 100644
@@ -33,6 +33,12 @@ else
 CRYPTSETUP_CONF_OPTS += --with-crypto_backend=kernel
 endif
 
+ifeq ($(BR2_PACKAGE_SYSTEMD_TMPFILES),y)
+CRYPTSETUP_CONF_OPTS += --with-tmpfilesdir=/usr/lib/tmpfiles.d
+else
+CRYPTSETUP_CONF_OPTS += --with-tmpfilesdir=no
+endif
+
 HOST_CRYPTSETUP_DEPENDENCIES = \
 	host-pkgconf \
 	host-lvm2 \
Signature · 1 line
2.31.1
#3 lore raw

PATCH 1/1 package/cryptsetup: disable tmpfiles.d for host build

In reply to John Keeping
Quoted 11 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"John" == John Keeping <[email protected]> writes:

When building host-cryptsetup, if tmpfiles.d support is enabled then the install step tries to install /usr/lib/tmpfiles.d/cryptsetup.conf globally on the host system.

Even if the tmpfiles.d config were installed correctly in the host directory, nothing would ever run these rules, so disable this feature via configure.

Committed to 2021.02.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard