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

Commit a8fa0711 authored by Jihoon Kang's avatar Jihoon Kang
Browse files

Create prebuilt kernel module for vendor_ramdisk partition

To correctly install *.ko files to the vendor_ramdisk partition.

Test: m soong_generated_vendor_ramdisk_filesystem_test
Bug: 381104942
Change-Id: Ib058a0f6893eaa273dfd609749a6417982cf057e
parent 60c23299
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -660,6 +660,10 @@ type PartitionVariables struct {
	BuildingOdmDlkmImage      bool     `json:",omitempty"`
	OdmKernelModules          []string `json:",omitempty"`
	OdmKernelBlocklistFile    string   `json:",omitempty"`

	VendorRamdiskKernelModules       []string `json:",omitempty"`
	VendorRamdiskKernelBlocklistFile string   `json:",omitempty"`
	VendorRamdiskKernelLoadModules   []string `json:",omitempty"`
}

func boolPtr(v bool) *bool {
+8 −1
Original line number Diff line number Diff line
@@ -321,7 +321,7 @@ func (f *filesystemCreator) createPartition(ctx android.LoadHookContext, partiti
		}
	}

	if android.InList(partitionType, dlkmPartitions) {
	if android.InList(partitionType, append(dlkmPartitions, "vendor_ramdisk")) {
		f.createPrebuiltKernelModules(ctx, partitionType)
	}

@@ -398,6 +398,7 @@ func (f *filesystemCreator) createPrebuiltKernelModules(ctx android.LoadHookCont
		System_dlkm_specific *bool
		Vendor_dlkm_specific *bool
		Odm_dlkm_specific    *bool
		Vendor_ramdisk       *bool
		Load_by_default      *bool
		Blocklist_file       *string
	}{
@@ -430,6 +431,12 @@ func (f *filesystemCreator) createPrebuiltKernelModules(ctx android.LoadHookCont
		if blocklistFile := ctx.Config().ProductVariables().PartitionVarsForSoongMigrationOnlyDoNotUse.OdmKernelBlocklistFile; blocklistFile != "" {
			props.Blocklist_file = proptools.StringPtr(blocklistFile)
		}
	case "vendor_ramdisk":
		props.Srcs = android.ExistentPathsForSources(ctx, ctx.Config().ProductVariables().PartitionVarsForSoongMigrationOnlyDoNotUse.VendorRamdiskKernelModules).Strings()
		props.Vendor_ramdisk = proptools.BoolPtr(true)
		if blocklistFile := ctx.Config().ProductVariables().PartitionVarsForSoongMigrationOnlyDoNotUse.VendorRamdiskKernelBlocklistFile; blocklistFile != "" {
			props.Blocklist_file = proptools.StringPtr(blocklistFile)
		}
	default:
		ctx.ModuleErrorf("DLKM is not supported for %s\n", partitionType)
	}