- Add support for NVDIMM devices (sparschauer)

- libparted/labels: link with libiconv if needed (arnout)
This commit is contained in:
Brian C. Lane 2017-12-19 11:55:37 -08:00
parent 633c511c8c
commit abca6a9a06
3 changed files with 142 additions and 1 deletions

View File

@ -0,0 +1,51 @@
From 8bec8bcc639cfc7ed0ca7cd3a5321513aa4348fd Mon Sep 17 00:00:00 2001
From: "Arnout Vandecappelle (Essensium/Mind)" <arnout@mind.be>
Date: Sun, 5 Nov 2017 23:33:37 +0100
Subject: [PATCH 80/81] libparted/labels: link with libiconv if needed
gpt.c uses iconv so it should link with it. Otherwise, on platforms
where libiconv is a separate library, we get a link failure of parted:
CCLD parted
../libparted/.libs/libparted.so: undefined reference to `libiconv'
../libparted/.libs/libparted.so: undefined reference to `libiconv_open'
../libparted/.libs/libparted.so: undefined reference to `libiconv_close'
Since iconv functionality is needed unconditionally (not only when
gettext is enabled), AM_ICONV needs to be added to configure.ac.
(cherry picked from commit 571293e3f9ee45f37867578899c6a8a9cd35afd4)
---
configure.ac | 2 ++
libparted/labels/Makefile.am | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 3d57157..5251dfb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -288,6 +288,8 @@ fi
AC_PROG_LIBTOOL
LT_INIT
+AM_ICONV
+
AM_GNU_GETTEXT_VERSION([0.18])
AM_GNU_GETTEXT([external])
if test "$USE_INCLUDED_LIBINTL" = "yes"; then
diff --git a/libparted/labels/Makefile.am b/libparted/labels/Makefile.am
index 3327c8c..db612d1 100644
--- a/libparted/labels/Makefile.am
+++ b/libparted/labels/Makefile.am
@@ -36,7 +36,7 @@ liblabels_la_SOURCES = \
rdb.c \
sun.c
-liblabels_la_LIBADD = $(OS_LIBS) $(INTLLIBS)
+liblabels_la_LIBADD = $(OS_LIBS) $(INTLLIBS) $(LIBICONV)
AM_CPPFLAGS = $(partedincludedir) $(INTLINCS)
--
2.13.6

View File

@ -0,0 +1,84 @@
From b5bbee5db418e85c8fd26bf07142e71302914738 Mon Sep 17 00:00:00 2001
From: Sebastian Parschauer <sparschauer@suse.de>
Date: Tue, 24 Oct 2017 10:22:21 +0200
Subject: [PATCH] Add support for NVDIMM devices
Recognize NVDIMM devices, so that "parted -s /dev/pmem7 p" now
prints "Model: NVDIMM Device (pmem)" instead of
"Model: Unknown (unknown)".
In order for a device to be recognized as NVDIMM, it has to
have a 'blkext' major number. But since this major can be
used also by other device types, we also check that the device
path contains 'pmem' as a substring.
* NEWS: Mention the change
* include/parted/device.h.in(PedDeviceType): Add PED_DEVICE_PMEM
* libparted/arch/linux.c(_device_probe_type): Recognize NVDIMM devices.
* libparted/arch/linux.c(linux_new): Handle NVDIMM devices.
* parted/parted.c(do_print): Add "pmem" to list of transports.
Signed-off-by: Sebastian Parschauer <sparschauer@suse.de>
(cherry picked from commit 71885c5f493f3a5d950adbb3e8d17eff7e023053)
---
include/parted/device.in.h | 3 ++-
libparted/arch/linux.c | 7 +++++++
parted/parted.c | 3 ++-
3 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/include/parted/device.in.h b/include/parted/device.in.h
index 1b6e7b8..d3af6bb 100644
--- a/include/parted/device.in.h
+++ b/include/parted/device.in.h
@@ -51,7 +51,8 @@ typedef enum {
PED_DEVICE_MD = 17,
PED_DEVICE_LOOP = 18,
PED_DEVICE_NVME = 19,
- PED_DEVICE_RAM = 20
+ PED_DEVICE_RAM = 20,
+ PED_DEVICE_PMEM = 21
} PedDeviceType;
typedef struct _PedDevice PedDevice;
diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
index b76000e..1c26b8c 100644
--- a/libparted/arch/linux.c
+++ b/libparted/arch/linux.c
@@ -704,6 +704,8 @@ _device_probe_type (PedDevice* dev)
dev->type = PED_DEVICE_NVME;
} else if (dev_major == RAM_MAJOR) {
dev->type = PED_DEVICE_RAM;
+ } else if (_is_blkext_major(dev_major) && dev->path && strstr(dev->path, "pmem")) {
+ dev->type = PED_DEVICE_PMEM;
} else {
dev->type = PED_DEVICE_UNKNOWN;
}
@@ -1487,6 +1489,11 @@ linux_new (const char* path)
goto error_free_arch_specific;
break;
+ case PED_DEVICE_PMEM:
+ if (!init_generic (dev, _("NVDIMM Device")))
+ goto error_free_arch_specific;
+ break;
+
case PED_DEVICE_ATARAID:
if (!init_generic (dev, _("ATARAID Controller")))
goto error_free_arch_specific;
diff --git a/parted/parted.c b/parted/parted.c
index d2e1f24..b49e1df 100644
--- a/parted/parted.c
+++ b/parted/parted.c
@@ -986,7 +986,8 @@ _print_disk_info (const PedDevice *dev, const PedDisk *diskp)
"cpqarray", "file", "ataraid", "i2o",
"ubd", "dasd", "viodasd", "sx8", "dm",
"xvd", "sd/mmc", "virtblk", "aoe",
- "md", "loopback", "nvme", "brd"};
+ "md", "loopback", "nvme", "brd",
+ "pmem"};
char* start = ped_unit_format (dev, 0);
PedUnit default_unit = ped_unit_get_default ();
--
2.13.6

View File

@ -4,7 +4,7 @@
Summary: The GNU disk partition manipulation program
Name: parted
Version: 3.2
Release: 28%{?dist}
Release: 29%{?dist}
License: GPLv3+
Group: Applications/System
URL: http://www.gnu.org/software/parted
@ -93,6 +93,8 @@ Patch0076: 0076-Increase-timeout-for-rmmod-scsi_debug-and-make-it-a-.patch
Patch0077: 0077-tests-t1701-rescue-fs-wait-for-the-device-to-appear.patch
Patch0078: 0078-libparted-Fix-udev-cookie-leak-in-_dm_resize_partiti.patch
Patch0079: 0079-atari.c-Drop-xlocale.h-1476934.patch
Patch0080: 0080-libparted-labels-link-with-libiconv-if-needed.patch
Patch0081: 0081-Add-support-for-NVDIMM-devices.patch
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -231,6 +233,10 @@ fi
%changelog
* Tue Dec 19 2017 Brian C. Lane <bcl@redhat.com> - 3.2-29
- Add support for NVDIMM devices (sparschauer)
- libparted/labels: link with libiconv if needed (arnout)
* Mon Jul 31 2017 Brian C. Lane <bcl@redhat.com> - 3.2-28
- atari.c: Drop xlocale.h
Resloves: rhbz#1476934