Skip to contentSkip to conversation

package/util-linux: fix LSMT_ROOT fallback definition

PATCH Applied Shubham Chakraborty 2 participants 3 messages Apr 17 – Jun 5

v2 of 3 Applied Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 package/util-linux: fix LSMT_ROOT fallback definition

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/

---
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
package/util-linux/0001-include-mount-api-utils.h-fix-LSMT_ROOT-definition.patch new file +27 -0
new file mode 100644
index 0000000000..3d0de62bfd
@@ -0,0 +1,27 @@
+From 72ff3b8998a675900fcb7c18c0e03f1552b13a8b Mon Sep 17 00:00:00 2001
+From: Shubham Chakraborty <[email protected]>
+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 <[email protected]>
+---
+ 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
+
package/util-linux/util-linux-libs/0001-include-mount-api-utils.h-fix-LSMT_ROOT-definition.patch new file +1 -0
new file mode 120000
index 0000000000..88f6b841f7
@@ -0,0 +1 @@
+../0001-include-mount-api-utils.h-fix-LSMT_ROOT-definition.patch
\ No newline at end of file
Signature · 6 lines
2.53.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

Hello,

Quoted 6 lines · 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.

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.

package/util-linux/0001-include-mount-api-utils.h-fix-LSMT_ROOT-definition.patch line 6

Quoted 12 lines
package/util-linux/0001-include-mount-api-utils.h-fix-LSMT_ROOT-definition.patch new file +6 -0
new file mode 100644
index 0000000000..3d0de62bfd
@@ -0,0 +1,27 @@
+From 72ff3b8998a675900fcb7c18c0e03f1552b13a8b Mon Sep 17 00:00:00 2001
+From: Shubham Chakraborty <[email protected]>
+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/[email protected]/T/#u

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

Thanks!

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw
In reply to Shubham Chakraborty

In reply of:

Quoted 4 lines

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.

Quoted 8 lines

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

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

Applied to 2026.02.x. Thanks

Quoted 59 lines

---
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
package/util-linux/0001-include-mount-api-utils.h-fix-LSMT_ROOT-definition.patch new file +27 -0
new file mode 100644
index 0000000000..3d0de62bfd
@@ -0,0 +1,27 @@
+From 72ff3b8998a675900fcb7c18c0e03f1552b13a8b Mon Sep 17 00:00:00 2001
+From: Shubham Chakraborty <[email protected]>
+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 <[email protected]>
+---
+ 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
+
package/util-linux/util-linux-libs/0001-include-mount-api-utils.h-fix-LSMT_ROOT-definition.patch new file +1 -0
new file mode 120000
index 0000000000..88f6b841f7
@@ -0,0 +1 @@
+../0001-include-mount-api-utils.h-fix-LSMT_ROOT-definition.patch
\ No newline at end of file
Signature · 6 lines
2.53.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot