Remove hashtree from builtin APEXes

Builtin APEXes (/system, ...) don't need hashtree.
So if we remove hashtree from builtin APEXes we can save more space in
/system.

However, this change only affects to the apex bundles which are built
from source, not from prebuilts.
Removing hashtree from prebuilts will be handled in a follow CL.

Bug: 139957269
Test: m
Test: see if /system/apex/*.apex have hashtree
Change-Id: Id755382b2153bf6bbaf2c480f3bbb91b6f62a564
This commit is contained in:
Jooyung Han 2019-08-28 00:27:35 +09:00
parent 2569cc5026
commit e65ed7cd67

View file

@ -1211,6 +1211,13 @@ func (a *apexBundle) buildUnflattenedApex(ctx android.ModuleContext, apexType ap
optFlags = append(optFlags, "--assets_dir "+filepath.Dir(noticeFile.String())) optFlags = append(optFlags, "--assets_dir "+filepath.Dir(noticeFile.String()))
} }
if !ctx.Config().UnbundledBuild() && a.installable() {
// Apexes which are supposed to be installed in builtin dirs(/system, etc)
// don't need hashtree for activation. Therefore, by removing hashtree from
// apex bundle (filesystem image in it, to be specific), we can save storage.
optFlags = append(optFlags, "--no_hashtree")
}
ctx.Build(pctx, android.BuildParams{ ctx.Build(pctx, android.BuildParams{
Rule: apexRule, Rule: apexRule,
Implicits: implicitInputs, Implicits: implicitInputs,