Skip to content

Commit

Permalink
devices: add new vg_partition parameter
Browse files Browse the repository at this point in the history
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 `vg_partition` is added and the parent VG
is found via the partition number of the full image similar to
the `partnum` from osbuild#1501

So a manifest 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",
      "vg_partnum": 4
    }
  }
}
```
  • Loading branch information
achilleas-k authored and mvo5 committed Aug 26, 2024
1 parent 2a7867e commit 5ab30a3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions devices/org.osbuild.lvm2.lv
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ SCHEMA = """
"volume": {
"type": "string",
"description": "Logical volume to active"
},
"vg_partition": {
"type": "number",
"description": "Partition on the parent device where the LV's volume group is located"
}
}
"""
Expand Down Expand Up @@ -182,6 +186,9 @@ class LVService(devices.DeviceService):

# Find the volume group that belongs to the device specified
# via `parent`
part = options.get("vg_partition")
if part:
parent_path += f"p{part}"
vg = self.volume_group_for_device(parent_path)

# Activate the logical volume
Expand Down

0 comments on commit 5ab30a3

Please sign in to comment.