[PATCH compass-ci 4/5] openeuler: build openeuler initramfs image with one command

[Why] Use the tool to create a new openeuler-$version initramfs image with one command. and we also can customize the pre-installed software by configuring ./packages-to-install. [How] We create a link button for the user to use. $CCI_SRC/rootfs/initramfs/openeuler/aarch64/${os_version}/build Signed-off-by: Wang Chenglong <18509160991@163.com> --- container/osimage/openeuler/run | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 container/osimage/openeuler/run diff --git a/container/osimage/openeuler/run b/container/osimage/openeuler/run new file mode 100755 index 0000000..c92c59f --- /dev/null +++ b/container/osimage/openeuler/run @@ -0,0 +1,27 @@ +#!/bin/bash +# SPDX-License-Identifier: MulanPSL-2.0+ +# Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved. + +. ${CCI_SRC}/container/osimage/centos/lib +. ${CCI_SRC}/container/defconfig.sh + +export_root_passwd +DIR=$(dirname $(realpath $0)) +cmd=( + docker run + --name init_docker + -v $DIR/create-image:/root/bin/create-image + -v $DIR/packages-to-install:/tmp/packages-to-install + -v $DIR/files-to-exclude:/tmp/files-to-exclude + -v $DIR/${image}.repo:/etc/yum.repos.d/openEuler.repo + -e ROOT_PASSWD=$ROOT_PASSWD + -e IMAGE_NAME=$IMAGE_NAME + $image + /root/bin/create-image +) + +pull_docker_image +"${cmd[@]}" +docker_cp_image +docker_rm init_docker &> /dev/null +echo "build finished" -- 2.23.0

On Thu, Nov 26, 2020 at 09:27:53AM +0800, Wang Chenglong wrote:
[Why] Use the tool to create a new openeuler-$version initramfs image with one command. and we also can customize the pre-installed software by ^ use , here
+export_root_passwd +DIR=$(dirname $(realpath $0))
add blank line here Thanks, Wang Yong

On Thu, Nov 26, 2020 at 09:58:59AM +0800, Wang Yong wrote:
On Thu, Nov 26, 2020 at 09:27:53AM +0800, Wang Chenglong wrote:
[Why] Use the tool to create a new openeuler-$version initramfs image with one command. and we also can customize the pre-installed software by ^ use , here
Good.
+export_root_passwd +DIR=$(dirname $(realpath $0))
add blank line here
Good. Thanks, Chenglong
Thanks, Wang Yong

On Thu, Nov 26, 2020 at 09:27:53AM +0800, Wang Chenglong wrote:
[Why] Use the tool to create a new openeuler-$version initramfs image with one command. and we also can customize the pre-installed software by configuring ./packages-to-install.
[How] We create a link button for the user to use. $CCI_SRC/rootfs/initramfs/openeuler/aarch64/${os_version}/build
Signed-off-by: Wang Chenglong <18509160991@163.com> --- container/osimage/openeuler/run | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 container/osimage/openeuler/run
diff --git a/container/osimage/openeuler/run b/container/osimage/openeuler/run new file mode 100755 index 0000000..c92c59f --- /dev/null +++ b/container/osimage/openeuler/run @@ -0,0 +1,27 @@
the same as container/osimage/centos/run can merge them?
+#!/bin/bash +# SPDX-License-Identifier: MulanPSL-2.0+ +# Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved. + +. ${CCI_SRC}/container/osimage/centos/lib +. ${CCI_SRC}/container/defconfig.sh + +export_root_passwd +DIR=$(dirname $(realpath $0)) +cmd=( + docker run + --name init_docker + -v $DIR/create-image:/root/bin/create-image + -v $DIR/packages-to-install:/tmp/packages-to-install + -v $DIR/files-to-exclude:/tmp/files-to-exclude + -v $DIR/${image}.repo:/etc/yum.repos.d/openEuler.repo + -e ROOT_PASSWD=$ROOT_PASSWD + -e IMAGE_NAME=$IMAGE_NAME + $image + /root/bin/create-image +) + +pull_docker_image +"${cmd[@]}" +docker_cp_image +docker_rm init_docker &> /dev/null +echo "build finished" -- 2.23.0

On Thu, Nov 26, 2020 at 10:01:12AM +0800, Xiao Shenwei wrote:
On Thu, Nov 26, 2020 at 09:27:53AM +0800, Wang Chenglong wrote:
[Why] Use the tool to create a new openeuler-$version initramfs image with one command. and we also can customize the pre-installed software by configuring ./packages-to-install.
[How] We create a link button for the user to use. $CCI_SRC/rootfs/initramfs/openeuler/aarch64/${os_version}/build
Signed-off-by: Wang Chenglong <18509160991@163.com> --- container/osimage/openeuler/run | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 container/osimage/openeuler/run
diff --git a/container/osimage/openeuler/run b/container/osimage/openeuler/run new file mode 100755 index 0000000..c92c59f --- /dev/null +++ b/container/osimage/openeuler/run @@ -0,0 +1,27 @@
the same as container/osimage/centos/run
can merge them?
Good. When i move the file, it make a mistake, i will fix it. Thanks, Chenglong
+#!/bin/bash +# SPDX-License-Identifier: MulanPSL-2.0+ +# Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved. + +. ${CCI_SRC}/container/osimage/centos/lib +. ${CCI_SRC}/container/defconfig.sh + +export_root_passwd +DIR=$(dirname $(realpath $0)) +cmd=( + docker run + --name init_docker + -v $DIR/create-image:/root/bin/create-image + -v $DIR/packages-to-install:/tmp/packages-to-install + -v $DIR/files-to-exclude:/tmp/files-to-exclude + -v $DIR/${image}.repo:/etc/yum.repos.d/openEuler.repo + -e ROOT_PASSWD=$ROOT_PASSWD + -e IMAGE_NAME=$IMAGE_NAME + $image + /root/bin/create-image +) + +pull_docker_image +"${cmd[@]}" +docker_cp_image +docker_rm init_docker &> /dev/null +echo "build finished" -- 2.23.0

On Thu, Nov 26, 2020 at 10:36:30AM +0800, Wang Chenglong wrote:
+++ b/container/osimage/openeuler/run @@ -0,0 +1,27 @@
the same as container/osimage/centos/run
can merge them?
-v $DIR/${image}.repo:/etc/yum.repos.d/openEuler.repo
这个映射仅用于生成openeuler时的docker,而生成centos是不需要的。我不知道怎么合并他们. 如果centos映射为空,会报错。
make a one for centos? based on os_name to choose Thanks, Shenwei
Thanks, Chenglong
participants (3)
-
Wang Chenglong
-
Wang Yong
-
Xiao Shenwei