All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 1/1] package/util-linux: fix LSMT_ROOT fallback definition
@ 2026-04-17  6:05 Shubham Chakraborty
  2026-05-30 10:02 ` Thomas Petazzoni via buildroot
  2026-06-05 12:49 ` Thomas Perale via buildroot
  0 siblings, 2 replies; 3+ messages in thread
From: Shubham Chakraborty @ 2026-04-17  6:05 UTC (permalink / raw)
  To: buildroot; +Cc: Giulio Benetti, Shubham Chakraborty

The fallback definition for LSMT_ROOT was incorrectly guarded
with #ifdef instead of #ifndef, making it ineffective on systems
with older kernel headers that don't define this constant.

This caused build failures with "LSMT_ROOT undeclared" errors on
autobuilders using older kernel headers.

Fixes:
 - http://autobuild.buildroot.net/results/ac2/ac2bc633db0c605564c79bfdfa0e257a9b4f1b28/

Signed-off-by: Shubham Chakraborty <chakrabortyshubham66@gmail.com>

---
Changes v1 -> v2:
  - Add missing 'Upstream:' tag to patches (fixes check-package failure)
  - Use symlink for util-linux-libs patch to avoid duplication
---
 ...api-utils.h-fix-LSMT_ROOT-definition.patch | 27 +++++++++++++++++++
 ...api-utils.h-fix-LSMT_ROOT-definition.patch |  1 +
 2 files changed, 28 insertions(+)
 create mode 100644 package/util-linux/0001-include-mount-api-utils.h-fix-LSMT_ROOT-definition.patch
 create mode 120000 package/util-linux/util-linux-libs/0001-include-mount-api-utils.h-fix-LSMT_ROOT-definition.patch

diff --git a/package/util-linux/0001-include-mount-api-utils.h-fix-LSMT_ROOT-definition.patch b/package/util-linux/0001-include-mount-api-utils.h-fix-LSMT_ROOT-definition.patch
new file mode 100644
index 0000000000..3d0de62bfd
--- /dev/null
+++ b/package/util-linux/0001-include-mount-api-utils.h-fix-LSMT_ROOT-definition.patch
@@ -0,0 +1,27 @@
+From 72ff3b8998a675900fcb7c18c0e03f1552b13a8b Mon Sep 17 00:00:00 2001
+From: Shubham Chakraborty <chakrabortyshubham66@gmail.com>
+Date: Tue, 14 Apr 2026 11:04:08 +0530
+Subject: [PATCH] include/mount-api-utils.h: fix LSMT_ROOT definition
+
+Upstream: Pending
+Signed-off-by: Shubham Chakraborty <chakrabortyshubham66@gmail.com>
+---
+ include/mount-api-utils.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/mount-api-utils.h b/include/mount-api-utils.h
+index a916f99..87e173e 100644
+--- a/include/mount-api-utils.h
++++ b/include/mount-api-utils.h
+@@ -339,7 +339,7 @@ struct ul_statmount {
+ /*
+  * Special @mnt_id values that can be passed to listmount
+  */
+-#ifdef LSMT_ROOT
++#ifndef LSMT_ROOT
+ # define LSMT_ROOT              0xffffffffffffffff    /* root mount */
+ #endif
+ 
+-- 
+2.53.0
+
diff --git a/package/util-linux/util-linux-libs/0001-include-mount-api-utils.h-fix-LSMT_ROOT-definition.patch b/package/util-linux/util-linux-libs/0001-include-mount-api-utils.h-fix-LSMT_ROOT-definition.patch
new file mode 120000
index 0000000000..88f6b841f7
--- /dev/null
+++ b/package/util-linux/util-linux-libs/0001-include-mount-api-utils.h-fix-LSMT_ROOT-definition.patch
@@ -0,0 +1 @@
+../0001-include-mount-api-utils.h-fix-LSMT_ROOT-definition.patch
\ No newline at end of file
-- 
2.53.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH v2 1/1] package/util-linux: fix LSMT_ROOT fallback definition
  2026-04-17  6:05 [Buildroot] [PATCH v2 1/1] package/util-linux: fix LSMT_ROOT fallback definition Shubham Chakraborty
@ 2026-05-30 10:02 ` Thomas Petazzoni via buildroot
  2026-06-05 12:49 ` Thomas Perale via buildroot
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2026-05-30 10:02 UTC (permalink / raw)
  To: Shubham Chakraborty; +Cc: buildroot, Giulio Benetti

Hello,

On Fri, Apr 17, 2026 at 11:35:53AM +0530, Shubham Chakraborty wrote:
> The fallback definition for LSMT_ROOT was incorrectly guarded
> with #ifdef instead of #ifndef, making it ineffective on systems
> with older kernel headers that don't define this constant.
> 
> This caused build failures with "LSMT_ROOT undeclared" errors on
> autobuilders using older kernel headers.

This explanation wasn't really complete: my builds with old kernel
headers were building fine. A critical piece of information is that
the issue only happened with musl, because it added the SYS_statmount
definition between musl 1.2.5 and 1.2.6, so since musl 1.2.6,
util-linux believes statmount() is available, uses it, but if you have
old kernel headers that don't provide LSMT_ROOT, the build fails.

