From: Andreas Ziegler <br015@umbiko.net>
To: Frank Wunderlich <frank-w@public-files.de>
Cc: buildroot <buildroot@buildroot.org>
Subject: Re: [Buildroot] lvm2 seems to require systemd
Date: Sun, 21 Jul 2024 10:16:27 +0000 [thread overview]
Message-ID: <e00d6149cbd2bd2a5a672fcf0323c814@umbiko.net> (raw)
In-Reply-To: <trinity-cf5cdaab-cad5-4928-9dea-541742606976-1721555640184@3c-app-gmx-bap52>
Hi Frank,
On 2024-07-21 09:54, Frank Wunderlich wrote:
> regards Frank
>
>
>> Gesendet: Sonntag, 21. Juli 2024 um 11:17 Uhr
>> Von: "Andreas Ziegler" <br015@umbiko.net>
>> An: frank-w@public-files.de
>> Cc: "buildroot" <buildroot@buildroot.org>
>> Betreff: Re: lvm2 seems to require systemd
>>
>> Hi Frank,
>>
>> On 2024-07-20 14:34, Frank Wunderlich wrote:
>> > 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
>>
>> 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"
>>
>> > 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
>> >
>> > 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)?
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
>
>> #!/bin/sh
>> prg=$1
>> shift
>> (
>> $prg $@ < /dev/zero > /tmp/error.log 2>&1
>> )&
>
>> Kind regards,
>> Andreas
>>
>> > regards Frank
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2024-07-21 10:16 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.12142.1721505316.24059.buildroot@buildroot.org>
2024-07-21 9:17 ` [Buildroot] lvm2 seems to require systemd Andreas Ziegler
2024-07-21 9:54 ` Frank Wunderlich via buildroot
2024-07-21 10:16 ` Andreas Ziegler [this message]
2024-07-21 15:50 ` Frank Wunderlich via buildroot
2024-07-21 17:58 ` Andreas Ziegler
2024-07-21 19:37 ` Frank Wunderlich via buildroot
2024-07-22 5:15 ` Andreas Ziegler
2024-07-30 9:50 ` Frank Wunderlich via buildroot
2024-07-30 11:39 ` Andreas Ziegler
2024-07-30 15:49 ` Frank Wunderlich via buildroot
2024-07-20 12:34 Frank Wunderlich via buildroot
2024-07-20 19:49 ` Frank Wunderlich via buildroot
2024-07-22 7:58 ` Arnout Vandecappelle via buildroot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e00d6149cbd2bd2a5a672fcf0323c814@umbiko.net \
--to=br015@umbiko.net \
--cc=buildroot@buildroot.org \
--cc=frank-w@public-files.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.