[why] for user deploy compass-ci at their local server, need to download os rootfs to run a qemu kvm or physical machine test.
deploy script will call it to download one os rootfs openeuler aarch64 20.03, user can also use this script to download other os rootfs if they want.
Signed-off-by: Liu Yinsi liuyinsi@163.com --- sbin/download-rootfs | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 sbin/download-rootfs
diff --git a/sbin/download-rootfs b/sbin/download-rootfs new file mode 100755 index 0000000..5ab427b --- /dev/null +++ b/sbin/download-rootfs @@ -0,0 +1,36 @@ +#!/bin/bash +# SPDX-License-Identifier: MulanPSL-2.0+ +# Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved. + +# download os rootfs. +# 1. download default os rootfs openeuler aarch64 20.03 +# example usage: +# ./download-rootfs + +# 2. download os rootfs you want by add params $os, $os_arch, $os_version. +# example usage: +# ./download-rootfs debian aarch64 sid + +: ${os:=openeuler} +: ${os_arch:=aarch64} +: ${os_version:=20.03} + +. ${CCI_SRC}/container/defconfig.sh + +load_cci_defaults + +rootfs_dir=/${os}/${os_arch}/${os_version} + +download_rootfs_file() +{ + mkdir -p /srv/os/${rootfs_dir} + + cd /srv/os/$rootfs_dir || exit + + wget http://api.compass-ci.openeuler.org:$%7BSRV_HTTP_PORT%7D/os/$%7Brootfs_dir%7... + + gzip -dc ${os_version}.cgz |cpio -id + rm -rf ${os_version}.cgz +} + +download_rootfs_file
On Tue, Jan 26, 2021 at 10:14:42AM +0800, Liu Yinsi wrote:
[why] for user deploy compass-ci at their local server, need to download os rootfs to run a qemu kvm or physical machine test.
deploy script will call it to download one os rootfs openeuler aarch64 20.03, user can also use this script to download other os rootfs if they want.
Signed-off-by: Liu Yinsi liuyinsi@163.com
sbin/download-rootfs | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 sbin/download-rootfs
diff --git a/sbin/download-rootfs b/sbin/download-rootfs new file mode 100755 index 0000000..5ab427b --- /dev/null +++ b/sbin/download-rootfs @@ -0,0 +1,36 @@ +#!/bin/bash +# SPDX-License-Identifier: MulanPSL-2.0+ +# Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved.
+# download os rootfs. +# 1. download default os rootfs openeuler aarch64 20.03 +# example usage: +# ./download-rootfs
+# 2. download os rootfs you want by add params $os, $os_arch, $os_version. +# example usage: +# ./download-rootfs debian aarch64 sid
+: ${os:=openeuler} +: ${os_arch:=aarch64} +: ${os_version:=20.03}
+. ${CCI_SRC}/container/defconfig.sh
+load_cci_defaults
+rootfs_dir=/${os}/${os_arch}/${os_version}
+download_rootfs_file() +{
- mkdir -p /srv/os/${rootfs_dir}
- cd /srv/os/$rootfs_dir || exit
- wget http://api.compass-ci.openeuler.org:$%7BSRV_HTTP_PORT%7D/os/$%7Brootfs_dir%7...
$? -ne 0 echo xxx exit1 1
Thanks, Jihui
- gzip -dc ${os_version}.cgz |cpio -id
- rm -rf ${os_version}.cgz
+}
+download_rootfs_file
2.23.0