build_oran.sh: add support for nxp-lx2xxx 38/2638/1
authorJackie Huang <jackie.huang@windriver.com>
Mon, 2 Mar 2020 11:29:01 +0000 (19:29 +0800)
committerJackie Huang <jackie.huang@windriver.com>
Mon, 2 Mar 2020 15:00:56 +0000 (23:00 +0800)
- remove the default templates
- add templates according to different BSP
- ceph is only added for x86-64
- linux-yocto-rt: add support for nxp-lx2xxx
- add patch for nxp-lx2xxx to support preempt-rt
- add an option for build script to select BSP

Issue-ID: INF-7
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Change-Id: I80c8acd9745db7003c56594ee36a1643ac269f2c

meta-oran/conf/distro/include/oran-whitelist.conf
meta-oran/conf/distro/oran-inf.conf
meta-oran/recipes-base/images/oran-image-inf-host.bb
meta-oran/recipes-kernel/linux/linux-yocto-rt_%.bbappend [new file with mode: 0644]
meta-oran/templates/default/README [deleted file]
meta-oran/templates/default/require [deleted file]
meta-oran/templates/default/template.conf [deleted file]
scripts/build_oran.sh
scripts/meta-patches/nxp-lx2xxx/0001-Revert-nxp-lx2xxx-remove-preempt-rt-related-file.patch [new file with mode: 0644]

index cb9a5cb..53f97b0 100644 (file)
@@ -90,6 +90,7 @@ PNWHITELIST_realtime_append = " \
 PNWHITELIST_virtualization-layer_append = " \
     ceph \
     cgroup-lite \
+    cni \
     compose-file \
     containerd-opencontainers \
     diod \
index 131c2ad..cb09707 100644 (file)
@@ -47,7 +47,7 @@ NON_MULTILIB_RECIPES_append = " ceph"
 
 # For images
 IMAGE_OVERHEAD_FACTOR ="1.1"
-IMAGE_FSTYPES += "tar.bz2 live wic.vmdk wic.vdi wic.qcow2"
+IMAGE_FSTYPES += "tar.bz2 wic.qcow2"
 
 # Use the default splash
 SYSLINUX_SPLASH = ""
index d065a12..5fee605 100644 (file)
@@ -23,7 +23,6 @@ require recipes-base/images/oran-image-inf-minimal.bb
 IMAGE_INSTALL += " \
     aufs-util \
     celt051 \
-    ceph \
     dpdk \
     hwloc \
     kernel-modules \
@@ -35,6 +34,10 @@ IMAGE_INSTALL += " \
     python-pyparsing \
     rt-tests \
     schedtool-dl \
+"
+
+IMAGE_INSTALL_append_x86-64 = " \
+    ceph \
     spice \
 "
 
diff --git a/meta-oran/recipes-kernel/linux/linux-yocto-rt_%.bbappend b/meta-oran/recipes-kernel/linux/linux-yocto-rt_%.bbappend
new file mode 100644 (file)
index 0000000..5e7ca3a
--- /dev/null
@@ -0,0 +1 @@
+TARGET_SUPPORTED_KTYPES_append_nxp-lx2xxx = " preempt-rt"
diff --git a/meta-oran/templates/default/README b/meta-oran/templates/default/README
deleted file mode 100644 (file)
index 1e1e082..0000000
+++ /dev/null
@@ -1 +0,0 @@
-This is the the default template for meta-oran
diff --git a/meta-oran/templates/default/require b/meta-oran/templates/default/require
deleted file mode 100644 (file)
index db29db8..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-feature/hosts-ia
-feature/kvm
-feature/kubernetes
-feature/self-hosted
-feature/dpdk
diff --git a/meta-oran/templates/default/template.conf b/meta-oran/templates/default/template.conf
deleted file mode 100644 (file)
index 05ca820..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-BANNER_ORAN_DEFAULT = ""
-
-BANNER_ORAN_DEFAULT_meta-oran = "\
-The default kernel will build the host kernel for the wrlinux-oran \
-distribution.  Add the feature/oran-guest to enable the guest \
-kernel."
-
-CONFIG_BANNER[meta-oran_default] = "${@'${BANNER_ORAN_DEFAULT}' if d.getVar('WRLINUX_OVP_ENABLE') != "guest" else ''}"
index 12dce7b..a94f94a 100755 (executable)
 # Ensure we fail the job if any steps fail.
 set -e -o pipefail
 
