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

Commit 78ea2f5e authored by Bowgo Tsai's avatar Bowgo Tsai
Browse files

Revert "Add debug ramdisk variant"

This reverts commit f84e9c05.

Because this breaks the usage of boot-debug.img and
vendor_boot-debug.img

Bug: 185970130
Bug: 185990198
Test: make bootimage_debug
Change-Id: I7886c971982faae1d5bc34688643de8d94d6e201
parent 752d63cd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -617,7 +617,7 @@ func archMutator(bpctx blueprint.BottomUpMutatorContext) {
	}

	// only the primary arch in the ramdisk / vendor_ramdisk / recovery partition
	if os == Android && (module.InstallInRecovery() || module.InstallInRamdisk() || module.InstallInVendorRamdisk() || module.InstallInDebugRamdisk()) {
	if os == Android && (module.InstallInRecovery() || module.InstallInRamdisk() || module.InstallInVendorRamdisk()) {
		osTargets = []Target{osTargets[0]}
	}

+0 −11
Original line number Diff line number Diff line
@@ -30,11 +30,6 @@ type ImageInterface interface {
	// vendor ramdisk partition).
	VendorRamdiskVariantNeeded(ctx BaseModuleContext) bool

	// DebugRamdiskVariantNeeded should return true if the module needs a debug ramdisk variant (installed on the
	// debug ramdisk partition: $(PRODUCT_OUT)/debug_ramdisk/first_stage_ramdisk if BOARD_USES_RECOVERY_AS_ROOT is
	// true, $(PRODUCT_OUT)/debug_ramdisk otherise).
	DebugRamdiskVariantNeeded(ctx BaseModuleContext) bool

	// RecoveryVariantNeeded should return true if the module needs a recovery variant (installed on the
	// recovery partition).
	RecoveryVariantNeeded(ctx BaseModuleContext) bool
@@ -65,9 +60,6 @@ const (

	// VendorRamdiskVariation means a module to be installed to vendor ramdisk image.
	VendorRamdiskVariation string = "vendor_ramdisk"

	// DebugRamdiskVariation means a module to be installed to debug ramdisk image.
	DebugRamdiskVariation string = "debug_ramdisk"
)

// imageMutator creates variants for modules that implement the ImageInterface that
@@ -91,9 +83,6 @@ func imageMutator(ctx BottomUpMutatorContext) {
		if m.VendorRamdiskVariantNeeded(ctx) {
			variations = append(variations, VendorRamdiskVariation)
		}
		if m.DebugRamdiskVariantNeeded(ctx) {
			variations = append(variations, DebugRamdiskVariation)
		}
		if m.RecoveryVariantNeeded(ctx) {
			variations = append(variations, RecoveryVariation)
		}
+0 −17
Original line number Diff line number Diff line
@@ -393,7 +393,6 @@ type ModuleContext interface {
	InstallInSanitizerDir() bool
	InstallInRamdisk() bool
	InstallInVendorRamdisk() bool
	InstallInDebugRamdisk() bool
	InstallInRecovery() bool
	InstallInRoot() bool
	InstallBypassMake() bool
@@ -451,7 +450,6 @@ type Module interface {
	InstallInSanitizerDir() bool
	InstallInRamdisk() bool
	InstallInVendorRamdisk() bool
	InstallInDebugRamdisk() bool
	InstallInRecovery() bool
	InstallInRoot() bool
	InstallBypassMake() bool
@@ -755,9 +753,6 @@ type commonProperties struct {
	// Whether this module is installed to vendor ramdisk
	Vendor_ramdisk *bool

	// Whether this module is installed to debug ramdisk
	Debug_ramdisk *bool

	// Whether this module is built for non-native architectures (also known as native bridge binary)
	Native_bridge_supported *bool `android:"arch_variant"`

@@ -1545,10 +1540,6 @@ func (m *ModuleBase) InstallInVendorRamdisk() bool {
	return Bool(m.commonProperties.Vendor_ramdisk)
}

func (m *ModuleBase) InstallInDebugRamdisk() bool {
	return Bool(m.commonProperties.Debug_ramdisk)
}

func (m *ModuleBase) InstallInRecovery() bool {
	return Bool(m.commonProperties.Recovery)
}
@@ -1602,10 +1593,6 @@ func (m *ModuleBase) InVendorRamdisk() bool {
	return m.base().commonProperties.ImageVariation == VendorRamdiskVariation
}

func (m *ModuleBase) InDebugRamdisk() bool {
	return m.base().commonProperties.ImageVariation == DebugRamdiskVariation
}

func (m *ModuleBase) InRecovery() bool {
	return m.base().commonProperties.ImageVariation == RecoveryVariation
}
@@ -2561,10 +2548,6 @@ func (m *moduleContext) InstallInVendorRamdisk() bool {
	return m.module.InstallInVendorRamdisk()
}

func (m *moduleContext) InstallInDebugRamdisk() bool {
	return m.module.InstallInDebugRamdisk()
}

func (m *moduleContext) InstallInRecovery() bool {
	return m.module.InstallInRecovery()
}
+0 −16
Original line number Diff line number Diff line
@@ -106,7 +106,6 @@ type ModuleInstallPathContext interface {
	InstallInSanitizerDir() bool
	InstallInRamdisk() bool
	InstallInVendorRamdisk() bool
	InstallInDebugRamdisk() bool
	InstallInRecovery() bool
	InstallInRoot() bool
	InstallBypassMake() bool
@@ -1690,16 +1689,6 @@ func modulePartition(ctx ModuleInstallPathContext, os OsType) string {
			if !ctx.InstallInRoot() {
				partition += "/system"
			}
		} else if ctx.InstallInDebugRamdisk() {
			// The module is only available after switching root into
			// /first_stage_ramdisk. To expose the module before switching root
			// on a device without a dedicated recovery partition, install the
			// recovery variant.
			if ctx.DeviceConfig().BoardUsesRecoveryAsBoot() {
				partition = "debug_ramdisk/first_stage_ramdisk"
			} else {
				partition = "debug_ramdisk"
			}
		} else if ctx.InstallInRecovery() {
			if ctx.InstallInRoot() {
				partition = "recovery/root"
@@ -1870,7 +1859,6 @@ type testModuleInstallPathContext struct {
	inSanitizerDir  bool
	inRamdisk       bool
	inVendorRamdisk bool
	inDebugRamdisk  bool
	inRecovery      bool
	inRoot          bool
	forceOS         *OsType
@@ -1903,10 +1891,6 @@ func (m testModuleInstallPathContext) InstallInVendorRamdisk() bool {
	return m.inVendorRamdisk
}

func (m testModuleInstallPathContext) InstallInDebugRamdisk() bool {
	return m.inDebugRamdisk
}

func (m testModuleInstallPathContext) InstallInRecovery() bool {
	return m.inRecovery
}
+0 −26
Original line number Diff line number Diff line
@@ -394,19 +394,6 @@ func TestPathForModuleInstall(t *testing.T) {
			out:          "target/product/test_device/vendor_ramdisk/my_test",
			partitionDir: "target/product/test_device/vendor_ramdisk",
		},
		{
			name: "debug_ramdisk binary",
			ctx: &testModuleInstallPathContext{
				baseModuleContext: baseModuleContext{
					os:     deviceTarget.Os,
					target: deviceTarget,
				},
				inDebugRamdisk: true,
			},
			in:           []string{"my_test"},
			out:          "target/product/test_device/debug_ramdisk/my_test",
			partitionDir: "target/product/test_device/debug_ramdisk",
		},
		{
			name: "system native test binary",
			ctx: &testModuleInstallPathContext{
@@ -746,19 +733,6 @@ func TestPathForModuleInstallRecoveryAsBoot(t *testing.T) {
			out:          "target/product/test_device/vendor_ramdisk/first_stage_ramdisk/my_test",
			partitionDir: "target/product/test_device/vendor_ramdisk/first_stage_ramdisk",
		},
		{
			name: "debug_ramdisk binary",
			ctx: &testModuleInstallPathContext{
				baseModuleContext: baseModuleContext{
					os:     deviceTarget.Os,
					target: deviceTarget,
				},
				inDebugRamdisk: true,
			},
			in:           []string{"my_test"},
			out:          "target/product/test_device/debug_ramdisk/first_stage_ramdisk/my_test",
			partitionDir: "target/product/test_device/debug_ramdisk/first_stage_ramdisk",
		},
	}

	for _, tc := range testCases {
Loading