Skip to content

Commit e5a3379

Browse files
imguoguomvo5
authored andcommitted
feat: add support for RISC-V architecture in disk image and partition table
1 parent d43ee73 commit e5a3379

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

bib/cmd/bootc-image-builder/image.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,15 @@ func manifestForDiskImage(c *ManifestConfig, rng *rand.Rand) (*manifest.Manifest
411411
},
412412
BIOS: true,
413413
}
414+
case arch.ARCH_RISCV64:
415+
img.Platform = &platform.RISCV64{
416+
UEFIVendor: "fedora",
417+
BasePlatform: platform.BasePlatform{
418+
QCOW2Compat: "1.1",
419+
},
420+
}
414421
}
422+
415423

416424
if kopts := customizations.GetKernel(); kopts != nil && kopts.Append != "" {
417425
img.OSCustomizations.KernelOptionsAppend = append(img.OSCustomizations.KernelOptionsAppend, kopts.Append)
@@ -581,6 +589,13 @@ func manifestForISO(c *ManifestConfig, rng *rand.Rand) (*manifest.Manifest, erro
581589
ImageFormat: platform.FORMAT_ISO,
582590
},
583591
}
592+
case arch.ARCH_RISCV64:
593+
img.Platform = &platform.RISCV64{
594+
BasePlatform: platform.BasePlatform{
595+
ImageFormat: platform.FORMAT_ISO,
596+
},
597+
UEFIVendor: c.SourceInfo.UEFIVendor,
598+
}
584599
default:
585600
return nil, fmt.Errorf("unsupported architecture %v", c.Architecture)
586601
}

bib/cmd/bootc-image-builder/partition_tables.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,4 +127,13 @@ var partitionTables = distro.BasePartitionTableMap{
127127
rootPartition,
128128
},
129129
},
130+
arch.ARCH_RISCV64.String(): disk.PartitionTable{
131+
UUID: diskUuidOfUnknownOrigin,
132+
Type: disk.PT_GPT,
133+
Partitions: []disk.Partition{
134+
efiPartition,
135+
bootPartition,
136+
rootPartition,
137+
},
138+
},
130139
}

0 commit comments

Comments
 (0)