+SUPPORTED_BSP="intel-x86-64 nxp-lx2xxx"
+WRTEMPLATE_COMMON="feature/oran-host-rt-tune feature/kubernetes feature/self-hosted"
+WRTEMPLATE_X86="feature/hosts-ia feature/kvm feature/dpdk"
+
+SRC_ORAN_BRANCH="master"
+SRC_WRL_BRANCH="WRLINUX_10_18_BASE"
+SRC_WRL_URL="git://github.com/WindRiver-Labs/wrlinux-x.git"
+
+SCRIPTS_DIR=$(dirname $(readlink -f $0))
+
 help_info () {
 cat << ENDHELP
 Usage:
-$(basename $0) <-w WORKSPACE_DIR> [-n] [-h]
+$(basename $0) <-w WORKSPACE_DIR> [-b BSP] [-n] [-h] [-r]
 where:
     -w WORKSPACE_DIR is the path for the project
+    -b BPS is one of supported BSP: "${SUPPORTED_BSP}"
+       (default is intel-x86-64 if not specified.)
     -n dry-run only for bitbake
     -h this help info
     -e EXTRA_CONF is the pat for extra config file
@@ -67,18 +79,33 @@ check_yn_rm_work () {
     esac
 }
 
+check_valid_bsp () {
+    bsp="$1"
+    for b in ${SUPPORTED_BSP}; do
+        if [ "${bsp}" == "${b}" ]; then
+            BSP_VALID="${bsp}"
+            break
+        fi
+    done
+    if [ -z "${BSP_VALID}" ]; then
+        echo_error "${bsp} is not a supported BSP, the supported BSPs are: ${SUPPORTED_BSP}"
+        exit 1
+    fi
+}
+
 DRYRUN=""
 EXTRA_CONF=""
 RM_WORK="Yes"
+BSP="intel-x86-64"
 
-SCRIPTS_DIR=`dirname $0`
-SCRIPTS_DIR=`readlink -f $SCRIPTS_DIR`
-
-while getopts "w:e:r:nh" OPTION; do
+while getopts "w:b:e:r:nh" OPTION; do
     case ${OPTION} in
         w)
             WORKSPACE=`readlink -f ${OPTARG}`
             ;;
+        b)
+           check_valid_bsp ${OPTARG}
+           ;;
         e)
             EXTRA_CONF=`readlink -f ${OPTARG}`
             ;;
@@ -95,29 +122,33 @@ while getopts "w:e:r:nh" OPTION; do
     esac
 done
 
-if [ -z ${WORKSPACE} ]; then
+if [ -z "${WORKSPACE}" ]; then
     echo_info "No workspace specified, a directory 'workspace' will be created in current directory as the workspace"
     WORKSPACE=`readlink -f workspace`
 fi
 
-SRC_WRL_DIR=${WORKSPACE}/src_wrl1018
+if [ -n "${BSP_VALID}" ]; then
+    BSP="${BSP_VALID}"
+fi
+
+SRC_WRL_DIR=${WORKSPACE}/src_wrlinux
 SRC_ORAN_DIR=${WORKSPACE}/src_oran
 PRJ_BUILD_DIR=${WORKSPACE}/prj_oran-inf
 
 mkdir -p ${SRC_WRL_DIR} ${PRJ_BUILD_DIR} ${SRC_ORAN_DIR}
 
 echo_info "The following directories are created in your workspace(${WORKSPACE}):"
-echo_info "For wrlinux1018 source: ${SRC_WRL_DIR}"
+echo_info "For wrlinux source: ${SRC_WRL_DIR}"
 echo_info "For oran layer source: ${SRC_ORAN_DIR}"
 echo_info "For build project: ${PRJ_BUILD_DIR}"
 
-# Clone the source of WRLinux BASE 10.18 from github and setup
-RUN_CMD="git clone --branch WRLINUX_10_18_BASE git://github.com/WindRiver-Labs/wrlinux-x.git"
-echo_cmd "Cloning wrlinux 1018 source from github:"
+# Clone the source of WRLinux from github and setup
+RUN_CMD="git clone --branch ${SRC_WRL_BRANCH} ${SRC_WRL_URL}"
+echo_cmd "Cloning wrlinux-x source from github:"
 cd ${SRC_WRL_DIR}
 ${RUN_CMD}
 
-RUN_CMD="./wrlinux-x/setup.sh --machines intel-x86-64 --layers meta-cloud-services"
+RUN_CMD="./wrlinux-x/setup.sh --machines ${BSP} --layers meta-cloud-services"
 echo_cmd "Setup wrlinux build project:"
 ${RUN_CMD}
 
@@ -133,11 +164,17 @@ if cd ${SCRIPTS_DIR} && git rev-parse --is-inside-work-tree > /dev/null 2>&1; th
 else
     echo_info "Cloning oran layer:"
     cd ${SRC_ORAN_DIR}
-    RUN_CMD="git clone https://gerrit.o-ran-sc.org/r/pti/rtp"
+    RUN_CMD="git clone --branch ${SRC_ORAN_BRANCH} https://gerrit.o-ran-sc.org/r/pti/rtp"
     echo_cmd "Cloing with:"
     ${RUN_CMD}
 fi
 
