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

Commit 7f7ca632 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Autogenerate a vendor/ partition" into main

parents c36b3cfe e3b65316
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1524,6 +1524,10 @@ func (c *deviceConfig) VendorPath() string {
	return "vendor"
}

func (c *deviceConfig) BuildingVendorImage() bool {
	return proptools.Bool(c.config.productVariables.BuildingVendorImage)
}

func (c *deviceConfig) CurrentApiLevelForVendorModules() string {
	return StringDefault(c.config.productVariables.DeviceCurrentApiLevelForVendorModules, "current")
}
+5 −4
Original line number Diff line number Diff line
@@ -338,6 +338,7 @@ type ProductVariables struct {
	HWASanExcludePaths []string `json:",omitempty"`

	VendorPath          *string `json:",omitempty"`
	BuildingVendorImage *bool   `json:",omitempty"`
	OdmPath             *string `json:",omitempty"`
	ProductPath         *string `json:",omitempty"`
	SystemExtPath       *string `json:",omitempty"`
+6 −0
Original line number Diff line number Diff line
@@ -101,6 +101,9 @@ func createFsGenState(ctx android.LoadHookContext) *FsGenState {
		if ctx.DeviceConfig().SystemExtPath() == "system_ext" {
			generatedPartitions = append(generatedPartitions, "system_ext")
		}
		if ctx.DeviceConfig().BuildingVendorImage() && ctx.DeviceConfig().VendorPath() == "vendor" {
			generatedPartitions = append(generatedPartitions, "vendor")
		}

		return &FsGenState{
			depCandidates: candidates,
@@ -340,6 +343,9 @@ func (f *filesystemCreator) createDeviceModule(ctx android.LoadHookContext) {
	if android.InList("system_ext", f.properties.Generated_partition_types) {
		partitionProps.System_ext_partition_name = proptools.StringPtr(generatedModuleNameForPartition(ctx.Config(), "system_ext"))
	}
	if android.InList("vendor", f.properties.Generated_partition_types) {
		partitionProps.Vendor_partition_name = proptools.StringPtr(generatedModuleNameForPartition(ctx.Config(), "vendor"))
	}

	ctx.CreateModule(filesystem.AndroidDeviceFactory, baseProps, partitionProps)
}