Skip to contentSkip to conversation

lvm2 seems to require systemd

Buildroot Andreas Ziegler 2 participants 10 messages Jul 21, 2024 – Jul 30, 2024 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Hi Frank,

Quoted 12 lines · Frank Wunderlich

Hi,

i try to build a buildroot (2024.05) initrd with lvm2 support

so basicly added these options:

#to select BR2_PACKAGE_HAS_UDEV
BR2_PACKAGE_EUDEV=y
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
BR2_PACKAGE_LIBBLOCKDEV=y
BR2_PACKAGE_LVM2=y

Quoted 6 lines

build is fine, but i see this while bootup:

[    3.665010] udevd[1520]: failed to execute '/usr/bin/systemd-run' '/usr/bin/systemd-run --no-block --property DefaultDependencies=

no --unit lvm-activate-vg-nvme /usr/sbin/lvm vgchange -aay --autoactivation event vg-nvme': No such file or directory done

lvm2 installs a bunch of udev rules; one of them relies on systemd-run to execute a command in the background:

# pvscan will check if this device completes a VG,
# i.e. all PVs in the VG are now present with the
# arrival of this PV.  If so, it prints to stdout:
# LVM_VG_NAME_COMPLETE='foo'
#
# When the VG is complete it can be activated, so
# vgchange -aay <vgname> is run.  It is run via
# systemd since it can take longer to run than
# udev wants to block when processing rules.
# (if there are hundreds of LVs to activate,
# the vgchange can take many seconds.)

...

IMPORT{program}="/usr/sbin/lvm pvscan --cache --listvg --checkcomplete --vgonline --autoactivation event --udevoutput --journal=output $env{DEVNAME}"
ENV{LVM_VG_NAME_COMPLETE}=="?*", RUN+="/usr/bin/systemd-run --no-block --property DefaultDependencies=no --unit lvm-activate-$env{LVM_VG_NAME_COMPLETE} /usr/sbin/lvm vgchange -aay --autoactivation event $env{LVM_VG_NAME_COMPLETE}" GOTO="lvm_end"

Quoted 12 lines

i see the physical volume, but logical volumes are disabled

# pvscan
  PV /dev/nvme0n1p5   VG vg-nvme   lvm2 [<1.79 TiB / <1.78 TiB free]
  Total: 1 [<1.79 TiB] / in use: 1 [<1.79 TiB] / in no VG: 0 [0   ]
# vgscan
  Found volume group "vg-nvme" using metadata type lvm2
# lvscan
  inactive          '/dev/vg-nvme/var' [10.00 GiB] inherit

and so i cannot mount the logical volume

Quoted 8 lines
# mount /dev/vg-nvme/var /mnt
[  281.006375] /dev/vg-nvme/var: Can't lookup blockdev
[  281.011279] /dev/vg-nvme/var: Can't lookup blockdev
[  281.016202] /dev/vg-nvme/var: Can't lookup blockdev
[  281.021080] /dev/vg-nvme/var: Can't lookup blockdev
mount: mounting /dev/vg-nvme/var on /mnt failed: No such file or directory

any ideas?

I would try to run vgchange manually to see if the setup works at all, then create a /usr/bin/systemd-run script that is able to execute commands in the background. Something like this (untested):

#!/bin/sh
prg=$1
shift
(

    $prg $@ < /dev/zero > /tmp/error.log 2>&1

)&

Kind regards,
Andreas

Quoted 986 lines

regards Frank

------------------------------

Message: 16
Date: Sat, 20 Jul 2024 14:40:08 +0200
From: Fabrice Fontaine <[email protected]>
To: [email protected]
Cc: Kelvin Cheung <[email protected]>, Fabrice Fontaine
<[email protected]>
Subject: [Buildroot] [PATCH 1/1] package/cpuload: fix build with gcc

	>= 14

Message-ID: <[email protected]>

Fix the following build failure with gcc >= 14:

read_cpu_stat.c: In function 'cpudata_new':
read_cpu_stat.c:49:17: error: implicit declaration of function 'error'; did you mean 'perror'? [-Wimplicit-function-declaration]

   49 |                 error("too many cpus");
      |                 ^~~~~
      |                 perror

Fixes:
-
http://autobuild.buildroot.org/results/3bca2659011d123d7b7a0ca19c4e868643d45766

---
 .../0001-Changed-error-calls-to-perror.patch  | 115 ++++++++++++++++++
 1 file changed, 115 insertions(+)
 create mode 100644 

package/cpuload/0001-Changed-error-calls-to-perror.patch

package/cpuload/0001-Changed-error-calls-to-perror.patch new file +86 -0
new file mode 100644
index 0000000000..6672bec677
@@ -0,0 +1,115 @@
+From ffd61eaa72acf123dea0c80ed3774656289ab49f Mon Sep 17 00:00:00 2001
+From: roiec <[email protected]>
+Date: Wed, 5 Jan 2022 17:12:05 +0200
+Subject: [PATCH] Changed 'error' calls to 'perror'
+
+Upstream: https://github.com/kelvincheung/cpuload/pull/1
+Signed-off-by: Fabrice Fontaine <[email protected]>
+---
+ .gitignore           | 60 
++++++++++++++++++++++++++++++++++++++++++++
+ src/graph_cpu_load.c |  4 +--
+ src/read_cpu_stat.c  |  2 +-
+ 3 files changed, 63 insertions(+), 3 deletions(-)
+ create mode 100644 .gitignore
+
+diff --git a/.gitignore b/.gitignore
+new file mode 100644
+index 0000000..c2ae907
+--- /dev/null
++++ b/.gitignore
+@@ -0,0 +1,60 @@
++# Prerequisites
++*.d
++
++# Object files
++*.o
++*.ko
++*.obj
++*.elf
++
++# Linker output
++*.ilk
++*.map
++*.exp
++
++# Precompiled Headers
++*.gch
++*.pch
++
++# Libraries
++*.lib
++*.a
++*.la
++*.lo
++
++# Shared objects (inc. Windows DLLs)
++*.dll
++*.so
++*.so.*
++*.dylib
++
++# Executables
++*.exe
++*.out
++*.app
++*.i*86
++*.x86_64
++*.hex
++
++# Debug files
++*.dSYM/
++*.su
++*.idb
++*.pdb
++
++# Kernel Module Compile Results
++*.mod*
++*.cmd
++.tmp_versions/
++modules.order
++Module.symvers
++Mkfile.old
++dkms.conf
++
++#images
++*.tgz
++*.img
++
++
++#build
++configure
+diff --git a/src/graph_cpu_load.c b/src/graph_cpu_load.c
+index e4b7785..525d9ed 100644
+--- a/src/graph_cpu_load.c
++++ b/src/graph_cpu_load.c
+@@ -132,7 +132,7 @@ void graph_new_line(char *str, unsigned long 

color)

