From 6100c90ef516eb9550fe6a33ba0b347a25d899b3 Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Tue, 15 Nov 2022 23:02:04 -0800 Subject: [PATCH] ANDROID: kleaf: convert rockpi4 to mixed build. Build the GKI //common:kernel_aarch64, then build rockpi4 modules on top of it. As a side effect of this change, rockpi4 will no longer be able to be built with build.sh because it won't produce vmlinux, etc.. Test: TH Test: bazel run //common:rockpi4_dist Bug: 258841346 Change-Id: I88989a265d0a90daddc85dd45a8736f942350522 Signed-off-by: Yifan Hong --- BUILD.bazel | 10 ++-------- arch/arm64/configs/rockpi4_gki.fragment | 3 +++ build.config.rockpi4 | 5 +++-- init/Kconfig.gki | 8 ++++++++ 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index bdd9830f6270..78502ea612ee 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -244,20 +244,14 @@ define_db845c( ], ) -# TODO(b/258259749): Convert rockpi4 to mixed build kernel_build( name = "rockpi4", outs = [ - "Image", - "System.map", - "modules.builtin", - "modules.builtin.modinfo", "rk3399-rock-pi-4b.dtb", - "vmlinux", - "vmlinux.symvers", ], + base_kernel = "//common:kernel_aarch64", build_config = "build.config.rockpi4", - module_outs = COMMON_GKI_MODULES_LIST + [ + module_outs = [ # keep sorted "drivers/block/virtio_blk.ko", "drivers/char/hw_random/virtio-rng.ko", diff --git a/arch/arm64/configs/rockpi4_gki.fragment b/arch/arm64/configs/rockpi4_gki.fragment index 2af01b890c59..84aecea1614e 100644 --- a/arch/arm64/configs/rockpi4_gki.fragment +++ b/arch/arm64/configs/rockpi4_gki.fragment @@ -80,3 +80,6 @@ CONFIG_HW_RANDOM_VIRTIO=m CONFIG_VIRTIO_PCI=m CONFIG_VIRTIO_BLK=m CONFIG_VIRTIO_NET=m + +# Do not sign non-GKI modules +# CONFIG_MODULE_SIG_ALL is not set diff --git a/build.config.rockpi4 b/build.config.rockpi4 index 424e568f018c..04da72b63a39 100644 --- a/build.config.rockpi4 +++ b/build.config.rockpi4 @@ -10,10 +10,11 @@ FRAGMENT_CONFIG=${KERNEL_DIR}/arch/arm64/configs/rockpi4_gki.fragment PRE_DEFCONFIG_CMDS="KCONFIG_CONFIG=${ROOT_DIR}/${KERNEL_DIR}/arch/arm64/configs/${DEFCONFIG} ${ROOT_DIR}/${KERNEL_DIR}/scripts/kconfig/merge_config.sh -m -r ${ROOT_DIR}/${KERNEL_DIR}/arch/arm64/configs/gki_defconfig ${ROOT_DIR}/${FRAGMENT_CONFIG}" POST_DEFCONFIG_CMDS="rm ${ROOT_DIR}/${KERNEL_DIR}/arch/arm64/configs/${DEFCONFIG}" -MAKE_GOALS="${MAKE_GOALS} +MAKE_GOALS=" +modules rockchip/rk3399-rock-pi-4b.dtb " -FILES="${FILES} +FILES=" arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4b.dtb " diff --git a/init/Kconfig.gki b/init/Kconfig.gki index ce622014516e..42233f24758f 100644 --- a/init/Kconfig.gki +++ b/init/Kconfig.gki @@ -227,6 +227,13 @@ config GKI_HIDDEN_DMA_CONFIGS Dummy config option used to enable the hidden DMA configs, required by various SoC platforms. +config GKI_HIDDEN_PCIE_ROCKCHIP_CONFIGS + bool "Hidden PCIE rockchip configuration needed for GKI" + select PCIE_ROCKCHIP + help + Dummy config option used to enable the hidden PCIE rockchip configs, + required by rockchip. + # Atrocities needed for # a) building GKI modules in separate tree, or # b) building drivers that are not modularizable @@ -258,6 +265,7 @@ config GKI_HACKS_TO_FIX select GKI_HIDDEN_MM_CONFIGS select GKI_HIDDEN_ETHERNET_CONFIGS select GKI_HIDDEN_DMA_CONFIGS + select GKI_HIDDEN_PCIE_ROCKCHIP_CONFIGS help Dummy config option used to enable core functionality used by