Re: [ptxdist] [PATCH 05/19] host-imx-cst: version bump 2.3.1 -> 2.3.2

2017-09-06 Thread Michael Olbrich
Hi,

On Tue, Sep 05, 2017 at 09:13:23AM +0200, Marc Kleine-Budde wrote:
> On 09/05/2017 08:20 AM, Michael Olbrich wrote:
> > On Mon, Sep 04, 2017 at 06:00:18AM +, Denis OSTERLAND wrote:
> >> as far as I know, this will require a change in Barebox 
> >> scripts/imx/imx-image.c,
> >> because in this version it expects input file as command line option
> >> and does not understand piped input anymore.
> >>
> >> This is how I deal with this issue, but it wont work with both versions.
> > 
> > Marc, you added the initial support. Can you comment on this?
> 
> Maybe you can parse the output of "cst --version"? No, it's the same for
> both versions :( But you can parse the output of "cst", the new version
> does have the "-i" parameter.
> 
> Another option would be to let imx-image first try the "-i" approach, if
> this doesn't work then try the stdin. I think this would be the best.

This would break all old barebox versions without this fix. Maybe we could
add a wrapper script to ptxdist that adds '-i /dev/stdin' if no '-i'
argument is given?

Michael

-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |

___
ptxdist mailing list
ptxdist@pengutronix.de

Re: [ptxdist] [PATCH 05/19] host-imx-cst: version bump 2.3.1 -> 2.3.2

2017-09-05 Thread Clemens Gruber
Hi,

On Tue, Sep 05, 2017 at 09:13:23AM +0200, Marc Kleine-Budde wrote:
> On 09/05/2017 08:20 AM, Michael Olbrich wrote:
> > Hi,
> > 
> > On Mon, Sep 04, 2017 at 06:00:18AM +, Denis OSTERLAND wrote:
> >> as far as I know, this will require a change in Barebox 
> >> scripts/imx/imx-image.c,
> >> because in this version it expects input file as command line option
> >> and does not understand piped input anymore.
> >>
> >> This is how I deal with this issue, but it wont work with both versions.
> > 
> > Marc, you added the initial support. Can you comment on this?
> 
> Maybe you can parse the output of "cst --version"? No, it's the same for
> both versions :( But you can parse the output of "cst", the new version
> does have the "-i" parameter.
> 
> Another option would be to let imx-image first try the "-i" approach, if
> this doesn't work then try the stdin. I think this would be the best.

Michael, should the cst version bump and the Barebox change go in
together?

As I use U-Boot, it's probably better if someone else implements this, who uses
Barebox.

Regards,
Clemens

___
ptxdist mailing list
ptxdist@pengutronix.de

Re: [ptxdist] [PATCH 05/19] host-imx-cst: version bump 2.3.1 -> 2.3.2

2017-09-05 Thread Marc Kleine-Budde
On 09/05/2017 08:20 AM, Michael Olbrich wrote:
> Hi,
> 
> On Mon, Sep 04, 2017 at 06:00:18AM +, Denis OSTERLAND wrote:
>> as far as I know, this will require a change in Barebox 
>> scripts/imx/imx-image.c,
>> because in this version it expects input file as command line option
>> and does not understand piped input anymore.
>>
>> This is how I deal with this issue, but it wont work with both versions.
> 
> Marc, you added the initial support. Can you comment on this?

Maybe you can parse the output of "cst --version"? No, it's the same for
both versions :( But you can parse the output of "cst", the new version
does have the "-i" parameter.

Another option would be to let imx-image first try the "-i" approach, if
this doesn't work then try the stdin. I think this would be the best.

Marc

-- 
Pengutronix e.K.  | Marc Kleine-Budde   |
Industrial Linux Solutions| Phone: +49-231-2826-924 |
Vertretung West/Dortmund  | Fax:   +49-5121-206917- |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |



signature.asc
Description: OpenPGP digital signature
___
ptxdist mailing list
ptxdist@pengutronix.de

Re: [ptxdist] [PATCH 05/19] host-imx-cst: version bump 2.3.1 -> 2.3.2

2017-09-05 Thread Michael Olbrich
Hi,

On Mon, Sep 04, 2017 at 06:00:18AM +, Denis OSTERLAND wrote:
> as far as I know, this will require a change in Barebox 
> scripts/imx/imx-image.c,
> because in this version it expects input file as command line option
> and does not understand piped input anymore.
> 
> This is how I deal with this issue, but it wont work with both versions.

Marc, you added the initial support. Can you comment on this?

Michael

> From: Denis Osterland 
> Date: Thu, 18 May 2017 07:40:48 +0200
> Subject: [PATCH] imx-image: Adapt command line of cst call to match changed
>  cli.
> 
> Current version 2.3.2 of freescales code-sign-tool expects '-i file' instead 
> of stdin.
> ---
>  scripts/imx/imx-image.c | 19 ++-
>  1 file changed, 14 insertions(+), 5 deletions(-)
> 
> diff --git a/scripts/imx/imx-image.c b/scripts/imx/imx-image.c
> index dd57994b..ed3f4ffa50c3 100644
> --- a/scripts/imx/imx-image.c
> +++ b/scripts/imx/imx-image.c
> @@ -517,7 +517,7 @@ static int nop(const struct config_data *data)
>  static int hab_sign(struct config_data *data)
>  {
> int fd, outfd, ret, lockfd;
> -   char *csffile, *command;
> +   char *csffile, *command, *csfinput;
> struct stat s;
> char *cst;
> void *buf;
> @@ -530,6 +530,10 @@ static int hab_sign(struct config_data *data)
> if (ret < 0)
> exit(1);
>  
> +   ret = asprintf(, "%s.csf", data->outfile);
> +   if (ret < 0)
> +   exit(1);
> +
> ret = stat(csffile, );
> if (!ret) {
> if (S_ISREG(s.st_mode)) {
> @@ -546,7 +550,7 @@ static int hab_sign(struct config_data *data)
> }
> }
>  
> -   ret = asprintf(, "%s -o %s", cst, csffile);
> +   ret = asprintf(, "%s -o %s -i %s", cst, csffile, csfinput);
> if (ret < 0)
> return -ENOMEM;
>  
> @@ -568,15 +572,20 @@ static int hab_sign(struct config_data *data)
> return -errno;
> }
>  
> -   FILE *f = popen(command, "w");
> +   FILE *f = fopen(csfinput, "w");
> if (!f) {
> -   perror("popen");
> +   perror("fopen");
> return -errno;
> }
>  
> fwrite(data->csf, 1, strlen(data->csf) + 1, f);
>  
> -   pclose(f);
> +   fclose(f);
> +
> +   ret = system(command);
> +   if (ret) {
> +   exit(ret);
> +   }
>  
> flock(lockfd, LOCK_UN);
> close(lockfd);
> 
> Am Freitag, den 01.09.2017, 18:39 +0200 schrieb Clemens Gruber:
> > Signed-off-by: Clemens Gruber 
> > ---
> >  rules/host-imx-cst.make | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/rules/host-imx-cst.make b/rules/host-imx-cst.make
> > index b5aad5aee..dc2a17f4a 100644
> > --- a/rules/host-imx-cst.make
> > +++ b/rules/host-imx-cst.make
> > @@ -16,8 +16,8 @@ HOST_PACKAGES-$(PTXCONF_HOST_IMX_CST) += host-imx-cst
> >  #
> >  # Paths and names
> >  #
> > -HOST_IMX_CST_VERSION   := 2.3.1
> > -HOST_IMX_CST_MD5   := 01684a853e9245dbd6db42acad5861dd
> > +HOST_IMX_CST_VERSION   := 2.3.2
> > +HOST_IMX_CST_MD5   := a81766cab2e184ab12e459c0476f6639
> >  HOST_IMX_CST   := cst-$(HOST_IMX_CST_VERSION)
> >  HOST_IMX_CST_SUFFIX:= tar.gz
> >  HOST_IMX_CST_URL   := 
> > https://www.nxp.com/webapp/sps/download/license.jsp?colCode=IMX_CST_TOOL
> Diehl AKO Stiftung & Co. KG, Pfannerstraße 75-83, 88239 Wangen im Allgäu
> Bereichsvorstand: Dipl.-Ing. Michael Siedentop (Sprecher), Josef Fellner 
> (Mitglied)
> Sitz der Gesellschaft: Wangen i.A. – Registergericht: Amtsgericht Ulm HRA 
> 620609 – Persönlich haftende Gesellschafterin: Diehl Verwaltungs-Stiftung – 
> Sitz: Nürnberg – Registergericht: Amtsgericht Nürnberg HRA 11756 –
> Vorstand: Dr.-Ing. E.h. Thomas Diehl (†) (Vorsitzender), Herr 
> Dipl.-Wirtsch.-Ing. Wolfgang Weggen (stellvertretender Vorsitzender), 
> Dipl.-Kfm. Claus Günther, Dipl.-Kfm. Frank Gutzeit, Dr.-Ing. Heinrich Schunk, 
> Dr.-Ing. Michael Siedentop , Dipl.-Kfm. Dr.-Ing. Martin Sommer, Dipl.-Ing. 
> (FH) Rainer von Borstel, Vorsitzender des Aufsichtsrates: Dr. Klaus Maier
> ___
> Der Inhalt der vorstehenden E-Mail ist nicht rechtlich bindend. Diese E-Mail 
> enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen.
> Informieren Sie uns bitte, wenn Sie diese E-Mail faelschlicherweise erhalten 
> haben. Bitte loeschen Sie in diesem Fall die Nachricht. Jede unerlaubte Form 
> der Reproduktion, Bekanntgabe, Aenderung, Verteilung und/oder Publikation 
> dieser E-Mail ist strengstens untersagt.
> The contents of the above mentioned e-mail is not legally binding. This 
> e-mail contains confidential and/or legally protected information. Please 
> inform us if you have received this e-mail by mistake and delete it in such a 
> case. Each 

Re: [ptxdist] [PATCH 05/19] host-imx-cst: version bump 2.3.1 -> 2.3.2

2017-09-04 Thread Denis OSTERLAND
Hi Clemens,

as far as I know, this will require a change in Barebox scripts/imx/imx-image.c,
because in this version it expects input file as command line option
and does not understand piped input anymore.

This is how I deal with this issue, but it wont work with both versions.

From: Denis Osterland 
Date: Thu, 18 May 2017 07:40:48 +0200
Subject: [PATCH] imx-image: Adapt command line of cst call to match changed
 cli.

Current version 2.3.2 of freescales code-sign-tool expects '-i file' instead of 
stdin.
---
 scripts/imx/imx-image.c | 19 ++-
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/scripts/imx/imx-image.c b/scripts/imx/imx-image.c
index dd57994b..ed3f4ffa50c3 100644
--- a/scripts/imx/imx-image.c
+++ b/scripts/imx/imx-image.c
@@ -517,7 +517,7 @@ static int nop(const struct config_data *data)
 static int hab_sign(struct config_data *data)
 {
int fd, outfd, ret, lockfd;
-   char *csffile, *command;
+   char *csffile, *command, *csfinput;
struct stat s;
char *cst;
void *buf;
@@ -530,6 +530,10 @@ static int hab_sign(struct config_data *data)
if (ret < 0)
exit(1);
 
+   ret = asprintf(, "%s.csf", data->outfile);
+   if (ret < 0)
+   exit(1);
+
ret = stat(csffile, );
if (!ret) {
if (S_ISREG(s.st_mode)) {
@@ -546,7 +550,7 @@ static int hab_sign(struct config_data *data)
}
}
 
-   ret = asprintf(, "%s -o %s", cst, csffile);
+   ret = asprintf(, "%s -o %s -i %s", cst, csffile, csfinput);
if (ret < 0)
return -ENOMEM;
 
@@ -568,15 +572,20 @@ static int hab_sign(struct config_data *data)
return -errno;
}
 
-   FILE *f = popen(command, "w");
+   FILE *f = fopen(csfinput, "w");
if (!f) {
-   perror("popen");
+   perror("fopen");
return -errno;
}
 
fwrite(data->csf, 1, strlen(data->csf) + 1, f);
 
-   pclose(f);
+   fclose(f);
+
+   ret = system(command);
+   if (ret) {
+   exit(ret);
+   }
 
flock(lockfd, LOCK_UN);
close(lockfd);

Am Freitag, den 01.09.2017, 18:39 +0200 schrieb Clemens Gruber:
> Signed-off-by: Clemens Gruber 
> ---
>  rules/host-imx-cst.make | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/rules/host-imx-cst.make b/rules/host-imx-cst.make
> index b5aad5aee..dc2a17f4a 100644
> --- a/rules/host-imx-cst.make
> +++ b/rules/host-imx-cst.make
> @@ -16,8 +16,8 @@ HOST_PACKAGES-$(PTXCONF_HOST_IMX_CST) += host-imx-cst
>  #
>  # Paths and names
>  #
> -HOST_IMX_CST_VERSION := 2.3.1
> -HOST_IMX_CST_MD5 := 01684a853e9245dbd6db42acad5861dd
> +HOST_IMX_CST_VERSION := 2.3.2
> +HOST_IMX_CST_MD5 := a81766cab2e184ab12e459c0476f6639
>  HOST_IMX_CST := cst-$(HOST_IMX_CST_VERSION)
>  HOST_IMX_CST_SUFFIX  := tar.gz
>  HOST_IMX_CST_URL := 
> https://www.nxp.com/webapp/sps/download/license.jsp?colCode=IMX_CST_TOOL
Diehl AKO Stiftung & Co. KG, Pfannerstraße 75-83, 88239 Wangen im Allgäu
Bereichsvorstand: Dipl.-Ing. Michael Siedentop (Sprecher), Josef Fellner 
(Mitglied)
Sitz der Gesellschaft: Wangen i.A. – Registergericht: Amtsgericht Ulm HRA 
620609 – Persönlich haftende Gesellschafterin: Diehl Verwaltungs-Stiftung – 
Sitz: Nürnberg – Registergericht: Amtsgericht Nürnberg HRA 11756 –
Vorstand: Dr.-Ing. E.h. Thomas Diehl (†) (Vorsitzender), Herr 
Dipl.-Wirtsch.-Ing. Wolfgang Weggen (stellvertretender Vorsitzender), 
Dipl.-Kfm. Claus Günther, Dipl.-Kfm. Frank Gutzeit, Dr.-Ing. Heinrich Schunk, 
Dr.-Ing. Michael Siedentop , Dipl.-Kfm. Dr.-Ing. Martin Sommer, Dipl.-Ing. (FH) 
Rainer von Borstel, Vorsitzender des Aufsichtsrates: Dr. Klaus Maier
___
Der Inhalt der vorstehenden E-Mail ist nicht rechtlich bindend. Diese E-Mail 
enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen.
Informieren Sie uns bitte, wenn Sie diese E-Mail faelschlicherweise erhalten 
haben. Bitte loeschen Sie in diesem Fall die Nachricht. Jede unerlaubte Form 
der Reproduktion, Bekanntgabe, Aenderung, Verteilung und/oder Publikation 
dieser E-Mail ist strengstens untersagt.
The contents of the above mentioned e-mail is not legally binding. This e-mail 
contains confidential and/or legally protected information. Please inform us if 
you have received this e-mail by mistake and delete it in such a case. Each 
unauthorized reproduction, disclosure, alteration, distribution and/or 
publication of this e-mail is strictly prohibited.
___
ptxdist mailing list
ptxdist@pengutronix.de

[ptxdist] [PATCH 05/19] host-imx-cst: version bump 2.3.1 -> 2.3.2

2017-09-01 Thread Clemens Gruber
Signed-off-by: Clemens Gruber 
---
 rules/host-imx-cst.make | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/rules/host-imx-cst.make b/rules/host-imx-cst.make
index b5aad5aee..dc2a17f4a 100644
--- a/rules/host-imx-cst.make
+++ b/rules/host-imx-cst.make
@@ -16,8 +16,8 @@ HOST_PACKAGES-$(PTXCONF_HOST_IMX_CST) += host-imx-cst
 #
 # Paths and names
 #
-HOST_IMX_CST_VERSION   := 2.3.1
-HOST_IMX_CST_MD5   := 01684a853e9245dbd6db42acad5861dd
+HOST_IMX_CST_VERSION   := 2.3.2
+HOST_IMX_CST_MD5   := a81766cab2e184ab12e459c0476f6639
 HOST_IMX_CST   := cst-$(HOST_IMX_CST_VERSION)
 HOST_IMX_CST_SUFFIX:= tar.gz
 HOST_IMX_CST_URL   := 
https://www.nxp.com/webapp/sps/download/license.jsp?colCode=IMX_CST_TOOL
-- 
2.14.1


___
ptxdist mailing list
ptxdist@pengutronix.de