Re: [OE-core] [kirkstone][PATCH] cpio: Replace fix wrong CRC with ASCII CRC for large files with upstream backport

2023-07-01 Thread Marek Vasut

On 6/28/23 00:05, Steve Sakoman wrote:

On Tue, Jun 27, 2023 at 11:59 AM Marek Vasut  wrote:


On 6/27/23 16:08, Steve Sakoman wrote:

On Sun, Jun 25, 2023 at 3:50 AM Marek Vasut  wrote:


Replace the original "Wrong CRC with ASCII CRC for large files"
patch with upstream backport, and add additional fix on top of
the same problem which upstream detected and fixed.


Your replacement patches are missing Upstream-Status and Signed-off-by tags:

ERROR: cpio-2.13-r0 do_patch: Missing Upstream-Status in patch
/home/steve/builds/poky-contrib-kirkstone/meta/recipes-extended/cpio/cpio-2.13/0003-Fix-calculation-of-CRC-in-copy-out-mode.patch
Please add according to
https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines#Patch_Header_Recommendations:_Upstream-Status
.
ERROR: cpio-2.13-r0 do_patch: Missing Upstream-Status in patch
/home/steve/builds/poky-contrib-kirkstone/meta/recipes-extended/cpio/cpio-2.13/0004-Fix-appending-to-archives-bigger-than-2G.patch
Please add according to
https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines#Patch_Header_Recommendations:_Upstream-Status


Upstream-Status was indeed missed.

What do I put into SoB line if the original patches have no SoB line
(which btw is common in other backports in OE-core and e.g. oelint-adv
warns about that too) ?


Probably common because only missing Upstream-Status generates an error!

The Signed-off-by should be your name/email if you are kind enough to add it.


V2 should have those fixed.

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#183773): 
https://lists.openembedded.org/g/openembedded-core/message/183773
Mute This Topic: https://lists.openembedded.org/mt/99769144/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [kirkstone][PATCH] cpio: Replace fix wrong CRC with ASCII CRC for large files with upstream backport

2023-06-27 Thread Steve Sakoman
On Tue, Jun 27, 2023 at 11:59 AM Marek Vasut  wrote:
>
> On 6/27/23 16:08, Steve Sakoman wrote:
> > On Sun, Jun 25, 2023 at 3:50 AM Marek Vasut  wrote:
> >>
> >> Replace the original "Wrong CRC with ASCII CRC for large files"
> >> patch with upstream backport, and add additional fix on top of
> >> the same problem which upstream detected and fixed.
> >
> > Your replacement patches are missing Upstream-Status and Signed-off-by tags:
> >
> > ERROR: cpio-2.13-r0 do_patch: Missing Upstream-Status in patch
> > /home/steve/builds/poky-contrib-kirkstone/meta/recipes-extended/cpio/cpio-2.13/0003-Fix-calculation-of-CRC-in-copy-out-mode.patch
> > Please add according to
> > https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines#Patch_Header_Recommendations:_Upstream-Status
> > .
> > ERROR: cpio-2.13-r0 do_patch: Missing Upstream-Status in patch
> > /home/steve/builds/poky-contrib-kirkstone/meta/recipes-extended/cpio/cpio-2.13/0004-Fix-appending-to-archives-bigger-than-2G.patch
> > Please add according to
> > https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines#Patch_Header_Recommendations:_Upstream-Status
>
> Upstream-Status was indeed missed.
>
> What do I put into SoB line if the original patches have no SoB line
> (which btw is common in other backports in OE-core and e.g. oelint-adv
> warns about that too) ?

Probably common because only missing Upstream-Status generates an error!

The Signed-off-by should be your name/email if you are kind enough to add it.

Steve

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#183504): 
https://lists.openembedded.org/g/openembedded-core/message/183504
Mute This Topic: https://lists.openembedded.org/mt/99769144/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [kirkstone][PATCH] cpio: Replace fix wrong CRC with ASCII CRC for large files with upstream backport

2023-06-27 Thread Marek Vasut

On 6/27/23 16:08, Steve Sakoman wrote:

On Sun, Jun 25, 2023 at 3:50 AM Marek Vasut  wrote:


Replace the original "Wrong CRC with ASCII CRC for large files"
patch with upstream backport, and add additional fix on top of
the same problem which upstream detected and fixed.


Your replacement patches are missing Upstream-Status and Signed-off-by tags:

ERROR: cpio-2.13-r0 do_patch: Missing Upstream-Status in patch
/home/steve/builds/poky-contrib-kirkstone/meta/recipes-extended/cpio/cpio-2.13/0003-Fix-calculation-of-CRC-in-copy-out-mode.patch
Please add according to
https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines#Patch_Header_Recommendations:_Upstream-Status
.
ERROR: cpio-2.13-r0 do_patch: Missing Upstream-Status in patch
/home/steve/builds/poky-contrib-kirkstone/meta/recipes-extended/cpio/cpio-2.13/0004-Fix-appending-to-archives-bigger-than-2G.patch
Please add according to
https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines#Patch_Header_Recommendations:_Upstream-Status


