6 $(basename $0) <-w WORKSPACE_DIR> [-n] [-h]
8 -w WORKSPACE_DIR is the path for the project
9 -n dry-run only for bitbake
11 -e EXTRA_CONF is the pat for extra config file
26 echo "CMD: ${RUN_CMD}"
30 echo "Missing options!"
38 SCRIPTS_DIR=`dirname $0`
39 SCRIPTS_DIR=`readlink -f $SCRIPTS_DIR`
41 while getopts "w:e:nh" OPTION; do
44 WORKSPACE=`readlink -f ${OPTARG}`
47 EXTRA_CONF=`readlink -f ${OPTARG}`
59 if [ -z ${WORKSPACE} ]; then
60 echo_info "No workspace specified, a directory 'workspace' will be created in current directory as the workspace"
61 WORKSPACE=`readlink -f workspace`
64 SRC_WRL_DIR=${WORKSPACE}/src_wrl1018
65 SRC_ORAN_DIR=${WORKSPACE}/src_oran
66 PRJ_BUILD_DIR=${WORKSPACE}/prj_oran-inf
68 mkdir -p ${SRC_WRL_DIR} ${PRJ_BUILD_DIR} ${SRC_ORAN_DIR}
70 echo_info "The following directories are created in your workspace(${WORKSPACE}):"
71 echo_info "For wrlinux1018 source: ${SRC_WRL_DIR}"
72 echo_info "For oran layer source: ${SRC_ORAN_DIR}"
73 echo_info "For build project: ${PRJ_BUILD_DIR}"
75 # Clone the source of WRLinux BASE 10.18 from github and setup
76 RUN_CMD="git clone --branch WRLINUX_10_18_BASE git://github.com/WindRiver-Labs/wrlinux-x.git"
77 echo_cmd "Cloning wrlinux 1018 source from github:"
81 RUN_CMD="./wrlinux-x/setup.sh --machines intel-x86-64 --layers meta-cloud-services"
82 echo_cmd "Setup wrlinux build project:"
85 # Clone the oran layer if it's not already cloned
87 # Check if the script is inside the repo
88 if git -C ${SCRIPTS_DIR} rev-parse --is-inside-work-tree > /dev/null 2>&1; then
89 CLONED_ORAN_REPO=`dirname ${SCRIPTS_DIR}`
90 echo_info "Use the cloned oran repo: ${CLONED_ORAN_REPO}"
91 ln -sf ${CLONED_ORAN_REPO}
93 echo_info "Cloning oran layer:"
94 RUN_CMD="git clone https://gerrit.o-ran-sc.org/r/pti/rtp"
95 echo_cmd "Cloing with:"
99 # Source the build env
101 . ./environment-setup-x86_64-wrlinuxsdk-linux
103 . ./oe-init-build-env ${PRJ_BUILD_DIR}
105 # Add the meta-oran layer
107 RUN_CMD="bitbake-layers add-layer ${SRC_ORAN_DIR}/rtp/meta-oran"
108 echo_cmd "Add the meta-oran layer into the build project"
111 # Add extra configs into local.conf
112 cat << EOF >> conf/local.conf
113 ########################
114 # Configs for oran-inf #
115 ########################
118 WRTEMPLATE += "feature/oran-host-rt-tune"
121 if [ "${EXTRA_CONF}" != "" ] && [ -f "${EXTRA_CONF}" ]; then
122 cat ${EXTRA_CONF} >> conf/local.conf
125 # Build the oran-inf-host image
127 TIMESTAMP=`date +"%Y%m%d_%H%M%S"`
129 RUN_CMD="bitbake ${DRYRUN} oran-image-inf-host"
130 echo_cmd "Build the oran-image-inf-host image"
131 bitbake ${DRYRUN} oran-image-inf-host 2>&1|tee logs/bitbake_oran-image-inf-host_${TIMESTAMP}.log
133 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"