Rename test_only_no_hashtree to generate_hashtree
In order not to introduce any changes in the system image default value of generate_hashtree is currently set to false. Once all the APEXes that shouldn't have hashtree enable (i.e. non-updatable ones) explicitly set `generate_hashtree: false` default value will be switched to true. Test: checked that are no diffs between ${OUT}/system/apex without this change and with this change. Test: m Bug: 190621617 Change-Id: I5a3144f8f6ea7dee25678af43e2b07a8c85daa9e
This commit is contained in:
parent
f8b55cd51e
commit
da6dc31389
13
apex/apex.go
13
apex/apex.go
|
@ -165,9 +165,10 @@ type apexBundleProperties struct {
|
||||||
// Default is false.
|
// Default is false.
|
||||||
Ignore_system_library_special_case *bool
|
Ignore_system_library_special_case *bool
|
||||||
|
|
||||||
// Whenever apex_payload.img of the APEX should include dm-verity hashtree. Should be only
|
// Whenever apex_payload.img of the APEX should include dm-verity hashtree.
|
||||||
// used in tests.
|
// Default value is false.
|
||||||
Test_only_no_hashtree *bool
|
// TODO(b/190621617): change default value to true.
|
||||||
|
Generate_hashtree *bool
|
||||||
|
|
||||||
// Whenever apex_payload.img of the APEX should not be dm-verity signed. Should be only
|
// Whenever apex_payload.img of the APEX should not be dm-verity signed. Should be only
|
||||||
// used in tests.
|
// used in tests.
|
||||||
|
@ -1268,9 +1269,9 @@ func (a *apexBundle) installable() bool {
|
||||||
return !a.properties.PreventInstall && (a.properties.Installable == nil || proptools.Bool(a.properties.Installable))
|
return !a.properties.PreventInstall && (a.properties.Installable == nil || proptools.Bool(a.properties.Installable))
|
||||||
}
|
}
|
||||||
|
|
||||||
// See the test_only_no_hashtree property
|
// See the generate_hashtree property
|
||||||
func (a *apexBundle) testOnlyShouldSkipHashtreeGeneration() bool {
|
func (a *apexBundle) shouldGenerateHashtree() bool {
|
||||||
return proptools.Bool(a.properties.Test_only_no_hashtree)
|
return proptools.BoolDefault(a.properties.Generate_hashtree, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
// See the test_only_unsigned_payload property
|
// See the test_only_unsigned_payload property
|
||||||
|
|
|
@ -629,11 +629,7 @@ func (a *apexBundle) buildUnflattenedApex(ctx android.ModuleContext) {
|
||||||
optFlags = append(optFlags, "--assets_dir "+filepath.Dir(a.mergedNotices.HtmlGzOutput.String()))
|
optFlags = append(optFlags, "--assets_dir "+filepath.Dir(a.mergedNotices.HtmlGzOutput.String()))
|
||||||
}
|
}
|
||||||
|
|
||||||
if ctx.ModuleDir() != "system/apex/apexd/apexd_testdata" && ctx.ModuleDir() != "system/apex/shim/build" && a.testOnlyShouldSkipHashtreeGeneration() {
|
if (moduleMinSdkVersion.GreaterThan(android.SdkVersion_Android10) && !a.shouldGenerateHashtree()) && !compressionEnabled {
|
||||||
ctx.PropertyErrorf("test_only_no_hashtree", "not available")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (moduleMinSdkVersion.GreaterThan(android.SdkVersion_Android10) || a.testOnlyShouldSkipHashtreeGeneration()) && !compressionEnabled {
|
|
||||||
// Apexes which are supposed to be installed in builtin dirs(/system, etc)
|
// Apexes which are supposed to be installed in builtin dirs(/system, etc)
|
||||||
// don't need hashtree for activation. Therefore, by removing hashtree from
|
// don't need hashtree for activation. Therefore, by removing hashtree from
|
||||||
// apex bundle (filesystem image in it, to be specific), we can save storage.
|
// apex bundle (filesystem image in it, to be specific), we can save storage.
|
||||||
|
|
Loading…
Reference in New Issue