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
86 # Check if the script is inside the repo
87 if cd ${SCRIPTS_DIR} && git rev-parse --is-inside-work-tree > /dev/null 2>&1; then
88 CLONED_ORAN_REPO=`dirname ${SCRIPTS_DIR}`
89 echo_info "Use the cloned oran repo: ${CLONED_ORAN_REPO}"
91 ln -sf ${CLONED_ORAN_REPO}
93 echo_info "Cloning oran layer:"
95 RUN_CMD="git clone https://gerrit.o-ran-sc.org/r/pti/rtp"
96 echo_cmd "Cloing with:"
100 # Source the build env
102 . ./environment-setup-x86_64-wrlinuxsdk-linux
104 . ./oe-init-build-env ${PRJ_BUILD_DIR}
106 # Add the meta-oran layer
108 RUN_CMD="bitbake-layers add-layer ${SRC_ORAN_DIR}/rtp/meta-oran"
109 echo_cmd "Add the meta-oran layer into the build project"
112 # Add extra configs into local.conf
113 cat << EOF >> conf/local.conf
114 ########################
115 # Configs for oran-inf #
116 ########################
119 WRTEMPLATE += "feature/oran-host-rt-tune"
122 if [ "${EXTRA_CONF}" != "" ] && [ -f "${EXTRA_CONF}" ]; then
123 cat ${EXTRA_CONF} >> conf/local.conf
126 # Build the oran-inf-host image
128 TIMESTAMP=`date +"%Y%m%d_%H%M%S"`
130 RUN_CMD="bitbake ${DRYRUN} oran-image-inf-host"
131 echo_cmd "Build the oran-image-inf-host image"
132 bitbake ${DRYRUN} oran-image-inf-host 2>&1|tee logs/bitbake_oran-image-inf-host_${TIMESTAMP}.log
134 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"