Upstream-Status was indeed missed.

What do I put into SoB line if the original patches have no SoB line 
(which btw is common in other backports in OE-core and e.g. oelint-adv 
warns about that too) ?

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#183503): 
https://lists.openembedded.org/g/openembedded-core/message/183503
Mute This Topic: https://lists.openembedded.org/mt/99769144/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [kirkstone][PATCH] cpio: Replace fix wrong CRC with ASCII CRC for large files with upstream backport

2023-06-27 Thread Steve Sakoman
On Sun, Jun 25, 2023 at 3:50 AM Marek Vasut  wrote:
>
> Replace the original "Wrong CRC with ASCII CRC for large files"
> patch with upstream backport, and add additional fix on top of
> the same problem which upstream detected and fixed.

Your replacement patches are missing Upstream-Status and Signed-off-by tags:

ERROR: cpio-2.13-r0 do_patch: Missing Upstream-Status in patch
/home/steve/builds/poky-contrib-kirkstone/meta/recipes-extended/cpio/cpio-2.13/0003-Fix-calculation-of-CRC-in-copy-out-mode.patch
Please add according to
https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines#Patch_Header_Recommendations:_Upstream-Status
.
ERROR: cpio-2.13-r0 do_patch: Missing Upstream-Status in patch
/home/steve/builds/poky-contrib-kirkstone/meta/recipes-extended/cpio/cpio-2.13/0004-Fix-appending-to-archives-bigger-than-2G.patch
Please add according to
https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines#Patch_Header_Recommendations:_Upstream-Status
.

Please submit a V2!

Thanks,

Steve

