distro/rhel84: remove hardcoded root partition UUIDs
Let's use the root partition UUID from the partition table instead of hardcoding the value. Signed-off-by: Ondřej Budai <ondrej@budai.cz>
This commit is contained in:
parent
d52c1ea1f8
commit
ae0d1b8663
2 changed files with 38 additions and 4 deletions
|
|
@ -82,6 +82,23 @@ func (pt PartitionTable) FSTabStageOptions() *osbuild.FSTabStageOptions {
|
|||
return &options
|
||||
}
|
||||
|
||||
// Returns the root partition (the partition whose filesystem has / as
|
||||
// a mountpoint) of the partition table. Nil is returned if there's no such
|
||||
// partition.
|
||||
func (pt PartitionTable) RootPartition() *Partition {
|
||||
for _, p := range pt.Partitions {
|
||||
if p.Filesystem == nil {
|
||||
continue
|
||||
}
|
||||
|
||||
if p.Filesystem.Mountpoint == "/" {
|
||||
return &p
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Converts Partition to osbuild.QEMUPartition that encodes the same partition.
|
||||
func (p Partition) QEMUPartition() osbuild.QEMUPartition {
|
||||
var fs *osbuild.QEMUFilesystem
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue