Skip to content

Commit

Permalink
disk: introduce a constant for bios-based PReP partition type
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejbudai committed Dec 5, 2024
1 parent 3822db7 commit 1b04aa0
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions cmd/otk/osbuild-gen-partition-table/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ func TestGenPartitionTableIntegrationPPC(t *testing.T) {
Name: "ppc-boot",
Bootable: true,
Size: "4 MiB",
PartType: "41",
PartType: disk.DosPRePID,
PartUUID: "",
},
{
Expand Down Expand Up @@ -373,7 +373,7 @@ func TestGenPartitionTableIntegrationPPC(t *testing.T) {
Bootable: true,
Start: 1048576,
Size: 4194304,
Type: "41",
Type: disk.DosPRePID,
},
{
Start: 5242880,
Expand Down
3 changes: 3 additions & 0 deletions pkg/disk/disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ const (

// Partition type ID for swap
DosSwapID = "82"

// Partition type ID for PRep on dos
DosPRePID = "41"
)

// pt type -> type -> ID mapping for convenience
Expand Down
2 changes: 1 addition & 1 deletion pkg/disk/partition.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func (p *Partition) IsPReP() bool {
return false
}

return p.Type == "41" || p.Type == PRePartitionGUID
return p.Type == DosPRePID || p.Type == PRePartitionGUID
}

func (p *Partition) MarshalJSON() ([]byte, error) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/distro/fedora/partition_tables.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ var defaultBasePartitionTables = distro.BasePartitionTableMap{
Partitions: []disk.Partition{
{
Size: 4 * datasizes.MebiByte,
Type: "41",
Type: disk.DosPRePID,
Bootable: true,
},
{
Expand Down
2 changes: 1 addition & 1 deletion pkg/distro/rhel/rhel10/partition_tables.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func defaultBasePartitionTables(t *rhel.ImageType) (disk.PartitionTable, bool) {
Partitions: []disk.Partition{
{
Size: 4 * datasizes.MebiByte,
Type: "41",
Type: disk.DosPRePID,
Bootable: true,
},
{
Expand Down
2 changes: 1 addition & 1 deletion pkg/distro/rhel/rhel8/partition_tables.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func defaultBasePartitionTables(t *rhel.ImageType) (disk.PartitionTable, bool) {
Partitions: []disk.Partition{
{
Size: 4 * datasizes.MebiByte,
Type: "41",
Type: disk.DosPRePID,
Bootable: true,
},
{
Expand Down
2 changes: 1 addition & 1 deletion pkg/distro/rhel/rhel9/partition_tables.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ func defaultBasePartitionTables(t *rhel.ImageType) (disk.PartitionTable, bool) {
Partitions: []disk.Partition{
{
Size: 4 * datasizes.MebiByte,
Type: "41",
Type: disk.DosPRePID,
Bootable: true,
},
{
Expand Down

0 comments on commit 1b04aa0

Please sign in to comment.