On Wed, Dec 09, 2020 at 09:44:49AM +0800, Liu Shaofei wrote:
On Wed, Dec 09, 2020 at 09:12:01AM +0800, Wang Chenglong wrote:
generate rootfs through docker image with one command. we also can customize the pre-installed software by configuring ./packages-to-install
Signed-off-by: Wang Chenglong 18509160991@163.com
container/docker-rootfs/run | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 container/docker-rootfs/run
diff --git a/container/docker-rootfs/run b/container/docker-rootfs/run new file mode 100755 index 0000000..de9c3a7 --- /dev/null +++ b/container/docker-rootfs/run @@ -0,0 +1,32 @@ +#!/bin/bash +# SPDX-License-Identifier: MulanPSL-2.0+ +# Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved.
+source "$(dirname $(realpath $0))/common"
+root_pwd_file="$HOME/.config/compass-ci/rootfs-passwd"
+get_host_arch +check_cmd_input "$@" +check_passwd_file "$root_pwd_file" +load_docker_img "$1" +echo $docker_name_tag +IMAGE_PACK=$(echo ${docker_name_tag%%:*}.cgz)
+start=(
- docker run
- --privileged=true
- -v $RUN_DIR/setup-image:/usr/bin/setup-image
- -v $RUN_DIR/packages-to-install:/tmp/packages-to-install
- -e ROOT_NEW_PASSWD=$ROOT_NEW_PASSWD
- -e IMAGE_PACK=$IMAGE_PACK
- --name rootfs-docker
- $docker_name_tag
- /usr/bin/setup-image
whether to need to add parameter "-i" or "-d" ?
There is no need to use '-i' or '-d'. When i use parameter, it can't run 'setup-image' script.
Thanks, Chenglong
Thanks, Liushaofei
+)
+"${start[@]}"
+cp_rootfs $IMAGE_PACK $2 +#docker rm -f rootfs-docker
+create_links_vmlinuz_initrd $2
2.23.0