From 61741e20a5c08a7ab8808b55681667e6298360ac Mon Sep 17 00:00:00 2001 From: Jose Galmes Date: Sun, 6 Feb 2022 22:06:23 -0800 Subject: [PATCH 1/2] Fix for duplicate modules across vendor and ramdisk snapshots. Bug: 215295121 Test: Generated snapshots and verified there are no duplicates. Change-Id: I6ba7deb4941e21d87578038de19ab313f2be539c --- rust/image.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rust/image.go b/rust/image.go index 5d57f1522..dfc7f7431 100644 --- a/rust/image.go +++ b/rust/image.go @@ -149,6 +149,10 @@ func (mod *Module) InRecovery() bool { return mod.ModuleBase.InRecovery() || mod.ModuleBase.InstallInRecovery() } +func (mod *Module) InRamdisk() bool { + return mod.ModuleBase.InRamdisk() || mod.ModuleBase.InstallInRamdisk() +} + func (mod *Module) InVendorRamdisk() bool { return mod.ModuleBase.InVendorRamdisk() || mod.ModuleBase.InstallInVendorRamdisk() } From c1a56bcbe92baf55876c6da0d484540583b534de Mon Sep 17 00:00:00 2001 From: Jose Galmes Date: Mon, 7 Mar 2022 14:07:59 -0800 Subject: [PATCH 2/2] Add InstallInRoot property to snapshot binary json file. Bug: 215295121 Test: Generated snapshot and verified InstallInRoot property is present. Change-Id: I4f20a454477d1263e9c16e98468d659f89e1e4f1 --- cc/vendor_snapshot.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cc/vendor_snapshot.go b/cc/vendor_snapshot.go index 8a17e2e54..e7c05aca8 100644 --- a/cc/vendor_snapshot.go +++ b/cc/vendor_snapshot.go @@ -146,6 +146,7 @@ type snapshotJsonFlags struct { // binary flags Symlinks []string `json:",omitempty"` StaticExecutable bool `json:",omitempty"` + InstallInRoot bool `json:",omitempty"` // dependencies SharedLibs []string `json:",omitempty"` @@ -320,6 +321,7 @@ var ccSnapshotAction snapshot.GenerateSnapshotAction = func(s snapshot.SnapshotS // binary flags prop.Symlinks = m.Symlinks() prop.StaticExecutable = m.StaticExecutable() + prop.InstallInRoot = m.InstallInRoot() prop.SharedLibs = m.SnapshotSharedLibs() // static libs dependencies are required to collect the NOTICE files. prop.StaticLibs = m.SnapshotStaticLibs()