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

Commit dd8dacc1 authored by Yifan Hong's avatar Yifan Hong
Browse files

Vendor ramdisk modules install to correct location

Install to recovery/root/first_stage_ramdisk if
BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT,
otherwise vendor-ramdisk. In addition, append /system
if not InstallInRoot().

On devices with dedicated recovery partition,
BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT is not set,
and this installs to the correct place (under $OUT/vendor-ramdisk).

On devices without a dedicated recovery partition:
- To install a module available before switching root
  to /first_stage_ramdisk, e.g. a binary under /system/bin,
  use recovery{_available} and install the recovery variant
  of the module.
- To install a module available after switching root
  to /first_stage_ramdisk, e.g. a binary under
  /first_stage_ramdisk/system/bin,
  use vendor_ramdisk{_available} and install the vendor_ramdisk
  variant of the module.

Test: pass
Bug: 156098440

Change-Id: I1af3f8889891a3e58263cda36f0680ce2b480499
parent 60e0cfb5
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1312,6 +1312,10 @@ func (c *deviceConfig) BoardKernelModuleInterfaceVersions() []string {
	return c.config.productVariables.BoardKernelModuleInterfaceVersions
}

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

// The ConfiguredJarList struct provides methods for handling a list of (apex, jar) pairs.
// Such lists are used in the build system for things like bootclasspath jars or system server jars.
// The apex part is either an apex name, or a special names "platform" or "system_ext". Jar is a
+8 −2
Original line number Diff line number Diff line
@@ -1378,8 +1378,14 @@ func modulePartition(ctx ModuleInstallPathContext, os OsType) string {
				partition += "/system"
			}
		} else if ctx.InstallInVendorRamdisk() {
			// TODO(elsk): Should be conditional on move_recovery_res_to_vendor_boot
			if ctx.DeviceConfig().BoardMoveRecoveryResourcesToVendorBoot() {
				partition = "recovery/root/first_stage_ramdisk"
			} else {
				partition = "vendor-ramdisk"
			}
			if !ctx.InstallInRoot() {
				partition += "/system"
			}
		} else if ctx.InstallInRecovery() {
			if ctx.InstallInRoot() {
				partition = "recovery/root"
+2 −0
Original line number Diff line number Diff line
@@ -352,6 +352,8 @@ type productVariables struct {

	BoardKernelBinaries                []string `json:",omitempty"`
	BoardKernelModuleInterfaceVersions []string `json:",omitempty"`

	BoardMoveRecoveryResourcesToVendorBoot *bool `json:",omitempty"`
}

func boolPtr(v bool) *bool {