Re: [yocto-patches] [meta-selinux][PATCH] refpolicy_common: strip POLICY_CUSTOM_BUILDOPT before passing to make
Chen Qi <[email protected]>
| Newsgroups | org.yoctoproject.lists.yocto-patches |
|---|---|
| Message-ID | <[email protected]> |
The strip() function only removes leading and trailing whitespaces.
Your original problem looks like a quoting issue. Does something like
below solve your problem?
CUSTOM_BUILDOPT='${POLICY_CUSTOM_BUILDOPT}'
Regards,
Qi
On 8/12/26 14:00, Rohith Chiluka via lists.yoctoproject.org wrote:
> POLICY_CUSTOM_BUILDOPT is passed directly to the refpolicy make command
> as CUSTOM_BUILDOPT. When layers use ':append' to extend this variable
> (e.g. POLICY_CUSTOM_BUILDOPT:append:distro = " option"), BitBake
> introduces a leading space. Passing that raw value to make causes:
>
> make: *** No rule to make target 'option'. Stop.
>
> Signed-off-by: Chiluka Rohith <[email protected]>
> ---
> recipes-security/refpolicy/refpolicy_common.inc | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/recipes-security/refpolicy/refpolicy_common.inc b/recipes-security/refpolicy/refpolicy_common.inc
> index 014714c..1566591 100644
> --- a/recipes-security/refpolicy/refpolicy_common.inc
> +++ b/recipes-security/refpolicy/refpolicy_common.inc
> @@ -126,7 +126,7 @@ EXTRA_OEMAKE = "NAME=${POLICY_NAME} \
> DIRECT_INITRC=${POLICY_DIRECT_INITRC} \
> SYSTEMD=${POLICY_SYSTEMD} \
> MONOLITHIC=${POLICY_MONOLITHIC} \
> - CUSTOM_BUILDOPT=${POLICY_CUSTOM_BUILDOPT} \
> + CUSTOM_BUILDOPT=${@d.getVar('POLICY_CUSTOM_BUILDOPT').strip()} \
> QUIET=${POLICY_QUIET} \
> MLS_SENS=${POLICY_MLS_SENS} \
> MLS_CATS=${POLICY_MLS_CATS} \