package/cpuload/0001-Changed-error-calls-to-perror.patch new file +9 -0
+ 	graph_last_x = graph_last_y = -1;
+
+ 	if (graph_data_index >= MAX_GRAPH_DATA - 2)
+-		error("Too many graph data.");
++		perror("Too many graph data.");
+
+ 	graph_data[graph_data_index++] = DATUM_COLOR;
+ 	graph_data[graph_data_index++] = color;
+@@ -145,7 +145,7 @@ void graph_new_line(char *str, unsigned long 

color)
+ void graph_add_point(int size, int amount)
+ {

package/cpuload/0001-Changed-error-calls-to-perror.patch new file +19 -1
+ 	if (graph_data_index >= MAX_GRAPH_DATA - 4)
+-		error("Too many graph data.");
++		perror("Too many graph data.");
+
+ 	graph_data[graph_data_index++] = DATUM_SIZE;
+ 	graph_data[graph_data_index++] = size;
+diff --git a/src/read_cpu_stat.c b/src/read_cpu_stat.c
+index 3d014be..ff51d7f 100644
+--- a/src/read_cpu_stat.c
++++ b/src/read_cpu_stat.c
+@@ -46,7 +46,7 @@ ProcessList *cpudata_new(void)
+ 	fclose(file);
+
+ 	if (cpu > cpus -1) {
+-		error("too many cpus");
++		perror("too many cpus");
+ 		exit(1);
+ 	}
+
--

2.43.0

------------------------------

Message: 17
Date: Sat, 20 Jul 2024 16:26:29 +0200
From: Fabrice Fontaine <[email protected]>
To: [email protected]
Cc: Fabrice Fontaine <[email protected]>
Subject: [Buildroot] [PATCH 1/1] package/autossh: fix build with gcc

	>= 14

Message-ID: <[email protected]>

Include stdio.h to avoid that __progname check wrongly returned that the function is unavailable with gcc >= 14 which enables -Werror=implicit-function-declaration
(https://gcc.gnu.org/gcc-14/porting_to.html):

configure:5231: checking if libc defines __progname
configure:5249: /home/autobuild/autobuild/instance-7/output-1/host/bin/sh4-buildroot-linux-musl-gcc

package/cpuload/0001-Changed-error-calls-to-perror.patch new file +0 -3
-o conftest -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE 
-D_FILE_OFFSET_BITS=64  -Os -g0  -static -Wall -D_LARGEFILE_SOURCE 
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -static conftest.c  >&5

conftest.c: In function 'main':
conftest.c:73:27: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
73 | extern char *__progname; printf("%s", __progname);
| ^~~~~~
conftest.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'

    1 | /* confdefs.h */

conftest.c:73:27: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
73 | extern char *__progname; printf("%s", __progname);
| ^~~~~~
conftest.c:73:27: note: include '<stdio.h>' or provide a declaration of 'printf'

resulting in the following static build failure:

/home/autobuild/autobuild/instance-7/output-1/host/lib/gcc/sh4-buildroot-linux-musl/14.1.0/../../../../sh4-buildroot-linux-musl/bin/ld: /home/autobuild/autobuild/instance-7/output-1/host/sh4-buildroot-linux-musl/sysroot/lib/libc.a(libc.o):(.bss.__progname+0x0): multiple definition of `__progname'; autossh.o:(.bss+0x120): first defined here

Fixes:
-
http://autobuild.buildroot.org/results/5d80a8096d0f5529cbd86903a74f3bab3d230f4a

---
 ....ac-fix-__progname-check-with-gcc-14.patch | 52 +++++++++++++++++++
 package/autossh/autossh.mk                    |  1 +
 2 files changed, 53 insertions(+)
 create mode 100644 

package/autossh/0001-configure.ac-fix-__progname-check-with-gcc-14.patch

(quoted diff) +0 -0
new file mode 100644
index 0000000000..a517328110

b/package/autossh/0001-configure.ac-fix-__progname-check-with-gcc-14.patch

(quoted diff) +12 -0
@@ -0,0 +1,52 @@
+From 3a74eff481f37975e04f00db4923b1c16f93497d Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <[email protected]>
+Date: Sat, 20 Jul 2024 16:06:37 +0200
+Subject: [PATCH] configure.ac: fix __progname check with gcc >= 14
+
+Include stdio.h to avoid that __progname check wrongly returns that
+the function is unavailable with gcc >= 14 which enables
+-Werror=implicit-function-declaration
+(https://gcc.gnu.org/gcc-14/porting_to.html):
+
+configure:5231: checking if libc defines __progname
+configure:5249: 

/home/autobuild/autobuild/instance-7/output-1/host/bin/sh4-buildroot-linux-musl-gcc

(quoted diff) +2 -3
-o conftest -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE 
-D_FILE_OFFSET_BITS=64  -Os -g0  -static -Wall -D_LARGEFILE_SOURCE 
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -static conftest.c  >&5
+conftest.c: In function 'main':
+conftest.c:73:27: error: implicit declaration of function 'printf' 

[-Wimplicit-function-declaration]

(quoted diff) +3 -0
+   73 |  extern char *__progname; printf("%s", __progname);
+      |                           ^~~~~~
+conftest.c:1:1: note: include '<stdio.h>' or provide a declaration of 

'printf'

(quoted diff) +2 -0
+    1 | /* confdefs.h */
+conftest.c:73:27: warning: incompatible implicit declaration of 

built-in function 'printf' [-Wbuiltin-declaration-mismatch]

(quoted diff) +3 -0
+   73 |  extern char *__progname; printf("%s", __progname);
+      |                           ^~~~~~
+conftest.c:73:27: note: include '<stdio.h>' or provide a declaration 

of 'printf'

(quoted diff) +4 -0
+
+resulting in the following static build failure:
+
+/home/autobuild/autobuild/instance-7/output-1/host/lib/gcc/sh4-buildroot-linux-musl/14.1.0/../../../../sh4-buildroot-linux-musl/bin/ld: 

/home/autobuild/autobuild/instance-7/output-1/host/sh4-buildroot-linux-musl/sysroot/lib/libc.a(libc.o):(.bss.__progname+0x0): multiple definition of `__progname'; autossh.o:(.bss+0x120): first defined here

(quoted diff) +3 -0
+
+Fixes:
+ - 

http://autobuild.buildroot.org/results/5d80a8096d0f5529cbd86903a74f3bab3d230f4a

(quoted diff) +13 -0
+
+Signed-off-by: Fabrice Fontaine <[email protected]>
+Upstream: https://github.com/Autossh/autossh/pull/9
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 4bb9380..dadb523 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -132,7 +132,7 @@ AC_CHECK_LIB(socket, connect)
+ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 

OUT OF
+ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
+- AC_TRY_LINK([],
++ AC_TRY_LINK([ #include <stdio.h> ],

(quoted diff) +6 -0
+ 		[ extern char *__progname; printf("%s", __progname); ],
+ 		[ ac_cv_libc_defines___progname="yes" ],
+ 		[ ac_cv_libc_defines___progname="no" ]
+--
+2.43.0
+
package/autossh/autossh.mk +1 -1
index 899e5cdb52..fbb525bcca 100644
@@ -10,6 +10,7 @@ AUTOSSH_SOURCE = autossh-$(AUTOSSH_VERSION).tgz
 AUTOSSH_LICENSE = Modified BSD
 AUTOSSH_LICENSE_FILES = autossh.c
 # Fix AC_ARG_WITH code generation for --with-ssh
+# 0001-configure.ac-fix-__progname-check-with-gcc-14.patch
 AUTOSSH_AUTORECONF = YES
 
 AUTOSSH_CONF_OPTS = --with-ssh=/usr/bin/ssh
--

2.43.0

------------------------------

Message: 18
Date: Sat, 20 Jul 2024 16:48:31 +0200
From: Fabrice Fontaine <[email protected]>
To: [email protected]
Cc: Thomas Petazzoni <[email protected]>, Fabrice Fontaine
<[email protected]>
Subject: [Buildroot] [PATCH 1/1] package/flashrom: disable -Werror
Message-ID: <[email protected]>

Disable -Werror to avoid the following build failure raised since switch to meson-package in commit 37dded43ae681e8319d7b76f9a612c71991467a9:

../stlinkv3_spi.c: In function 'stlinkv3_spi_init':
../stlinkv3_spi.c:508:12: error: 'stlinkv3_handle' may be used uninitialized [-Werror=maybe-uninitialized]
508 | if (!stlinkv3_handle) {
| ^
../stlinkv3_spi.c:485:31: note: 'stlinkv3_handle' was declared here

  485 |         libusb_device_handle *stlinkv3_handle;
      |                               ^~~~~~~~~~~~~~~
Fixes 37dded43ae681e8319d7b76f9a612c71991467a9

-
http://autobuild.buildroot.org/results/eecabbdd0d21344991379a57e605845e73ef679e

---
 package/flashrom/flashrom.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
package/flashrom/flashrom.mk +2 -2
index 60774b9621..0b474caab4 100644
@@ -15,7 +15,8 @@ FLASHROM_CONF_OPTS = \
 	-Dclassic_cli_print_wiki=disabled \
 	-Dich_descriptors_tool=enabled \
 	-Dtests=disabled \
-	-Duse_internal_dmi=true
+	-Duse_internal_dmi=true \
+	-Dwerror=false
 
 FLASHROM_PROGRAMMERS = \
 	buspirate_spi \
--

2.43.0

------------------------------

Message: 19
Date: Sat, 20 Jul 2024 16:50:18 +0200
From: Fabrice Fontaine <[email protected]>
To: [email protected]
Cc: Thomas Petazzoni <[email protected]>, Fabrice Fontaine
<[email protected]>
Subject: [Buildroot] [PATCH 1/1] package/flashrom: fix satamv handling
Message-ID: <[email protected]>

satamv is only available on x86 resulting in the following build failure since switch to meson-package in commit 37dded43ae681e8319d7b76f9a612c71991467a9:

../output-1/build/flashrom-1.3.0/meson.build:475:6: ERROR: Problem encountered: satamv selected but not supported on this platform

Fixes 37dded43ae681e8319d7b76f9a612c71991467a9

-
http://autobuild.buildroot.org/results/c689bf039d7686a9b42c6fcb84f87b555a9bcfb6

---
 package/flashrom/flashrom.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
package/flashrom/flashrom.mk +2 -3
index 0b474caab4..478b53e1ac 100644
@@ -65,7 +65,6 @@ FLASHROM_PROGRAMMERS += \
 	nicintel_eeprom \
 	nicintel_spi \
 	ogp_spi \
-	satamv \
 	satasii
 
 ifeq ($(BR2_i386)$(BR2_x86_64),y)
@@ -74,7 +73,8 @@ FLASHROM_PROGRAMMERS += \
 	atapromise \
 	nic3com \
 	nicnatsemi \
-	nicrealtek
+	nicrealtek \
+	satamv
 endif
 endif
 
--

2.43.0

------------------------------

Message: 20
Date: Sat, 20 Jul 2024 17:31:13 +0200
From: Fabrice Fontaine <[email protected]>
To: [email protected]
Cc: Alexey Lukyanchuk <[email protected]>, Fabrice Fontaine
<[email protected]>
Subject: [Buildroot] [PATCH 1/1] package/zabbix: fix patch fuzz
Message-ID: <[email protected]>

Fix patch fuzz to avoid the following build failure raised since commit 8f88a644ed7d6c9ea55fd4fbe9d7f37055920016 which reduced the fuzz factor:

Applying 0002-fix-build-with-libressl-3.5.0.patch using patch:
patching file include/zbxcomms.h
Hunk #1 succeeded at 210 (offset -43 lines).
patching file src/libs/zbxcomms/tls.c
Hunk #1 FAILED at 30.
1 out of 1 hunk FAILED -- saving rejects to file src/libs/zbxcomms/tls.c.rej

While at it, also fix Upstream tags

Fixes 8f88a644ed7d6c9ea55fd4fbe9d7f37055920016

-
http://autobuild.buildroot.org/results/75dfe12312b5479669fcdfea623d93880c675e13

---
 .checkpackageignore                                       | 2 --
 .../0001-m4-netsnmp.m4-fix-shared-netsnmp-build.patch     | 2 +-
 package/zabbix/0002-fix-build-with-libressl-3.5.0.patch   | 8 ++++----
 3 files changed, 5 insertions(+), 7 deletions(-)
.checkpackageignore +0 -0
index f0fa13eb4f..6d51e80b99 100644
@@ -1478,8 +1478,6 @@ 

package/yajl/0003-Link-with-shared-libyajl-in-a-shared-build.patch lib_patch.Ups

package/yajl/0004-Link-libyajl-_s-with-libm-when-isnan-is-not-brought-.patch lib_patch.Upstream
package/ympd/0001-only-c-language.patch lib_patch.Upstream package/ympd/0002-added-forward-declarations.patch lib_patch.Upstream
-package/zabbix/0001-m4-netsnmp.m4-fix-shared-netsnmp-build.patch lib_patch.Upstream
-package/zabbix/0002-fix-build-with-libressl-3.5.0.patch
lib_patch.Upstream
package/zic/0001-remove-dependency-check-on-version-file.patch
lib_patch.Upstream

package/zip/0001-configure-Remove-Check-C-compiler-type-optimization-.patch lib_patch.Upstream
package/zip/0002-configure-Don-t-use-host-CPP.patch lib_patch.Upstream

package/zabbix/0001-m4-netsnmp.m4-fix-shared-netsnmp-build.patch +0 -0
index ffb1f54ba2..6c742b0d0a 100644
@@ -16,7 +16,7 @@ Fixes:
  - 

http://autobuild.buildroot.org/results/0f541e45d1fa27b3302968683bf64949131ec1c9

-[Upstream status: https://github.com/zabbix/zabbix/pull/61]

package/zabbix/0001-m4-netsnmp.m4-fix-shared-netsnmp-build.patch +1 -0
+Upstream: https://github.com/zabbix/zabbix/pull/61
 ---
  m4/netsnmp.m4 | 7 +++++--
  1 file changed, 5 insertions(+), 2 deletions(-)
package/zabbix/0002-fix-build-with-libressl-3.5.0.patch +0 -0
index acb5cfc9a6..ad6960f329 100644
@@ -30,7 +30,7 @@ Fixes:
  - 

http://autobuild.buildroot.org/results/acdfcb17b39d438ccf5e4621707a10f60577d233

-[Upstream status: not sent (no feedback on first patch)]

package/zabbix/0002-fix-build-with-libressl-3.5.0.patch +1 -0
+Upstream: not sent (no feedback on first patch)
 ---
  include/zbxcomms.h      | 3 ++-
  src/libs/zbxcomms/tls.c | 5 +++--
@@ -54,9 +54,9 @@ diff --git a/src/libs/zbxcomms/tls.c 

b/src/libs/zbxcomms/tls.c
index 54ab0a6ef4..bd4075b3e4 100644
--- a/src/libs/zbxcomms/tls.c
+++ b/src/libs/zbxcomms/tls.c
-@@ -30,8 +30,9 @@
- #include "zbxstr.h"
- #include "zbxtime.h"
+@@ -28,8 +28,9 @@
+ #include "log.h"
+ #include "zbxcrypto.h"

-#if defined(HAVE_OPENSSL) && OPENSSL_VERSION_NUMBER < 0x1010000fL ||
defined(LIBRESSL_VERSION_NUMBER)
-/* for OpenSSL 1.0.1/1.0.2 (before 1.1.0) or LibreSSL */
--
2.43.0

------------------------------

Message: 21
Date: Sat, 20 Jul 2024 19:38:34 +0200
From: Julien Olivain <[email protected]>
To: [email protected]
Cc: Julien Olivain <[email protected]>
Subject: [Buildroot] [PATCH 1/1] support/testing: add gpsd runtime
testing
Message-ID: <[email protected]>

---
 DEVELOPERS                                    |  2 +
 support/testing/tests/package/test_gpsd.py    | 56 +++++++++++++++++++
 .../rootfs-overlay/root/udp-nmea.log          |  6 ++
 3 files changed, 64 insertions(+)
 create mode 100644 support/testing/tests/package/test_gpsd.py
 create mode 100644 

support/testing/tests/package/test_gpsd/rootfs-overlay/root/udp-nmea.log

DEVELOPERS +2 -0
index c4f1565edd..5495f7a3f2 100644
@@ -1870,6 +1870,8 @@ F:	support/testing/tests/package/test_gnuplot.py
 F:	support/testing/tests/package/test_gnuplot/
 F:	support/testing/tests/package/test_gnuradio.py
 F:	support/testing/tests/package/test_gnuradio/
+F:	support/testing/tests/package/test_gpsd.py
+F:	support/testing/tests/package/test_gpsd/
 F:	support/testing/tests/package/test_gzip.py
 F:	support/testing/tests/package/test_highway.py
 F:	support/testing/tests/package/test_hwloc.py
support/testing/tests/package/test_gpsd.py new file +21 -0
new file mode 100644
index 0000000000..deed586c17
@@ -0,0 +1,56 @@
+import os
+import time
+
+import infra.basetest
+
+
+class TestGpsd(infra.basetest.BRTest):
+    rootfs_overlay = \
+        infra.filepath("tests/package/test_gpsd/rootfs-overlay")
+    # This test is using the gpsfake Python script.
+    config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
+        f"""
+        BR2_PACKAGE_GPSD=y
+        BR2_PACKAGE_PYTHON3=y
+        BR2_ROOTFS_OVERLAY="{rootfs_overlay}"
+        BR2_TARGET_ROOTFS_CPIO=y
+        # BR2_TARGET_ROOTFS_TAR is not set
+        """
+
+    def test_run(self):
+        cpio_file = os.path.join(self.builddir, "images", 

"rootfs.cpio")

support/testing/tests/package/test_gpsd.py new file +35 -0
+        self.emulator.boot(arch="armv5",
+                           kernel="builtin",
+                           options=["-initrd", cpio_file])
+        self.emulator.login()
+
+        # We check the program can execute.
+        self.assertRunOk("gpsd --version")
+
+        # Since gpsd needs a real GPS device, we stop the service.
+        self.assertRunOk("/etc/init.d/S50gpsd stop")
+
+        # We start the "gpsfake" GPS emulator instead.
+        cmd = "gpsfake"
+        cmd += " --slow --cycle 0.1 --quiet"
+        cmd += "/root/udp-nmea.log &> /dev/null &"
+        self.assertRunOk(cmd)
+
+        # Wait a bit, to let the gpsfake and gpsd to settle...
+        time.sleep(3 * self.timeout_multiplier)
+
+        # List the GPS devices. We should see our local UDP test GPS.
+        out, ret = self.emulator.run("gpsctl")
+        self.assertEqual(ret, 0)
+        self.assertTrue(out[0].startswith("udp://127.0.0.1"))
+        self.assertIn("NMEA0183", out[0])
+
+        # Collect some of our fake GPS data, and check we got the
+        # coordinates from our test data file.
+        # Our expected coordinates are:
+        # https://www.openstreetmap.org/#map=19/43.60439/1.44336
+        out, ret = self.emulator.run("gpscsv --header 0 --count 3")
+        self.assertEqual(ret, 0)
+        _, gps_lat, gps_long, _ = out[0].split(",")
+        self.assertAlmostEqual(float(gps_lat), 43.60439)
+        self.assertAlmostEqual(float(gps_long), 1.44336)
(quoted diff) +0 -0
new file mode 100644
index 0000000000..f3730da7c5

b/support/testing/tests/package/test_gpsd/rootfs-overlay/root/udp-nmea.log

(quoted diff) +6 -1
@@ -0,0 +1,6 @@
+# Name: NMEA 0183 messages for gpsd Buildroot test
+# Transport: UDP
+# For packet format, see:
+# https://gpsd.gitlab.io/gpsd/NMEA.html
+$GPGGA,123456.789,4336.2634,N,0126.6016,E,1,04,1.7,143.5,M,,,,*3A
+$GPZDA,123456.789,20,07,2024,2,00*64
--

2.45.2

------------------------------

Message: 22
Date: Sat, 20 Jul 2024 21:01:40 +0200
From: Fabrice Fontaine <[email protected]>
To: [email protected]
Cc: Joris Lijssens <[email protected]>, Fabrice Fontaine
<[email protected]>
Subject: [Buildroot] [PATCH 1/1] package/libcoap: enable required
libopenssl options
Message-ID: <[email protected]>

libcoap unconditionally calls the (deprecated) ENGINE_* logic in libopenssl resulting in a build failure when !BR2_PACKAGE_LIBOPENSSL_ENGINES since commit 623d3bbe43e9193aa8e3395367d01af59071b859

libcoap also unconditionally uses PSK

Fixes 623d3bbe43e9193aa8e3395367d01af59071b859

-
http://autobuild.buildroot.org/results/6bd3e1390cbbc59b9b3d030c2a401e45e9d173da
-
http://autobuild.buildroot.org/results/f243209454feed4f33f759786c2023c576a2cd3d

---
 package/libcoap/Config.in | 2 ++
 1 file changed, 2 insertions(+)
package/libcoap/Config.in +2 -1
index 6e0c1905bc..950aee5279 100644
@@ -1,5 +1,7 @@
 config BR2_PACKAGE_LIBCOAP
 	bool "libcoap"
+	select BR2_PACKAGE_LIBOPENSSL_ENABLE_PSK if BR2_PACKAGE_LIBOPENSSL
+	select BR2_PACKAGE_LIBOPENSSL_ENGINES if BR2_PACKAGE_LIBOPENSSL
 	help
 	  libcoap is a C implementation of a lightweight
 	  application-protocol for devices that are constrained their
--

2.43.0

------------------------------

Message: 23
Date: Sat, 20 Jul 2024 21:31:42 +0200
From: Fabrice Fontaine <[email protected]>
To: [email protected]
Cc: Fabrice Fontaine <[email protected]>
Subject: [Buildroot] [PATCH 1/1] package/openswan: select libxcrypt if
needed
Message-ID: <[email protected]>

Fix the following build failure raised since bump of glibc to version 2.39 in commit b5680f53d60acf8ff6010082f873438a39bd5d97:

/home/autobuild/autobuild/instance-7/output-1/build/openswan-3.0.0/programs/pluto/xauth.c:36:10: fatal error: crypt.h: No such file or directory
36 | #include <crypt.h>

      |          ^~~~~~~~~
Fixes b5680f53d60acf8ff6010082f873438a39bd5d97

-
http://autobuild.buildroot.org/results/df7cce809e3e4aa92e700a3fc5105c6c20f21f6b

---
 package/openswan/Config.in   | 1 +
 package/openswan/openswan.mk | 4 ++++
 2 files changed, 5 insertions(+)
package/openswan/Config.in +1 -0
index 724654e984..31c4a66b35 100644
@@ -4,6 +4,7 @@ config BR2_PACKAGE_OPENSWAN
 	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_4 # iproute2
 	select BR2_PACKAGE_GMP
 	select BR2_PACKAGE_IPROUTE2
+	select BR2_PACKAGE_LIBXCRYPT if BR2_TOOLCHAIN_USES_GLIBC
 	help
 	  Openswan is an implementation of IPsec for Linux
 
package/openswan/openswan.mk +4 -1
index 4c6a779f0d..64218810f8 100644
@@ -22,6 +22,10 @@ OPENSWAN_DEPENDENCIES += libcurl
 OPENSWAN_MAKE_OPTS += USE_LIBCURL=true
 endif
 
+ifeq ($(BR2_PACKAGE_LIBXCRYPT),y)
+OPENSWAN_DEPENDENCIES += libxcrypt
+endif
+
 ifeq ($(BR2_PACKAGE_OPENSSL),y)
 OPENSWAN_DEPENDENCIES += openssl
 OPENSWAN_MAKE_OPTS += HAVE_OPENSSL=true
--

2.43.0

------------------------------

Message: 24
Date: Sat, 20 Jul 2024 21:39:13 +0200
From: Andreas Hilse <[email protected]>
To: Arnout Vandecappelle <[email protected]>
Cc: Peter Korsgaard <[email protected]>, Joachim Wiberg
<[email protected]>, Christian Stewart <[email protected]>, Buildroot Mailing List <[email protected]>
Subject: Re: [Buildroot] package/openssh: please backport bump to

	9.8p1

Message-ID:
<CANabuZfTRZwbAyVZ5Ha27Ch5r+nTb6YjFgM2Pu1vC16wi1v4TA@mail.gmail.com>
Content-Type: text/plain; charset="UTF-8"

Hi,

Quoted 3 lines · On Fri, Jul 19, 2024 at 5:32?PM Arnout Vandecappelle <[email protected]> wrote:

I would say, in that case, fix your vulnerability scanner. We have
dozens of
packages where CVEs are patched. See the IGNORE_CVES variables in various packages.

I know about that, but the problem lies not with our vulnerability scanner, that alone we can handle.
The problem is that our customers conduct their own scans or hire a 3rd party to do blackbox tests. When they see openssh 9.7 they will complain.

Regards,
Andreas

------------------------------

Message: 25
Date: Sat, 20 Jul 2024 21:49:42 +0200
From: Frank Wunderlich <[email protected]>
To: Frank Wunderlich <[email protected]>
Cc: [email protected]
Subject: Re: [Buildroot] lvm2 seems to require systemd Message-ID:

	<trinity-6ec563fa-da3b-425d-9184-a34393e6d9b5-1721504982908@3c-app-gmx-bs02>

Content-Type: text/plain; charset=UTF-8

Hi

in the meantime i tried to add systemd (which i want to avoid due to size and complexity)

BR2_PACKAGE_SYSTEMD=y
BR2_INIT_SYSTEMD=y

but hang on this:

Found CMake: /media/data_ext/git/buildroot/output/per-package/systemd/host/bin/cmake (3.28.3) Run-time dependency libbpf found: NO (tried pkgconfig and cmake)
Run-time dependency mount found: NO (tried pkgconfig and cmake)

output/build/systemd-254.13/meson.build:1188:11: ERROR: Dependency "mount" not found, tried pkgconfig and cmake

tried installing libmount-dev pkgconf-bin libbpf-dev on my building-machine without success

also tried without BR2_INIT_SYSTEMD, which compiles good, but the error below is on running bootup (before login) so i guess i need systemd as init, but maybe i'm wrong

regards Frank

Quoted 43 lines

Gesendet: Samstag, 20. Juli 2024 um 14:34 Uhr
Von: "Frank Wunderlich" <[email protected]>
An: [email protected]
Betreff: lvm2 seems to require systemd

Hi,

i try to build a buildroot (2024.05) initrd with lvm2 support

so basicly added these options:

#to select BR2_PACKAGE_HAS_UDEV BR2_PACKAGE_EUDEV=y BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y BR2_PACKAGE_LIBBLOCKDEV=y
BR2_PACKAGE_LVM2=y

build is fine, but i see this while bootup:

[    3.665010] udevd[1520]: failed to execute '/usr/bin/systemd-run' '/usr/bin/systemd-run --no-block --property DefaultDependencies=

no --unit lvm-activate-vg-nvme /usr/sbin/lvm vgchange -aay --autoactivation event vg-nvme': No such file or directory done

i see the physical volume, but logical volumes are disabled

# pvscan
  PV /dev/nvme0n1p5   VG vg-nvme   lvm2 [<1.79 TiB / <1.78 TiB free]
  Total: 1 [<1.79 TiB] / in use: 1 [<1.79 TiB] / in no VG: 0 [0   ]
# vgscan
  Found volume group "vg-nvme" using metadata type lvm2
# lvscan
  inactive          '/dev/vg-nvme/var' [10.00 GiB] inherit

and so i cannot mount the logical volume

# mount /dev/vg-nvme/var /mnt
[  281.006375] /dev/vg-nvme/var: Can't lookup blockdev
[  281.011279] /dev/vg-nvme/var: Can't lookup blockdev
[  281.016202] /dev/vg-nvme/var: Can't lookup blockdev
[  281.021080] /dev/vg-nvme/var: Can't lookup blockdev
mount: mounting /dev/vg-nvme/var on /mnt failed: No such file or directory
Quoted 5 lines

any ideas?

regards Frank

------------------------------

Message: 26
Date: Sat, 20 Jul 2024 21:55:05 +0200
From: Fabrice Fontaine <[email protected]>
To: [email protected]
Cc: Phil Eichinger <[email protected]>, Fabrice Fontaine
<[email protected]>
Subject: [Buildroot] [PATCH 1/1] package/zsh: fix build with gcc >= 14
Message-ID: <[email protected]>

Fix the following build failure with gcc >= 14:

termcap.c:45:14: error: conflicting types for 'boolcodes'; have 'char *[]'

   45 | static char *boolcodes[] = {
      |              ^~~~~~~~~
In file included from ../../Src/zshterm.h:1,
                 from ../../Src/zsh_system.h:932,
                 from ../../Src/zsh.mdh:17,
                 from termcap.mdh:17,
                 from termcap.c:38:
/home/autobuild/autobuild/instance-0/output-1/host/or1k-buildroot-linux-uclibc/sysroot/usr/include/term.h:764:56: note: previous declaration of 'boolcodes' with type 'const char * const[]'
  764 | extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) 
boolcodes[];
      |                                                        

^~~~~~~~~

Fixes:
-
http://autobuild.buildroot.org/results/fe2f7170465e96cc1de3dae139a25f615331f4b9

---
 ...er-types-in-terminfo-global-variable.patch | 51 +++++++++++++++++++
 package/zsh/zsh.mk                            |  2 +
 2 files changed, 53 insertions(+)
 create mode 100644 

package/zsh/0001-52383-Avoid-incompatible-pointer-types-in-terminfo-global-variable.patch

(quoted diff) +0 -0
new file mode 100644
index 0000000000..c67c374918

b/package/zsh/0001-52383-Avoid-incompatible-pointer-types-in-terminfo-global-variable.patch

(quoted diff) +4 -0
@@ -0,0 +1,51 @@
+From 4c89849c98172c951a9def3690e8647dae76308f Mon Sep 17 00:00:00 2001
+From: Florian Weimer <[email protected]>
+Date: Fri, 8 Dec 2023 21:58:07 +0100
+Subject: [PATCH] 52383: Avoid incompatible pointer types in terminfo 

global
+ variable checks

(quoted diff) +2 -0
+
+Upstream: 

https://sourceforge.net/p/zsh/code/ci/4c89849c98172c951a9def3690e8647dae76308f

(quoted diff) +11 -0
+Signed-off-by: Fabrice Fontaine <[email protected]>
+---
+ ChangeLog    |  3 +++
+ configure.ac | 12 ++++++------
+ 2 files changed, 9 insertions(+), 6 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 2a8221e1f..2871dcb7c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1768,27 +1768,27 @@ if test x$zsh_cv_path_term_header != xnone; 

then

(quoted diff) +4 -0
+   fi
+
+   AC_MSG_CHECKING(if boolcodes is available)
+-  AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = 

boolcodes; puts(*test);]])],[AC_DEFINE(HAVE_BOOLCODES) boolcodes=yes],[boolcodes=no]) ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test =
(char **)boolcodes; puts(*test);]])],[AC_DEFINE(HAVE_BOOLCODES) boolcodes=yes],[boolcodes=no])

