mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Denis OSTERLAND <denis.osterland@diehl.com>
To: "ptxdist@pengutronix.de" <ptxdist@pengutronix.de>
Subject: Re: [ptxdist] [PATCH 05/19] host-imx-cst: version bump 2.3.1 -> 2.3.2
Date: Mon, 4 Sep 2017 06:00:18 +0000	[thread overview]
Message-ID: <1504504818.3979.6.camel@diehl.com> (raw)
In-Reply-To: <20170901163929.16585-5-clemens.gruber@pqgruber.com>

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 <Denis.Osterland@diehl.com>
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 dd5799cccc4b..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(&csfinput, "%s.csf", data->outfile);
+       if (ret < 0)
+               exit(1);
+
        ret = stat(csffile, &s);
        if (!ret) {
                if (S_ISREG(s.st_mode)) {
@@ -546,7 +550,7 @@ static int hab_sign(struct config_data *data)
                }
        }
 
-       ret = asprintf(&command, "%s -o %s", cst, csffile);
+       ret = asprintf(&command, "%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 <clemens.gruber@pqgruber.com>
> ---
>  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

  reply	other threads:[~2017-09-04  6:00 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-01 16:39 [ptxdist] [PATCH 01/19] busybox: version bump 1.26.2 -> 1.27.2 Clemens Gruber
2017-09-01 16:39 ` [ptxdist] [PATCH 02/19] dbus: version bump 1.10.18 -> 1.10.22 Clemens Gruber
2017-09-01 16:39 ` [ptxdist] [PATCH 03/19] dbus: add upstream patch to avoid blocking at boot time Clemens Gruber
2017-09-01 16:39 ` [ptxdist] [PATCH 04/19] e2fsprogs: version bump 1.43.4 -> 1.43.6 Clemens Gruber
2017-09-01 16:39 ` [ptxdist] [PATCH 05/19] host-imx-cst: version bump 2.3.1 -> 2.3.2 Clemens Gruber
2017-09-04  6:00   ` Denis OSTERLAND [this message]
2017-09-05  6:20     ` Michael Olbrich
2017-09-05  7:13       ` Marc Kleine-Budde
2017-09-05 14:59         ` Clemens Gruber
2017-09-06 12:42         ` Michael Olbrich
2017-09-01 16:39 ` [ptxdist] [PATCH 06/19] keyutils: version bump 1.5.9 -> 1.5.10 Clemens Gruber
2017-09-01 16:39 ` [ptxdist] [PATCH 07/19] libcap-ng: version bump 0.7.7 -> 0.7.8 Clemens Gruber
2017-09-01 16:39 ` [ptxdist] [PATCH 08/19] libgcrypt: version bump 1.7.8 -> 1.8.1 Clemens Gruber
2017-09-01 16:39 ` [ptxdist] [PATCH 09/19] mosh: version bump 1.3.0 -> 1.3.2 Clemens Gruber
2017-09-01 16:39 ` [ptxdist] [PATCH 10/19] mosh: make the crypto library configurable Clemens Gruber
2017-09-01 16:39 ` [ptxdist] [PATCH 11/19] mpg123: version bump 1.25.2 -> 1.25.6 Clemens Gruber
2017-09-01 16:39 ` [ptxdist] [PATCH 12/19] procps: fix configure flags Clemens Gruber
2017-09-01 16:39 ` [ptxdist] [PATCH 13/19] postgresql: specify the used license Clemens Gruber
2017-09-01 16:39 ` [ptxdist] [PATCH 14/19] strace: version bump 4.16 -> 4.18 Clemens Gruber
2017-09-01 16:39 ` [ptxdist] [PATCH 15/19] tcpdump: version bump 4.9.0 -> 4.9.1 Clemens Gruber
2017-09-01 16:39 ` [ptxdist] [PATCH 16/19] trace-cmd: version bump 2.5.2 -> 2.6.1 Clemens Gruber
2017-09-01 16:39 ` [ptxdist] [PATCH 17/19] u-boot-tools: version bump 2017.05.0 -> 2017.07.0 Clemens Gruber
2017-09-01 16:39 ` [ptxdist] [PATCH 18/19] util-linux-ng: version bump 2.30 -> 2.30.1 Clemens Gruber
2017-09-01 16:39 ` [ptxdist] [PATCH 19/19] util-linux-ng: add fsfreeze Clemens Gruber
2017-09-02  5:14 ` [ptxdist] [PATCH 01/19] busybox: version bump 1.26.2 -> 1.27.2 Alexander Dahl
2017-09-02 10:51   ` Clemens Gruber
2017-09-02 19:06     ` Alexander Dahl
2017-09-05 15:11       ` Clemens Gruber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1504504818.3979.6.camel@diehl.com \
    --to=denis.osterland@diehl.com \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox