ANDROID: build: Fix output directory layout
With a recent change to the output directory handling from build_with_bazel.py, some dist directory paths incorrectly used hyphens instead of underscores. Fix this issue by mirroring the logic in msm_common.bzl which handles these paths properly. Also, run buildifier to fix format of Bazel build files. Change-Id: Ia82073f059c54f4a7f523c5bd91afdc755c70df1 Signed-off-by: John Moon <quic_johmoo@quicinc.com>
This commit is contained in:
parent
72594b5d98
commit
c38cee9986
@ -627,8 +627,8 @@ filegroup(
|
||||
ddk_headers(
|
||||
name = "all_headers_unsafe",
|
||||
hdrs = [
|
||||
"drivers/gpu/drm/virtio/virtgpu_trace.h",
|
||||
"drivers/devfreq/governor.h",
|
||||
"drivers/gpu/drm/virtio/virtgpu_trace.h",
|
||||
"mm/slab.h",
|
||||
],
|
||||
# The list of include directories where source files can #include headers
|
||||
|
@ -6,7 +6,7 @@ target_name = "autogvm"
|
||||
|
||||
def define_autogvm_lxc():
|
||||
_autogvm_lxc_in_tree_modules = [
|
||||
# keep sorted
|
||||
# keep sorted
|
||||
]
|
||||
|
||||
for variant in lxc_variants:
|
||||
@ -20,5 +20,6 @@ def define_autogvm_lxc():
|
||||
boot_image_opts = boot_image_opts(
|
||||
boot_image_header_version = 2,
|
||||
base_address = 0x80000000,
|
||||
page_size = 4096),
|
||||
page_size = 4096,
|
||||
),
|
||||
)
|
||||
|
@ -22,13 +22,13 @@ def sign_boot_img(ctx):
|
||||
--key {key} --partition_size {boot_partition_size} --partition_name boot \
|
||||
{proplist}
|
||||
""".format(
|
||||
boot_img = boot_img.path,
|
||||
tool = ctx.file.avbtool.path,
|
||||
key = ctx.file.key.path,
|
||||
boot_dir = outputs.dirname,
|
||||
boot_name = outputs.basename,
|
||||
boot_partition_size = ctx.attr.boot_partition_size,
|
||||
proplist = proplist,
|
||||
boot_img = boot_img.path,
|
||||
tool = ctx.file.avbtool.path,
|
||||
key = ctx.file.key.path,
|
||||
boot_dir = outputs.dirname,
|
||||
boot_name = outputs.basename,
|
||||
boot_partition_size = ctx.attr.boot_partition_size,
|
||||
proplist = proplist,
|
||||
)
|
||||
|
||||
ctx.actions.run_shell(
|
||||
@ -63,7 +63,7 @@ avb_sign_boot_image = rule(
|
||||
),
|
||||
"boot_partition_size": attr.int(
|
||||
mandatory = False,
|
||||
default = 0x6000000, # bytes, = 98304 kb
|
||||
default = 0x6000000, # bytes, = 98304 kb
|
||||
doc = "Final size of boot.img desired",
|
||||
),
|
||||
"props": attr.string_list(
|
||||
|
@ -34,8 +34,16 @@ class Target:
|
||||
if self.out_dir:
|
||||
out_dir = self.out_dir
|
||||
else:
|
||||
# Mirror the logic in msm_common.bzl:get_out_dir()
|
||||
if "allyes" in self.target:
|
||||
target_norm = self.target.replace("_", "-")
|
||||
else:
|
||||
target_norm = self.target.replace("-", "_")
|
||||
|
||||
variant_norm = self.variant.replace("-", "_")
|
||||
|
||||
out_dir = DEFAULT_OUT_DIR.format(
|
||||
workspace = self.workspace, target=self.target, variant=self.variant
|
||||
workspace = self.workspace, target=target_norm, variant=variant_norm
|
||||
)
|
||||
|
||||
if suffix:
|
||||
|
@ -6,7 +6,7 @@ target_name = "gen4auto"
|
||||
|
||||
def define_gen4auto_lxc():
|
||||
_gen4auto_lxc_in_tree_modules = [
|
||||
# keep sorted
|
||||
# keep sorted
|
||||
]
|
||||
|
||||
for variant in lxc_variants:
|
||||
@ -20,5 +20,6 @@ def define_gen4auto_lxc():
|
||||
boot_image_opts = boot_image_opts(
|
||||
boot_image_header_version = 2,
|
||||
base_address = 0x80000000,
|
||||
page_size = 4096),
|
||||
page_size = 4096,
|
||||
),
|
||||
)
|
||||
|
@ -34,7 +34,7 @@ def gen_config_without_source_lines(build_config, target):
|
||||
return ":" + rule_name
|
||||
|
||||
def get_out_dir(msm_target, variant):
|
||||
if msm_target.find("allyes") != -1:
|
||||
if "allyes" in msm_target:
|
||||
return "out/msm-kernel-{}-{}".format(msm_target.replace("_", "-"), variant.replace("-", "_"))
|
||||
return "out/msm-kernel-{}-{}".format(msm_target.replace("-", "_"), variant.replace("-", "_"))
|
||||
|
||||
@ -48,7 +48,7 @@ def define_signing_keys():
|
||||
$(location //prebuilts/build-tools:linux-x86/bin/openssl) req -new -nodes -utf8 -sha256 -days 36500 \
|
||||
-batch -x509 -config $(location //msm-kernel:certs/qcom_x509.genkey) \
|
||||
-outform PEM -out "$@" -keyout "$@"
|
||||
"""
|
||||
""",
|
||||
)
|
||||
|
||||
native.genrule(
|
||||
@ -60,5 +60,5 @@ def define_signing_keys():
|
||||
$(location //prebuilts/build-tools:linux-x86/bin/openssl) req -new -nodes -utf8 -newkey rsa:1024 -days 36500 \
|
||||
-batch -x509 -config $(location //msm-kernel:certs/qcom_x509.genkey) \
|
||||
-outform PEM -out $(location verity_cert.pem) -keyout $(location verity_key.pem)
|
||||
"""
|
||||
""",
|
||||
)
|
||||
|
@ -7,12 +7,12 @@ def define_top_level_rules():
|
||||
|
||||
native.config_setting(
|
||||
name = "skip_{}_setting".format(skippable),
|
||||
flag_values = {":skip_{}".format(skippable): "1"}
|
||||
flag_values = {":skip_{}".format(skippable): "1"},
|
||||
)
|
||||
|
||||
native.config_setting(
|
||||
name = "include_{}_setting".format(skippable),
|
||||
flag_values = {":skip_{}".format(skippable): "0"}
|
||||
flag_values = {":skip_{}".format(skippable): "0"},
|
||||
)
|
||||
|
||||
def define_combined_vm_image(target, variant, vm_size_ext4):
|
||||
|
@ -27,11 +27,11 @@ load(":target_variants.bzl", "vm_variants")
|
||||
|
||||
def define_make_vm_dtb_img(target, dtb_list, page_size):
|
||||
compiled_dtbs = ["//msm-kernel:{}/{}".format(target, t) for t in dtb_list]
|
||||
dtb_cmd="compiled_dtb_list=\"{}\"\n".format(" ".join(["$(location {})".format(d) for d in compiled_dtbs]))
|
||||
dtb_cmd = "compiled_dtb_list=\"{}\"\n".format(" ".join(["$(location {})".format(d) for d in compiled_dtbs]))
|
||||
dtb_cmd += """
|
||||
$(location //prebuilts/kernel-build-tools:linux-x86/bin/mkdtboimg) \\
|
||||
create "$@" --page_size={page_size} $${{compiled_dtb_list}}
|
||||
""".format(page_size=page_size)
|
||||
""".format(page_size = page_size)
|
||||
|
||||
native.genrule(
|
||||
name = "{}_vm_dtb_img".format(target),
|
||||
@ -85,17 +85,17 @@ DUMMY_IMG_SIZE=%d
|
||||
|
||||
EOF
|
||||
""" % (
|
||||
" ".join([v.replace("-", "_") for v in vm_variants]), # VARIANTS
|
||||
msm_arch, # MSM_ARCH
|
||||
variant.replace("-", "_"), # VARIANT
|
||||
vm_image_opts.preferred_usespace, # PREFERED_USERSPACE
|
||||
int(vm_image_opts.vm_dtb_img_create), # VM_DTB_IMG_CREATE
|
||||
vm_image_opts.kernel_offset, # KERNEL_OFFSET
|
||||
vm_image_opts.dtb_offset, # DTB_OFFSET
|
||||
vm_image_opts.ramdisk_offset, # RAMDISK_OFFSET
|
||||
vm_image_opts.cmdline_cpio_offset, # CMDLINE_CPIO_OFFSET
|
||||
vm_image_opts.vm_size_ext4, # VM_SIZE_EXT4
|
||||
vm_image_opts.dummy_img_size, # DUMMY_IMG_SIZE
|
||||
" ".join([v.replace("-", "_") for v in vm_variants]), # VARIANTS
|
||||
msm_arch, # MSM_ARCH
|
||||
variant.replace("-", "_"), # VARIANT
|
||||
vm_image_opts.preferred_usespace, # PREFERED_USERSPACE
|
||||
int(vm_image_opts.vm_dtb_img_create), # VM_DTB_IMG_CREATE
|
||||
vm_image_opts.kernel_offset, # KERNEL_OFFSET
|
||||
vm_image_opts.dtb_offset, # DTB_OFFSET
|
||||
vm_image_opts.ramdisk_offset, # RAMDISK_OFFSET
|
||||
vm_image_opts.cmdline_cpio_offset, # CMDLINE_CPIO_OFFSET
|
||||
vm_image_opts.vm_size_ext4, # VM_SIZE_EXT4
|
||||
vm_image_opts.dummy_img_size, # DUMMY_IMG_SIZE
|
||||
)
|
||||
|
||||
# Generate the build config
|
||||
@ -307,9 +307,9 @@ def define_msm_vm(
|
||||
|
||||
# use only dtbs related to the variant for dtb image creation
|
||||
if "tuivm" in msm_target:
|
||||
seg_dtb_list = [ dtb for dtb in dtb_list if "-vm-" in dtb ]
|
||||
seg_dtb_list = [dtb for dtb in dtb_list if "-vm-" in dtb]
|
||||
elif "oemvm" in msm_target:
|
||||
seg_dtb_list = [ dtb for dtb in dtb_list if "-oemvm-" in dtb ]
|
||||
seg_dtb_list = [dtb for dtb in dtb_list if "-oemvm-" in dtb]
|
||||
|
||||
define_make_vm_dtb_img(target, seg_dtb_list, vm_image_opts.dummy_img_size)
|
||||
|
||||
|
@ -20,5 +20,6 @@ def define_pineapple_allyes():
|
||||
boot_image_opts = boot_image_opts(
|
||||
boot_image_header_version = 2,
|
||||
base_address = 0x80000000,
|
||||
page_size = 4096),
|
||||
page_size = 4096,
|
||||
),
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user