summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/util-linux/util-linux
diff options
context:
space:
mode:
authorPierre-Jean Texier <pjtexier@koncepto.io>2020-02-29 21:38:01 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-03-01 10:40:11 +0000
commit5a8d7be90aa2dc86447aededceb972e4a112b43a (patch)
treeba7f565311e0f48777076ad81784624f6909b2c7 /meta/recipes-core/util-linux/util-linux
parente1b4a438cb55e187a9406b80fa3f247960dd5bc8 (diff)
downloadpoky-5a8d7be90aa2dc86447aededceb972e4a112b43a.tar.gz
util-linux: upgrade 2.34 -> 2.35.1
License-Update: add GPLv3 text in README.licensing Also: - Drop upstreamed patch - Backport an upstream patch to fix an issue with 'sfdisk' - Use 'disable-hwclock-gplv3' explicitly. Since commit 7a3000f7ba548cf7d74ac77cc63fe8de228a669e ("hwclock: use parse_date function") hwclock is linked with parse_date.y from gnullib. This gnulib code is distributed with GPLv3. So, we have to use '--disable-hwclock-gplv3' to exclude this code. See full changelog https://lore.kernel.org/util-linux/20200131095846.ogjtqrs7ai774tka@ws.net.home/T/#u (From OE-Core rev: 324f33ba5a77d498cfff81c6857c78ad13b27125) Signed-off-by: Pierre-Jean Texier <pjtexier@koncepto.io> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/util-linux/util-linux')
-rw-r--r--meta/recipes-core/util-linux/util-linux/0001-libfdisk-script-accept-sector-size-ignore-unknown-he.patch137
-rw-r--r--meta/recipes-core/util-linux/util-linux/0001-lsblk-force-to-print-PKNAME-for-partition.patch36
2 files changed, 137 insertions, 36 deletions
diff --git a/meta/recipes-core/util-linux/util-linux/0001-libfdisk-script-accept-sector-size-ignore-unknown-he.patch b/meta/recipes-core/util-linux/util-linux/0001-libfdisk-script-accept-sector-size-ignore-unknown-he.patch
new file mode 100644
index 0000000000..911f70bc1f
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/0001-libfdisk-script-accept-sector-size-ignore-unknown-he.patch
@@ -0,0 +1,137 @@
1From 00e53f17c8462cb34ece08cc10db60a7da29a305 Mon Sep 17 00:00:00 2001
2From: Karel Zak <kzak@redhat.com>
3Date: Tue, 4 Feb 2020 15:11:19 +0100
4Subject: [PATCH] libfdisk: (script) accept sector-size, ignore unknown headers
5
6- add sector-size between supported headers (already in --dump output)
7
8- report unknown headers by -ENOTSUP
9
10- ignore ENOTSUP in sfdisk (but print warning) and in fdisk_script_read_file()
11
12Upstream-Status: Backport [https://github.com/karelzak/util-linux/commit/00e53f17c8462cb34ece08cc10db60a7da29a305]
13
14Addresses: https://github.com/karelzak/util-linux/issues/949
15Signed-off-by: Karel Zak <kzak@redhat.com>
16Signed-off-by: Pierre-Jean Texier <pjtexier@koncepto.io>
17---
18 disk-utils/sfdisk.c | 6 +++++-
19 libfdisk/src/script.c | 49 ++++++++++++++++++++++++++-----------------------
20 2 files changed, 31 insertions(+), 24 deletions(-)
21
22diff --git a/disk-utils/sfdisk.c b/disk-utils/sfdisk.c
23index bb6e1c6..c0bea70 100644
24--- a/disk-utils/sfdisk.c
25+++ b/disk-utils/sfdisk.c
26@@ -1782,7 +1782,11 @@ static int command_fdisk(struct sfdisk *sf, int argc, char **argv)
27 }
28
29 rc = fdisk_script_read_line(dp, stdin, buf, sizeof(buf));
30- if (rc < 0) {
31+ if (rc == -ENOTSUP) {
32+ buf[sizeof(buf) - 1] = '\0';
33+ fdisk_warnx(sf->cxt, _("Unknown script header '%s' -- ignore."), buf);
34+ continue;
35+ } else if (rc < 0) {
36 DBG(PARSE, ul_debug("script parsing failed, trying sfdisk specific commands"));
37 buf[sizeof(buf) - 1] = '\0';
38 rc = loop_control_commands(sf, dp, buf);
39diff --git a/libfdisk/src/script.c b/libfdisk/src/script.c
40index a21771b..d3e67fa 100644
41--- a/libfdisk/src/script.c
42+++ b/libfdisk/src/script.c
43@@ -805,8 +805,12 @@ static inline int is_header_line(const char *s)
44 /* parses "<name>: value", note modifies @s*/
45 static int parse_line_header(struct fdisk_script *dp, char *s)
46 {
47- int rc = -EINVAL;
48+ size_t i;
49 char *name, *value;
50+ static const char *supported[] = {
51+ "label", "unit", "label-id", "device", "grain",
52+ "first-lba", "last-lba", "table-length", "sector-size"
53+ };
54
55 DBG(SCRIPT, ul_debugobj(dp, " parse header '%s'", s));
56
57@@ -816,7 +820,7 @@ static int parse_line_header(struct fdisk_script *dp, char *s)
58 name = s;
59 value = strchr(s, ':');
60 if (!value)
61- goto done;
62+ return -EINVAL;
63 *value = '\0';
64 value++;
65
66@@ -825,32 +829,30 @@ static int parse_line_header(struct fdisk_script *dp, char *s)
67 ltrim_whitespace((unsigned char *) value);
68 rtrim_whitespace((unsigned char *) value);
69
70+ if (!*name || !*value)
71+ return -EINVAL;
72+
73+ /* check header name */
74+ for (i = 0; i < ARRAY_SIZE(supported); i++) {
75+ if (strcmp(name, supported[i]) == 0)
76+ break;
77+ }
78+ if (i == ARRAY_SIZE(supported))
79+ return -ENOTSUP;
80+
81+ /* header specific actions */
82 if (strcmp(name, "label") == 0) {
83 if (dp->cxt && !fdisk_get_label(dp->cxt, value))
84- goto done; /* unknown label name */
85+ return -EINVAL; /* unknown label name */
86 dp->force_label = 1;
87+
88 } else if (strcmp(name, "unit") == 0) {
89 if (strcmp(value, "sectors") != 0)
90- goto done; /* only "sectors" supported */
91- } else if (strcmp(name, "label-id") == 0
92- || strcmp(name, "device") == 0
93- || strcmp(name, "grain") == 0
94- || strcmp(name, "first-lba") == 0
95- || strcmp(name, "last-lba") == 0
96- || strcmp(name, "table-length") == 0) {
97- ; /* whatever is possible */
98- } else
99- goto done; /* unknown header */
100+ return -EINVAL; /* only "sectors" supported */
101
102- if (*name && *value)
103- rc = fdisk_script_set_header(dp, name, value);
104-done:
105- if (rc)
106- DBG(SCRIPT, ul_debugobj(dp, "header parse error: "
107- "[rc=%d, name='%s', value='%s']",
108- rc, name, value));
109- return rc;
110+ }
111
112+ return fdisk_script_set_header(dp, name, value);
113 }
114
115 /* returns zero terminated string with next token and @str is updated */
116@@ -1363,7 +1365,8 @@ int fdisk_script_set_fgets(struct fdisk_script *dp,
117 *
118 * Reads next line into dump.
119 *
120- * Returns: 0 on success, <0 on error, 1 when nothing to read.
121+ * Returns: 0 on success, <0 on error, 1 when nothing to read. For unknown headers
122+ * returns -ENOTSUP, it's usually safe to ignore this error.
123 */
124 int fdisk_script_read_line(struct fdisk_script *dp, FILE *f, char *buf, size_t bufsz)
125 {
126@@ -1428,7 +1431,7 @@ int fdisk_script_read_file(struct fdisk_script *dp, FILE *f)
127
128 while (!feof(f)) {
129 rc = fdisk_script_read_line(dp, f, buf, sizeof(buf));
130- if (rc)
131+ if (rc && rc != -ENOTSUP)
132 break;
133 }
134
135--
1362.7.4
137
diff --git a/meta/recipes-core/util-linux/util-linux/0001-lsblk-force-to-print-PKNAME-for-partition.patch b/meta/recipes-core/util-linux/util-linux/0001-lsblk-force-to-print-PKNAME-for-partition.patch
deleted file mode 100644
index 5d4c148fb3..0000000000
--- a/meta/recipes-core/util-linux/util-linux/0001-lsblk-force-to-print-PKNAME-for-partition.patch
+++ /dev/null
@@ -1,36 +0,0 @@
1From e3bb9bfb76c17b1d05814436ced62c05c4011f48 Mon Sep 17 00:00:00 2001
2From: Karel Zak <kzak@redhat.com>
3Date: Thu, 27 Jun 2019 09:22:18 +0200
4Subject: [PATCH] lsblk: force to print PKNAME for partition
5
6PKNAME (parent kernel device name) is based on printed tree according
7to parent -> child relationship. The tree is optional and not printed
8if partition specified (.e.g "lsblk -o+PKNAME /dev/sda1"), but old
9versions print the PKNAME also in this case.
10
11Upstream-Status: Backport [https://github.com/karelzak/util-linux/commit/e3bb9bfb76c17b1d05814436ced62c05c4011f48]
12
13Addresses: https://github.com/karelzak/util-linux/issues/813
14Signed-off-by: Karel Zak <kzak@redhat.com>
15Signed-off-by: Liwei Song <liwei.song@windriver.com>
16---
17 misc-utils/lsblk.c | 3 +++
18 1 file changed, 3 insertions(+)
19
20diff --git a/misc-utils/lsblk.c b/misc-utils/lsblk.c
21index e95af7af0256..3ce6da730264 100644
22--- a/misc-utils/lsblk.c
23+++ b/misc-utils/lsblk.c
24@@ -1019,6 +1019,9 @@ static void device_to_scols(
25 DBG(DEV, ul_debugobj(dev, "add '%s' to scols", dev->name));
26 ON_DBG(DEV, if (ul_path_isopen_dirfd(dev->sysfs)) ul_debugobj(dev, " %s ---> is open!", dev->name));
27
28+ if (!parent && dev->wholedisk)
29+ parent = dev->wholedisk;
30+
31 /* Do not print device more than one in --list mode */
32 if (!(lsblk->flags & LSBLK_TREE) && dev->is_printed)
33 return;
34--
352.17.1
36