diff --git a/build.py b/build.py index cd538fdd14b8f29aa1fda7a120b90b8105e69e09..d2fc7789e6f4917b675a9f1d9d37b2c349cf5923 100644 --- a/build.py +++ b/build.py @@ -105,6 +105,10 @@ class Build(object): return -1 if step: + cmd = 'echo "export STEP=%s" >> script/setup_env.sh' % step + if os.system(cmd) != 0: + logger.error("build fail") + return -1 code = trace_execute("bash -x {0} {1}".format( self.local_build_shell_path, step), env=self.env, logger=logger) if code != 0 and code != "0": diff --git a/script/common_function.sh b/script/common_function.sh index de7817d3c58ee62aae72acb0da4bdc94b936f0ec..c6dca1ff7cafc108a97e09c0d94111c425d01647 100644 --- a/script/common_function.sh +++ b/script/common_function.sh @@ -97,8 +97,11 @@ source "${BUILD_SCRIPT_DIR}"/step/get_version.sh source "${BUILD_SCRIPT_DIR}"/step/release_dir.sh #source "${BUILD_SCRIPT_DIR}"/step/createrepo.sh source "${BUILD_SCRIPT_DIR}"/step/make_docker_image.sh -source "${BUILD_SCRIPT_DIR}"/step/make_raspi_image.sh -source "${BUILD_SCRIPT_DIR}"/step/make_microvm_image.sh +if [ "$STEP" == "make_raspi_image" ];then + source "${BUILD_SCRIPT_DIR}"/step/make_raspi_image.sh +else + source "${BUILD_SCRIPT_DIR}"/step/make_microvm_image.sh +fi source "${BUILD_SCRIPT_DIR}"/step/make_gcov.sh source "${BUILD_SCRIPT_DIR}"/step/merge_release_html.sh #source "${BUILD_SCRIPT_DIR}"/step/build_and_wait.sh diff --git a/script/config/unable_install_list b/script/config/unable_install_list new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/script/make_version.sh b/script/make_version.sh index 3aefe0cd1f8bcc41f1959c8280d75466c96d8c0c..f5c8da03b277e9c08f0d41cedfb87bf8188519ca 100644 --- a/script/make_version.sh +++ b/script/make_version.sh @@ -9,6 +9,7 @@ export HOME="/root" export OUTPUT_PATH="${BUILD_SCRIPT_DIR}/output" export PROJECT_PATH="${BUILD_SCRIPT_DIR}/../../../../.." export ERROR_LOG="${OUTPUT_PATH}/error_log" +export UNABLE_INSTALL_LIST="${BUILD_SCRIPT_DIR}"/config/unable_install_list if [ ! -d "${OUTPUT_PATH}" ]; then mkdir -p "${OUTPUT_PATH}" @@ -27,7 +28,7 @@ source "${BUILD_SCRIPT_DIR}"/tools/common.sh || exit 1 source "${BUILD_SCRIPT_DIR}"/tools/chroot.sh || exit 1 #source "${BUILD_SCRIPT_DIR}"/tools/obs.sh || exit 1 -function get_private_ip() +function get_repose() { expect -c " spawn $* @@ -41,7 +42,7 @@ function get_private_ip() } for((i=0;i<3;i++)); do -ret=$(get_private_ip ssh -i ~/.ssh/super_publish_rsa root@${RELEASE_SERVER_IP} ip addr | grep "172." | tr -cd "[0-9].[0-9]/ " | awk '{print $3}' | awk -F "/" '{print $1}') +ret=$(get_repose ssh -i ~/.ssh/super_publish_rsa root@${RELEASE_SERVER_IP} ip addr | grep "172." | tr -cd "[0-9].[0-9]/ " | awk '{print $3}' | awk -F "/" '{print $1}') if [ "$ret" != "${RELEASE_SERVER_IP}" ];then break fi diff --git a/script/step/make_debug_everything.sh b/script/step/make_debug_everything.sh index 051c89e77911b9d9de86ff09bda400025b4b5af3..8040b9cf6a2b648fef8ba1a0021def999f9d9ae0 100644 --- a/script/step/make_debug_everything.sh +++ b/script/step/make_debug_everything.sh @@ -30,27 +30,21 @@ function make_debug_everything_inchroot() yum_conf="${BUILD_SCRIPT_DIR}/config/repo_conf/obs-repo.conf" yum clean all -c "${yum_conf}" - if rpm -q mkeuleros &> /dev/null; then - yum remove mkeuleros -y + if rpm -q oemaker &> /dev/null; then + yum remove oemaker -y fi if rpm -q lorax &> /dev/null; then yum remove lorax -y fi - yum install mkeuleros lorax -y -c "${yum_conf}" - cd /opt/mkeuleros - - if [ "${ARCH}" = "x86_64" ]; then - mkeuleros_conf="config/standard/standard.conf" - elif [ "${ARCH}" = "aarch64" ]; then - mkeuleros_conf="config/aarch64/standard.conf" - fi + yum install oemaker lorax -y -c "${yum_conf}" + cd /opt/oemaker set +e num=0 while [ "${num}" -lt 3 ] do - bash -x mkeuleros.sh -f "${mkeuleros_conf}" -n "${OS_NAME}" -v "${OS_VERSION}" -s "SP1" -a "${ARCH}" -r "${OBS_STANDARD_REPO_URL}" -i 1 + bash -x oemaker -t everything_debug -p ${PRODUCTS} -v "${OS_VERSION}" -r "" -s "${OBS_STANDARD_REPO_URL}" if [ $? -eq 0 ];then break elif [ $? -eq 133 ]; then @@ -84,8 +78,11 @@ function make_debug_everything_inchroot() sshcmd "${SSH_CMD}" sshscp "${TGZ_NAME} ${TGZ_NAME}${SHA256SUM}" "${RELEASE_DIR}" set +e - SSH_CMD="losetup -a | grep ${TGZ_NAME} | grep ${OS_VERSION} | awk -F ':' '{print \$1}' | xargs umount" - sshcmd "${SSH_CMD}" + ret=$(get_repose ssh -i ~/.ssh/super_publish_rsa root@${RELEASE_SERVER_IP} mount | grep ${RELEASE_VERSION_DIR} | grep OS/${ARCH} | awk '{print $3}') + for mp in $ret + do + ret=$(get_repose ssh -i ~/.ssh/super_publish_rsa root@${RELEASE_SERVER_IP} umount $mp) + done SSH_CMD="mount -t iso9660 -o loop ${RELEASE_DIR}/${TGZ_NAME} ${MOUNT_DIR}" sshcmd "${SSH_CMD}" set -e diff --git a/script/step/make_iso.sh b/script/step/make_iso.sh index 54430e33503a2ba35bd6bae407355504fc793938..744ccc4205eea217a88c0d11b7efa77b4b8c37d0 100644 --- a/script/step/make_iso.sh +++ b/script/step/make_iso.sh @@ -28,27 +28,21 @@ function make_iso_inchroot() TIME=${TIME#"${version}"-} yum_conf="${BUILD_SCRIPT_DIR}/config/repo_conf/obs-repo.conf" yum clean all -c "${yum_conf}" - if rpm -q mkeuleros &> /dev/null; then - yum remove mkeuleros -y + if rpm -q oemaker &> /dev/null; then + yum remove oemaker -y fi if rpm -q lorax &> /dev/null; then yum remove lorax -y fi - - yum install mkeuleros lorax -y -c "${yum_conf}" - cd /opt/mkeuleros - - if [ "${ARCH}" = "x86_64" ]; then - mkeuleros_conf="config/standard/standard.conf" - elif [ "${ARCH}" = "aarch64" ]; then - mkeuleros_conf="config/aarch64/standard.conf" - fi + yum install oemaker lorax -y -c "${yum_conf}" + cd /opt/oemaker set +e num=0 + set +u while [ "${num}" -lt 3 ] do - bash -x mkeuleros.sh -f "${mkeuleros_conf}" -n "${OS_NAME}" -v "${OS_VERSION}" -s "SP1" -a "${ARCH}" -r "${OBS_STANDARD_REPO_URL}" + bash -x oemaker -t standard -p ${PRODUCTS} -v "${OS_VERSION}" -r "" -s "${OBS_STANDARD_REPO_URL}" if [ $? -eq 0 ];then break elif [ $? -eq 133 ]; then @@ -84,11 +78,13 @@ function make_iso_inchroot() sshcmd "${SSH_CMD}" sshscp "${TGZ_NAME} ${TGZ_NAME}${SHA256SUM} ${iso_rpmlist}" "${RELEASE_DIR}" set +e - SSH_CMD="losetup -a | grep ${TGZ_NAME} | grep ${OS_VERSION} | awk -F ':' '{print \$1}' | xargs umount" - sshcmd "${SSH_CMD}" + ret=$(get_repose ssh -i ~/.ssh/super_publish_rsa root@${RELEASE_SERVER_IP} mount | grep ${RELEASE_VERSION_DIR} | grep OS/${ARCH} | awk '{print $3}') + for mp in $ret + do + ret=$(get_repose ssh -i ~/.ssh/super_publish_rsa root@${RELEASE_SERVER_IP} umount $mp) + done SSH_CMD="mount -t iso9660 -o loop ${RELEASE_DIR}/${TGZ_NAME} ${MOUNT_DIR}" sshcmd "${SSH_CMD}" - set -e [ -n "${iso_rpmlist}" ] && rm -rf "${iso_rpmlist}" release_file="release_iso" @@ -106,7 +102,6 @@ function make_iso_inchroot() echo "
View the history version, please go to : ${RELEASE_HTTP_URL}/${RELEASE_VERSION_DIR}/
" >> "${html}" echo "