On Fri, Feb 02, 2024 at 04:12:09PM +0100, Alexander Dahl wrote:
> If you had set
> PTXCONF_IMAGE_RAUC_DESCRIPTION="${PTXCONF_PROJECT_VENDOR} ${PTXCONF_PROJECT}"
> like DistroKit-2023.12.0 does, target update.raucb failed with
> 'command not found' because of wrong quoting and interpreting parts of
> PTXCONF_IMAGE_RAUC_DESCRIPTION as command.
> 
> Signed-off-by: Alexander Dahl <a...@thorsis.com>

Huh. Strange, I never got such an error all the times I built the
DistroKit update.raucb. I guess the bundle description in DistroKit is
unfortunate enough; this is in the output of 'ptxdist -v image
update.raucb':

    RAUC_BUNDLE_DESCRIPTION=""Pengutronix" "DistroKit""

… and bash interprets that as an empty string, a plain word, a quoted
space, another plain word, and another empty string, and concatenates
that into RAUC_BUNDLE_DESCRIPTION as expected. I guess if your bundle
description contains any special chars like '(' or '$', bash starts
interpreting those as bash syntax instead of plain words, which could
lead to the error you see.

Anyway, your patch gives me the correct results.

Reviewed-by: Roland Hieber <r...@pengutronix.de>
> ---
>  rules/image-rauc.make | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/rules/image-rauc.make b/rules/image-rauc.make
> index e267e78c6..def2ade1e 100644
> --- a/rules/image-rauc.make
> +++ b/rules/image-rauc.make
> @@ -56,7 +56,7 @@ IMAGE_RAUC_ENV      = \
>       RAUC_BUNDLE_FORMAT=$(IMAGE_RAUC_BUNDLE_FORMAT) \
>       RAUC_BUNDLE_VERSION="$(call remove_quotes, 
> $(PTXCONF_RAUC_BUNDLE_VERSION))" \
>       RAUC_BUNDLE_BUILD=$(call ptx/sh, date +%FT%T%z) \
> -     RAUC_BUNDLE_DESCRIPTION=$(PTXCONF_IMAGE_RAUC_DESCRIPTION) \
> +     RAUC_BUNDLE_DESCRIPTION="$(call remove_quotes, 
> $(PTXCONF_IMAGE_RAUC_DESCRIPTION))" \
>       $(IMAGE_RAUC_ENV_HOOK) \
>       RAUC_KEY="$(shell cs_get_uri update)" \
>       RAUC_CERT="$(shell cs_get_uri update)" \
> -- 
> 2.39.2
> 
> 

-- 
Roland Hieber, Pengutronix e.K.          | r.hie...@pengutronix.de     |
Steuerwalder Str. 21                     | https://www.pengutronix.de/ |
31137 Hildesheim, Germany                | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686         | Fax:   +49-5121-206917-5555 |

Reply via email to