Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 718910 - sys-fs/lvm2 - change "device-mapper-only" to "lvm"
Summary: sys-fs/lvm2 - change "device-mapper-only" to "lvm"
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
Depends on:
Reported: 2020-04-22 16:48 UTC by jan vereecke
Modified: 2020-04-27 18:20 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description jan vereecke 2020-04-22 16:48:36 UTC
I am trying to create a system without lvm, and build udesks with -lvm flag.
udesks does not pull in lvm because of the -lvm flag, but it pulls in libblockdev with mandatory cryptsetup use flag.
libblockdev pulls in sys-fs/cryptsetup.
sys-fs/cryptsetup then unconditionally pulls in lvm2.
This should not happen. and can be prevented by having cryptsetup honor the lvm flag.

Reproducible: Always

Steps to Reproduce:
1. set USE="-lvm" in make.conf
2. emerge -uDN udisks
3. lvm2 is pulled in due to cryptsetup.
Actual Results:  
sys-fs/lvm2 is emerged even when use flag -lvm says it should not be.

Expected Results:  
USE flag -lvm in make.conf should make sure that package lvm is never emerged.
Comment 1 Lars Wendler (Polynomial-C) gentoo-dev 2020-04-22 17:24:46 UTC
I do not see a possibility to make lvm optional in sys-fs/cryptsetup. There's a non-optional configure check for libdevmapper which belongs to sys-fs/lvm2:

The only other solution I can see here is to install sys-fs/lvm2 with USE="device-mapper-only" which does what the USE flag says, it's only installing device-mapper stuff. Would that be a feasible alternative to you?
Comment 2 jan vereecke 2020-04-26 16:48:54 UTC
This would meet the goal of removing parts that are unnecessary bloat, while keeping essential functionality.

My concern with this kind of use flags is twofold: 
They are relatively hard to understand for someone who does not delve deeply in the details of a package, so that means that the meaning of this use flag may need some more description that just 'emerges the device mapper only'.
So if I want to globally set -lvm, I may understand what logical volumes are, as they are something on a user level, but not what the device mapper is, as that is more of an implementation issue. Also the relation to the global -lvm flag may not be clear.

The second concern is that according to its name this is one flag that enables/disable two things: the logical volume management  and the device mapper. I believe there is more flexibility to have one flag for each thing that you want to enable/disable.

So I guess there should be in fact two local flags: lvm and device-mapper with the semantics that the first emerges the 'logical volumes' and the second the device mapper'.

They would have the following relation in the lvm2 ebuild:
if lvm is set, then device-mapper must be set.
if lvm is unset, then device mapper is free to be enabled, and can be required by depending packages.

In this way, cryptsetup can specify it requires sys-fs/lvm2[device-mapper]. This is more logical than requiring sys-fs/cryptsetup[device-mapper-only].
Comment 3 Mike Gilbert gentoo-dev 2020-04-26 18:14:27 UTC
(In reply to jan vereecke from comment #2)

What would happen if the user has USE="-lvm -device-mapper"? I suspect we would end up installing nothing, which doesn't make any sense. I think the "device-mapper" USE flag would serve no useful purpose.

However, changing "device-mapper-only" to "lvm" and inverting its logic definitely makes sense. Enabling USE flags should add functionality, not remove it.
Comment 4 jan vereecke 2020-04-27 18:20:20 UTC
That would work and makes sense. packages such as cryptsetup would then only depend on sys-fs/lvm2, whereas packages requiring lvm functionality would need sys-fs/lvm2[lvm], and it would follow the global meaning of the lvm flag.