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

Commit 87230e61 authored by Inseob Kim's avatar Inseob Kim
Browse files

Add defaults modules for avb modules

Bug: 302465542
Test: build
Change-Id: I5bb5a0241d40cf142ed8bbefb76bc8a3709c3e34
parent 4ce715f5
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import (

type avbAddHashFooter struct {
	android.ModuleBase
	android.DefaultableModuleBase

	properties avbAddHashFooterProperties

@@ -80,6 +81,7 @@ func avbAddHashFooterFactory() android.Module {
	module := &avbAddHashFooter{}
	module.AddProperties(&module.properties)
	android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst)
	android.InitDefaultableModule(module)
	return module
}

@@ -206,3 +208,19 @@ var _ android.SourceFileProducer = (*avbAddHashFooter)(nil)
func (a *avbAddHashFooter) Srcs() android.Paths {
	return append(android.Paths{}, a.output)
}

type avbAddHashFooterDefaults struct {
	android.ModuleBase
	android.DefaultsModuleBase
}

// avb_add_hash_footer_defaults provides a set of properties that can be inherited by other
// avb_add_hash_footer modules. A module can use the properties from an avb_add_hash_footer_defaults
// using `defaults: ["<:default_module_name>"]`. Properties of both modules are erged (when
// possible) by prepending the default module's values to the depending module's values.
func avbAddHashFooterDefaultsFactory() android.Module {
	module := &avbAddHashFooterDefaults{}
	module.AddProperties(&avbAddHashFooterProperties{})
	android.InitDefaultsModule(module)
	return module
}
+19 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import (

type avbGenVbmetaImage struct {
	android.ModuleBase
	android.DefaultableModuleBase

	properties avbGenVbmetaImageProperties

@@ -47,6 +48,7 @@ func avbGenVbmetaImageFactory() android.Module {
	module := &avbGenVbmetaImage{}
	module.AddProperties(&module.properties)
	android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst)
	android.InitDefaultableModule(module)
	return module
}

@@ -106,3 +108,20 @@ func (a *avbGenVbmetaImage) OutputFiles(tag string) (android.Paths, error) {
	}
	return nil, fmt.Errorf("unsupported module reference tag %q", tag)
}

type avbGenVbmetaImageDefaults struct {
	android.ModuleBase
	android.DefaultsModuleBase
}

// avb_gen_vbmeta_image_defaults provides a set of properties that can be inherited by other
// avb_gen_vbmeta_image modules. A module can use the properties from an
// avb_gen_vbmeta_image_defaults using `defaults: ["<:default_module_name>"]`. Properties of both
// modules are erged (when possible) by prepending the default module's values to the depending
// module's values.
func avbGenVbmetaImageDefaultsFactory() android.Module {
	module := &avbGenVbmetaImageDefaults{}
	module.AddProperties(&avbGenVbmetaImageProperties{})
	android.InitDefaultsModule(module)
	return module
}
+2 −0
Original line number Diff line number Diff line
@@ -36,7 +36,9 @@ func registerBuildComponents(ctx android.RegistrationContext) {
	ctx.RegisterModuleType("android_filesystem", filesystemFactory)
	ctx.RegisterModuleType("android_system_image", systemImageFactory)
	ctx.RegisterModuleType("avb_add_hash_footer", avbAddHashFooterFactory)
	ctx.RegisterModuleType("avb_add_hash_footer_defaults", avbAddHashFooterDefaultsFactory)
	ctx.RegisterModuleType("avb_gen_vbmeta_image", avbGenVbmetaImageFactory)
	ctx.RegisterModuleType("avb_gen_vbmeta_image_defaults", avbGenVbmetaImageDefaultsFactory)
}

type filesystem struct {