(quoted diff) +4 -0
+   AC_MSG_RESULT($boolcodes)
+
+   AC_MSG_CHECKING(if numcodes is available)
+-  AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = 

numcodes; puts(*test);]])],[AC_DEFINE(HAVE_NUMCODES) numcodes=yes],[numcodes=no]) ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = (char **)numcodes; puts(*test);]])],[AC_DEFINE(HAVE_NUMCODES) numcodes=yes],[numcodes=no])

(quoted diff) +4 -0
+   AC_MSG_RESULT($numcodes)
+
+   AC_MSG_CHECKING(if strcodes is available)
+-  AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = 

strcodes; puts(*test);]])],[AC_DEFINE(HAVE_STRCODES) strcodes=yes],[strcodes=no]) ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = (char **)strcodes; puts(*test);]])],[AC_DEFINE(HAVE_STRCODES) strcodes=yes],[strcodes=no])

(quoted diff) +4 -0
+   AC_MSG_RESULT($strcodes)
+
+   AC_MSG_CHECKING(if boolnames is available)
+-  AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = 

boolnames; puts(*test);]])],[AC_DEFINE(HAVE_BOOLNAMES) boolnames=yes],[boolnames=no]) ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test =
(char **)boolnames; puts(*test);]])],[AC_DEFINE(HAVE_BOOLNAMES) boolnames=yes],[boolnames=no])

