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

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

Merge changes I68c6319a,I21c9ddc2 into main

* changes:
  Update $PRODUCT_OUT for auto generated partitions
  Copy partition image files to PRODUCT_OUT
parents 9b023340 e90cebec
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -79,6 +79,8 @@ func (a *androidDevice) DepsMutator(ctx android.BottomUpMutatorContext) {
	}

	addDependencyIfDefined(a.partitionProps.Boot_partition_name)
	addDependencyIfDefined(a.partitionProps.Vendor_boot_partition_name)
	addDependencyIfDefined(a.partitionProps.Init_boot_partition_name)
	addDependencyIfDefined(a.partitionProps.System_partition_name)
	addDependencyIfDefined(a.partitionProps.System_ext_partition_name)
	addDependencyIfDefined(a.partitionProps.Product_partition_name)
+8 −0
Original line number Diff line number Diff line
@@ -372,6 +372,10 @@ func (b *bootimg) addAvbFooter(ctx android.ModuleContext, unsignedImage android.
		cmd.FlagWithArg("--rollback_index ", strconv.FormatInt(*b.properties.Avb_rollback_index, 10))
	}

	if !ctx.Config().KatiEnabled() {
		copyImageFileToProductOut(ctx, builder, b.bootImageType.String(), output)
	}

	builder.Build("add_avb_footer", fmt.Sprintf("Adding avb footer to %s", b.BaseModuleName()))
	return output
}
@@ -387,6 +391,10 @@ func (b *bootimg) signImage(ctx android.ModuleContext, unsignedImage android.Pat
		Implicits(toolDeps).
		Output(output)

	if !ctx.Config().KatiEnabled() {
		copyImageFileToProductOut(ctx, builder, b.bootImageType.String(), output)
	}

	builder.Build("sign_bootimg", fmt.Sprintf("Signing %s", b.BaseModuleName()))
	return output
}
+11 −2
Original line number Diff line number Diff line
@@ -593,11 +593,16 @@ func (f *filesystem) copyPackagingSpecs(ctx android.ModuleContext, builder *andr
}

func (f *filesystem) copyFilesToProductOut(ctx android.ModuleContext, builder *android.RuleBuilder, rebasedDir android.OutputPath) {
	if f.Name() != ctx.Config().SoongDefinedSystemImage() {
	if !(f.Name() == ctx.Config().SoongDefinedSystemImage() || proptools.Bool(f.properties.Is_auto_generated)) {
		return
	}
	installPath := android.PathForModuleInPartitionInstall(ctx, f.partitionName())
	builder.Command().Textf("cp -prf %s/* %s", rebasedDir, installPath)
	builder.Command().Textf("rsync --checksum %s %s", rebasedDir, installPath)
}

func copyImageFileToProductOut(ctx android.ModuleContext, builder *android.RuleBuilder, partition string, output android.Path) {
	copyDir := android.PathForModuleInPartitionInstall(ctx, "").Join(ctx, fmt.Sprintf("%s.img", partition))
	builder.Command().Textf("rsync -a %s %s", output, copyDir)
}

func (f *filesystem) rootDirString() string {
@@ -651,6 +656,10 @@ func (f *filesystem) buildImageUsingBuildImage(ctx android.ModuleContext) (andro
		Output(output).
		Text(rootDir.String()) // directory where to find fs_config_files|dirs

	if !ctx.Config().KatiEnabled() {
		copyImageFileToProductOut(ctx, builder, f.partitionName(), output)
	}

	// rootDir is not deleted. Might be useful for quick inspection.
	builder.Build("build_filesystem_image", fmt.Sprintf("Creating filesystem %s", f.BaseModuleName()))

+4 −0
Original line number Diff line number Diff line
@@ -281,6 +281,10 @@ func (v *vbmeta) GenerateAndroidBuildActions(ctx android.ModuleContext) {
		FlagWithArg("-s ", strconv.Itoa(vbmetaMaxSize)).
		Output(output)

	if !ctx.Config().KatiEnabled() {
		copyImageFileToProductOut(ctx, builder, v.partitionName(), output)
	}

	builder.Build("vbmeta", fmt.Sprintf("vbmeta %s", ctx.ModuleName()))

	v.installDir = android.PathForModuleInstall(ctx, "etc")