+osimage_dir=/srv/initrd/osimage/${os}/${os_arch}/${os_version}
ok
add ""
-download_os_rootfs() -{
mkdir -p $rootfs_dir
cd $rootfs_dir
+mkdir -p $rootfs_dir $osimage_dir
download_url="http://api.compass-ci.openeuler.org:${SRV_HTTP_OS_PORT}/os/${os}/${os_arch}/${os_version}.cgz"
wget $download_url
+wget_download() +{
- local download_url=$1
- wget $download_url
- [ "$?" -ne 0 ] && {
log_error "failed to download os rootfs: $download_url"
exit 1
- }
wget $download_url || { xxx }
ok
+}
[ "$?" -ne 0 ] && {
log_error "failed to download os rootfs: $download_url"
exit 1
}
+download_os_rootfs() +{
- cd $rootfs_dir && {
wget_download "http://api.compass-ci.openeuler.org:${SRV_HTTP_OS_PORT}/os/${os}/${os_arch}/${os_version}.cgz" gzip -dc ${os_version}.cgz | cpio -id rm -rf ${os_version}.cgz }
+}
gzip -dc ${os_version}.cgz | cpio -id
rm -rf ${os_version}.cgz
+download_osimage() +{
- cd $osimage_dir
- wget_download "http://api.compass-ci.openeuler.org:$%7BSRV_HTTP_INITRD_PORT%7D/initrd/osima..."
- wget_download "http://api.compass-ci.openeuler.org:$%7BSRV_HTTP_INITRD_PORT%7D/initrd/deps/..."
ditto
ok
Thanks, Yinsi
Thanks, Luan Shengde
}
is_virtual() @@ -42,4 +55,4 @@ is_virtual() dmidecode -s system-product-name | grep -iq "virtual" }
-is_virtual || download_os_rootfs
+is_virtual || ( download_os_rootfs && download_osimage )
2.23.0