Thanks, applied as 3e150564474af6cd16ef804d7226ef5237c74c11.

Michael

[sent from post-receive hook]

On Tue, 19 May 2020 14:23:41 +0200, Bastian Krause <[email protected]> wrote:
> Signed-off-by: Bastian Krause <[email protected]>
> Message-Id: <[email protected]>
> Signed-off-by: Michael Olbrich <[email protected]>
> 
> diff --git a/rules/templates/template-barebox-imx-habv4-make 
> b/rules/templates/template-barebox-imx-habv4-make
> index d8086f0cf057..ec402afa1edf 100644
> --- a/rules/templates/template-barebox-imx-habv4-make
> +++ b/rules/templates/template-barebox-imx-habv4-make
> @@ -74,7 +74,7 @@ $(STATEDIR)/barebox-@[email protected]:
>       @$(call targetinfo)
>  
>       @$(call world/env, BAREBOX_@PACKAGE@) \
> -             ptxd_make_imx_habv4_gen_table "imx-habv4-srk%d"
> +             ptxd_make_imx_habv4_gen_table "imx-habv4-srk%d" 4
>  
>       @$(call world/compile, BAREBOX_@PACKAGE@)
>  
> diff --git a/scripts/lib/ptxd_lib_imx_hab.sh b/scripts/lib/ptxd_lib_imx_hab.sh
> index 781c1b3f610e..d1e2aba99fab 100644
> --- a/scripts/lib/ptxd_lib_imx_hab.sh
> +++ b/scripts/lib/ptxd_lib_imx_hab.sh
> @@ -9,10 +9,12 @@
>  #
>  # ptxd_make_imx_habv4_gen_table - generate the srk fuse file and srk table 
> for i.MX HABv4
>  #
> -# usage: ptxd_make_imx_habv4_gen_table <template>
> +# usage: ptxd_make_imx_habv4_gen_table <template> [<srk_count>]
>  #
>  # template: the role template to access the keys. Must contain a "%d" which 
> is
>  #           used as index
> +# srk_count: the number of keys (keys with index 1..srk_count will be used),
> +#            defaults to 4
>  #
>  # The output files are generated in the package build dir:
>  #
> @@ -24,13 +26,22 @@
>  #
>  ptxd_make_imx_habv4_gen_table_impl() {
>      local template="${1}"
> +    local srk_count="${2}"
>      local table_bin="${pkg_build_dir}/imx-srk-table.bin"
>      local srk_fuse_bin="${pkg_build_dir}/imx-srk-fuse.bin"
>      local -a certs
>  
> +    if [ -z "${srk_count}" ]; then
> +     srk_count=4
> +    fi
> +
> +    if [ "${srk_count}" -gt 4 ]; then
> +     ptxd_bailout "HABv4 allows only 4 certificates"
> +    fi
> +
>      echo -e "generating $(basename ${table_bin}) and $(basename 
> ${srk_fuse_bin})\n"
>  
> -    for i in 1 2 3 4; do
> +    for i in $(seq ${srk_count}); do
>       certs[${#certs[*]}]="$(cs_get_ca "$(printf "${template}" ${i})")"
>      done
>  

_______________________________________________
ptxdist mailing list
[email protected]

Reply via email to