File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
bib/cmd/bootc-image-builder Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 7
7
"math"
8
8
"math/big"
9
9
"math/rand"
10
+ "path/filepath"
10
11
"slices"
11
12
"strconv"
12
13
"strings"
@@ -251,6 +252,28 @@ func genPartitionTable(c *ManifestConfig, customizations *blueprint.Customizatio
251
252
}
252
253
}
253
254
255
+ if c .SourceInfo != nil && c .SourceInfo .KernelInfo != nil && c .SourceInfo .KernelInfo .HasAbootImg {
256
+ idx := slices .IndexFunc (partitionTable .Partitions , func (part disk.Partition ) bool {
257
+ // The aboot support in ostree supports both traditional android verified boot and
258
+ // ukiboot. For aboot, the partition is labeled "boot_a", as described in
259
+ // https://source.android.com/docs/core/ota/ab/ab_implement
260
+ // For ukibooot (https://gitlab.com/CentOS/automotive/src/ukiboot) the partition
261
+ // either has label ukiboot_a (GPT) or type 0x46 (MBR).
262
+ return part .Label == "boot_a" || part .Label == "ukiboot_a" || part .Type == "46"
263
+ })
264
+ if idx >= 0 {
265
+ sourcePipeline := "build"
266
+ if c .BuildSourceInfo != nil {
267
+ sourcePipeline = "target"
268
+ }
269
+
270
+ partitionTable .Partitions [idx ].Payload = & disk.Raw {
271
+ SourcePipeline : sourcePipeline ,
272
+ SourcePath : filepath .Join ("/usr/lib/modules/" , c .SourceInfo .KernelInfo .Version , "aboot.img" ),
273
+ }
274
+ }
275
+ }
276
+
254
277
return partitionTable , nil
255
278
}
256
279
You can’t perform that action at this time.
0 commit comments