Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 98c541ed authored by Pechetty Sravani (xWF)'s avatar Pechetty Sravani (xWF) Committed by Automerger Merge Worker
Browse files

Merge "Revert "Support auto-generating prebuilt_* modules for recovery ...""...

Merge "Revert "Support auto-generating prebuilt_* modules for recovery ..."" into main am: 1460213f am: 55c6086b

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3389199



Change-Id: I03ab78cd593628685449da90d11358186b04f7d7
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 3d6b428d 55c6086b
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -245,7 +245,6 @@ func createInstallInRootAllowingRules() []Rule {
			Without("name", "librecovery_ui_ext").
			With("install_in_root", "true").
			NotModuleType("prebuilt_root").
			NotModuleType("prebuilt_vendor").
			Because("install_in_root is only for init_first_stage or librecovery_ui_ext."),
	}
}
+0 −1
Original line number Diff line number Diff line
@@ -574,7 +574,6 @@ func InitPrebuiltEtcModule(p *PrebuiltEtc, dirBase string) {
	p.installDirBase = dirBase
	p.AddProperties(&p.properties)
	p.AddProperties(&p.subdirProperties)
	p.AddProperties(&p.rootProperties)
}

func InitPrebuiltRootModule(p *PrebuiltEtc) {
+0 −25
Original line number Diff line number Diff line
@@ -36,7 +36,6 @@ type prebuiltSrcGroupByInstallPartition struct {
	system_ext map[string][]srcBaseFileInstallBaseFileTuple
	product    map[string][]srcBaseFileInstallBaseFileTuple
	vendor     map[string][]srcBaseFileInstallBaseFileTuple
	recovery   map[string][]srcBaseFileInstallBaseFileTuple
}

func newPrebuiltSrcGroupByInstallPartition() *prebuiltSrcGroupByInstallPartition {
@@ -45,7 +44,6 @@ func newPrebuiltSrcGroupByInstallPartition() *prebuiltSrcGroupByInstallPartition
		system_ext: map[string][]srcBaseFileInstallBaseFileTuple{},
		product:    map[string][]srcBaseFileInstallBaseFileTuple{},
		vendor:     map[string][]srcBaseFileInstallBaseFileTuple{},
		recovery:   map[string][]srcBaseFileInstallBaseFileTuple{},
	}
}

@@ -75,8 +73,6 @@ func appendIfCorrectInstallPartition(partitionToInstallPathList []partitionToIns
				srcMap = srcGroup.product
			case "vendor":
				srcMap = srcGroup.vendor
			case "recovery":
				srcMap = srcGroup.recovery
			}
			if srcMap != nil {
				srcMap[relativeInstallDir] = append(srcMap[relativeInstallDir], srcBaseFileInstallBaseFileTuple{
@@ -132,7 +128,6 @@ func processProductCopyFiles(ctx android.LoadHookContext) map[string]*prebuiltSr
	// System is intentionally added at the last to consider the scenarios where
	// non-system partitions are installed as part of the system partition
	partitionToInstallPathList := []partitionToInstallPath{
		{name: "recovery", installPath: "recovery/root"},
		{name: "vendor", installPath: ctx.DeviceConfig().VendorPath()},
		{name: "product", installPath: ctx.DeviceConfig().ProductPath()},
		{name: "system_ext", installPath: ctx.DeviceConfig().SystemExtPath()},
@@ -160,7 +155,6 @@ type prebuiltModuleProperties struct {
	Soc_specific        *bool
	Product_specific    *bool
	System_ext_specific *bool
	Recovery            *bool

	Srcs []string
	Dsts []string
@@ -180,12 +174,6 @@ type prebuiltSubdirProperties struct {
	Relative_install_path *string
}

// Split install_in_root to a separate struct as it is part of rootProperties instead of
// properties
type prebuiltInstallInRootProperties struct {
	Install_in_root *bool
}

var (
	etcInstallPathToFactoryList = map[string]android.ModuleFactory{
		"":                etc.PrebuiltRootFactory,
@@ -267,8 +255,6 @@ func prebuiltEtcModuleProps(moduleName, partition string) prebuiltModuleProperti
		moduleProps.Product_specific = proptools.BoolPtr(true)
	case "vendor":
		moduleProps.Soc_specific = proptools.BoolPtr(true)
	case "recovery":
		moduleProps.Recovery = proptools.BoolPtr(true)
	}

	moduleProps.No_full_install = proptools.BoolPtr(true)
@@ -316,16 +302,6 @@ func createPrebuiltEtcModulesInDirectory(ctx android.LoadHookContext, partition,
			installBaseFiles = append(installBaseFiles, tuple.installBaseFile)
		}

		// Recovery partition-installed modules are installed to `recovery/root/system` by
		// default (See modulePartition() in android/paths.go). If the destination file
		// directory is not `recovery/root/system/...`, it should set install_in_root to true
		// to prevent being installed in `recovery/root/system`.
		if partition == "recovery" && !strings.HasPrefix(destDir, "system") {
			propsList = append(propsList, &prebuiltInstallInRootProperties{
				Install_in_root: proptools.BoolPtr(true),
			})
		}

		// Set appropriate srcs, dsts, and releative_install_path based on
		// the source and install file names
		if allCopyFileNamesUnchanged {
@@ -371,7 +347,6 @@ func createPrebuiltEtcModules(ctx android.LoadHookContext) (ret []string) {
		ret = append(ret, createPrebuiltEtcModulesForPartition(ctx, "system_ext", srcDir, groupedSource.system_ext)...)
		ret = append(ret, createPrebuiltEtcModulesForPartition(ctx, "product", srcDir, groupedSource.product)...)
		ret = append(ret, createPrebuiltEtcModulesForPartition(ctx, "vendor", srcDir, groupedSource.vendor)...)
		ret = append(ret, createPrebuiltEtcModulesForPartition(ctx, "recovery", srcDir, groupedSource.recovery)...)
	}

	return ret