ucloud-setup/init.sh
2019-09-07 13:21:54 +05:00

57 lines
No EOL
1.4 KiB
Bash

get_distro() {
OS=$(cat /etc/*release | grep ID | head -1 | cut -c 4-)
echo $OS
}
if ! grep -q "export LC_ALL=C.UTF-8" ~/.bashrc; then
echo 'export LC_ALL=C.UTF-8' >> ~/.bashrc
echo 'export LANG=C.UTF-8' >> ~/.bashrc
case $(get_distro) in
"alpine")
# Install QEMU
(git clone https://github.com/ahmedbilal/qemu-with-rbd-alpine.git \
&& cd qemu-with-rbd-alpine && apk add *.apk --allow-untrusted)
# Enable Alpine (3.10 + Edge) Repos
cat > /etc/apk/repositories << EOF
http://dl-cdn.alpinelinux.org/alpine/v3.10/main
http://dl-cdn.alpinelinux.org/alpine/v3.10/community
http://dl-cdn.alpinelinux.org/alpine/edge/main
http://dl-cdn.alpinelinux.org/alpine/edge/community
http://dl-cdn.alpinelinux.org/alpine/edge/testing
EOF
# Update Package List and Upgrade System
apk update
apk upgrade
# Install system packages
apk add python3 ceph py2-pip py3-pip etcd-ctl
# Some python package dependencies
apk add libffi-dev openssl-dev make alpine-sdk gcc g++ python3-dev
apk add py3-grpcio py3-protobuf py3-tempita
;;
"devuan")
# Update Package List and Upgrade System
apt update
apt upgrade --yes
# Install QEMU
apt install qemu python3 ceph python-pip python3-pip etcd-client --yes
esac
pip3 install --upgrade pip
pip2 install --upgrade pip
# For CEPH
pip2 install prettytable
pip3 install pipenv
pipenv install