Skip to content

Commit a05141b

Browse files
committed
lvm2: Bump to 2.03.25 with C23 compatibility patch
Upgrade from 2.03.23 (Nov 2023) to 2.03.25 (Jul 2024). The newer version removes the libgen.h issue that required a GCC 15.1.0 workaround patch. However, GCC 15.1.0's C23 mode enforces const qualifiers on stdin/stdout/stderr, which breaks lvm2's reopen_standard_stream() calls. Port the working patch from lvm2-2.03.23 in osresearch/heads master branch (commit 63290d6) to 2.03.25. The patch wraps problematic memory allocation and log10() calls in #if 0 blocks to disable them at compile-time, maintaining compatibility with musl-libc and C23 standard enforcement. Changes: - Bump lvm2 from 2.03.23 to 2.03.25 - Update hash to 4bea6fd2e5af9cdb3e27b48b4efa8d89210d9bfa13df900e092e404720a59b1d - Replace -Os with -Oz for space optimization - Port lvm2-2.03.23.patch to lvm2-2.03.25.patch for C23 compatibility - Remove obsolete lvm2-gcc-15.1-libgen.patch Tested: EOL_x220-hotp-maximized board builds successfully with 182 KiB free CBFS Ref: GCC 15.1.0 upgrade (PR #1991) Signed-off-by: Thierry Laurion <insurgo@riseup.net>
1 parent b66ca63 commit a05141b

2 files changed

Lines changed: 9 additions & 16 deletions

File tree

modules/lvm2

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
modules-$(CONFIG_LVM2) += lvm2
22

3-
lvm2_version := 2.03.23
3+
# NOTE: lvm2 is one of the largest binaries (~2.1 MiB) but is essential for LUKS+LVM
4+
# layered encryption support. The lvm binary is a multi-call binary that includes all
5+
# LVM tools even though Heads only uses 'lvm vgchange'. Extracting just vgchange is
6+
# not feasible due to deep library dependencies. Further size reduction would require
7+
# removing LVM support entirely, which would break LUKS+LVM encrypted disk support.
8+
9+
lvm2_version := 2.03.25
410
lvm2_dir := lvm2.$(lvm2_version)
511
lvm2_tar := LVM2.$(lvm2_version).tgz
612
lvm2_url := https://mirrors.kernel.org/sourceware/lvm2/$(lvm2_tar)
7-
lvm2_hash := 74e794a9e9dee1bcf8a2065f65b9196c44fdf321e22d63b98ed7de8c9aa17a5d
8-
9-
#TODO: remove libgen.h patch when bumping lvm2 version (current 2.03.23 needs libgen.h include for basename function with GCC 15.1.0)
13+
lvm2_hash := 4bea6fd2e5af9cdb3e27b48b4efa8d89210d9bfa13df900e092e404720a59b1d
1014
# cross compiling test assumes malloc/realloc aren't glibc compat
1115
# so we force it via the configure cache.
1216
lvm2_configure := \
Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
static void _allocate_memory(void)
66
{
77
+#if 0
8-
#if defined(__GLIBC__) && !defined(VALGRIND_POOL)
8+
#if defined(__GLIBC__)
99
/* Memory allocation is currently only tested with glibc
1010
* for different C libraries, some other mechanisms might be needed
1111
@@ -233,11 +234,14 @@
@@ -147,15 +147,4 @@
147147
+INSTALL_PROGRAM = $(INSTALL) $(M_INSTALL_PROGRAM)
148148
INSTALL_DATA = $(INSTALL) -p $(M_INSTALL_DATA)
149149
INSTALL_WDATA = $(INSTALL) -p -m 644
150-
151-
--- ./lib/device/device_id.c.orig 2025-07-30 14:46:00.000000000 +0000
152-
+++ ./lib/device/device_id.c 2025-07-30 14:46:00.000000000 +0000
153-
@@ -33,6 +33,7 @@
154-
#include <sys/types.h>
155-
#include <sys/file.h>
156-
#include <sys/sysmacros.h>
157-
+#include <libgen.h>
158-
159-
#define DEVICES_FILE_MAJOR 1
160-
#define DEVICES_FILE_MINOR 1
161150

0 commit comments

Comments
 (0)