Merge "ramdisk_module and dtb_prebuild properties are optional" am: fe306aba98
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1934956 Change-Id: I9991082a01a0c5807382d9eb027ddabc8a4d827f
This commit is contained in:
commit
f6d53e9586
1 changed files with 14 additions and 18 deletions
|
@ -145,12 +145,10 @@ func (b *bootimg) buildBootImage(ctx android.ModuleContext, vendor bool) android
|
|||
}
|
||||
|
||||
dtbName := proptools.String(b.properties.Dtb_prebuilt)
|
||||
if dtbName == "" {
|
||||
ctx.PropertyErrorf("dtb_prebuilt", "must be set")
|
||||
return output
|
||||
if dtbName != "" {
|
||||
dtb := android.PathForModuleSrc(ctx, dtbName)
|
||||
cmd.FlagWithInput("--dtb ", dtb)
|
||||
}
|
||||
dtb := android.PathForModuleSrc(ctx, dtbName)
|
||||
cmd.FlagWithInput("--dtb ", dtb)
|
||||
|
||||
cmdline := strings.Join(b.properties.Cmdline, " ")
|
||||
if cmdline != "" {
|
||||
|
@ -178,20 +176,18 @@ func (b *bootimg) buildBootImage(ctx android.ModuleContext, vendor bool) android
|
|||
cmd.FlagWithArg("--header_version ", headerVersion)
|
||||
|
||||
ramdiskName := proptools.String(b.properties.Ramdisk_module)
|
||||
if ramdiskName == "" {
|
||||
ctx.PropertyErrorf("ramdisk_module", "must be set")
|
||||
return output
|
||||
}
|
||||
ramdisk := ctx.GetDirectDepWithTag(ramdiskName, bootimgRamdiskDep)
|
||||
if filesystem, ok := ramdisk.(*filesystem); ok {
|
||||
flag := "--ramdisk "
|
||||
if vendor {
|
||||
flag = "--vendor_ramdisk "
|
||||
if ramdiskName != "" {
|
||||
ramdisk := ctx.GetDirectDepWithTag(ramdiskName, bootimgRamdiskDep)
|
||||
if filesystem, ok := ramdisk.(*filesystem); ok {
|
||||
flag := "--ramdisk "
|
||||
if vendor {
|
||||
flag = "--vendor_ramdisk "
|
||||
}
|
||||
cmd.FlagWithInput(flag, filesystem.OutputPath())
|
||||
} else {
|
||||
ctx.PropertyErrorf("ramdisk", "%q is not android_filesystem module", ramdisk.Name())
|
||||
return output
|
||||
}
|
||||
cmd.FlagWithInput(flag, filesystem.OutputPath())
|
||||
} else {
|
||||
ctx.PropertyErrorf("ramdisk", "%q is not android_filesystem module", ramdisk.Name())
|
||||
return output
|
||||
}
|
||||
|
||||
bootconfig := proptools.String(b.properties.Bootconfig)
|
||||
|
|
Loading…
Reference in a new issue