Skip to content

Commit

Permalink
iot-raw-image: change partition table to DOS
Browse files Browse the repository at this point in the history
For parity with ImageFactory built images there should be only a DOS
partition table in the raw images, with a non-standard ID set for the
boot partition for Raspberry Pi compatibility.

This only applies to the aarch64 images.

As noted in #3220.
  • Loading branch information
supakeen authored and ondrejbudai committed Mar 20, 2023
1 parent 39879a9 commit 92cdb0f
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 228 deletions.
25 changes: 7 additions & 18 deletions internal/distro/fedora/partition_tables.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,27 +155,17 @@ var iotBasePartitionTables = distro.BasePartitionTableMap{
},
},
distro.Aarch64ArchName: disk.PartitionTable{
UUID: "D209C89E-EA5E-4FBD-B161-B461CCE297E0",
Type: "gpt",
UUID: "0xc1748067",
Type: "dos",
Partitions: []disk.Partition{
{
Size: 501 * common.MebiByte, // 501 MiB
Type: disk.EFISystemPartitionGUID,
UUID: disk.EFISystemPartitionUUID,
Payload: &disk.Filesystem{
Type: "vfat",
UUID: disk.EFIFilesystemUUID,
Mountpoint: "/boot/efi",
Label: "EFI-SYSTEM",
FSTabOptions: "umask=0077,shortname=winnt",
FSTabFreq: 0,
FSTabPassNo: 2,
},
Size: 501 * common.MebiByte, // 501 MiB
Type: "06",
Bootable: true,
},
{
Size: 1 * common.GibiByte, // 1 GiB
Type: disk.FilesystemDataGUID,
UUID: disk.FilesystemDataUUID,
Type: "83",
Payload: &disk.Filesystem{
Type: "ext4",
Mountpoint: "/boot",
Expand All @@ -187,8 +177,7 @@ var iotBasePartitionTables = distro.BasePartitionTableMap{
},
{
Size: 2569 * common.MebiByte, // 2.5 GiB
Type: disk.FilesystemDataGUID,
UUID: disk.RootPartitionUUID,
Type: "83",
Payload: &disk.Filesystem{
Type: "ext4",
Label: "root",
Expand Down
79 changes: 9 additions & 70 deletions test/data/manifests/fedora_36-aarch64-iot_raw_image-boot.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,6 @@
}
}
},
{
"id": "sha256:8aa090f3e7647b8f9fea241410b96277e8f9577da1b86f868681584aceeba400",
"options": {
"metadata": {
"rpm.check_gpg": true
}
}
},
{
"id": "sha256:8742c24ce33c2df36bba94451a96eee6fe9a95a2524c0985125953cbe610014c",
"options": {
Expand Down Expand Up @@ -2144,13 +2136,6 @@
"options": "defaults",
"freq": 1,
"passno": 2
},
{
"uuid": "7B77-95E7",
"vfs_type": "vfat",
"path": "/boot/efi",
"options": "umask=0077,shortname=winnt",
"passno": 2
}
]
},
Expand Down Expand Up @@ -2289,26 +2274,24 @@
{
"type": "org.osbuild.sfdisk",
"options": {
"label": "gpt",
"uuid": "D209C89E-EA5E-4FBD-B161-B461CCE297E0",
"label": "dos",
"uuid": "0xc1748067",
"partitions": [
{
"bootable": true,
"size": 1026048,
"start": 2048,
"type": "C12A7328-F81F-11D2-BA4B-00A0C93EC93B",
"uuid": "68B2905B-DF3E-4FB3-80FA-49D1E773AA33"
"type": "06"
},
{
"size": 2097152,
"start": 1028096,
"type": "0FC63DAF-8483-4772-8E79-3D69D8477DE4",
"uuid": "CB07C243-BC44-4717-853E-28852021225B"
"type": "83"
},
{
"size": 5263327,
"size": 5263360,
"start": 3125248,
"type": "0FC63DAF-8483-4772-8E79-3D69D8477DE4",
"uuid": "6264D520-3FB9-423F-8AB8-7A0A8E3D3562"
"type": "83"
}
]
},
Expand All @@ -2322,23 +2305,6 @@
}
}
},
{
"type": "org.osbuild.mkfs.fat",
"options": {
"volid": "7B7795E7"
},
"devices": {
"device": {
"type": "org.osbuild.loopback",
"options": {
"filename": "disk.img",
"start": 2048,
"size": 1026048,
"lock": true
}
}
}
},
{
"type": "org.osbuild.mkfs.ext4",
"options": {
Expand Down Expand Up @@ -2369,7 +2335,7 @@
"options": {
"filename": "disk.img",
"start": 3125248,
"size": 5263327,
"size": 5263360,
"lock": true
}
}
Expand Down Expand Up @@ -2403,20 +2369,12 @@
"size": 2097152
}
},
"boot.efi": {
"type": "org.osbuild.loopback",
"options": {
"filename": "disk.img",
"start": 2048,
"size": 1026048
}
},
"root": {
"type": "org.osbuild.loopback",
"options": {
"filename": "disk.img",
"start": 3125248,
"size": 5263327
"size": 5263360
}
}
},
Expand All @@ -2432,12 +2390,6 @@
"type": "org.osbuild.ext4",
"source": "boot",
"target": "/boot"
},
{
"name": "boot.efi",
"type": "org.osbuild.fat",
"source": "boot.efi",
"target": "/boot/efi"
}
]
}
Expand Down Expand Up @@ -2872,9 +2824,6 @@
"sha256:8a929fce4cf768b44b6fc0a548b89f84d2a26d46f1edb863d037defc372ff054": {
"url": "https://rpmrepo.osbuild.org/v2/mirror/public/f36/f36-aarch64-fedora-20220617/Packages/z/zlib-1.2.11-31.fc36.aarch64.rpm"
},
"sha256:8aa090f3e7647b8f9fea241410b96277e8f9577da1b86f868681584aceeba400": {
"url": "https://rpmrepo.osbuild.org/v2/mirror/public/f36/f36-aarch64-fedora-20220617/Packages/d/dosfstools-4.2-3.fc36.aarch64.rpm"
},
"sha256:8c0ed9385ccb82bec74755e2ba3977a1edecfc449998b88e03e1096f8f5084d0": {
"url": "https://rpmrepo.osbuild.org/v2/mirror/public/f36/f36-aarch64-fedora-20220617/Packages/l/libnfnetlink-1.0.1-21.fc36.aarch64.rpm"
},
Expand Down Expand Up @@ -3391,16 +3340,6 @@
"checksum": "sha256:dbd082622d6f4310d289f4959d3c00f389cbd270ba85e2bc6b38376a181a1d64",
"check_gpg": true
},
{
"name": "dosfstools",
"epoch": 0,
"version": "4.2",
"release": "3.fc36",
"arch": "aarch64",
"remote_location": "https://rpmrepo.osbuild.org/v2/mirror/public/f36/f36-aarch64-fedora-20220617/Packages/d/dosfstools-4.2-3.fc36.aarch64.rpm",
"checksum": "sha256:8aa090f3e7647b8f9fea241410b96277e8f9577da1b86f868681584aceeba400",
"check_gpg": true
},
{
"name": "dracut",
"epoch": 0,
Expand Down
79 changes: 9 additions & 70 deletions test/data/manifests/fedora_37-aarch64-iot_raw_image-boot.json
Original file line number Diff line number Diff line change
Expand Up @@ -280,14 +280,6 @@
}
}
},
{
"id": "sha256:caf01590a095a0ded437ff9a6100de6b2a9d5c638c0d8df218685e9ca049a257",
"options": {
"metadata": {
"rpm.check_gpg": true
}
}
},
{
"id": "sha256:e4716da965a3141394efc6cfca127880bbab451c7cb285bfc48d1911d8402164",
"options": {
Expand Down Expand Up @@ -2160,13 +2152,6 @@
"options": "defaults",
"freq": 1,
"passno": 2
},
{
"uuid": "7B77-95E7",
"vfs_type": "vfat",
"path": "/boot/efi",
"options": "umask=0077,shortname=winnt",
"passno": 2
}
]
},
Expand Down Expand Up @@ -2305,26 +2290,24 @@
{
"type": "org.osbuild.sfdisk",
"options": {
"label": "gpt",
"uuid": "D209C89E-EA5E-4FBD-B161-B461CCE297E0",
"label": "dos",
"uuid": "0xc1748067",
"partitions": [
{
"bootable": true,
"size": 1026048,
"start": 2048,
"type": "C12A7328-F81F-11D2-BA4B-00A0C93EC93B",
"uuid": "68B2905B-DF3E-4FB3-80FA-49D1E773AA33"
"type": "06"
},
{
"size": 2097152,
"start": 1028096,
"type": "0FC63DAF-8483-4772-8E79-3D69D8477DE4",
"uuid": "CB07C243-BC44-4717-853E-28852021225B"
"type": "83"
},
{
"size": 5263327,
"size": 5263360,
"start": 3125248,
"type": "0FC63DAF-8483-4772-8E79-3D69D8477DE4",
"uuid": "6264D520-3FB9-423F-8AB8-7A0A8E3D3562"
"type": "83"
}
]
},
Expand All @@ -2338,23 +2321,6 @@
}
}
},
{
"type": "org.osbuild.mkfs.fat",
"options": {
"volid": "7B7795E7"
},
"devices": {
"device": {
"type": "org.osbuild.loopback",
"options": {
"filename": "disk.img",
"start": 2048,
"size": 1026048,
"lock": true
}
}
}
},
{
"type": "org.osbuild.mkfs.ext4",
"options": {
Expand Down Expand Up @@ -2385,7 +2351,7 @@
"options": {
"filename": "disk.img",
"start": 3125248,
"size": 5263327,
"size": 5263360,
"lock": true
}
}
Expand Down Expand Up @@ -2419,20 +2385,12 @@
"size": 2097152
}
},
"boot.efi": {
"type": "org.osbuild.loopback",
"options": {
"filename": "disk.img",
"start": 2048,
"size": 1026048
}
},
"root": {
"type": "org.osbuild.loopback",
"options": {
"filename": "disk.img",
"start": 3125248,
"size": 5263327
"size": 5263360
}
}
},
Expand All @@ -2448,12 +2406,6 @@
"type": "org.osbuild.ext4",
"source": "boot",
"target": "/boot"
},
{
"name": "boot.efi",
"type": "org.osbuild.fat",
"source": "boot.efi",
"target": "/boot/efi"
}
]
}
Expand Down Expand Up @@ -3056,9 +3008,6 @@
"sha256:c9a351964d88b8f4162b8349c7ef8c5aae3e56b53f2f9f4acc081c1d998bbb39": {
"url": "https://rpmrepo.osbuild.org/v2/mirror/public/f37/f37-aarch64-fedora-development-20221025/Packages/a/aardvark-dns-1.1.0-1.fc37.aarch64.rpm"
},
"sha256:caf01590a095a0ded437ff9a6100de6b2a9d5c638c0d8df218685e9ca049a257": {
"url": "https://rpmrepo.osbuild.org/v2/mirror/public/f37/f37-aarch64-fedora-development-20221025/Packages/d/dosfstools-4.2-4.fc37.aarch64.rpm"
},
"sha256:ccf0d18c15586c0a7ad9e7e69551fa9b997c25970701b5e635a981878c8a9dfe": {
"url": "https://rpmrepo.osbuild.org/v2/mirror/public/f37/f37-aarch64-fedora-development-20221025/Packages/i/iptables-libs-1.8.8-3.fc37.aarch64.rpm"
},
Expand Down Expand Up @@ -3539,16 +3488,6 @@
"checksum": "sha256:2b34436e8003d7d1ab95f9a16db3ee455f571c56bf06a4833771046810dd5368",
"check_gpg": true
},
{
"name": "dosfstools",
"epoch": 0,
"version": "4.2",
"release": "4.fc37",
"arch": "aarch64",
"remote_location": "https://rpmrepo.osbuild.org/v2/mirror/public/f37/f37-aarch64-fedora-development-20221025/Packages/d/dosfstools-4.2-4.fc37.aarch64.rpm",
"checksum": "sha256:caf01590a095a0ded437ff9a6100de6b2a9d5c638c0d8df218685e9ca049a257",
"check_gpg": true
},
{
"name": "dracut",
"epoch": 0,
Expand Down
Loading

0 comments on commit 92cdb0f

Please sign in to comment.