(quoted diff) +4 -0
+   AC_MSG_RESULT($boolnames)
+
+   AC_MSG_CHECKING(if numnames is available)
+-  AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = 

numnames; puts(*test);]])],[AC_DEFINE(HAVE_NUMNAMES) numnames=yes],[numnames=no]) ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = (char **)numnames; puts(*test);]])],[AC_DEFINE(HAVE_NUMNAMES) numnames=yes],[numnames=no])

(quoted diff) +4 -0
+   AC_MSG_RESULT($numnames)
+
+   AC_MSG_CHECKING(if strnames is available)
+-  AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = 

strnames; puts(*test);]])],[AC_DEFINE(HAVE_STRNAMES) strnames=yes],[strnames=no]) ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = (char **)strnames; puts(*test);]])],[AC_DEFINE(HAVE_STRNAMES) strnames=yes],[strnames=no])

(quoted diff) +3 -0
+   AC_MSG_RESULT($strnames)
+
+   dnl There are apparently defective terminal library headers on some
package/zsh/zsh.mk +0 -0
index e790bf4c5e..7e577fa9e1 100644
@@ -13,6 +13,8 @@ ZSH_CONF_ENV = zsh_cv_sys_nis=no 

zsh_cv_sys_nis_plus=no
ZSH_LICENSE = MIT-like
ZSH_LICENSE_FILES = LICENCE
ZSH_CPE_ID_VENDOR = zsh
+# 0001-52383-Avoid-incompatible-pointer-types-in-terminfo-global-variable.patch +ZSH_AUTORECONF = YES

 # zsh uses TRY_RUN to determine these
 ZSH_CONF_OPTS += \
--
2.43.0

------------------------------

Subject: Digest Footer

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

Quoted 4 lines

------------------------------

End of buildroot Digest, Vol 217, Issue 67
******************************************

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

#2 lore raw

regards Frank

Quoted 75 lines

Gesendet: Sonntag, 21. Juli 2024 um 11:17 Uhr
Von: "Andreas Ziegler" <[email protected]>
An: [email protected]
Cc: "buildroot" <[email protected]>
Betreff: Re: lvm2 seems to require systemd

Hi Frank,

Quoted 12 lines · Frank Wunderlich

Hi,

i try to build a buildroot (2024.05) initrd with lvm2 support

so basicly added these options:

#to select BR2_PACKAGE_HAS_UDEV
BR2_PACKAGE_EUDEV=y
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
BR2_PACKAGE_LIBBLOCKDEV=y
BR2_PACKAGE_LVM2=y

Quoted 7 lines

build is fine, but i see this while bootup:

[    3.665010] udevd[1520]: failed to execute '/usr/bin/systemd-run'

'/usr/bin/systemd-run --no-block --property DefaultDependencies= no --unit lvm-activate-vg-nvme /usr/sbin/lvm vgchange -aay --autoactivation event vg-nvme': No such file or directory done

lvm2 installs a bunch of udev rules; one of them relies on systemd-run to execute a command in the background:

# pvscan will check if this device completes a VG,
# i.e. all PVs in the VG are now present with the
# arrival of this PV.  If so, it prints to stdout:
# LVM_VG_NAME_COMPLETE='foo'
#
# When the VG is complete it can be activated, so
# vgchange -aay <vgname> is run.  It is run via
# systemd since it can take longer to run than
# udev wants to block when processing rules.
# (if there are hundreds of LVs to activate,
# the vgchange can take many seconds.)

...

IMPORT{program}="/usr/sbin/lvm pvscan --cache --listvg --checkcomplete --vgonline --autoactivation event --udevoutput --journal=output $env{DEVNAME}"
ENV{LVM_VG_NAME_COMPLETE}=="?*", RUN+="/usr/bin/systemd-run --no-block --property DefaultDependencies=no --unit lvm-activate-$env{LVM_VG_NAME_COMPLETE} /usr/sbin/lvm vgchange -aay --autoactivation event $env{LVM_VG_NAME_COMPLETE}" GOTO="lvm_end"

Quoted 20 lines

i see the physical volume, but logical volumes are disabled

# pvscan
  PV /dev/nvme0n1p5   VG vg-nvme   lvm2 [<1.79 TiB / <1.78 TiB free]
  Total: 1 [<1.79 TiB] / in use: 1 [<1.79 TiB] / in no VG: 0 [0   ]
# vgscan
  Found volume group "vg-nvme" using metadata type lvm2
# lvscan
  inactive          '/dev/vg-nvme/var' [10.00 GiB] inherit

and so i cannot mount the logical volume

# mount /dev/vg-nvme/var /mnt
[  281.006375] /dev/vg-nvme/var: Can't lookup blockdev
[  281.011279] /dev/vg-nvme/var: Can't lookup blockdev
[  281.016202] /dev/vg-nvme/var: Can't lookup blockdev
[  281.021080] /dev/vg-nvme/var: Can't lookup blockdev
mount: mounting /dev/vg-nvme/var on /mnt failed: No such file or
directory
Quoted 5 lines
Quoted 1 line

any ideas?

I would try to run vgchange manually to see if the setup works at all, then create a /usr/bin/systemd-run script that is able to execute commands in the background. Something like this (untested):

i was able to manually initialize the lvm value after adding the systemd without init (running the command without prefix "systemd-run")...

basicly with this command:

/usr/sbin/lvm vgchange -aay --autoactivation event vg-nvme

with init i had compile issues missing libmount, see my followup post

now i have to remove systems from my initrd somehow to do further testing with only the eudev. any idea doing this without making all clear (or is this dropped when recreating the cpio file)?

Quoted 11 lines
   #!/bin/sh
   prg=$1
   shift
   (
     $prg $@ < /dev/zero > /tmp/error.log 2>&1
   )&

Kind regards,
Andreas

Quoted 1 line

regards Frank

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

#3 lore raw

Hi Frank,

Quoted 86 lines · Frank Wunderlich

regards Frank

Quoted 75 lines

Gesendet: Sonntag, 21. Juli 2024 um 11:17 Uhr
Von: "Andreas Ziegler" <[email protected]>
An: [email protected]
Cc: "buildroot" <[email protected]>
Betreff: Re: lvm2 seems to require systemd

Hi Frank,

Quoted 12 lines · Frank Wunderlich

Hi,

i try to build a buildroot (2024.05) initrd with lvm2 support

so basicly added these options:

#to select BR2_PACKAGE_HAS_UDEV
BR2_PACKAGE_EUDEV=y
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
BR2_PACKAGE_LIBBLOCKDEV=y
BR2_PACKAGE_LVM2=y

Quoted 7 lines

build is fine, but i see this while bootup:

[    3.665010] udevd[1520]: failed to execute '/usr/bin/systemd-run'

'/usr/bin/systemd-run --no-block --property DefaultDependencies= no --unit lvm-activate-vg-nvme /usr/sbin/lvm vgchange -aay --autoactivation event vg-nvme': No such file or directory done

lvm2 installs a bunch of udev rules; one of them relies on systemd-run to execute a command in the background:

# pvscan will check if this device completes a VG,
# i.e. all PVs in the VG are now present with the
# arrival of this PV.  If so, it prints to stdout:
# LVM_VG_NAME_COMPLETE='foo'
#
# When the VG is complete it can be activated, so
# vgchange -aay <vgname> is run.  It is run via
# systemd since it can take longer to run than
# udev wants to block when processing rules.
# (if there are hundreds of LVs to activate,
# the vgchange can take many seconds.)

...

IMPORT{program}="/usr/sbin/lvm pvscan --cache --listvg --checkcomplete --vgonline --autoactivation event --udevoutput --journal=output $env{DEVNAME}"
ENV{LVM_VG_NAME_COMPLETE}=="?*", RUN+="/usr/bin/systemd-run --no-block --property DefaultDependencies=no --unit lvm-activate-$env{LVM_VG_NAME_COMPLETE} /usr/sbin/lvm vgchange -aay --autoactivation event $env{LVM_VG_NAME_COMPLETE}" GOTO="lvm_end"

Quoted 20 lines

i see the physical volume, but logical volumes are disabled

# pvscan
  PV /dev/nvme0n1p5   VG vg-nvme   lvm2 [<1.79 TiB / <1.78 TiB free]
  Total: 1 [<1.79 TiB] / in use: 1 [<1.79 TiB] / in no VG: 0 [0   ]
# vgscan
  Found volume group "vg-nvme" using metadata type lvm2
# lvscan
  inactive          '/dev/vg-nvme/var' [10.00 GiB] inherit

and so i cannot mount the logical volume

# mount /dev/vg-nvme/var /mnt
[  281.006375] /dev/vg-nvme/var: Can't lookup blockdev
[  281.011279] /dev/vg-nvme/var: Can't lookup blockdev
[  281.016202] /dev/vg-nvme/var: Can't lookup blockdev
[  281.021080] /dev/vg-nvme/var: Can't lookup blockdev
mount: mounting /dev/vg-nvme/var on /mnt failed: No such file or
directory
Quoted 5 lines
Quoted 1 line

any ideas?

I would try to run vgchange manually to see if the setup works at all, then create a /usr/bin/systemd-run script that is able to execute commands in the background. Something like this (untested):

i was able to manually initialize the lvm value after adding the systemd without init (running the command without prefix "systemd-run")...

Quoted 7 lines

basicly with this command:

/usr/sbin/lvm vgchange -aay --autoactivation event vg-nvme

with init i had compile issues missing libmount, see my followup post

now i have to remove systems from my initrd somehow to do further testing with only the eudev. any idea doing this without making all clear (or is this dropped when recreating the cpio file)?

Without running make clean, unwanted files need to be removed manually. Buildroot creates per-package logs .files-list, .files-list-{host,images,staging}, which contain the names of files copied to the respective destination. Remove at least those from .files-list to revert to a system without the package; preferrably also those from .files-list-staging.

Kind regards,
Andreas

Quoted 8 lines
Quoted 7 lines
   #!/bin/sh
   prg=$1
   shift
   (
     $prg $@ < /dev/zero > /tmp/error.log 2>&1
   )&
Quoted 4 lines
Quoted 4 lines

Kind regards,
Andreas

Quoted 1 line

regards Frank

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

#4 lore raw

Hi Andreas

noticed some errors when calling the vgchange command

# /usr/sbin/lvm vgchange -aay --autoactivation event vg-nvme
  1 logical volume(s) in volume group "vg-nvme" now active
[ 8023.796866] udevd[1614]: failed to execute '/usr/sbin/blkid' '/usr/sbin/blkid -o udev -p /dev/dm-0': No such file or directory
[ 8023.808977] udevd[1610]: conflicting device node '/dev/mapper/vg--nvme-var' found, link to '/dev/dm-0' will not be created
# lvscan
  ACTIVE            '/dev/vg-nvme/var' [10.00 GiB] inherit

but i'm able to mount it

