#!/bin/bash SCRIPT_NAME="$(basename ${BASH_SOURCE[0]})" SCRIPT_FULLPATH="$(readlink -f ${BASH_SOURCE[0]})" SCRIPT_BASE="$(dirname ${SCRIPT_FULLPATH})" SCRIPT_VER="0.0.2" CMD_RS_GEN="${SCRIPT_BASE}/script/rootstrap_gen_1.0_64.sh" CMD_API_FILTER="${SCRIPT_BASE}/script/api_filter.py" CMD_API_GDBUS_FILTER="${SCRIPT_BASE}/script/api_filter_gdbus.py" ############################################################################### # function log ############################################################################### function log() { printf "[${SCRIPT_NAME}:${BASH_LINENO[0]}] ${@}\n" } ############################################################################### # function check_error # $1 : Error code(integer) # $2 : Error Message # $3 : Error Xml File) # Example : check_error $? "Fail to function" ############################################################################### function check_error() { if [ "$1" -ne "0" ]; then printf "[${SCRIPT_NAME}:${BASH_LINENO[0]}] ERROR : $2 - exit code ($1) \n" 1>&2 exit $1 fi } ############################################################################### ## function callRootstrapGen # $1 : emulator/target # $2 : ${RPM_PKG_SVR_EMULATOR} # $3 : ${BASE_PKG_SVR_EMULATOR} # Example : callRootstrapGen emulator ${RPM_PKG_SVR_EMULATOR} ${BASE_PKG_SVR_EMULATOR} ############################################################################### function callRootstrapGen () { log "make rootstrap for ${1}..." 1>&2 ROOTSTRAP_TYPE=${1}; if [[ -z ${3} ]] then FULL_RS_CMD="${CMD_RS_GEN} -t ${1} -u ${2} -q ${BUILD_REQUIRED_INSTALLED_PATH} -r ${GBS_BUILDROOT} -A ${OPT_ARCH} ${xmlList}" else FULL_RS_CMD="${CMD_RS_GEN} -t ${1} -u ${2} -b ${3} -q ${BUILD_REQUIRED_INSTALLED_PATH} -r ${GBS_BUILDROOT} -A ${OPT_ARCH} ${xmlList}" fi log "$FULL_RS_CMD" $FULL_RS_CMD check_error $? "Fail to ${CMD_RS_GEN}" log "Done... [$SECONDS]Sec" 1>&2 } OPT_TARGET=false OPT_EMULATOR=false OPT_CONF="" OPT_ARCH="" INTERNAL=false ############################################################################### # function usage ############################################################################### function usage () { echo "$SCRIPT_NAME ($SCRIPT_VER) is script to make rootstrap using xml from OBS" echo "Usage: $SCRIPT_NAME -C [] [