3 # Copyright (C) 2019 Wind River Systems, Inc.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 # Ensure we fail the job if any steps fail.
22 This script is used to genereate package-index and output the path
23 of rpm packages and index files, it must be ran after build_oran.sh
25 $(basename $0) [-w WORKSPACE_DIR] [-n] [-h]
27 -w WORKSPACE_DIR is the path for the project
28 -n dry-run only for bitbake
44 echo "CMD: ${RUN_CMD}"
49 SCRIPTS_DIR=`dirname $0`
50 SCRIPTS_DIR=`readlink -f $SCRIPTS_DIR`
52 while getopts "w:nh" OPTION; do
55 WORKSPACE=`readlink -f ${OPTARG}`
67 if [ -z ${WORKSPACE} ]; then
68 echo_info "No workspace specified, assume './workspace'"
69 WORKSPACE=`readlink -f workspace`
72 if [ ! -d ${WORKSPACE} ]; then
73 echo_error "The workspace ${WORKSPACE} doesn't exist!!"
74 echo_error "You need to run build_oran.sh to create a valid worksapce and build image first."
75 echo_error "Then run this script with -w option to specify the correct path of the worksapce."
80 SRC_WRL_DIR=${WORKSPACE}/src_wrl1018
81 SRC_ORAN_DIR=${WORKSPACE}/src_oran
82 PRJ_BUILD_DIR=${WORKSPACE}/prj_oran-inf
83 RPM_REPO_LIST=${SRC_ORAN_DIR}/rtp/scripts/rpm_repo_list.txt
84 RPM_DEPLOY_DIR=${PRJ_BUILD_DIR}/tmp-glibc/deploy/rpm
85 RPM_REPODATA=${RPM_DEPLOY_DIR}/repodata
87 echo_info "For wrlinux1018 source: ${SRC_WRL_DIR}"
88 echo_info "For oran layer source: ${SRC_ORAN_DIR}"
89 echo_info "For build project: ${PRJ_BUILD_DIR}"
91 # Source the build env
93 . ./environment-setup-x86_64-wrlinuxsdk-linux
95 . ./oe-init-build-env ${PRJ_BUILD_DIR}
98 TIMESTAMP=`date +"%Y%m%d_%H%M%S"`
100 RECIPE_LIST=`grep -v '^#' ${RPM_REPO_LIST}|awk '{print $1}'|sort|uniq`
101 RPM_PKG_LIST=`grep -v '^#' ${RPM_REPO_LIST}|awk '{print $2}'|sort|uniq`
103 if [ -z "${RECIPE_LIST}" ]; then
104 echo_info "The recipes list is empty, nothing to do!!"
109 RUN_CMD="bitbake ${DRYRUN} ${RECIPE_LIST}"
110 echo_cmd "Build the recipes: '${RECIPE_LIST}'"
111 bitbake ${DRYRUN} ${RECIPE_LIST} 2>&1|tee logs/bitbake_recipes_${TIMESTAMP}.log
113 # Build the package-index
114 RUN_CMD="bitbake ${DRYRUN} package-index"
115 echo_cmd "Build the package-index'"
116 bitbake ${DRYRUN} package-index 2>&1|tee logs/bitbake_package-index_${TIMESTAMP}.log
118 echo_info "Build succeeded"
120 echo_info "Package index files"
123 echo_info "RPM files"
124 for i in ${RPM_PKG_LIST}; do
125 readlink -f ${RPM_DEPLOY_DIR}/*/$i