# mkdir /mnt/var
# mount /dev/mapper/vg--nvme-var /mnt/var/
[ 8514.687803] EXT4-fs (dm-0): mounted filesystem be8b31d6-96e2-43a1-8416-a058972118b3 r/w with ordered data mode. Quota mode: disabled.
# ls /mnt/var
cache       lib         log         lost+found  run         tmp
#

how can i test the script? currently i'm in the initrd, so changing anything will be lost on reboot, so i want to test the script before putting it into the initrd. as far as i see the original call via udev contains some systemd-specific params and environment-vars i do not know currently

regards Frank

Quoted 114 lines

Gesendet: Sonntag, 21. Juli 2024 um 12:16 Uhr
Von: "Andreas Ziegler" <[email protected]>
An: "Frank Wunderlich" <[email protected]>
Cc: "buildroot" <[email protected]>
Betreff: Re: Aw: Re: lvm2 seems to require systemd

Hi Frank,

Quoted 90 lines · Frank Wunderlich

regards Frank

Quoted 75 lines

Gesendet: Sonntag, 21. Juli 2024 um 11:17 Uhr
Von: "Andreas Ziegler" <[email protected]>
An: [email protected]
Cc: "buildroot" <[email protected]>
Betreff: Re: lvm2 seems to require systemd

Hi Frank,

Quoted 12 lines · Frank Wunderlich

Hi,

i try to build a buildroot (2024.05) initrd with lvm2 support

so basicly added these options:

#to select BR2_PACKAGE_HAS_UDEV
BR2_PACKAGE_EUDEV=y
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
BR2_PACKAGE_LIBBLOCKDEV=y
BR2_PACKAGE_LVM2=y

Quoted 7 lines

build is fine, but i see this while bootup:

[    3.665010] udevd[1520]: failed to execute '/usr/bin/systemd-run'

'/usr/bin/systemd-run --no-block --property DefaultDependencies= no --unit lvm-activate-vg-nvme /usr/sbin/lvm vgchange -aay --autoactivation event vg-nvme': No such file or directory done

lvm2 installs a bunch of udev rules; one of them relies on systemd-run to execute a command in the background:

# pvscan will check if this device completes a VG,
# i.e. all PVs in the VG are now present with the
# arrival of this PV.  If so, it prints to stdout:
# LVM_VG_NAME_COMPLETE='foo'
#
# When the VG is complete it can be activated, so
# vgchange -aay <vgname> is run.  It is run via
# systemd since it can take longer to run than
# udev wants to block when processing rules.
# (if there are hundreds of LVs to activate,
# the vgchange can take many seconds.)

...

IMPORT{program}="/usr/sbin/lvm pvscan --cache --listvg --checkcomplete --vgonline --autoactivation event --udevoutput --journal=output $env{DEVNAME}"
ENV{LVM_VG_NAME_COMPLETE}=="?*", RUN+="/usr/bin/systemd-run --no-block --property DefaultDependencies=no --unit lvm-activate-$env{LVM_VG_NAME_COMPLETE} /usr/sbin/lvm vgchange -aay --autoactivation event $env{LVM_VG_NAME_COMPLETE}" GOTO="lvm_end"

Quoted 20 lines

i see the physical volume, but logical volumes are disabled

# pvscan
  PV /dev/nvme0n1p5   VG vg-nvme   lvm2 [<1.79 TiB / <1.78 TiB free]
  Total: 1 [<1.79 TiB] / in use: 1 [<1.79 TiB] / in no VG: 0 [0   ]
# vgscan
  Found volume group "vg-nvme" using metadata type lvm2
# lvscan
  inactive          '/dev/vg-nvme/var' [10.00 GiB] inherit

and so i cannot mount the logical volume

# mount /dev/vg-nvme/var /mnt
[  281.006375] /dev/vg-nvme/var: Can't lookup blockdev
[  281.011279] /dev/vg-nvme/var: Can't lookup blockdev
[  281.016202] /dev/vg-nvme/var: Can't lookup blockdev
[  281.021080] /dev/vg-nvme/var: Can't lookup blockdev
mount: mounting /dev/vg-nvme/var on /mnt failed: No such file or
directory
Quoted 5 lines
Quoted 1 line

any ideas?

I would try to run vgchange manually to see if the setup works at all, then create a /usr/bin/systemd-run script that is able to execute commands in the background. Something like this (untested):

i was able to manually initialize the lvm value after adding the systemd without init (running the command without prefix "systemd-run")...

basicly with this command:

Quoted 7 lines

/usr/sbin/lvm vgchange -aay --autoactivation event vg-nvme

with init i had compile issues missing libmount, see my followup post

now i have to remove systems from my initrd somehow to do further testing with only the eudev. any idea doing this without making all clear (or is this dropped when recreating the cpio file)?

Without running make clean, unwanted files need to be removed manually. Buildroot creates per-package logs .files-list, .files-list-{host,images,staging}, which contain the names of files copied to the respective destination. Remove at least those from .files-list to revert to a system without the package; preferrably also those from .files-list-staging.

Quoted 16 lines

Kind regards,
Andreas

Quoted 12 lines
Quoted 12 lines
   #!/bin/sh
   prg=$1
   shift
   (
     $prg $@ < /dev/zero > /tmp/error.log 2>&1
   )&

Kind regards,
Andreas

Quoted 1 line

regards Frank

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

#5 lore raw

Hi Frank,

Quoted 10 lines · Frank Wunderlich

Hi Andreas

noticed some errors when calling the vgchange command

# /usr/sbin/lvm vgchange -aay --autoactivation event vg-nvme
  1 logical volume(s) in volume group "vg-nvme" now active
[ 8023.796866] udevd[1614]: failed to execute '/usr/sbin/blkid' '/usr/sbin/blkid -o udev -p /dev/dm-0': No such file or directory
[ 8023.808977] udevd[1610]: conflicting device node '/dev/mapper/vg--nvme-var' found, link to '/dev/dm-0' will not be created
# lvscan
  ACTIVE            '/dev/vg-nvme/var' [10.00 GiB] inherit

Your execution of vgchange triggers additional udev messages, that are not handled correctly. Try to find out what is missing and add it to your image; blkid, for example, is part of package util-linux.

The double-dash in vg--nvme-var looks strange: is this intentional?

Quoted 10 lines

but i'm able to mount it

# mkdir /mnt/var
# mount /dev/mapper/vg--nvme-var /mnt/var/
[ 8514.687803] EXT4-fs (dm-0): mounted filesystem be8b31d6-96e2-43a1-8416-a058972118b3 r/w with ordered data mode. Quota mode: disabled.
# ls /mnt/var
cache       lib         log         lost+found  run         tmp
#

how can i test the script? currently i'm in the initrd, so changing anything will be lost on reboot, so i want to test the script before putting it into the initrd.

I usually mount the target's file system via ssh://root@hostname in a file browser; that allows me to copy to and from the target machine. Script and configuration changes are made directly on the target system, and copied back to the development machine when everything runs satisfactorily.

Quoted 1 line

as far as i see the original call via udev contains some systemd-specific params and environment-vars i do not know currently

They are probably safe to ignore; when in doubt, consult the systemd documentation. Evironment variables are extensively used within the udev context; I doubt that the called lvm2 tool makes use of them.

Kind regards,
Andreas

Quoted 134 lines

regards Frank

Quoted 130 lines

Gesendet: Sonntag, 21. Juli 2024 um 12:16 Uhr
Von: "Andreas Ziegler" <[email protected]>
An: "Frank Wunderlich" <[email protected]>
Cc: "buildroot" <[email protected]>
Betreff: Re: Aw: Re: lvm2 seems to require systemd

Hi Frank,

Quoted 90 lines · Frank Wunderlich

regards Frank

Quoted 75 lines

Gesendet: Sonntag, 21. Juli 2024 um 11:17 Uhr
Von: "Andreas Ziegler" <[email protected]>
An: [email protected]
Cc: "buildroot" <[email protected]>
Betreff: Re: lvm2 seems to require systemd

Hi Frank,

Quoted 12 lines · Frank Wunderlich

Hi,

i try to build a buildroot (2024.05) initrd with lvm2 support

so basicly added these options:

#to select BR2_PACKAGE_HAS_UDEV
BR2_PACKAGE_EUDEV=y
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
BR2_PACKAGE_LIBBLOCKDEV=y
BR2_PACKAGE_LVM2=y

Quoted 7 lines

build is fine, but i see this while bootup:

[    3.665010] udevd[1520]: failed to execute '/usr/bin/systemd-run'

'/usr/bin/systemd-run --no-block --property DefaultDependencies= no --unit lvm-activate-vg-nvme /usr/sbin/lvm vgchange -aay --autoactivation event vg-nvme': No such file or directory done

lvm2 installs a bunch of udev rules; one of them relies on systemd-run to execute a command in the background:

# pvscan will check if this device completes a VG,
# i.e. all PVs in the VG are now present with the
# arrival of this PV.  If so, it prints to stdout:
# LVM_VG_NAME_COMPLETE='foo'
#
# When the VG is complete it can be activated, so
# vgchange -aay <vgname> is run.  It is run via
# systemd since it can take longer to run than
# udev wants to block when processing rules.
# (if there are hundreds of LVs to activate,
# the vgchange can take many seconds.)

...

IMPORT{program}="/usr/sbin/lvm pvscan --cache --listvg --checkcomplete --vgonline --autoactivation event --udevoutput --journal=output $env{DEVNAME}"
ENV{LVM_VG_NAME_COMPLETE}=="?*", RUN+="/usr/bin/systemd-run --no-block --property DefaultDependencies=no --unit lvm-activate-$env{LVM_VG_NAME_COMPLETE} /usr/sbin/lvm vgchange -aay --autoactivation event $env{LVM_VG_NAME_COMPLETE}" GOTO="lvm_end"

Quoted 20 lines

i see the physical volume, but logical volumes are disabled

# pvscan
  PV /dev/nvme0n1p5   VG vg-nvme   lvm2 [<1.79 TiB / <1.78 TiB free]
  Total: 1 [<1.79 TiB] / in use: 1 [<1.79 TiB] / in no VG: 0 [0   ]
# vgscan
  Found volume group "vg-nvme" using metadata type lvm2
# lvscan
  inactive          '/dev/vg-nvme/var' [10.00 GiB] inherit

and so i cannot mount the logical volume

# mount /dev/vg-nvme/var /mnt
[  281.006375] /dev/vg-nvme/var: Can't lookup blockdev
[  281.011279] /dev/vg-nvme/var: Can't lookup blockdev
[  281.016202] /dev/vg-nvme/var: Can't lookup blockdev
[  281.021080] /dev/vg-nvme/var: Can't lookup blockdev
mount: mounting /dev/vg-nvme/var on /mnt failed: No such file or
directory
Quoted 5 lines
Quoted 1 line

any ideas?

I would try to run vgchange manually to see if the setup works at all, then create a /usr/bin/systemd-run script that is able to execute commands in the background. Something like this (untested):

i was able to manually initialize the lvm value after adding the systemd without init (running the command without prefix "systemd-run")...

basicly with this command:

Quoted 7 lines

/usr/sbin/lvm vgchange -aay --autoactivation event vg-nvme

with init i had compile issues missing libmount, see my followup post

now i have to remove systems from my initrd somehow to do further testing with only the eudev. any idea doing this without making all clear (or is this dropped when recreating the cpio file)?

Without running make clean, unwanted files need to be removed manually. Buildroot creates per-package logs .files-list, .files-list-{host,images,staging}, which contain the names of files copied to the respective destination. Remove at least those from .files-list to revert to a system without the package; preferrably also those from .files-list-staging.

Kind regards,
Andreas

Quoted 12 lines
Quoted 12 lines
   #!/bin/sh
   prg=$1
   shift
   (
     $prg $@ < /dev/zero > /tmp/error.log 2>&1
   )&

Kind regards,
Andreas

Quoted 1 line

regards Frank

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

#6 lore raw

Hi

Quoted 23 lines

Gesendet: Sonntag, 21. Juli 2024 um 19:58 Uhr
Von: "Andreas Ziegler" <[email protected]>
An: "Frank Wunderlich" <[email protected]>
Cc: "buildroot" <[email protected]>
Betreff: Re: Aw: Re: Re: lvm2 seems to require systemd

Hi Frank,

Quoted 4 lines · Frank Wunderlich

Hi Andreas

noticed some errors when calling the vgchange command

Quoted 9 lines
# /usr/sbin/lvm vgchange -aay --autoactivation event vg-nvme
  1 logical volume(s) in volume group "vg-nvme" now active
[ 8023.796866] udevd[1614]: failed to execute '/usr/sbin/blkid'
'/usr/sbin/blkid -o udev -p /dev/dm-0': No such file or directory
[ 8023.808977] udevd[1610]: conflicting device node
'/dev/mapper/vg--nvme-var' found, link to '/dev/dm-0' will not be
created
# lvscan
  ACTIVE            '/dev/vg-nvme/var' [10.00 GiB] inherit
