[Buildroot] [PATCH] package/tpm2-tss: fix build on host with setfacl

Peter Korsgaard peter at korsgaard.com
Sun Nov 7 08:45:05 UTC 2021


>>>>> "Yann" == Yann E MORIN <yann.morin.1998 at free.fr> writes:

s/with/without/ in the subject.


 > Since the bump to 3.1.0 in commit 470e2e9bc521 (package/tpm2-tss: bump
 > version to 3.1.0), the install is borked because it is looking for
 > programs at configure time, so it finds those on the host if they exist,
 > or do not find any at all, which can very well differ from what will be
 > present on the target.

 > But this is not totally unreasonable: there is no way, at cross-configure
 > time, for a package to find the tools that will be present at runtime.

 > All that can be done in such a case is to force the path to such tools.

 > However, in this case, tpm2-tss only uses setfacl if systemd-tmpfiles is
 > not available. If the call to setfacl fails, the install does not fail
 > (split on two lines for readability):

 >     @-$(call make_fapi_dirs) && $(call set_fapi_permissions) \
 >     || echo "WARNING Failed to create the FAPI directories with the correct permissions"

 > set_fapi_permissions is a macro that eventually expands to:

 >     (chown -R tss:tss "$1") && \
 >     (chmod -R 2775 "$1") && \
 >     (setfacl -m default:group:tss:rwx "$1")

 > So the call to setfacl will not even be ever attempted, because the
 > chown will fail first. Furthermore, it would look for the 'tss' username
 > and groupname from the host, which could differ from those on the
 > target.

 > So we can just fake the fact that setfacl is available.

 > As for the permissions, they are to be set on a directory that is in
 > ${runstatedir}, i.e. /run, which is a tmpfs, so there is no way we can
 > prepare them at build time. We'd need a startup script or systemd unit,
 > or proper systemd-tmpfiles support, either of which can be done in a
 > followup patch by an interested party...

 > Signed-off-by: Yann E. MORIN <yann.morin.1998 at free.fr>
 > Cc: Yair Ben-Avraham <yairba at protonmail.com>
 > Cc: Fabrice Fontaine <fontaine.fabrice at gmail.com>
 > Cc: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
 > Cc: Peter Korsgaard <peter at korsgaard.com>

Committed after adding an autobuilder reference, thanks.

-- 
Bye, Peter Korsgaard



More information about the buildroot mailing list