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:
Ondřej Budai 2020-12-14 22:39:01 +01:00 committed by Ondřej Budai
parent d52c1ea1f8
commit ae0d1b8663
2 changed files with 38 additions and 4 deletions

View file

@ -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