Quoted 3 lines

Your execution of vgchange triggers additional udev messages, that are not handled correctly. Try to find out what is missing and add it to your image; blkid, for example, is part of package util-linux.

i have already enabled util_linux
Symbol: BR2_PACKAGE_UTIL_LINUX [=y]
BR2_PACKAGE_HOST_UTIL_LINUX [=y]
BR2_PACKAGE_UTIL_LINUX_LIBBLKID [=y]

so strange that blkid is not there, but it is in /sbin

# which blkid
/sbin/blkid

maybe a symlink needs to be created?

Quoted 1 line

The double-dash in vg--nvme-var looks strange: is this intentional?

as you can see above i used only one dash in vg-nvme, not sure why another one was inserted here

# pvscan
  PV /dev/nvme0n1p5   VG vg-nvme   lvm2 [<1.79 TiB / <1.78 TiB free]
  Total: 1 [<1.79 TiB] / in use: 1 [<1.79 TiB] / in no VG: 0 [0   ]
Quoted 21 lines
Quoted 11 lines

but i'm able to mount it

# mkdir /mnt/var
# mount /dev/mapper/vg--nvme-var /mnt/var/
[ 8514.687803] EXT4-fs (dm-0): mounted filesystem
be8b31d6-96e2-43a1-8416-a058972118b3 r/w with ordered data mode. Quota
mode: disabled.
# ls /mnt/var
cache       lib         log         lost+found  run         tmp
#
Quoted 3 lines

how can i test the script? currently i'm in the initrd, so changing anything will be lost on reboot, so i want to test the script before putting it into the initrd.

I usually mount the target's file system via ssh://root@hostname in a file browser; that allows me to copy to and from the target machine. Script and configuration changes are made directly on the target system, and copied back to the development machine when everything runs satisfactorily.

Quoted 6 lines
Quoted 2 lines

as far as i see the original call via udev contains some systemd-specific params and environment-vars i do not know currently

They are probably safe to ignore; when in doubt, consult the systemd documentation. Evironment variables are extensively used within the udev context; I doubt that the called lvm2 tool makes use of them.

they seem to be systemd options which are not stripped by the script yet which will result in invalid call (imho only first param is shifted away)

Quoted 140 lines

Kind regards,
Andreas

Quoted 136 lines

regards Frank

Quoted 132 lines

Gesendet: Sonntag, 21. Juli 2024 um 12:16 Uhr
Von: "Andreas Ziegler" <[email protected]>
An: "Frank Wunderlich" <[email protected]>
Cc: "buildroot" <[email protected]>
Betreff: Re: Aw: Re: lvm2 seems to require systemd

Hi Frank,

Quoted 90 lines · Frank Wunderlich

regards Frank

Quoted 75 lines

Gesendet: Sonntag, 21. Juli 2024 um 11:17 Uhr
Von: "Andreas Ziegler" <[email protected]>
An: [email protected]
Cc: "buildroot" <[email protected]>
Betreff: Re: lvm2 seems to require systemd

Hi Frank,

Quoted 12 lines · Frank Wunderlich

Hi,

i try to build a buildroot (2024.05) initrd with lvm2 support

so basicly added these options:

#to select BR2_PACKAGE_HAS_UDEV
BR2_PACKAGE_EUDEV=y
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
BR2_PACKAGE_LIBBLOCKDEV=y
BR2_PACKAGE_LVM2=y

Quoted 7 lines

build is fine, but i see this while bootup:

[    3.665010] udevd[1520]: failed to execute '/usr/bin/systemd-run'

'/usr/bin/systemd-run --no-block --property DefaultDependencies= no --unit lvm-activate-vg-nvme /usr/sbin/lvm vgchange -aay --autoactivation event vg-nvme': No such file or directory done

lvm2 installs a bunch of udev rules; one of them relies on systemd-run to execute a command in the background:

# pvscan will check if this device completes a VG,
# i.e. all PVs in the VG are now present with the
# arrival of this PV.  If so, it prints to stdout:
# LVM_VG_NAME_COMPLETE='foo'
#
# When the VG is complete it can be activated, so
# vgchange -aay <vgname> is run.  It is run via
# systemd since it can take longer to run than
# udev wants to block when processing rules.
# (if there are hundreds of LVs to activate,
# the vgchange can take many seconds.)

...

IMPORT{program}="/usr/sbin/lvm pvscan --cache --listvg --checkcomplete --vgonline --autoactivation event --udevoutput --journal=output $env{DEVNAME}"
ENV{LVM_VG_NAME_COMPLETE}=="?*", RUN+="/usr/bin/systemd-run --no-block --property DefaultDependencies=no --unit lvm-activate-$env{LVM_VG_NAME_COMPLETE} /usr/sbin/lvm vgchange -aay --autoactivation event $env{LVM_VG_NAME_COMPLETE}" GOTO="lvm_end"

Quoted 20 lines

i see the physical volume, but logical volumes are disabled

# pvscan
  PV /dev/nvme0n1p5   VG vg-nvme   lvm2 [<1.79 TiB / <1.78 TiB free]
  Total: 1 [<1.79 TiB] / in use: 1 [<1.79 TiB] / in no VG: 0 [0   ]
# vgscan
  Found volume group "vg-nvme" using metadata type lvm2
# lvscan
  inactive          '/dev/vg-nvme/var' [10.00 GiB] inherit

and so i cannot mount the logical volume

# mount /dev/vg-nvme/var /mnt
[  281.006375] /dev/vg-nvme/var: Can't lookup blockdev
[  281.011279] /dev/vg-nvme/var: Can't lookup blockdev
[  281.016202] /dev/vg-nvme/var: Can't lookup blockdev
[  281.021080] /dev/vg-nvme/var: Can't lookup blockdev
mount: mounting /dev/vg-nvme/var on /mnt failed: No such file or
directory
Quoted 5 lines
Quoted 1 line

any ideas?

I would try to run vgchange manually to see if the setup works at all, then create a /usr/bin/systemd-run script that is able to execute commands in the background. Something like this (untested):

i was able to manually initialize the lvm value after adding the systemd without init (running the command without prefix "systemd-run")...

basicly with this command:

Quoted 7 lines

/usr/sbin/lvm vgchange -aay --autoactivation event vg-nvme

with init i had compile issues missing libmount, see my followup post

now i have to remove systems from my initrd somehow to do further testing with only the eudev. any idea doing this without making all clear (or is this dropped when recreating the cpio file)?

Without running make clean, unwanted files need to be removed manually.
Buildroot creates per-package logs .files-list, .files-list-{host,images,staging}, which contain the names of files copied to the respective destination. Remove at least those from .files-list to revert to a system without the package; preferrably also
those from .files-list-staging.

Kind regards,
Andreas

Quoted 12 lines
Quoted 12 lines
   #!/bin/sh
   prg=$1
   shift
   (
     $prg $@ < /dev/zero > /tmp/error.log 2>&1
   )&

Kind regards,
Andreas

Quoted 1 line

regards Frank

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

#7 lore raw

Hi Frank,

Quoted 34 lines · Frank Wunderlich

Hi

Quoted 23 lines

Gesendet: Sonntag, 21. Juli 2024 um 19:58 Uhr
Von: "Andreas Ziegler" <[email protected]>
An: "Frank Wunderlich" <[email protected]>
Cc: "buildroot" <[email protected]>
Betreff: Re: Aw: Re: Re: lvm2 seems to require systemd

Hi Frank,

Quoted 4 lines · Frank Wunderlich

Hi Andreas

noticed some errors when calling the vgchange command

Quoted 9 lines
# /usr/sbin/lvm vgchange -aay --autoactivation event vg-nvme
  1 logical volume(s) in volume group "vg-nvme" now active
[ 8023.796866] udevd[1614]: failed to execute '/usr/sbin/blkid'
'/usr/sbin/blkid -o udev -p /dev/dm-0': No such file or directory
[ 8023.808977] udevd[1610]: conflicting device node
'/dev/mapper/vg--nvme-var' found, link to '/dev/dm-0' will not be
created
# lvscan
  ACTIVE            '/dev/vg-nvme/var' [10.00 GiB] inherit
Quoted 3 lines

Your execution of vgchange triggers additional udev messages, that are not handled correctly. Try to find out what is missing and add it to your image; blkid, for example, is part of package util-linux.

i have already enabled util_linux
Symbol: BR2_PACKAGE_UTIL_LINUX [=y]
BR2_PACKAGE_HOST_UTIL_LINUX [=y]
BR2_PACKAGE_UTIL_LINUX_LIBBLKID [=y]

Quoted 7 lines

so strange that blkid is not there, but it is in /sbin

# which blkid
/sbin/blkid

maybe a symlink needs to be created?

Sorry, my mistake: blkid is provided by busybox and busybox installs it in /sbin. Since this is a Buildroot feature (unless you activate BR2_ROOTFS_MERGED_USER), I would modify the udev rule.

Quoted 32 lines
Quoted 1 line

The double-dash in vg--nvme-var looks strange: is this intentional?

as you can see above i used only one dash in vg-nvme, not sure why another one was inserted here

# pvscan
  PV /dev/nvme0n1p5   VG vg-nvme   lvm2 [<1.79 TiB / <1.78 TiB free]
  Total: 1 [<1.79 TiB] / in use: 1 [<1.79 TiB] / in no VG: 0 [0   ]
Quoted 24 lines
Quoted 11 lines

but i'm able to mount it

# mkdir /mnt/var
# mount /dev/mapper/vg--nvme-var /mnt/var/
[ 8514.687803] EXT4-fs (dm-0): mounted filesystem
be8b31d6-96e2-43a1-8416-a058972118b3 r/w with ordered data mode. Quota
mode: disabled.
# ls /mnt/var
cache       lib         log         lost+found  run         tmp
#
Quoted 3 lines

how can i test the script? currently i'm in the initrd, so changing anything will be lost on reboot, so i want to test the script before putting it into the initrd.

I usually mount the target's file system via ssh://root@hostname in a file browser; that allows me to copy to and from the target machine. Script and configuration changes are made directly on the target system, and copied back to the development machine when everything runs satisfactorily.

Quoted 2 lines

as far as i see the original call via udev contains some systemd-specific params and environment-vars i do not know currently

Quoted 7 lines
Quoted 3 lines

They are probably safe to ignore; when in doubt, consult the systemd documentation. Evironment variables are extensively used within the udev context; I doubt that the called lvm2 tool makes use of them.

they seem to be systemd options which are not stripped by the script yet which will result in invalid call (imho only first param is shifted away)

RUN+="/usr/bin/systemd-run \
--no-block \
--property DefaultDependencies=no \
--unit lvm-activate-$env{LVM_VG_NAME_COMPLETE} \
/usr/sbin/lvm \
vgchange \
-aay \
-autoactivation \
event $env{LVM_VG_NAME_COMPLETE}"

If you put a 'shift 5' at the beginning of the script, it should get rid of the systemd parameters. Alternatively, you could modify the udev rule.

Kind regards,
Andreas

Quoted 134 lines
Quoted 134 lines

Kind regards,
Andreas

Quoted 131 lines

regards Frank

Quoted 127 lines

Gesendet: Sonntag, 21. Juli 2024 um 12:16 Uhr
Von: "Andreas Ziegler" <[email protected]>
An: "Frank Wunderlich" <[email protected]>
Cc: "buildroot" <[email protected]>
Betreff: Re: Aw: Re: lvm2 seems to require systemd

Hi Frank,

Quoted 90 lines · Frank Wunderlich

regards Frank

Quoted 75 lines

Gesendet: Sonntag, 21. Juli 2024 um 11:17 Uhr
Von: "Andreas Ziegler" <[email protected]>
An: [email protected]
Cc: "buildroot" <[email protected]>
Betreff: Re: lvm2 seems to require systemd

Hi Frank,

Quoted 12 lines · Frank Wunderlich

Hi,

i try to build a buildroot (2024.05) initrd with lvm2 support

so basicly added these options:

#to select BR2_PACKAGE_HAS_UDEV
BR2_PACKAGE_EUDEV=y
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
BR2_PACKAGE_LIBBLOCKDEV=y
BR2_PACKAGE_LVM2=y

Quoted 7 lines

build is fine, but i see this while bootup:

[    3.665010] udevd[1520]: failed to execute '/usr/bin/systemd-run'

'/usr/bin/systemd-run --no-block --property DefaultDependencies= no --unit lvm-activate-vg-nvme /usr/sbin/lvm vgchange -aay --autoactivation event vg-nvme': No such file or directory done

