
On Thu, Nov 19, 2020 at 08:47:14AM +0800, Yu Chuan wrote:
[Why] We can only generate the rootfs of dailybuild, so decouple the code related to dailybuild.
looks your patch is about the follow function: [Why] The 'iso_url_file' field is only relate to the dailybuild function, and this field is unnecessary when user only want generate a rootfs from offical distribution. But now if this field is none, this job will failed. So decouple the code related to dailybuild. [Addition] if the `iso_url_file` field exists, this job will generate a soft link which point to the result rootfs. soft link name: {iso_version}-dailybuild.
get_cache_iso_checksum() { - mount_rootfs - CHECKSUM_FILE_CACHE="${ROOTFS_LOCAL_PATH}/${iso_version}-latest.sha256sum"
[ ! -f "${CHECKSUM_FILE_CACHE}" ] ||
why it seems so strange? Thanks, Shenwei
SHA256SUM_CACHE=$(awk '{print $1}' "$CHECKSUM_FILE_CACHE") @@ -243,7 +240,10 @@ config_iso2rootfs() pre_works() { check_yaml_vars - check_sha256sum_update + + mount_rootfs + [ -n "${iso_url_file}" ] && check_sha256sum_update + check_os
config_iso2rootfs @@ -286,7 +286,7 @@ config_iso2qcow2()
config_pip_proxy config_iso_conf - config_iso_url + [ -n "${iso_url_file}" ] && config_iso_url }
run_iso2qcow2() @@ -332,7 +332,7 @@ config_qcow2rootfs() run_qcow2rootfs() { log_info "starting run qcow2rootfs ..." - local qcow2_path="${I2Q_SRC}/output/${ISO_NAME%.iso}.qcow2" + local qcow2_path="$(ls ${I2Q_SRC}/output/*.qcow2)"
cd "${CCI_SRC}/container/qcow2rootfs" ./run "${qcow2_path}" "${ROOTFS_DES_DIR}" @@ -501,12 +501,14 @@ post_works() { log_info "starting post works ..."
- mv "${CHECKSUM_FILE_CACHE}.tmp" "${CHECKSUM_FILE_CACHE}" + [ -n "${iso_url_file}" ] && { + mv "${CHECKSUM_FILE_CACHE}.tmp" "${CHECKSUM_FILE_CACHE}"
- local soft_link="${iso_version}-dailybuild" - cd "${ROOTFS_LOCAL_PATH}" && - rm -f "${soft_link}" && - ln -s "$(basename "${ROOTFS_DES_DIR}")" "${soft_link}" + local soft_link="${iso_version}-dailybuild" + cd "${ROOTFS_LOCAL_PATH}" && + rm -f "${soft_link}" && + ln -s "$(basename "${ROOTFS_DES_DIR}")" "${soft_link}" + }
cd / && umount "${ROOTFS_LOCAL_PATH}"
-- 2.23.0