Commit 4b9202b
committed
blockdev: Add Device::root_disk() to find the whole-disk ancestor
Add a root_disk() method that walks the parent chain via lsblk
--inverse to find the root (whole disk) device, then refreshes it
to populate its actual children (partitions).
This is needed by callers that start from a partition device (e.g.
from list_dev_by_dir on /sysroot) and need to find sibling
partitions such as the ESP.
Assisted-by: Claude Code (Opus 4)
Signed-off-by: ckyrouac <ckyrouac@redhat.com>1 parent 62ea078 commit 4b9202b
1 file changed
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
187 | 218 | | |
188 | 219 | | |
189 | 220 | | |
| |||
0 commit comments