> Signed-off-by: Marek Vasut 
> ---
> NOTE: There is no oe-core/master counterpart, since oe-core/master
>   updated to cpio 2.14 in the meantime.
> ---
> Cc: Alexandre Belloni 
> Cc: Khem Raj 
> Cc: Richard Purdie 
> Cc: Richard Purdie 
> Cc: Ross Burton 
> Cc: Steve Sakoman 
> ---
>  ...g-CRC-with-ASCII-CRC-for-large-files.patch |  39 ---
>  ...-calculation-of-CRC-in-copy-out-mode.patch |  55 
>  ...appending-to-archives-bigger-than-2G.patch | 309 ++
>  meta/recipes-extended/cpio/cpio_2.13.bb   |   3 +-
>  4 files changed, 366 insertions(+), 40 deletions(-)
>  delete mode 100644 
> meta/recipes-extended/cpio/cpio-2.13/0001-Wrong-CRC-with-ASCII-CRC-for-large-files.patch
>  create mode 100644 
> meta/recipes-extended/cpio/cpio-2.13/0003-Fix-calculation-of-CRC-in-copy-out-mode.patch
>  create mode 100644 
> meta/recipes-extended/cpio/cpio-2.13/0004-Fix-appending-to-archives-bigger-than-2G.patch
>
> diff --git 
> a/meta/recipes-extended/cpio/cpio-2.13/0001-Wrong-CRC-with-ASCII-CRC-for-large-files.patch
>  
> b/meta/recipes-extended/cpio/cpio-2.13/0001-Wrong-CRC-with-ASCII-CRC-for-large-files.patch
> deleted file mode 100644
> index 4b96e4316c..00
> --- 
> a/meta/recipes-extended/cpio/cpio-2.13/0001-Wrong-CRC-with-ASCII-CRC-for-large-files.patch
> +++ /dev/null
> @@ -1,39 +0,0 @@
> -From 77ff5f1be394eb2c786df561ff37dde7f982ec76 Mon Sep 17 00:00:00 2001
> -From: Stefano Babic 
> -Date: Fri, 28 Jul 2017 13:20:52 +0200
> -Subject: [PATCH] Wrong CRC with ASCII CRC for large files
> -
> -Due to signedness, the checksum is not computed when filesize is bigger
> -a 2GB.
> -
> -Upstream-Status: Submitted 
> [https://lists.gnu.org/archive/html/bug-cpio/2017-07/msg4.html]
> -Signed-off-by: Stefano Babic 
> 
> - src/copyout.c | 8 
> - 1 file changed, 4 insertions(+), 4 deletions(-)
> -
> -diff --git a/src/copyout.c b/src/copyout.c
> -index 1f0987a..727aeca 100644
>  a/src/copyout.c
> -+++ b/src/copyout.c
> -@@ -34,13 +34,13 @@
> -compute and return a checksum for them.  */
> -
> - static uint32_t
> --read_for_checksum (int in_file_des, int file_size, char *file_name)
> -+read_for_checksum (int in_file_des, unsigned int file_size, char *file_name)
> - {
> -   uint32_t crc;
> -   char buf[BUFSIZ];
> --  int bytes_left;
> --  int bytes_read;
> --  int i;
> -+  unsigned int bytes_left;
> -+  unsigned int bytes_read;
> -+  unsigned int i;
> -
> -   crc = 0;
> -
> ---
> -2.7.4
> -
> diff --git 
> a/meta/recipes-extended/cpio/cpio-2.13/0003-Fix-calculation-of-CRC-in-copy-out-mode.patch
>  
> b/meta/recipes-extended/cpio/cpio-2.13/0003-Fix-calculation-of-CRC-in-copy-out-mode.patch
> new file mode 100644
> index 00..aa478b5126
> --- /dev/null
> +++ 
> b/meta/recipes-extended/cpio/cpio-2.13/0003-Fix-calculation-of-CRC-in-copy-out-mode.patch
> @@ -0,0 +1,55 @@
> +From d257e47a6c6b41ba727b196ac96c05ab91bd9d65 Mon Sep 17 00:00:00 2001
> +From: Sergey Poznyakoff 
> +Date: Fri, 7 Apr 2023 11:23:37 +0300
> +Subject: [PATCH 3/4] Fix calculation of CRC in copy-out mode.
> +
> +* src/copyout.c (read_for_checksum): Fix type of the file_size argument.
> +Rewrite the reading loop.
> +
> +Original patch by Stefano Babic 
> +---
> + src/copyout.c | 16 +++-
> + 1 file changed, 7 insertions(+), 9 deletions(-)
> +
> +diff --git a/src/copyout.c b/src/copyout.c
> +index 8b0beb6..f1ff351 100644
> +--- a/src/copyout.c
>  b/src/copyout.c
> +@@ -34,27 +34,25 @@
> +compute and return a checksum for them.  */
> +
> + static uint32_t
> +-read_for_checksum (int in_file_des, int file_size, char *file_name)
> ++read_for_checksum (int in_file_des, off_t file_size, char *file_name)
> + {
> +   uint32_t crc;
> +-  char buf[BUFSIZ];
> +-  int bytes_left;
> +-  int bytes_read;
> +-  int i;
> ++  unsigned char buf[BUFSIZ];
> ++  ssize_t bytes_read;
> ++  ssize_t i;
> +
> +   crc = 0;
> +
> +-  for (bytes_left = file_size; bytes_left > 0; bytes_left -= bytes_read)
> ++  while 

[OE-core] [kirkstone][PATCH] cpio: Replace fix wrong CRC with ASCII CRC for large files with upstream backport

2023-06-25 Thread Marek Vasut
Replace the original "Wrong CRC with ASCII CRC for large files"
patch with upstream backport, and add additional fix on top of
the same problem which upstream detected and fixed.

Signed-off-by: Marek Vasut 
---
NOTE: There is no oe-core/master counterpart, since oe-core/master
  updated to cpio 2.14 in the meantime.
---
Cc: Alexandre Belloni 
Cc: Khem Raj 
Cc: Richard Purdie 
Cc: Richard Purdie 
Cc: Ross Burton 
Cc: Steve Sakoman 
---
 ...g-CRC-with-ASCII-CRC-for-large-files.patch |  39 ---
 ...-calculation-of-CRC-in-copy-out-mode.patch |  55 
 ...appending-to-archives-bigger-than-2G.patch | 309 ++
 meta/recipes-extended/cpio/cpio_2.13.bb   |   3 +-
 4 files changed, 366 insertions(+), 40 deletions(-)
 delete mode 100644 
meta/recipes-extended/cpio/cpio-2.13/0001-Wrong-CRC-with-ASCII-CRC-for-large-files.patch
 create mode 100644 
meta/recipes-extended/cpio/cpio-2.13/0003-Fix-calculation-of-CRC-in-copy-out-mode.patch
 create mode 100644 
meta/recipes-extended/cpio/cpio-2.13/0004-Fix-appending-to-archives-bigger-than-2G.patch

diff --git 
a/meta/recipes-extended/cpio/cpio-2.13/0001-Wrong-CRC-with-ASCII-CRC-for-large-files.patch
 
b/meta/recipes-extended/cpio/cpio-2.13/0001-Wrong-CRC-with-ASCII-CRC-for-large-files.patch
deleted file mode 100644
index 4b96e4316c..00
--- 
a/meta/recipes-extended/cpio/cpio-2.13/0001-Wrong-CRC-with-ASCII-CRC-for-large-files.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From 77ff5f1be394eb2c786df561ff37dde7f982ec76 Mon Sep 17 00:00:00 2001
-From: Stefano Babic 
-Date: Fri, 28 Jul 2017 13:20:52 +0200
-Subject: [PATCH] Wrong CRC with ASCII CRC for large files
-
-Due to signedness, the checksum is not computed when filesize is bigger
-a 2GB.
-
-Upstream-Status: Submitted 
[https://lists.gnu.org/archive/html/bug-cpio/2017-07/msg4.html]
-Signed-off-by: Stefano Babic 

- src/copyout.c | 8 
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/src/copyout.c b/src/copyout.c
-index 1f0987a..727aeca 100644
 a/src/copyout.c
-+++ b/src/copyout.c
-@@ -34,13 +34,13 @@
-compute and return a checksum for them.  */
- 
- static uint32_t
--read_for_checksum (int in_file_des, int file_size, char *file_name)
-+read_for_checksum (int in_file_des, unsigned int file_size, char *file_name)
- {
-   uint32_t crc;
-   char buf[BUFSIZ];
--  int bytes_left;
--  int bytes_read;
--  int i;
-+  unsigned int bytes_left;
-+  unsigned int bytes_read;
-+  unsigned int i;
- 
-   crc = 0;
- 
--- 
-2.7.4
-
diff --git 
a/meta/recipes-extended/cpio/cpio-2.13/0003-Fix-calculation-of-CRC-in-copy-out-mode.patch
 
b/meta/recipes-extended/cpio/cpio-2.13/0003-Fix-calculation-of-CRC-in-copy-out-mode.patch
new file mode 100644
index 00..aa478b5126
--- /dev/null
+++ 
b/meta/recipes-extended/cpio/cpio-2.13/0003-Fix-calculation-of-CRC-in-copy-out-mode.patch
@@ -0,0 +1,55 @@
+From d257e47a6c6b41ba727b196ac96c05ab91bd9d65 Mon Sep 17 00:00:00 2001
+From: Sergey Poznyakoff 
+Date: Fri, 7 Apr 2023 11:23:37 +0300
+Subject: [PATCH 3/4] Fix calculation of CRC in copy-out mode.
+
+* src/copyout.c (read_for_checksum): Fix type of the file_size argument.
+Rewrite the reading loop.
+
+Original patch by Stefano Babic 
+---
+ src/copyout.c | 16 +++-
+ 1 file changed, 7 insertions(+), 9 deletions(-)
+
+diff --git a/src/copyout.c b/src/copyout.c
+index 8b0beb6..f1ff351 100644
+--- a/src/copyout.c
 b/src/copyout.c
+@@ -34,27 +34,25 @@
+compute and return a checksum for them.  */
+ 
+ static uint32_t
+-read_for_checksum (int in_file_des, int file_size, char *file_name)
++read_for_checksum (int in_file_des, off_t file_size, char *file_name)
+ {
+   uint32_t crc;
+-  char buf[BUFSIZ];
+-  int bytes_left;
+-  int bytes_read;
+-  int i;
++  unsigned char buf[BUFSIZ];
++  ssize_t bytes_read;
++  ssize_t i;
+ 
+   crc = 0;
+ 
+-  for (bytes_left = file_size; bytes_left > 0; bytes_left -= bytes_read)
++  while (file_size > 0)
+ {
+   bytes_read = read (in_file_des, buf, BUFSIZ);
+   if (bytes_read < 0)
+   error (PAXEXIT_FAILURE, errno, _("cannot read checksum for %s"), 
file_name);
+   if (bytes_read == 0)
+   break;
+-  if (bytes_left < bytes_read)
+-bytes_read = bytes_left;
+-  for (i = 0; i < bytes_read; ++i)
++  for (i = 0; i < bytes_read; i++)
+   crc += buf[i] & 0xff;
++  file_size -= bytes_read;
+ }
+   if (lseek (in_file_des, 0L, SEEK_SET))
+ error (PAXEXIT_FAILURE, errno, _("cannot read checksum for %s"), 
file_name);
+-- 
+2.39.2
+
diff --git 
a/meta/recipes-extended/cpio/cpio-2.13/0004-Fix-appending-to-archives-bigger-than-2G.patch
 
b/meta/recipes-extended/cpio/cpio-2.13/0004-Fix-appending-to-archives-bigger-than-2G.patch
new file mode 100644
index 00..677702c0bc
--- /dev/null
+++ 
b/meta/recipes-extended/cpio/cpio-2.13/0004-Fix-appending-to-archives-bigger-than-2G.patch
@@ -0,0 +1,309 @@
+From 8513495ab5cfb63eb7c4c933fdf0b78c6196cd27 Mon Sep 17 00:00:00 2001
+From: Sergey Poznyakoff