* [Buildroot] [PATCH 0/2] package/ndctl: new package @ 2026-03-06 3:44 cp0613 2026-03-06 3:44 ` [Buildroot] [PATCH 1/2] " cp0613 2026-03-06 3:44 ` [Buildroot] [PATCH 2/2] DEVELOPERS: Add Chen Pei to ndctl cp0613 0 siblings, 2 replies; 5+ messages in thread From: cp0613 @ 2026-03-06 3:44 UTC (permalink / raw) To: buildroot; +Cc: ju.o, Chen Pei From: Chen Pei <cp0613@linux.alibaba.com> ndctl is a userspace utility for managing persistent memory (PMEM) and NVDIMM devices on Linux, enabling configuration and monitoring of namespaces, regions, and health status. Adding ndctl to Buildroot allows embedded or server systems with PMEM hardware to manage persistent memory directly on the target device in a lightweight, self-contained manner. Chen Pei (2): package/ndctl: new package DEVELOPERS: Add Chen Pei to ndctl DEVELOPERS | 1 + package/Config.in | 1 + package/ndctl/Config.in | 21 +++++++++++++++++++++ package/ndctl/ndctl.hash | 3 +++ package/ndctl/ndctl.mk | 34 ++++++++++++++++++++++++++++++++++ 5 files changed, 60 insertions(+) create mode 100644 package/ndctl/Config.in create mode 100644 package/ndctl/ndctl.hash create mode 100644 package/ndctl/ndctl.mk -- 2.50.1 _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Buildroot] [PATCH 1/2] package/ndctl: new package 2026-03-06 3:44 [Buildroot] [PATCH 0/2] package/ndctl: new package cp0613 @ 2026-03-06 3:44 ` cp0613 2026-03-07 12:46 ` Julien Olivain via buildroot 2026-03-06 3:44 ` [Buildroot] [PATCH 2/2] DEVELOPERS: Add Chen Pei to ndctl cp0613 1 sibling, 1 reply; 5+ messages in thread From: cp0613 @ 2026-03-06 3:44 UTC (permalink / raw) To: buildroot; +Cc: ju.o, Chen Pei From: Chen Pei <cp0613@linux.alibaba.com> A "device memory" enabling project encompassing tools and libraries for CXL, NVDIMMs, DAX, memory tiering and other platform memory device topics. Signed-off-by: Chen Pei <cp0613@linux.alibaba.com> --- package/Config.in | 1 + package/ndctl/Config.in | 21 +++++++++++++++++++++ package/ndctl/ndctl.hash | 3 +++ package/ndctl/ndctl.mk | 34 ++++++++++++++++++++++++++++++++++ 4 files changed, 59 insertions(+) create mode 100644 package/ndctl/Config.in create mode 100644 package/ndctl/ndctl.hash create mode 100644 package/ndctl/ndctl.mk diff --git a/package/Config.in b/package/Config.in index d1dce9c4d7..ec657d5441 100644 --- a/package/Config.in +++ b/package/Config.in @@ -2867,6 +2867,7 @@ menu "System tools" source "package/monit/Config.in" source "package/multipath-tools/Config.in" source "package/ncdu/Config.in" + source "package/ndctl/Config.in" source "package/nerdctl/Config.in" source "package/netifrc/Config.in" source "package/numactl/Config.in" diff --git a/package/ndctl/Config.in b/package/ndctl/Config.in new file mode 100644 index 0000000000..841e9981b8 --- /dev/null +++ b/package/ndctl/Config.in @@ -0,0 +1,21 @@ +config BR2_PACKAGE_NDCTL + bool "ndctl" + depends on BR2_TOOLCHAIN_HAS_THREADS + depends on BR2_USE_MMU + depends on BR2_LINUX_KERNEL + depends on BR2_PACKAGE_HAS_UDEV + select BR2_PACKAGE_KMOD + select BR2_PACKAGE_JSON_C + select BR2_PACKAGE_UTIL_LINUX + select BR2_PACKAGE_UTIL_LINUX_LIBS + select BR2_PACKAGE_UTIL_LINUX_LIBUUID + select BR2_PACKAGE_LIBTRACEEVENT + select BR2_PACKAGE_LIBTRACEFS + select BR2_PACKAGE_KEYUTILS + select BR2_PACKAGE_INIPARSER + help + A "device memory" enabling project encompassing tools and + libraries for CXL, NVDIMMs, DAX, memory tiering and other + platform memory device topics. + + https://github.com/pmem/ndctl diff --git a/package/ndctl/ndctl.hash b/package/ndctl/ndctl.hash new file mode 100644 index 0000000000..a04f0cfa10 --- /dev/null +++ b/package/ndctl/ndctl.hash @@ -0,0 +1,3 @@ +# locally computed +sha256 dd4b9b9a9dc0a15e980670b6f889e910a80ad60f2309e03bfd9cc6071d14dd30 ndctl-83.tar.gz +sha256 1334f22048052d69647860fe9fb24997dc3b33737cb494297d68949f589fa1cf COPYING diff --git a/package/ndctl/ndctl.mk b/package/ndctl/ndctl.mk new file mode 100644 index 0000000000..5c8ed86da7 --- /dev/null +++ b/package/ndctl/ndctl.mk @@ -0,0 +1,34 @@ +################################################################################ +# +# ndctl +# +################################################################################ + +NDCTL_VERSION = 83 +NDCTL_SITE = $(call github,pmem,ndctl,v$(NDCTL_VERSION)) +NDCTL_LICENSE = LGPL-2.1+, GPL-2.0+ +NDCTL_LICENSE_FILES = COPYING + +NDCTL_DEPENDENCIES = \ + host-meson \ + host-ninja \ + util-linux-libs \ + kmod \ + json-c \ + libtraceevent \ + libtracefs \ + keyutils \ + iniparser + +NDCTL_CONF_OPTS = \ + -Ddocs=disabled \ + -Diniparserdir=$(TARGET_DIR)/usr/include/iniparser + +ifeq ($(BR2_PACKAGE_SYSTEMD),y) +NDCTL_CONF_OPTS += -Dsystemd=enabled +NDCTL_DEPENDENCIES += systemd +else +NDCTL_CONF_OPTS += -Dsystemd=disabled +endif + +$(eval $(meson-package)) -- 2.50.1 _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Buildroot] [PATCH 1/2] package/ndctl: new package 2026-03-06 3:44 ` [Buildroot] [PATCH 1/2] " cp0613 @ 2026-03-07 12:46 ` Julien Olivain via buildroot 2026-03-09 1:48 ` [Buildroot] [PATCH] " cp0613 0 siblings, 1 reply; 5+ messages in thread From: Julien Olivain via buildroot @ 2026-03-07 12:46 UTC (permalink / raw) To: cp0613; +Cc: buildroot Hi Pei, Thanks for the patch. I have few comments, see below. On 06/03/2026 04:44, cp0613@linux.alibaba.com wrote: > From: Chen Pei <cp0613@linux.alibaba.com> > > A "device memory" enabling project encompassing tools and > libraries for CXL, NVDIMMs, DAX, memory tiering and other > platform memory device topics. > > Signed-off-by: Chen Pei <cp0613@linux.alibaba.com> > --- [...] > diff --git a/package/ndctl/Config.in b/package/ndctl/Config.in > new file mode 100644 > index 0000000000..841e9981b8 > --- /dev/null > +++ b/package/ndctl/Config.in > @@ -0,0 +1,21 @@ > +config BR2_PACKAGE_NDCTL > + bool "ndctl" > + depends on BR2_TOOLCHAIN_HAS_THREADS > + depends on BR2_USE_MMU > + depends on BR2_LINUX_KERNEL This "depends on BR2_LINUX_KERNEL" is not needed. It can be removed. ndctl can compile without the kernel being selected. The kernel-headers are in the toolchain. > + depends on BR2_PACKAGE_HAS_UDEV There is possibly a missing "depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_..." here. ndctl cxl/fwctl is using __struct_group(). See: https://github.com/pmem/ndctl/blob/v83/cxl/fwctl/features.h#L108 This macro was introduced in Kernel 5.16 in: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?&id=50d7bd38c3aafc4749e05e8d7fcb616979143602 So this cannot compile with toolchains with older kernel headers. When using the Arm external toolchain, compilation fails with error: In file included from ../test/fwctl.c:17: ../cxl/fwctl/features.h:108:9: error: expected specifier-qualifier-list before ‘__struct_group’ The fwctl support is a ndctl meson option, but disabling it breaks at configuration time. You could probably propose a fix upstream for that (fixing ndctl when configured with -Dtest=enabled and -Dfwctl=disabled). Or you can always pass -Dfwctl=enabled in Buildroot, and add this kernel header requirement. See the kmemd package for example: https://gitlab.com/buildroot.org/buildroot/-/blob/master/package/kmemd/Config.in > + select BR2_PACKAGE_KMOD > + select BR2_PACKAGE_JSON_C > + select BR2_PACKAGE_UTIL_LINUX > + select BR2_PACKAGE_UTIL_LINUX_LIBS > + select BR2_PACKAGE_UTIL_LINUX_LIBUUID > + select BR2_PACKAGE_LIBTRACEEVENT > + select BR2_PACKAGE_LIBTRACEFS libtracefs seems to be an optional dependency. See: https://github.com/pmem/ndctl/blob/v83/meson_options.txt#L5 In Buildroot, we try to keep package dependencies minimal. So, unless there is a good reason to always enable it in Buildroot (e.g. upstream support incomplete or broken), this should be kept optional. So those "select BR2_PACKAGE_..." should be removed, and the optional dependency should go in ndctl.mk (like you did for systemd). For example: ifeq ($(BR2_PACKAGE_TRACEFS)$(BR2_PACKAGE_TRACEEVENT),yy) NDCTL_CONF_OPTS += -Dlibtracefs=enabled NDCTL_DEPENDENCIES += libtraceevent libtracefs else NDCTL_CONF_OPTS += -Dlibtracefs=disabled endif > + select BR2_PACKAGE_KEYUTILS The keyutils is optional: https://github.com/pmem/ndctl/blob/v83/meson_options.txt#L7 Again, trying to build with -Dkeyutils=disabled fails with error: ../ndctl/dimm.c:1030:16: error: too many arguments to function ‘ndctl_dimm_remove_key’; expected 1, have 2 Ideally, this should be fixed upstream to keep it optional in Buildroot. If you decide to not fix it upstream, you can add a comment that building with keyutils support disabled is currently broken upstream. You can also add -Dkeyutils=enabled in ndctl.mk to show it is always enabled. > + select BR2_PACKAGE_INIPARSER After those changes, could you sort all the remaining "select BR2_PACKAGE_" line alphabetically? > + help > + A "device memory" enabling project encompassing tools and > + libraries for CXL, NVDIMMs, DAX, memory tiering and other > + platform memory device topics. > + > + https://github.com/pmem/ndctl Since the package has specific "depends on" requirements, you should add here a Kconfig comment when they are not met. See for example: https://gitlab.com/buildroot.org/buildroot/-/blob/2026.02/package/collectd/Config.in?ref_type=tags#L617 [...] > diff --git a/package/ndctl/ndctl.mk b/package/ndctl/ndctl.mk > new file mode 100644 > index 0000000000..5c8ed86da7 > --- /dev/null > +++ b/package/ndctl/ndctl.mk > @@ -0,0 +1,34 @@ > +################################################################################ > +# > +# ndctl > +# > +################################################################################ > + > +NDCTL_VERSION = 83 > +NDCTL_SITE = $(call github,pmem,ndctl,v$(NDCTL_VERSION)) > +NDCTL_LICENSE = LGPL-2.1+, GPL-2.0+ Reading the file: https://github.com/pmem/ndctl/blob/v83/COPYING there is more details of components and extra licenses. You could add those info in _LICENSE, for ex: NDCTL_LICENSE = \ CC0-1.0 (helper routines), \ GPL-2.0+ (tools), \ LGPL-2.1+ (libraries), \ MIT (helper routines) > +NDCTL_LICENSE_FILES = COPYING It would also be preferable to include the actual license files too: NDCTL_LICENSE_FILES = \ COPYING \ LICENSES/other/CC0-1.0 \ LICENSES/other/MIT \ LICENSES/preferred/GPL-2.0 \ LICENSES/preferred/LGPL-2.1 and update the ndctl.hash accordingly. > + > +NDCTL_DEPENDENCIES = \ > + host-meson \ > + host-ninja \ The host-meson and host-ninja can be removed. They are automatically added by the package infra in the last line "$(eval $(meson-package))" > + util-linux-libs \ > + kmod \ > + json-c \ > + libtraceevent \ > + libtracefs \ libtraceevent and libtracefs can be removed from here, and added in a conditional block to handle those as optional dependencies. > + keyutils \ Same comment for keyutils (if you decide to fix it upstream). > + iniparser You miss a dependency to "udev" in this list. Without it, the configuration can fail depending the order. Could you also sort the _DEPENDENCY list alphabetically please? > + > +NDCTL_CONF_OPTS = \ > + -Ddocs=disabled \ > + -Diniparserdir=$(TARGET_DIR)/usr/include/iniparser The compilation should not point to $(TARGET_DIR). You should use $(STAGING_DIR) instead. > + > +ifeq ($(BR2_PACKAGE_SYSTEMD),y) > +NDCTL_CONF_OPTS += -Dsystemd=enabled > +NDCTL_DEPENDENCIES += systemd > +else > +NDCTL_CONF_OPTS += -Dsystemd=disabled > +endif > + > +$(eval $(meson-package)) > -- > 2.50.1 After those changes, could you also check it passes the compilation tests with the command: utils/test-pkg -a -p ndctl and it also passes checks with the command: utils/docker-run make check-package Could you send an updated patch with those changes, please? Best regards, Julien. _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Buildroot] [PATCH] package/ndctl: new package 2026-03-07 12:46 ` Julien Olivain via buildroot @ 2026-03-09 1:48 ` cp0613 0 siblings, 0 replies; 5+ messages in thread From: cp0613 @ 2026-03-09 1:48 UTC (permalink / raw) To: ju.o; +Cc: buildroot On Sat, 07 Mar 2026 13:46:56 +0100, ju.o@free.fr wrote: > > From: Chen Pei <cp0613@linux.alibaba.com> > > > > A "device memory" enabling project encompassing tools and > > libraries for CXL, NVDIMMs, DAX, memory tiering and other > > platform memory device topics. > > > > Signed-off-by: Chen Pei <cp0613@linux.alibaba.com> > > --- > [...] > > diff --git a/package/ndctl/Config.in b/package/ndctl/Config.in > > new file mode 100644 > > index 0000000000..841e9981b8 > > --- /dev/null > > +++ b/package/ndctl/Config.in > > @@ -0,0 +1,21 @@ > > +config BR2_PACKAGE_NDCTL > > + bool "ndctl" > > + depends on BR2_TOOLCHAIN_HAS_THREADS > > + depends on BR2_USE_MMU > > + depends on BR2_LINUX_KERNEL > > This "depends on BR2_LINUX_KERNEL" is not needed. It can be > removed. ndctl can compile without the kernel being selected. > The kernel-headers are in the toolchain. > > > + depends on BR2_PACKAGE_HAS_UDEV > > There is possibly a missing "depends on > BR2_TOOLCHAIN_HEADERS_AT_LEAST_..." here. > > ndctl cxl/fwctl is using __struct_group(). See: > https://github.com/pmem/ndctl/blob/v83/cxl/fwctl/features.h#L108 > > This macro was introduced in Kernel 5.16 in: > https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?&id=50d7bd38c3aafc4749e05e8d7fcb616979143602 > > So this cannot compile with toolchains with older kernel headers. > When using the Arm external toolchain, compilation fails with error: > > In file included from ../test/fwctl.c:17: > ../cxl/fwctl/features.h:108:9: error: expected specifier-qualifier-list > before ‘__struct_group’ > > The fwctl support is a ndctl meson option, but disabling it > breaks at configuration time. You could probably propose a > fix upstream for that (fixing ndctl when configured with > -Dtest=enabled and -Dfwctl=disabled). > > Or you can always pass -Dfwctl=enabled in Buildroot, and add this > kernel header requirement. See the kmemd package for example: > https://gitlab.com/buildroot.org/buildroot/-/blob/master/package/kmemd/Config.in > > > + select BR2_PACKAGE_KMOD > > + select BR2_PACKAGE_JSON_C > > + select BR2_PACKAGE_UTIL_LINUX > > + select BR2_PACKAGE_UTIL_LINUX_LIBS > > + select BR2_PACKAGE_UTIL_LINUX_LIBUUID > > + select BR2_PACKAGE_LIBTRACEEVENT > > + select BR2_PACKAGE_LIBTRACEFS > > libtracefs seems to be an optional dependency. See: > https://github.com/pmem/ndctl/blob/v83/meson_options.txt#L5 > > In Buildroot, we try to keep package dependencies > minimal. So, unless there is a good reason to always enable > it in Buildroot (e.g. upstream support incomplete or broken), > this should be kept optional. So those "select BR2_PACKAGE_..." > should be removed, and the optional dependency should go in > ndctl.mk (like you did for systemd). For example: > ifeq ($(BR2_PACKAGE_TRACEFS)$(BR2_PACKAGE_TRACEEVENT),yy) > NDCTL_CONF_OPTS += -Dlibtracefs=enabled > NDCTL_DEPENDENCIES += libtraceevent libtracefs > else > NDCTL_CONF_OPTS += -Dlibtracefs=disabled > endif > > > + select BR2_PACKAGE_KEYUTILS > > The keyutils is optional: > https://github.com/pmem/ndctl/blob/v83/meson_options.txt#L7 > > Again, trying to build with -Dkeyutils=disabled fails with error: > > ../ndctl/dimm.c:1030:16: error: too many arguments to function > ‘ndctl_dimm_remove_key’; expected 1, have 2 > > Ideally, this should be fixed upstream to keep it optional in Buildroot. > > If you decide to not fix it upstream, you can add a comment that > building with keyutils support disabled is currently broken upstream. > You can also add -Dkeyutils=enabled in ndctl.mk to show it is always > enabled. > > > + select BR2_PACKAGE_INIPARSER > > After those changes, could you sort all the remaining > "select BR2_PACKAGE_" line alphabetically? > > > + help > > + A "device memory" enabling project encompassing tools and > > + libraries for CXL, NVDIMMs, DAX, memory tiering and other > > + platform memory device topics. > > + > > + https://github.com/pmem/ndctl > > Since the package has specific "depends on" requirements, you > should add here a Kconfig comment when they are not met. See for > example: > https://gitlab.com/buildroot.org/buildroot/-/blob/2026.02/package/collectd/Config.in?ref_type=tags#L617 > > [...] > > diff --git a/package/ndctl/ndctl.mk b/package/ndctl/ndctl.mk > > new file mode 100644 > > index 0000000000..5c8ed86da7 > > --- /dev/null > > +++ b/package/ndctl/ndctl.mk > > @@ -0,0 +1,34 @@ > > +################################################################################ > > +# > > +# ndctl > > +# > > +################################################################################ > > + > > +NDCTL_VERSION = 83 > > +NDCTL_SITE = $(call github,pmem,ndctl,v$(NDCTL_VERSION)) > > +NDCTL_LICENSE = LGPL-2.1+, GPL-2.0+ > > Reading the file: > https://github.com/pmem/ndctl/blob/v83/COPYING > there is more details of components and extra licenses. > > You could add those info in _LICENSE, for ex: > > NDCTL_LICENSE = \ > CC0-1.0 (helper routines), \ > GPL-2.0+ (tools), \ > LGPL-2.1+ (libraries), \ > MIT (helper routines) > > > +NDCTL_LICENSE_FILES = COPYING > > It would also be preferable to include the actual license > files too: > > NDCTL_LICENSE_FILES = \ > COPYING \ > LICENSES/other/CC0-1.0 \ > LICENSES/other/MIT \ > LICENSES/preferred/GPL-2.0 \ > LICENSES/preferred/LGPL-2.1 > > and update the ndctl.hash accordingly. > > > + > > +NDCTL_DEPENDENCIES = \ > > + host-meson \ > > + host-ninja \ > > The host-meson and host-ninja can be removed. They are > automatically added by the package infra in the last line > "$(eval $(meson-package))" > > > + util-linux-libs \ > > + kmod \ > > + json-c \ > > + libtraceevent \ > > + libtracefs \ > > libtraceevent and libtracefs can be removed from here, and > added in a conditional block to handle those as optional > dependencies. > > > + keyutils \ > > Same comment for keyutils (if you decide to fix it upstream). > > > + iniparser > > You miss a dependency to "udev" in this list. Without it, the > configuration can fail depending the order. > > Could you also sort the _DEPENDENCY list alphabetically please? > > > + > > +NDCTL_CONF_OPTS = \ > > + -Ddocs=disabled \ > > + -Diniparserdir=$(TARGET_DIR)/usr/include/iniparser > > The compilation should not point to $(TARGET_DIR). > You should use $(STAGING_DIR) instead. > > > + > > +ifeq ($(BR2_PACKAGE_SYSTEMD),y) > > +NDCTL_CONF_OPTS += -Dsystemd=enabled > > +NDCTL_DEPENDENCIES += systemd > > +else > > +NDCTL_CONF_OPTS += -Dsystemd=disabled > > +endif > > + > > +$(eval $(meson-package)) > > -- > > 2.50.1 > > After those changes, could you also check it passes the compilation > tests with the command: > utils/test-pkg -a -p ndctl > > and it also passes checks with the command: > utils/docker-run make check-package Hi, Julien, Thank you for your very detailed review. I will revise according to your feedback. Thanks, Pei _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Buildroot] [PATCH 2/2] DEVELOPERS: Add Chen Pei to ndctl 2026-03-06 3:44 [Buildroot] [PATCH 0/2] package/ndctl: new package cp0613 2026-03-06 3:44 ` [Buildroot] [PATCH 1/2] " cp0613 @ 2026-03-06 3:44 ` cp0613 1 sibling, 0 replies; 5+ messages in thread From: cp0613 @ 2026-03-06 3:44 UTC (permalink / raw) To: buildroot; +Cc: ju.o, Chen Pei From: Chen Pei <cp0613@linux.alibaba.com> Signed-off-by: Chen Pei <cp0613@linux.alibaba.com> --- DEVELOPERS | 1 + 1 file changed, 1 insertion(+) diff --git a/DEVELOPERS b/DEVELOPERS index f347240ef2..39a756f85a 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -604,6 +604,7 @@ F: package/qoriq-cadence-dp-firmware/ N: Chen Pei <cp0613@linux.alibaba.com> F: package/iniparser/ +F: package/ndctl/ N: Chris Packham <judge.packham@gmail.com> F: package/coremark/ -- 2.50.1 _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-03-09 1:49 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-03-06 3:44 [Buildroot] [PATCH 0/2] package/ndctl: new package cp0613 2026-03-06 3:44 ` [Buildroot] [PATCH 1/2] " cp0613 2026-03-07 12:46 ` Julien Olivain via buildroot 2026-03-09 1:48 ` [Buildroot] [PATCH] " cp0613 2026-03-06 3:44 ` [Buildroot] [PATCH 2/2] DEVELOPERS: Add Chen Pei to ndctl cp0613
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox