1 Star 0 Fork 651

liuyafei/mugen_16

forked from openEuler/mugen 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
dep_install.sh 2.67 KB
一键复制 编辑 原始数据 按行查看 历史
zjl_long 提交于 2022-07-13 18:28 . update cli-test cases
#!/usr/bin/bash
# Copyright (c) [2021] Huawei Technologies Co.,Ltd.ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
####################################
# @Author : lemon-higgins
# @email : lemon.higgins@aliyun.com
# @Date : 2021-04-23 16:08:22
# @License : Mulan PSL v2
# @Version : 1.0
# @Desc :
#####################################
usage() {
printf "Usage: sh dep_install.sh [options]\n
-e: install addtitional dependencies qemu for remote testing\n
-g shell_file: run shell file to set crocess compiliation, if have run srcipt must use source\n
-h: print this usage info\n
\n"
}
common_dep(){
yum install expect psmisc make iputils python3-six python3-paramiko -y
}
qemu_dep(){
echo "install qemu"
yum install bridge-utils -y
qemu-system-aarch64 --version && qemu-system-arm --version
if [ $? -eq 0 ]; then
return 0
fi
yum install qemu-system-aarch64 qemu-system-arm -y
if [ $? -ne 0 ]; then
echo "ERROR: qemu not install, you need install it youself."
return 1
fi
}
run_name=$0
in_qemu=0
run_shell=""
check_option(){
had_g=0
for opt in "$@"; do
if [[ $opt == "-h" ]]; then
usage
return 0
elif [[ $opt == "-e" ]]; then
in_qemu=1
elif [[ $opt == "-g" ]]; then
had_g=1
check_name=${run_name##*/}
if [[ $check_name == "dep_install.sh" ]]; then
echo "ERROR: run with crocess compiliation, must use 'source' to run script"
return 1
fi
elif [ $had_g -eq 1 ]; then
run_shell=$opt
else
usage
return 1
fi
done
if [[ had_g -eq 1 && run_shell == "" ]]; then
echo "ERROR: -g parameter need"
usage
return 1
fi
return 0
}
main(){
check_option $@
if [ $? -ne 0 ]; then
return 1
fi
common_dep
if [ $? -ne 0 ]; then
return 1
fi
if [ $in_qemu -eq 1 ]; then
qemu_dep
if [ $? -ne 0 ]; then
return 1
fi
fi
if [ $run_shell ]; then
source $run_shell
if [ $? -ne 0 ]; then
echo "ERROR: run crocess compiliation file $run_shell fail"
return 1
fi
fi
return 0
}
main $@
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/liuyafei1/mugen_16.git
git@gitee.com:liuyafei1/mugen_16.git
liuyafei1
mugen_16
mugen_16
master

搜索帮助