lvm2 installs a bunch of udev rules; one of them relies on systemd-run to execute a command in the background:

# pvscan will check if this device completes a VG,
# i.e. all PVs in the VG are now present with the
# arrival of this PV.  If so, it prints to stdout:
# LVM_VG_NAME_COMPLETE='foo'
#
# When the VG is complete it can be activated, so
# vgchange -aay <vgname> is run.  It is run via
# systemd since it can take longer to run than
# udev wants to block when processing rules.
# (if there are hundreds of LVs to activate,
# the vgchange can take many seconds.)

...

IMPORT{program}="/usr/sbin/lvm pvscan --cache --listvg --checkcomplete --vgonline --autoactivation event --udevoutput --journal=output $env{DEVNAME}"
ENV{LVM_VG_NAME_COMPLETE}=="?*", RUN+="/usr/bin/systemd-run --no-block --property DefaultDependencies=no --unit lvm-activate-$env{LVM_VG_NAME_COMPLETE} /usr/sbin/lvm vgchange -aay --autoactivation event $env{LVM_VG_NAME_COMPLETE}" GOTO="lvm_end"

Quoted 20 lines

i see the physical volume, but logical volumes are disabled

# pvscan
  PV /dev/nvme0n1p5   VG vg-nvme   lvm2 [<1.79 TiB / <1.78 TiB free]
  Total: 1 [<1.79 TiB] / in use: 1 [<1.79 TiB] / in no VG: 0 [0   ]
# vgscan
  Found volume group "vg-nvme" using metadata type lvm2
# lvscan
  inactive          '/dev/vg-nvme/var' [10.00 GiB] inherit

and so i cannot mount the logical volume

# mount /dev/vg-nvme/var /mnt
[  281.006375] /dev/vg-nvme/var: Can't lookup blockdev
[  281.011279] /dev/vg-nvme/var: Can't lookup blockdev
[  281.016202] /dev/vg-nvme/var: Can't lookup blockdev
[  281.021080] /dev/vg-nvme/var: Can't lookup blockdev
mount: mounting /dev/vg-nvme/var on /mnt failed: No such file or
directory
Quoted 5 lines
Quoted 1 line

any ideas?

I would try to run vgchange manually to see if the setup works at all, then create a /usr/bin/systemd-run script that is able to execute commands in the background. Something like this (untested):

i was able to manually initialize the lvm value after adding the systemd without init (running the command without prefix "systemd-run")...

basicly with this command:

Quoted 7 lines

/usr/sbin/lvm vgchange -aay --autoactivation event vg-nvme

with init i had compile issues missing libmount, see my followup post

now i have to remove systems from my initrd somehow to do further testing with only the eudev. any idea doing this without making all clear (or is this dropped when recreating the cpio file)?

Without running make clean, unwanted files need to be removed manually.
Buildroot creates per-package logs .files-list, .files-list-{host,images,staging}, which contain the names of files copied to the respective destination. Remove at least those from .files-list to revert to a system without the package; preferrably also
those from .files-list-staging.

Kind regards,
Andreas

Quoted 8 lines
Quoted 7 lines
   #!/bin/sh
   prg=$1
   shift
   (
     $prg $@ < /dev/zero > /tmp/error.log 2>&1
   )&
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines

Kind regards,
Andreas

Quoted 1 line

regards Frank

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

#8 lore raw

Hi

Quoted 109 lines

Gesendet: Montag, 22. Juli 2024 um 07:15 Uhr
Von: "Andreas Ziegler" <[email protected]>
An: "Frank Wunderlich" <[email protected]>
Cc: "buildroot" <[email protected]>
Betreff: Re: Aw: Re: Re: Re: lvm2 seems to require systemd

Hi Frank,

Quoted 34 lines · Frank Wunderlich

Hi

Quoted 23 lines

Gesendet: Sonntag, 21. Juli 2024 um 19:58 Uhr
Von: "Andreas Ziegler" <[email protected]>
An: "Frank Wunderlich" <[email protected]>
Cc: "buildroot" <[email protected]>
Betreff: Re: Aw: Re: Re: lvm2 seems to require systemd

Hi Frank,

Quoted 4 lines · Frank Wunderlich

Hi Andreas

noticed some errors when calling the vgchange command

Quoted 9 lines
# /usr/sbin/lvm vgchange -aay --autoactivation event vg-nvme
  1 logical volume(s) in volume group "vg-nvme" now active
[ 8023.796866] udevd[1614]: failed to execute '/usr/sbin/blkid'
'/usr/sbin/blkid -o udev -p /dev/dm-0': No such file or directory
[ 8023.808977] udevd[1610]: conflicting device node
'/dev/mapper/vg--nvme-var' found, link to '/dev/dm-0' will not be
created
# lvscan
  ACTIVE            '/dev/vg-nvme/var' [10.00 GiB] inherit
Quoted 3 lines

Your execution of vgchange triggers additional udev messages, that are not handled correctly. Try to find out what is missing and add it to your image; blkid, for example, is part of package util-linux.

i have already enabled util_linux
Symbol: BR2_PACKAGE_UTIL_LINUX [=y]
BR2_PACKAGE_HOST_UTIL_LINUX [=y]
BR2_PACKAGE_UTIL_LINUX_LIBBLKID [=y]

Quoted 7 lines

so strange that blkid is not there, but it is in /sbin

# which blkid
/sbin/blkid

maybe a symlink needs to be created?

Sorry, my mistake: blkid is provided by busybox and busybox installs it in /sbin. Since this is a Buildroot feature (unless you activate BR2_ROOTFS_MERGED_USER), I would modify the udev rule.

Quoted 34 lines
Quoted 1 line

The double-dash in vg--nvme-var looks strange: is this intentional?

as you can see above i used only one dash in vg-nvme, not sure why another one was inserted here

# pvscan
  PV /dev/nvme0n1p5   VG vg-nvme   lvm2 [<1.79 TiB / <1.78 TiB free]
  Total: 1 [<1.79 TiB] / in use: 1 [<1.79 TiB] / in no VG: 0 [0   ]
Quoted 25 lines
Quoted 11 lines

but i'm able to mount it

# mkdir /mnt/var
# mount /dev/mapper/vg--nvme-var /mnt/var/
[ 8514.687803] EXT4-fs (dm-0): mounted filesystem
be8b31d6-96e2-43a1-8416-a058972118b3 r/w with ordered data mode. Quota
mode: disabled.
# ls /mnt/var
cache       lib         log         lost+found  run         tmp
#
Quoted 3 lines

how can i test the script? currently i'm in the initrd, so changing anything will be lost on reboot, so i want to test the script before putting it into the initrd.

I usually mount the target's file system via ssh://root@hostname in a file browser; that allows me to copy to and from the target machine. Script and configuration changes are made directly on the target system,
and copied back to the development machine when everything runs satisfactorily.

Quoted 2 lines

as far as i see the original call via udev contains some systemd-specific params and environment-vars i do not know currently

Quoted 9 lines
Quoted 4 lines

They are probably safe to ignore; when in doubt, consult the systemd documentation. Evironment variables are extensively used within the udev
context; I doubt that the called lvm2 tool makes use of them.

they seem to be systemd options which are not stripped by the script yet which
will result in invalid call (imho only first param is shifted away)

RUN+="/usr/bin/systemd-run \
   --no-block \
   --property DefaultDependencies=no \
   --unit lvm-activate-$env{LVM_VG_NAME_COMPLETE} \
   /usr/sbin/lvm \
   vgchange \
   -aay \
   -autoactivation \
   event $env{LVM_VG_NAME_COMPLETE}"
Quoted 3 lines

If you put a 'shift 5' at the beginning of the script, it should get rid of the systemd parameters. Alternatively, you could modify the udev rule.

I'm not sure how to fix properly....where should i put the script (it is called on bootup and there my changes done on runtime are dropped) and where to call it (imho it should be called by the existing udev-rule, right)?

how to fix the blkid properly (maybe add symlink)? but this has to be done in source too or while building.

sorry for my noob questions, but my buildroot-knowledge is only :)

regards Frank

Quoted 144 lines

Kind regards,
Andreas

Quoted 140 lines
Quoted 140 lines

Kind regards,
Andreas

Quoted 136 lines

regards Frank

Quoted 132 lines

Gesendet: Sonntag, 21. Juli 2024 um 12:16 Uhr
Von: "Andreas Ziegler" <[email protected]>
An: "Frank Wunderlich" <[email protected]>
Cc: "buildroot" <[email protected]>
Betreff: Re: Aw: Re: lvm2 seems to require systemd

Hi Frank,

Quoted 90 lines · Frank Wunderlich

regards Frank

Quoted 75 lines

Gesendet: Sonntag, 21. Juli 2024 um 11:17 Uhr
Von: "Andreas Ziegler" <[email protected]>
An: [email protected]
Cc: "buildroot" <[email protected]>
Betreff: Re: lvm2 seems to require systemd

Hi Frank,

Quoted 12 lines · Frank Wunderlich

Hi,

i try to build a buildroot (2024.05) initrd with lvm2 support

so basicly added these options:

#to select BR2_PACKAGE_HAS_UDEV
BR2_PACKAGE_EUDEV=y
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
BR2_PACKAGE_LIBBLOCKDEV=y
BR2_PACKAGE_LVM2=y

Quoted 7 lines

build is fine, but i see this while bootup:

[    3.665010] udevd[1520]: failed to execute '/usr/bin/systemd-run'

'/usr/bin/systemd-run --no-block --property DefaultDependencies= no --unit lvm-activate-vg-nvme /usr/sbin/lvm vgchange -aay --autoactivation event vg-nvme': No such file or directory done

lvm2 installs a bunch of udev rules; one of them relies on systemd-run to execute a command in the background:

# pvscan will check if this device completes a VG,
# i.e. all PVs in the VG are now present with the
# arrival of this PV.  If so, it prints to stdout:
# LVM_VG_NAME_COMPLETE='foo'
#
# When the VG is complete it can be activated, so
# vgchange -aay <vgname> is run.  It is run via
# systemd since it can take longer to run than
# udev wants to block when processing rules.
# (if there are hundreds of LVs to activate,
# the vgchange can take many seconds.)

...

IMPORT{program}="/usr/sbin/lvm pvscan --cache --listvg --checkcomplete --vgonline --autoactivation event --udevoutput --journal=output $env{DEVNAME}"
ENV{LVM_VG_NAME_COMPLETE}=="?*", RUN+="/usr/bin/systemd-run --no-block --property DefaultDependencies=no --unit lvm-activate-$env{LVM_VG_NAME_COMPLETE} /usr/sbin/lvm vgchange -aay --autoactivation event $env{LVM_VG_NAME_COMPLETE}" GOTO="lvm_end"

Quoted 20 lines

i see the physical volume, but logical volumes are disabled

# pvscan
  PV /dev/nvme0n1p5   VG vg-nvme   lvm2 [<1.79 TiB / <1.78 TiB free]
  Total: 1 [<1.79 TiB] / in use: 1 [<1.79 TiB] / in no VG: 0 [0   ]
# vgscan
  Found volume group "vg-nvme" using metadata type lvm2
# lvscan
  inactive          '/dev/vg-nvme/var' [10.00 GiB] inherit

and so i cannot mount the logical volume

# mount /dev/vg-nvme/var /mnt
[  281.006375] /dev/vg-nvme/var: Can't lookup blockdev
[  281.011279] /dev/vg-nvme/var: Can't lookup blockdev
[  281.016202] /dev/vg-nvme/var: Can't lookup blockdev
[  281.021080] /dev/vg-nvme/var: Can't lookup blockdev
mount: mounting /dev/vg-nvme/var on /mnt failed: No such file or
directory
Quoted 5 lines
Quoted 1 line

any ideas?

I would try to run vgchange manually to see if the setup works at all, then create a /usr/bin/systemd-run script that is able to execute commands in the background. Something like this (untested):

i was able to manually initialize the lvm value after adding the systemd without init (running the command without prefix "systemd-run")...

basicly with this command:

Quoted 7 lines

/usr/sbin/lvm vgchange -aay --autoactivation event vg-nvme

with init i had compile issues missing libmount, see my followup post

now i have to remove systems from my initrd somehow to do further testing with only the eudev. any idea doing this without making all clear (or is this dropped when recreating the cpio file)?

Without running make clean, unwanted files need to be removed manually.
Buildroot creates per-package logs .files-list, .files-list-{host,images,staging}, which contain the names of files copied to the respective destination. Remove at least those from .files-list to revert to a system without the package; preferrably also
those from .files-list-staging.

Kind regards,
Andreas

