1 Star 0 Fork 0

SpaceInvader/MugenGccTest

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
dep_install_eula.sh 3.01 KB
一键复制 编辑 原始数据 按行查看 历史
SpaceInvader 提交于 2024-03-05 02:08 . 1
#!/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(){
zypper install -y expect psmisc make iputils python3-six python3-paramiko lshw
}
anolis_dep(){
yum install expect psmisc make iputils gcc -y
yum install python39 -y
ln -s -f /usr/bin/pip3.9 /etc/alternatives/pip3
ln -s -f /usr/bin/pip-3.9 /etc/alternatives/pip-3
ln -s -f /usr/bin/python3.9 /etc/alternatives/python3
pip3 install paramiko -i https://pypi.tuna.tsinghua.edu.cn/simple
}
qemu_dep(){
echo "install qemu"
zypper install -y bridge-utils
qemu-system-aarch64 --version && qemu-system-arm --version
if [ $? -eq 0 ]; then
return 0
fi
zypper install -y qemu-system-aarch64 qemu-system-arm
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/Paged/mugen-gcc-test.git
git@gitee.com:Paged/mugen-gcc-test.git
Paged
mugen-gcc-test
MugenGccTest
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385