Add InstallInRoot to allow modules to install into root partition
am: 90ba5f4e98
Change-Id: I73a597b875c336624b0016302c3710177bb0a658
This commit is contained in:
commit
5c17b4e9bb
|
@ -157,6 +157,7 @@ type ModuleContext interface {
|
||||||
InstallInTestcases() bool
|
InstallInTestcases() bool
|
||||||
InstallInSanitizerDir() bool
|
InstallInSanitizerDir() bool
|
||||||
InstallInRecovery() bool
|
InstallInRecovery() bool
|
||||||
|
InstallInRoot() bool
|
||||||
InstallBypassMake() bool
|
InstallBypassMake() bool
|
||||||
|
|
||||||
RequiredModuleNames() []string
|
RequiredModuleNames() []string
|
||||||
|
@ -196,6 +197,7 @@ type Module interface {
|
||||||
InstallInTestcases() bool
|
InstallInTestcases() bool
|
||||||
InstallInSanitizerDir() bool
|
InstallInSanitizerDir() bool
|
||||||
InstallInRecovery() bool
|
InstallInRecovery() bool
|
||||||
|
InstallInRoot() bool
|
||||||
InstallBypassMake() bool
|
InstallBypassMake() bool
|
||||||
SkipInstall()
|
SkipInstall()
|
||||||
ExportedToMake() bool
|
ExportedToMake() bool
|
||||||
|
@ -846,6 +848,10 @@ func (m *ModuleBase) InstallInRecovery() bool {
|
||||||
return Bool(m.commonProperties.Recovery)
|
return Bool(m.commonProperties.Recovery)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *ModuleBase) InstallInRoot() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
func (m *ModuleBase) InstallBypassMake() bool {
|
func (m *ModuleBase) InstallBypassMake() bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
@ -1522,6 +1528,10 @@ func (m *moduleContext) InstallInRecovery() bool {
|
||||||
return m.module.InstallInRecovery()
|
return m.module.InstallInRecovery()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *moduleContext) InstallInRoot() bool {
|
||||||
|
return m.module.InstallInRoot()
|
||||||
|
}
|
||||||
|
|
||||||
func (m *moduleContext) InstallBypassMake() bool {
|
func (m *moduleContext) InstallBypassMake() bool {
|
||||||
return m.module.InstallBypassMake()
|
return m.module.InstallBypassMake()
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,6 +47,7 @@ type ModuleInstallPathContext interface {
|
||||||
InstallInTestcases() bool
|
InstallInTestcases() bool
|
||||||
InstallInSanitizerDir() bool
|
InstallInSanitizerDir() bool
|
||||||
InstallInRecovery() bool
|
InstallInRecovery() bool
|
||||||
|
InstallInRoot() bool
|
||||||
InstallBypassMake() bool
|
InstallBypassMake() bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1159,8 +1160,12 @@ func modulePartition(ctx ModuleInstallPathContext) string {
|
||||||
} else if ctx.InstallInTestcases() {
|
} else if ctx.InstallInTestcases() {
|
||||||
partition = "testcases"
|
partition = "testcases"
|
||||||
} else if ctx.InstallInRecovery() {
|
} else if ctx.InstallInRecovery() {
|
||||||
// the layout of recovery partion is the same as that of system partition
|
if ctx.InstallInRoot() {
|
||||||
partition = "recovery/root/system"
|
partition = "recovery/root"
|
||||||
|
} else {
|
||||||
|
// the layout of recovery partion is the same as that of system partition
|
||||||
|
partition = "recovery/root/system"
|
||||||
|
}
|
||||||
} else if ctx.SocSpecific() {
|
} else if ctx.SocSpecific() {
|
||||||
partition = ctx.DeviceConfig().VendorPath()
|
partition = ctx.DeviceConfig().VendorPath()
|
||||||
} else if ctx.DeviceSpecific() {
|
} else if ctx.DeviceSpecific() {
|
||||||
|
@ -1169,6 +1174,8 @@ func modulePartition(ctx ModuleInstallPathContext) string {
|
||||||
partition = ctx.DeviceConfig().ProductPath()
|
partition = ctx.DeviceConfig().ProductPath()
|
||||||
} else if ctx.SystemExtSpecific() {
|
} else if ctx.SystemExtSpecific() {
|
||||||
partition = ctx.DeviceConfig().SystemExtPath()
|
partition = ctx.DeviceConfig().SystemExtPath()
|
||||||
|
} else if ctx.InstallInRoot() {
|
||||||
|
partition = "root"
|
||||||
} else {
|
} else {
|
||||||
partition = "system"
|
partition = "system"
|
||||||
}
|
}
|
||||||
|
|
|
@ -204,6 +204,7 @@ type moduleInstallPathContextImpl struct {
|
||||||
inTestcases bool
|
inTestcases bool
|
||||||
inSanitizerDir bool
|
inSanitizerDir bool
|
||||||
inRecovery bool
|
inRecovery bool
|
||||||
|
inRoot bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (moduleInstallPathContextImpl) Fs() pathtools.FileSystem {
|
func (moduleInstallPathContextImpl) Fs() pathtools.FileSystem {
|
||||||
|
@ -232,6 +233,10 @@ func (m moduleInstallPathContextImpl) InstallInRecovery() bool {
|
||||||
return m.inRecovery
|
return m.inRecovery
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m moduleInstallPathContextImpl) InstallInRoot() bool {
|
||||||
|
return m.inRoot
|
||||||
|
}
|
||||||
|
|
||||||
func (m moduleInstallPathContextImpl) InstallBypassMake() bool {
|
func (m moduleInstallPathContextImpl) InstallBypassMake() bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
@ -313,6 +318,40 @@ func TestPathForModuleInstall(t *testing.T) {
|
||||||
in: []string{"bin", "my_test"},
|
in: []string{"bin", "my_test"},
|
||||||
out: "target/product/test_device/system_ext/bin/my_test",
|
out: "target/product/test_device/system_ext/bin/my_test",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "root binary",
|
||||||
|
ctx: &moduleInstallPathContextImpl{
|
||||||
|
baseModuleContext: baseModuleContext{
|
||||||
|
target: deviceTarget,
|
||||||
|
},
|
||||||
|
inRoot: true,
|
||||||
|
},
|
||||||
|
in: []string{"my_test"},
|
||||||
|
out: "target/product/test_device/root/my_test",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "recovery binary",
|
||||||
|
ctx: &moduleInstallPathContextImpl{
|
||||||
|
baseModuleContext: baseModuleContext{
|
||||||
|
target: deviceTarget,
|
||||||
|
},
|
||||||
|
inRecovery: true,
|
||||||
|
},
|
||||||
|
in: []string{"bin/my_test"},
|
||||||
|
out: "target/product/test_device/recovery/root/system/bin/my_test",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "recovery root binary",
|
||||||
|
ctx: &moduleInstallPathContextImpl{
|
||||||
|
baseModuleContext: baseModuleContext{
|
||||||
|
target: deviceTarget,
|
||||||
|
},
|
||||||
|
inRecovery: true,
|
||||||
|
inRoot: true,
|
||||||
|
},
|
||||||
|
in: []string{"my_test"},
|
||||||
|
out: "target/product/test_device/recovery/root/my_test",
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
name: "system native test binary",
|
name: "system native test binary",
|
||||||
|
|
Loading…
Reference in New Issue