diff options
author | Jiyong Park <jiyong@google.com> | 2021-03-05 18:58:29 +0900 |
---|---|---|
committer | Jiyong Park <jiyong@google.com> | 2021-03-08 09:12:17 +0900 |
commit | 81aea9a0f2eb5d00d54e9bca3ceac883ef86cc6d (patch) | |
tree | 75e61886f501cfee026a86452adfcf4dec319c08 /filesystem | |
parent | 6d3e72688729ea72bf64f1e7dacccc5b57f384be (diff) |
bootimg supports v4 header
It's the latest version of android boot image header which supports
bootconfig. Bootconfig parameters are now passed via `bootconfig`
property.
Bug: 181936566
Test: m microdroid_boot
Change-Id: Iff8697434f7502fe56fca5bce5573e53f2f6ac60
Diffstat (limited to 'filesystem')
-rw-r--r-- | filesystem/bootimg.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/filesystem/bootimg.go b/filesystem/bootimg.go index 764f0452b..4e587377e 100644 --- a/filesystem/bootimg.go +++ b/filesystem/bootimg.go @@ -62,6 +62,10 @@ type bootimgProperties struct { // Optional kernel commandline Cmdline *string + // File that contains bootconfig parameters. This can be set only when `vendor_boot` is true + // and `header_version` is greater than or equal to 4. + Bootconfig *string `android:"arch_variant,path"` + // When set to true, sign the image with avbtool. Default is false. Use_avb *bool @@ -189,6 +193,19 @@ func (b *bootimg) buildBootImage(ctx android.ModuleContext, vendor bool) android return output } + bootconfig := proptools.String(b.properties.Bootconfig) + if bootconfig != "" { + if !vendor { + ctx.PropertyErrorf("bootconfig", "requires vendor_boot: true") + return output + } + if verNum < 4 { + ctx.PropertyErrorf("bootconfig", "requires header_version: 4 or later") + return output + } + cmd.FlagWithInput("--vendor_bootconfig ", android.PathForModuleSrc(ctx, bootconfig)) + } + flag := "--output " if vendor { flag = "--vendor_boot " |