Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
devices: add detectpv option to lvm2.lv to auto-discover PV
This is needed for bootc where all mounts need to be from the same physical disk/loop so that bootupd works. The idea is that in the manifest the new option `detectv` is added and the parent device is the full disk instead of the PV partition that is currently used and that results in multiple loop devices for each partition. So a manifest now looks like: ```json "devices": { "disk": { "type": "org.osbuild.loopback", "options": { "filename": "disk.raw", "partscan": true } }, "rootlv": { "type": "org.osbuild.lvm2.lv", "parent": "disk", "options": { "volume": "rootlv", "detectpv": true } } }, ``` instead of the alternative way via the partition (like this): ```json "devices": { "device": { "type": "org.osbuild.lvm2.lv", "parent": "rootvg", "options": { "volume": "rootlv" } }, "rootvg": { "type": "org.osbuild.loopback", "options": { "filename": "disk.raw", "start": 3127296, "size": 17844191, "lock": true } } } ``` The approach via `detectpv` means that it is impossible to put two identically named logical volume in two different volume groups on the same "physical" disk (loop-device). If this is a problem we need a different approach, we could create the `vg_name` in `org.osbuild.lvm2.create` in a predicatable but non-clashing way, e.g. it could be a `{filename}-{start}-{size}` and we would add the name to `org.osbuild.lvm2.lv` in options. This would still mean that we cannot do two LVM builds in parallel on the same host with identical `{filename}-{start}-{size}` so also not an ideal solution. Or we just put a random vg_name in the manifest but that also means no parallel image builds for the same manifest on the same host.
- Loading branch information