Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
lvm2 initramfs activation conflicts with udev and systemd
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
ololoshwin
n00b
n00b


Joined: 25 Nov 2021
Posts: 8

PostPosted: Fri Mar 07, 2025 2:41 pm    Post subject: lvm2 initramfs activation conflicts with udev and systemd Reply with quote

Hello
I have custom initramfs to activate lvm volume for roof filesystem.

Everything works except warning in systemct:
dev-mapper-sys-root.device loaded activating tentative /dev/mapper/sys-root

This is because udev marked this device as not ready for systemd:
# udevadm info /dev/mapper/sys-root

E: DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG=1
E: DM_UDEV_DISABLE_DISK_RULES_FLAG=1
E: DM_UDEV_DISABLE_OTHER_RULES_FLAG=1
E: SYSTEMD_READY=0
E: TAGS=:systemd:
E: CURRENT_TAGS=:systemd:



How can I pass control over device to the udevd/systemd ?
Back to top
View user's profile Send private message
zen_desu
Apprentice
Apprentice


Joined: 25 Oct 2024
Posts: 248

PostPosted: Fri Mar 07, 2025 7:43 pm    Post subject: Reply with quote

https://github.com/desultory/ugrd/blob/main/src/ugrd/fs/fakeudev.py#L22


I'm not claiming this is perfect, and would appreciate any feedback on how this may be incorrect, but this is what I do in ugrd and it seems to work well enough.
Code:

    for dm in /sys/block/dm-*; do
        if [ ! -e "${dm}/uevent" ]; then
            continue
        fi
        source "${dm}/uevent"
        einfo "Faking udev for: ${DEVNAME}"
        udev_db_file="/run/udev/data/b${MAJOR}:${MINOR}"
        printf 'E:DM_UDEV_PRIMARY_SOURCE_FLAG=1\n' > "${udev_db_file}"
    done


More info at: https://github.com/desultory/ugrd/issues/181
https://github.com/lvmteam/lvm2/issues/153#issuecomment-2268468603
_________________
µgRD dev
Wiki writer
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum