Skip to content

Commit

Permalink
devices: add new vg_partnum 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_partnum` is added and the parent VG
is found via the partition number of the full image similar to
the `partnum` from osbuild#1501

A manifest using this feature looks like this:
```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
    }
  }
}
```

Co-authored-by: Michael Vogt <mvogt@redhat.com>
  • Loading branch information
achilleas-k and mvo5 committed Aug 26, 2024
1 parent 2a7867e commit 7149f1e
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_partnum": {
"type": "number",
"description": "Partition number 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_partnum")
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 7149f1e

Please sign in to comment.