summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-oe/recipes-bsp/nvme-cli/nvme-cli/0001-nvme-Use-C99-types-for-uint32_t.patch88
-rw-r--r--meta-oe/recipes-bsp/nvme-cli/nvme-cli/0001-plugins-ssstc-Replace-__uint16_t-with-uint16_t.patch34
-rw-r--r--meta-oe/recipes-bsp/nvme-cli/nvme-cli_2.10.2.bb (renamed from meta-oe/recipes-bsp/nvme-cli/nvme-cli_2.9.1.bb)7
3 files changed, 2 insertions, 127 deletions
diff --git a/meta-oe/recipes-bsp/nvme-cli/nvme-cli/0001-nvme-Use-C99-types-for-uint32_t.patch b/meta-oe/recipes-bsp/nvme-cli/nvme-cli/0001-nvme-Use-C99-types-for-uint32_t.patch
deleted file mode 100644
index be1452af51..0000000000
--- a/meta-oe/recipes-bsp/nvme-cli/nvme-cli/0001-nvme-Use-C99-types-for-uint32_t.patch
+++ /dev/null
@@ -1,88 +0,0 @@
1From ac2ff1dbe0b44953de636c50c7d7f8c1e9f1e458 Mon Sep 17 00:00:00 2001
2From: Sam James <sam@gentoo.org>
3Date: Sat, 4 May 2024 09:13:06 +0100
4Subject: [PATCH] nvme: Use C99 types for uint32_t
5
6<stdint.h> provides `uint32_t`, while `u_int_32` is an unofficial/internal
7typedef that glibc happens to provide. This fixes the build on musl.
8
9Bug: https://bugs.gentoo.org/931194
10
11Upstream-Status: Backport [https://github.com/linux-nvme/nvme-cli/commit/ac2ff1dbe0b44953de636c50c7d7f8c1e9f1e458]
12Signed-off-by: Sam James <sam@gentoo.org>
13---
14 nvme.c | 13 +++++++------
15 util/base64.c | 5 +++--
16 2 files changed, 10 insertions(+), 8 deletions(-)
17
18diff --git a/nvme.c b/nvme.c
19index 46a2399a..5409ddf2 100644
20--- a/nvme.c
21+++ b/nvme.c
22@@ -34,6 +34,7 @@
23 #include <inttypes.h>
24 #include <locale.h>
25 #include <stdio.h>
26+#include <stdint.h>
27 #include <stdlib.h>
28 #include <string.h>
29 #include <unistd.h>
30@@ -9081,8 +9082,8 @@ static int check_dhchap_key(int argc, char **argv, struct command *command, stru
31
32 unsigned char decoded_key[128];
33 unsigned int decoded_len;
34- u_int32_t crc = crc32(0L, NULL, 0);
35- u_int32_t key_crc;
36+ uint32_t crc = crc32(0L, NULL, 0);
37+ uint32_t key_crc;
38 int err = 0, hmac;
39 struct config {
40 char *key;
41@@ -9150,10 +9151,10 @@ static int check_dhchap_key(int argc, char **argv, struct command *command, stru
42 return -EINVAL;
43 }
44 crc = crc32(crc, decoded_key, decoded_len);
45- key_crc = ((u_int32_t)decoded_key[decoded_len]) |
46- ((u_int32_t)decoded_key[decoded_len + 1] << 8) |
47- ((u_int32_t)decoded_key[decoded_len + 2] << 16) |
48- ((u_int32_t)decoded_key[decoded_len + 3] << 24);
49+ key_crc = ((uint32_t)decoded_key[decoded_len]) |
50+ ((uint32_t)decoded_key[decoded_len + 1] << 8) |
51+ ((uint32_t)decoded_key[decoded_len + 2] << 16) |
52+ ((uint32_t)decoded_key[decoded_len + 3] << 24);
53 if (key_crc != crc) {
54 nvme_show_error("CRC mismatch (key %08x, crc %08x)", key_crc, crc);
55 return -EINVAL;
56diff --git a/util/base64.c b/util/base64.c
57index 7f47cda6..0e89f2e9 100644
58--- a/util/base64.c
59+++ b/util/base64.c
60@@ -20,6 +20,7 @@
61 * MA 02110-1301, USA.
62 */
63
64+#include <stdint.h>
65 #include <stdlib.h>
66 #include <string.h>
67 #include <errno.h>
68@@ -42,7 +43,7 @@ static const char base64_table[65] =
69 int base64_encode(const unsigned char *src, int srclen, char *dst)
70 {
71 int i, bits = 0;
72- u_int32_t ac = 0;
73+ uint32_t ac = 0;
74 char *cp = dst;
75
76 for (i = 0; i < srclen; i++) {
77@@ -77,7 +78,7 @@ int base64_encode(const unsigned char *src, int srclen, char *dst)
78 */
79 int base64_decode(const char *src, int srclen, unsigned char *dst)
80 {
81- u_int32_t ac = 0;
82+ uint32_t ac = 0;
83 int i, bits = 0;
84 unsigned char *bp = dst;
85
86--
872.45.1
88
diff --git a/meta-oe/recipes-bsp/nvme-cli/nvme-cli/0001-plugins-ssstc-Replace-__uint16_t-with-uint16_t.patch b/meta-oe/recipes-bsp/nvme-cli/nvme-cli/0001-plugins-ssstc-Replace-__uint16_t-with-uint16_t.patch
deleted file mode 100644
index 1881b18aac..0000000000
--- a/meta-oe/recipes-bsp/nvme-cli/nvme-cli/0001-plugins-ssstc-Replace-__uint16_t-with-uint16_t.patch
+++ /dev/null
@@ -1,34 +0,0 @@
1From 47d33d8da7a5b7310a2c2f4328115b439039e46c Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 21 May 2024 14:09:32 -0700
4Subject: [PATCH] plugins/ssstc: Replace __uint16_t with uint16_t
5
6uint16_t is ISO defined and comes from stdint.h, makes it
7portable across glibc and musl on linux.
8
9Upstream-Status: Submitted [https://github.com/linux-nvme/nvme-cli/pull/2351]
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 plugins/ssstc/ssstc-nvme.c | 6 +++---
13 1 file changed, 3 insertions(+), 3 deletions(-)
14
15diff --git a/plugins/ssstc/ssstc-nvme.c b/plugins/ssstc/ssstc-nvme.c
16index 03e4fe3f..302df988 100644
17--- a/plugins/ssstc/ssstc-nvme.c
18+++ b/plugins/ssstc/ssstc-nvme.c
19@@ -64,9 +64,9 @@ void show_ssstc_add_smart_log_jsn(struct nvme_additional_smart_log *smart,
20 unsigned int nsid, const char *devname)
21 {
22 struct json_object *root, *entry_stats, *dev_stats, *multi;
23- __uint16_t wear_level_min = 0;
24- __uint16_t wear_level_max = 0;
25- __uint16_t wear_level_avg = 0;
26+ uint16_t wear_level_min = 0;
27+ uint16_t wear_level_max = 0;
28+ uint16_t wear_level_avg = 0;
29 uint64_t raw_val = 0;
30
31 root = json_create_object();
32--
332.45.1
34
diff --git a/meta-oe/recipes-bsp/nvme-cli/nvme-cli_2.9.1.bb b/meta-oe/recipes-bsp/nvme-cli/nvme-cli_2.10.2.bb
index f4ddec88c4..2005a198aa 100644
--- a/meta-oe/recipes-bsp/nvme-cli/nvme-cli_2.9.1.bb
+++ b/meta-oe/recipes-bsp/nvme-cli/nvme-cli_2.10.2.bb
@@ -6,12 +6,9 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=8264535c0c4e9c6c335635c4026a8022 \
6 file://ccan/licenses/CC0;md5=c17af43b05840255a6fedc5eda9d56cc \ 6 file://ccan/licenses/CC0;md5=c17af43b05840255a6fedc5eda9d56cc \
7 file://ccan/licenses/BSD-MIT;md5=838c366f69b72c5df05c96dff79b35f2" 7 file://ccan/licenses/BSD-MIT;md5=838c366f69b72c5df05c96dff79b35f2"
8DEPENDS = "json-c libnvme" 8DEPENDS = "json-c libnvme"
9SRCREV = "b340fd7dcf1aef76f8d46ab28bef3c170d310887" 9SRCREV = "eeaa08c9a0e9184f3889df0bff3d2a23db6d6294"
10 10
11SRC_URI = "git://github.com/linux-nvme/nvme-cli.git;branch=master;protocol=https \ 11SRC_URI = "git://github.com/linux-nvme/nvme-cli.git;branch=master;protocol=https"
12 file://0001-nvme-Use-C99-types-for-uint32_t.patch \
13 file://0001-plugins-ssstc-Replace-__uint16_t-with-uint16_t.patch \
14 "
15 12
16S = "${WORKDIR}/git" 13S = "${WORKDIR}/git"
17 14