Skip to content

Commit

Permalink
minimal-raw/fedora: Add offset to partitions
Browse files Browse the repository at this point in the history
A number of edge devices, in most cases pre-prod that may be on
the edge of proper certification, need to write the firmware to
the beginning of the storage, while this is far from ideal the
default 2048 blocks (1Mb) is generally not enough and it means
when the firmware is written out we will zap the EFI ESP
partition so let's start this with an offset of 1Mb for
these images to ensure we have enough space for those (hopefully
rare) use cases.

Signed-off-by: Peter Robinson <[email protected]>
  • Loading branch information
nullr0ute committed Aug 31, 2023
1 parent c7158db commit 94b8891
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/distro/fedora/distro.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ var (
buildPipelines: []string{"build"},
payloadPipelines: []string{"os", "image", "xz"},
exports: []string{"xz"},
basePartitionTables: defaultBasePartitionTables,
basePartitionTables: minimalrawPartitionTables,
}
)

Expand Down
95 changes: 95 additions & 0 deletions pkg/distro/fedora/partition_tables.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,101 @@ var defaultBasePartitionTables = distro.BasePartitionTableMap{
},
}

var minimalrawPartitionTables = distro.BasePartitionTableMap{
platform.ARCH_X86_64.String(): disk.PartitionTable{
UUID: "D209C89E-EA5E-4FBD-B161-B461CCE297E0",
Type: "gpt",
Partitions: []disk.Partition{
{
Size: 200 * common.MebiByte,
Type: disk.EFISystemPartitionGUID,
UUID: disk.EFISystemPartitionUUID,
Payload: &disk.Filesystem{
Start: 8192,

Check failure on line 121 in pkg/distro/fedora/partition_tables.go

View workflow job for this annotation

GitHub Actions / ⌨ Lint

unknown field 'Start' in struct literal of type disk.Filesystem

Check failure on line 121 in pkg/distro/fedora/partition_tables.go

View workflow job for this annotation

GitHub Actions / ⌨ Lint

unknown field 'Start' in struct literal of type disk.Filesystem
Type: "vfat",
UUID: disk.EFIFilesystemUUID,
Mountpoint: "/boot/efi",
Label: "EFI-SYSTEM",
FSTabOptions: "defaults,uid=0,gid=0,umask=077,shortname=winnt",
FSTabFreq: 0,
FSTabPassNo: 2,
},
},
{
Size: 500 * common.MebiByte,
Type: disk.XBootLDRPartitionGUID,
UUID: disk.FilesystemDataUUID,
Payload: &disk.Filesystem{
Type: "ext4",
Mountpoint: "/boot",
Label: "boot",
FSTabOptions: "defaults",
FSTabFreq: 0,
FSTabPassNo: 0,
},
},
{
Size: 2 * common.GibiByte,
Type: disk.FilesystemDataGUID,
UUID: disk.RootPartitionUUID,
Payload: &disk.Filesystem{
Type: "ext4",
Label: "root",
Mountpoint: "/",
FSTabOptions: "defaults",
FSTabFreq: 0,
FSTabPassNo: 0,
},
},
},
},
platform.ARCH_AARCH64.String(): disk.PartitionTable{
UUID: "0xc1748067",
Type: "dos",
Partitions: []disk.Partition{
{
Size: 200 * common.MebiByte,
Type: "06",
Bootable: true,
Payload: &disk.Filesystem{
Start: 8192,

Check failure on line 168 in pkg/distro/fedora/partition_tables.go

View workflow job for this annotation

GitHub Actions / ⌨ Lint

unknown field 'Start' in struct literal of type disk.Filesystem (typecheck)

Check failure on line 168 in pkg/distro/fedora/partition_tables.go

View workflow job for this annotation

GitHub Actions / ⌨ Lint

unknown field 'Start' in struct literal of type disk.Filesystem) (typecheck)
Type: "vfat",
UUID: disk.EFIFilesystemUUID,
Mountpoint: "/boot/efi",
Label: "EFI-SYSTEM",
FSTabOptions: "defaults,uid=0,gid=0,umask=077,shortname=winnt",
FSTabFreq: 0,
FSTabPassNo: 2,
},
},
{
Size: 500 * common.MebiByte,
Type: "83",
Payload: &disk.Filesystem{
Type: "ext4",
Mountpoint: "/boot",
Label: "boot",
FSTabOptions: "defaults",
FSTabFreq: 0,
FSTabPassNo: 0,
},
},
{
Size: 2 * common.GibiByte,
Type: "83",
Payload: &disk.Filesystem{
Type: "ext4",
Label: "root",
Mountpoint: "/",
FSTabOptions: "defaults",
FSTabFreq: 0,
FSTabPassNo: 0,
},
},
},
},
}

var iotBasePartitionTables = distro.BasePartitionTableMap{
platform.ARCH_X86_64.String(): disk.PartitionTable{
UUID: "D209C89E-EA5E-4FBD-B161-B461CCE297E0",
Expand Down

0 comments on commit 94b8891

Please sign in to comment.