+# Apply meta patches for nxp-lx2xxx
+if [ "${BSP}" == "nxp-lx2xxx" ]; then
+    cd ${SRC_WRL_DIR}/layers/nxp-lx2xxx/
+    git am ${SRC_ORAN_DIR}/rtp/scripts/meta-patches/nxp-lx2xxx/0001-Revert-nxp-lx2xxx-remove-preempt-rt-related-file.patch
+fi
+
 # Source the build env
 cd ${SRC_WRL_DIR}
 . ./environment-setup-x86_64-wrlinuxsdk-linux
@@ -157,10 +194,20 @@ cat << EOF >> conf/local.conf
 ########################
 DISTRO = "oran-inf"
 BB_NO_NETWORK = '0'
-WRTEMPLATE += "feature/oran-host-rt-tune"
 
 # Work around for CI build
 IMAGE_INSTALL_remove = "ceph"
+
+# For container image
+WR_APP_CONTAINER_APP = "rt-tests"
+
+# Disable multilib fo nxp-lx2xxx
+MULTILIBS_nxp-lx2xxx = ""
+DEFAULTTUNE_virtclass-multilib-lib32_nxp-lx2xxx = ""
+
+# Add templates
+WRTEMPLATE += "${WRTEMPLATE_COMMON}"
+WRTEMPLATE_prepend_x86-64 += "${WRTEMPLATE_X86}"
 EOF
 
 if [ "${RM_WORK}" == "Yes" ]; then
@@ -178,4 +225,8 @@ RUN_CMD="bitbake ${DRYRUN} oran-image-inf-host"
 echo_cmd "Build the oran-image-inf-host image"
 bitbake ${DRYRUN} oran-image-inf-host 2>&1|tee logs/bitbake_oran-image-inf-host_${TIMESTAMP}.log
 
+RUN_CMD="bitbake ${DRYRUN} wr-app-container"
+echo_cmd "Build the wr-app-container image"
+bitbake ${DRYRUN} wr-app-container 2>&1|tee logs/bitbake_wr-app-container_${TIMESTAMP}.log
+
 echo_info "Build succeeded, you can get the image in ${PRJ_BUILD_DIR}/tmp-glibc/deploy/images/intel-x86-64/oran-image-inf-host-intel-x86-64.iso"
diff --git a/scripts/meta-patches/nxp-lx2xxx/0001-Revert-nxp-lx2xxx-remove-preempt-rt-related-file.patch b/scripts/meta-patches/nxp-lx2xxx/0001-Revert-nxp-lx2xxx-remove-preempt-rt-related-file.patch
new file mode 100644 (file)
index 0000000..21a880b
--- /dev/null
@@ -0,0 +1,37 @@
+From e49c87267262cb7172281007717e45acd3918278 Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Thu, 7 Nov 2019 08:58:44 +0000
+Subject: [PATCH] Revert "nxp-lx2xxx: remove preempt-rt related file"
+
+This reverts commit 3fa6ccab0f46ecdaa6f0f528633c6d53f3cc5f62.
+---
+ README                                            | 2 +-
+ recipes-kernel/linux/linux-yocto-rt_4.18.bbappend | 3 +++
+ 2 files changed, 4 insertions(+), 1 deletion(-)
+ create mode 100755 recipes-kernel/linux/linux-yocto-rt_4.18.bbappend
+
+diff --git a/README b/README
+index ff42782..73a1d36 100755
+--- a/README
++++ b/README
+@@ -166,7 +166,7 @@ Note: Use 'i2c mw 66 50 20;sf probe 0:0' to program DEV#1, while use
+ NXP provides a pre-built image which contains U-Boot, RCW, etc.
+ Please download it through:
+- wget http://www.nxp.com/lgfiles/sdk/lsdk1903/firmware_lx2160ardb_uboot_xspiboot.img
++ wget http://www.nxp.com/lgfiles/sdk/lsdk1906/firmware_lx2160ardb_uboot_xspiboot.img
+ and burn it to the target board under the U-Boot prompt using the commands below:
+ $i2c mw 66 50 20;sf probe 0:0;
+diff --git a/recipes-kernel/linux/linux-yocto-rt_4.18.bbappend b/recipes-kernel/linux/linux-yocto-rt_4.18.bbappend
+new file mode 100755
+index 0000000..07c6519
+--- /dev/null
++++ b/recipes-kernel/linux/linux-yocto-rt_4.18.bbappend
+@@ -0,0 +1,3 @@
++require linux-yocto-nxp-lx2xxx.inc
++
++KBRANCH_nxp-lx2xxx  = "v4.18/standard/preempt-rt/nxp-ls/lsdk-1906/${KMACHINE}"
+-- 
+2.18.1
+