Quoted 12 lines
Quoted 12 lines
   #!/bin/sh
   prg=$1
   shift
   (
     $prg $@ < /dev/zero > /tmp/error.log 2>&1
   )&

Kind regards,
Andreas

Quoted 1 line

regards Frank

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

#9 lore raw

Hi Frank,

Quoted 111 lines · Frank Wunderlich

Hi

Quoted 109 lines

Gesendet: Montag, 22. Juli 2024 um 07:15 Uhr
Von: "Andreas Ziegler" <[email protected]>
An: "Frank Wunderlich" <[email protected]>
Cc: "buildroot" <[email protected]>
Betreff: Re: Aw: Re: Re: Re: lvm2 seems to require systemd

Hi Frank,

Quoted 34 lines · Frank Wunderlich

Hi

Quoted 23 lines

Gesendet: Sonntag, 21. Juli 2024 um 19:58 Uhr
Von: "Andreas Ziegler" <[email protected]>
An: "Frank Wunderlich" <[email protected]>
Cc: "buildroot" <[email protected]>
Betreff: Re: Aw: Re: Re: lvm2 seems to require systemd

Hi Frank,

Quoted 4 lines · Frank Wunderlich

Hi Andreas

noticed some errors when calling the vgchange command

Quoted 9 lines
# /usr/sbin/lvm vgchange -aay --autoactivation event vg-nvme
  1 logical volume(s) in volume group "vg-nvme" now active
[ 8023.796866] udevd[1614]: failed to execute '/usr/sbin/blkid'
'/usr/sbin/blkid -o udev -p /dev/dm-0': No such file or directory
[ 8023.808977] udevd[1610]: conflicting device node
'/dev/mapper/vg--nvme-var' found, link to '/dev/dm-0' will not be
created
# lvscan
  ACTIVE            '/dev/vg-nvme/var' [10.00 GiB] inherit
Quoted 3 lines

Your execution of vgchange triggers additional udev messages, that are not handled correctly. Try to find out what is missing and add it to your image; blkid, for example, is part of package util-linux.

i have already enabled util_linux
Symbol: BR2_PACKAGE_UTIL_LINUX [=y]
BR2_PACKAGE_HOST_UTIL_LINUX [=y]
BR2_PACKAGE_UTIL_LINUX_LIBBLKID [=y]

Quoted 7 lines

so strange that blkid is not there, but it is in /sbin

# which blkid
/sbin/blkid

maybe a symlink needs to be created?

Sorry, my mistake: blkid is provided by busybox and busybox installs it in /sbin. Since this is a Buildroot feature (unless you activate BR2_ROOTFS_MERGED_USER), I would modify the udev rule.

Quoted 34 lines
Quoted 1 line

The double-dash in vg--nvme-var looks strange: is this intentional?

as you can see above i used only one dash in vg-nvme, not sure why another one was inserted here

# pvscan
  PV /dev/nvme0n1p5   VG vg-nvme   lvm2 [<1.79 TiB / <1.78 TiB free]
  Total: 1 [<1.79 TiB] / in use: 1 [<1.79 TiB] / in no VG: 0 [0   ]
Quoted 25 lines
Quoted 11 lines

but i'm able to mount it

# mkdir /mnt/var
# mount /dev/mapper/vg--nvme-var /mnt/var/
[ 8514.687803] EXT4-fs (dm-0): mounted filesystem
be8b31d6-96e2-43a1-8416-a058972118b3 r/w with ordered data mode. Quota
mode: disabled.
# ls /mnt/var
cache       lib         log         lost+found  run         tmp
#
Quoted 3 lines

how can i test the script? currently i'm in the initrd, so changing anything will be lost on reboot, so i want to test the script before putting it into the initrd.

I usually mount the target's file system via ssh://root@hostname in a file browser; that allows me to copy to and from the target machine. Script and configuration changes are made directly on the target system,
and copied back to the development machine when everything runs satisfactorily.

Quoted 2 lines

as far as i see the original call via udev contains some systemd-specific params and environment-vars i do not know currently

Quoted 9 lines
Quoted 4 lines

They are probably safe to ignore; when in doubt, consult the systemd documentation. Evironment variables are extensively used within the udev
context; I doubt that the called lvm2 tool makes use of them.

they seem to be systemd options which are not stripped by the script yet which
will result in invalid call (imho only first param is shifted away)

RUN+="/usr/bin/systemd-run \
   --no-block \
   --property DefaultDependencies=no \
   --unit lvm-activate-$env{LVM_VG_NAME_COMPLETE} \
   /usr/sbin/lvm \
   vgchange \
   -aay \
   -autoactivation \
   event $env{LVM_VG_NAME_COMPLETE}"
Quoted 5 lines
Quoted 3 lines

If you put a 'shift 5' at the beginning of the script, it should get rid of the systemd parameters. Alternatively, you could modify the udev rule.

I'm not sure how to fix properly....where should i put the script (it is called on bootup and there my changes done on runtime are dropped) and where to call it (imho it should be called by the existing udev-rule, right)?

The script might go into /usr/bin. Put all new or changed files in a separate directory, within a layout reflecting that of your root filesystem. Configure Buildroot's BR2_ROOTFS_OVERLAY and these files - with their relative directories - will be copied to the root filesystem after build and before image creation. For examples, see [1].

Quoted 1 line

how to fix the blkid properly (maybe add symlink)? but this has to be done in source too or while building.

Leave blkid where it is, modify the udev script and put it in your overlay filesystem. As Arnout suggested, reworking all of the udev scripts will probably be the easiest approach ...

Quoted 1 line

sorry for my noob questions, but my buildroot-knowledge is only :)

The Buildroot manual [2] is quite useful. Bootlin has some training materials [3] for general use.

Kind regards,
Andreas

Quoted 3 lines

regards Frank

<cut>

[1] https://buildroot.org/downloads/manual/manual.html#customize
[2] https://buildroot.org/docs.html
[3] https://bootlin.com/docs/
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#10 lore raw

Hi

Quoted 6 lines

Gesendet: Dienstag, 30. Juli 2024 um 13:39 Uhr
Von: "Andreas Ziegler" <[email protected]>
An: "Frank Wunderlich" <[email protected]>
Cc: "buildroot" <[email protected]>
Betreff: Re: Aw: Re: Re: Re: Re: lvm2 seems to require systemd

Quoted 119 lines

Hi Frank,

Quoted 116 lines · Frank Wunderlich

Hi

Quoted 114 lines

Gesendet: Montag, 22. Juli 2024 um 07:15 Uhr
Von: "Andreas Ziegler" <[email protected]>
An: "Frank Wunderlich" <[email protected]>
Cc: "buildroot" <[email protected]>
Betreff: Re: Aw: Re: Re: Re: lvm2 seems to require systemd

Hi Frank,

Quoted 34 lines · Frank Wunderlich

Hi

Quoted 23 lines

Gesendet: Sonntag, 21. Juli 2024 um 19:58 Uhr
Von: "Andreas Ziegler" <[email protected]>
An: "Frank Wunderlich" <[email protected]>
Cc: "buildroot" <[email protected]>
Betreff: Re: Aw: Re: Re: lvm2 seems to require systemd

Hi Frank,

Quoted 4 lines · Frank Wunderlich

Hi Andreas

noticed some errors when calling the vgchange command

Quoted 9 lines
# /usr/sbin/lvm vgchange -aay --autoactivation event vg-nvme
  1 logical volume(s) in volume group "vg-nvme" now active
[ 8023.796866] udevd[1614]: failed to execute '/usr/sbin/blkid'
'/usr/sbin/blkid -o udev -p /dev/dm-0': No such file or directory
[ 8023.808977] udevd[1610]: conflicting device node
'/dev/mapper/vg--nvme-var' found, link to '/dev/dm-0' will not be
created
# lvscan
  ACTIVE            '/dev/vg-nvme/var' [10.00 GiB] inherit
Quoted 3 lines

Your execution of vgchange triggers additional udev messages, that are not handled correctly. Try to find out what is missing and add it to your image; blkid, for example, is part of package util-linux.

i have already enabled util_linux
Symbol: BR2_PACKAGE_UTIL_LINUX [=y]
BR2_PACKAGE_HOST_UTIL_LINUX [=y]
BR2_PACKAGE_UTIL_LINUX_LIBBLKID [=y]

Quoted 7 lines

so strange that blkid is not there, but it is in /sbin

# which blkid
/sbin/blkid

maybe a symlink needs to be created?

Sorry, my mistake: blkid is provided by busybox and busybox installs it
in /sbin. Since this is a Buildroot feature (unless you activate BR2_ROOTFS_MERGED_USER), I would modify the udev rule.

Quoted 34 lines
Quoted 1 line

The double-dash in vg--nvme-var looks strange: is this intentional?

as you can see above i used only one dash in vg-nvme, not sure why another one was inserted here

# pvscan
  PV /dev/nvme0n1p5   VG vg-nvme   lvm2 [<1.79 TiB / <1.78 TiB free]
  Total: 1 [<1.79 TiB] / in use: 1 [<1.79 TiB] / in no VG: 0 [0   ]
Quoted 25 lines
Quoted 11 lines

but i'm able to mount it

# mkdir /mnt/var
# mount /dev/mapper/vg--nvme-var /mnt/var/
[ 8514.687803] EXT4-fs (dm-0): mounted filesystem
be8b31d6-96e2-43a1-8416-a058972118b3 r/w with ordered data mode. Quota
mode: disabled.
# ls /mnt/var
cache       lib         log         lost+found  run         tmp
#
Quoted 3 lines

how can i test the script? currently i'm in the initrd, so changing anything will be lost on reboot, so i want to test the script before putting it into the initrd.

I usually mount the target's file system via ssh://root@hostname in a file browser; that allows me to copy to and from the target machine. Script and configuration changes are made directly on the target system,
and copied back to the development machine when everything runs satisfactorily.

Quoted 2 lines

as far as i see the original call via udev contains some systemd-specific params and environment-vars i do not know currently

Quoted 9 lines
Quoted 4 lines

They are probably safe to ignore; when in doubt, consult the systemd documentation. Evironment variables are extensively used within the udev
context; I doubt that the called lvm2 tool makes use of them.

they seem to be systemd options which are not stripped by the script yet which
will result in invalid call (imho only first param is shifted away)

RUN+="/usr/bin/systemd-run \
   --no-block \
   --property DefaultDependencies=no \
   --unit lvm-activate-$env{LVM_VG_NAME_COMPLETE} \
   /usr/sbin/lvm \
   vgchange \
   -aay \
   -autoactivation \
   event $env{LVM_VG_NAME_COMPLETE}"

If you put a 'shift 5' at the beginning of the script, it should get rid
of the systemd parameters. Alternatively, you could modify the udev rule.

got rootfs-overlay working so far

# ls -l /usr/sbin/blkid
lrwxrwxrwx    1 root     root            11 Jul 30  2024 /usr/sbin/blkid -> /sbin/blkid
# cat /usr/bin/systemd-run
#!/bin/sh
logfile=/tmp/error.log
echo $@ > $logfile
shift 5
(
        $@ < /dev/zero >> $logfile 2>&1
)&
# ls /dev/vg-nvme/
var
#

thank you very much for your work...maybe this can be added as a fix somehow?

if udev-rules need to be changed (have not done this, only added blkid symlink and systemd-run script), relatred files are

13-dm-disk.rules # blkid call

69-dm-lvm.rules # systemd-run call

regards Frank

Quoted 27 lines
Quoted 4 lines

I'm not sure how to fix properly....where should i put the script (it is called on bootup and there my changes done on runtime are dropped) and where to call it (imho it should be called by the existing udev-rule, right)?

The script might go into /usr/bin. Put all new or changed files in a separate directory, within a layout reflecting that of your root filesystem. Configure Buildroot's BR2_ROOTFS_OVERLAY and these files - with their relative directories - will be copied to the root filesystem after build and before image creation. For examples, see [1].

Quoted 2 lines

how to fix the blkid properly (maybe add symlink)? but this has to be done in source too or while building.

Leave blkid where it is, modify the udev script and put it in your overlay filesystem. As Arnout suggested, reworking all of the udev scripts will probably be the easiest approach ...

Quoted 1 line

sorry for my noob questions, but my buildroot-knowledge is only :)

The Buildroot manual [2] is quite useful. Bootlin has some training materials [3] for general use.

Kind regards,
Andreas

Quoted 1 line
Quoted 9 lines
Quoted 2 lines

regards Frank

<cut>

[1] https://buildroot.org/downloads/manual/manual.html#customize
[2] https://buildroot.org/docs.html
[3] https://bootlin.com/docs/

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