> diff --git a/package/util-linux/0001-include-mount-api-utils.h-fix-LSMT_ROOT-definition.patch b/package/util-linux/0001-include-mount-api-utils.h-fix-LSMT_ROOT-definition.patch
> new file mode 100644
> index 0000000000..3d0de62bfd
> --- /dev/null
> +++ b/package/util-linux/0001-include-mount-api-utils.h-fix-LSMT_ROOT-definition.patch
> @@ -0,0 +1,27 @@
> +From 72ff3b8998a675900fcb7c18c0e03f1552b13a8b Mon Sep 17 00:00:00 2001
> +From: Shubham Chakraborty <chakrabortyshubham66@gmail.com>
> +Date: Tue, 14 Apr 2026 11:04:08 +0530
> +Subject: [PATCH] include/mount-api-utils.h: fix LSMT_ROOT definition
> +
> +Upstream: Pending

This is not useful in Buildroot. You have to provide an actual link
showing where it was submitted.

So I did submit the patch upstream:

  https://lore.kernel.org/util-linux/20260530094932.2351791-1-thomas.petazzoni@bootlin.com/T/#u

with an improved commit message, included this improved patch in
Buildroot, and applied.

Thanks!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH v2 1/1] package/util-linux: fix LSMT_ROOT fallback definition
  2026-04-17  6:05 [Buildroot] [PATCH v2 1/1] package/util-linux: fix LSMT_ROOT fallback definition Shubham Chakraborty
  2026-05-30 10:02 ` Thomas Petazzoni via buildroot
@ 2026-06-05 12:49 ` Thomas Perale via buildroot
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Perale via buildroot @ 2026-06-05 12:49 UTC (permalink / raw)
  To: Shubham Chakraborty; +Cc: Thomas Perale, buildroot

In reply of:
> The fallback definition for LSMT_ROOT was incorrectly guarded
> with #ifdef instead of #ifndef, making it ineffective on systems
> with older kernel headers that don't define this constant.
> 
> This caused build failures with "LSMT_ROOT undeclared" errors on
> autobuilders using older kernel headers.
> 
> Fixes:
>  - http://autobuild.buildroot.net/results/ac2/ac2bc633db0c605564c79bfdfa0e257a9b4f1b28/
> 
> Signed-off-by: Shubham Chakraborty <chakrabortyshubham66@gmail.com>
> 

Applied to 2026.02.x. Thanks

> ---
> Changes v1 -> v2:
>   - Add missing 'Upstream:' tag to patches (fixes check-package failure)
>   - Use symlink for util-linux-libs patch to avoid duplication
> ---
>  ...api-utils.h-fix-LSMT_ROOT-definition.patch | 27 +++++++++++++++++++
>  ...api-utils.h-fix-LSMT_ROOT-definition.patch |  1 +
>  2 files changed, 28 insertions(+)
>  create mode 100644 package/util-linux/0001-include-mount-api-utils.h-fix-LSMT_ROOT-definition.patch
>  create mode 120000 package/util-linux/util-linux-libs/0001-include-mount-api-utils.h-fix-LSMT_ROOT-definition.patch
> 
> diff --git a/package/util-linux/0001-include-mount-api-utils.h-fix-LSMT_ROOT-definition.patch b/package/util-linux/0001-include-mount-api-utils.h-fix-LSMT_ROOT-definition.patch
> new file mode 100644
> index 0000000000..3d0de62bfd
> --- /dev/null
> +++ b/package/util-linux/0001-include-mount-api-utils.h-fix-LSMT_ROOT-definition.patch
> @@ -0,0 +1,27 @@
> +From 72ff3b8998a675900fcb7c18c0e03f1552b13a8b Mon Sep 17 00:00:00 2001
> +From: Shubham Chakraborty <chakrabortyshubham66@gmail.com>
> +Date: Tue, 14 Apr 2026 11:04:08 +0530
> +Subject: [PATCH] include/mount-api-utils.h: fix LSMT_ROOT definition
> +
> +Upstream: Pending
> +Signed-off-by: Shubham Chakraborty <chakrabortyshubham66@gmail.com>
> +---
> + include/mount-api-utils.h | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/include/mount-api-utils.h b/include/mount-api-utils.h
> +index a916f99..87e173e 100644
> +--- a/include/mount-api-utils.h
> ++++ b/include/mount-api-utils.h
> +@@ -339,7 +339,7 @@ struct ul_statmount {
> + /*
> +  * Special @mnt_id values that can be passed to listmount
> +  */
> +-#ifdef LSMT_ROOT
> ++#ifndef LSMT_ROOT
> + # define LSMT_ROOT              0xffffffffffffffff    /* root mount */
> + #endif
> + 
> +-- 
> +2.53.0
> +
> diff --git a/package/util-linux/util-linux-libs/0001-include-mount-api-utils.h-fix-LSMT_ROOT-definition.patch b/package/util-linux/util-linux-libs/0001-include-mount-api-utils.h-fix-LSMT_ROOT-definition.patch
> new file mode 120000
> index 0000000000..88f6b841f7
> --- /dev/null
> +++ b/package/util-linux/util-linux-libs/0001-include-mount-api-utils.h-fix-LSMT_ROOT-definition.patch
> @@ -0,0 +1 @@
> +../0001-include-mount-api-utils.h-fix-LSMT_ROOT-definition.patch
> \ No newline at end of file
> -- 
> 2.53.0
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-06-05 12:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-17  6:05 [Buildroot] [PATCH v2 1/1] package/util-linux: fix LSMT_ROOT fallback definition Shubham Chakraborty
2026-05-30 10:02 ` Thomas Petazzoni via buildroot
2026-06-05 12:49 ` Thomas Perale via buildroot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.