-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·136 lines (133 loc) · 3.68 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·136 lines (133 loc) · 3.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#!/bin/bash
# Colors section
error() {
echo -ne "\033[0;31m"
echo -n "[ERROR] $1"
echo -e "\033[0m"
}
success() {
echo -ne "\033[0;32m"
echo -n "[SUCCESS] $1"
echo -e "\033[0m"
}
info() {
echo -ne "\033[1;33m"
echo -n "[INFO] $1"
echo -e "\033[0m"
}
red() {
echo -ne "\033[0;31m"
echo -n "$1"
echo -e "\033[0m"
}
green() {
echo -ne "\033[0;32m"
echo -n "$1"
echo -e "\033[0m"
}
yellow() {
echo -ne "\033[1;33m"
echo -n "$1"
echo -e "\033[0m"
}
# Title
title () {
echo ""
yellow " ▄▄▄▄ ▄▄ ▄▄▄▄▄ ▄▄▄▄▄▄▄ "
red "▄██▀▀██▄ ██ ▀▀ ▀▀ ▄███████▄ █████▀▀▀ "
green "███ ███ ██ ██ ██ ███▄███▄ ██ ████▄ ██ ██ ██ ███▄███▄ ███ ███ ▀████▄ "
yellow "███▀▀███ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ███▄▄▄███ ▀████ "
red "███ ███ ██ ▀██▀█ ██ ██ ██ ██▄ ██ ██ ██▄ ▀██▀█ ██ ██ ██ ▀█████▀ ███████▀ "
}
# Installer functions
clone_repo() {
if [ -d AluminiumOS ]; then
info "Cloning on ALOS folder due to stock folder being occupied"
git clone --recurse-submodules https://github.com/BasGame1/AluminiumOS.git ALOS --depth=1
DIR=alos
else
info "Cloning from github"
git clone --recurse-submodules https://github.com/BasGame1/AluminiumOS.git --depth=1
DIR=AluminiumOS
fi
}
check_git() {
info "Checking if git its installed"
CHECK_GIT=$(command -v git)
if [ -z $CHECK_GIT ]; then
error "Please install GIT"
exit 255
fi
}
check_manager() {
info "Checking distro manager"
for i in apt pacman yum dnf zypper snap flatpak; do
HAS_MANAGER=$(which $i 2>/dev/null)
if [ ! -z $HAS_MANAGER ]; then
MANAGER=$i
break
fi
done
success "Found $MANAGER"
}
install_qemu() {
QEMU=$(which qemu-system-aarch64 2>/dev/null)
if [ -z $QEMU ]; then
error "QEMU not installed, installing it"
case $MANAGER in
apt)
info "Installing qemu via apt"
sudo apt install qemu-system-arm qemu-efi-aarch64
;;
pacman)
info "Installing qemu via pacman"
sudo pacman -S qemu-system-aarch64
;;
yum)
info "Installing qemu via yum"
sudo yum install qemu
;;
dnf)
info "Installing qemu via dnf"
sudo dnf install qemu
;;
zypper)
info "Installing qemu via zypper"
# This commands are from the opensuse official page (https://software.opensuse.org/download/package?package=qemu-guest-agent&project=Virtualization)
sudo zypper addrepo https://download.opensuse.org/repositories/Virtualization/openSUSE_Slowroll/Virtualization.repo
sudo zypper refresh
sudo zypper install qemu-guest-agent
;;
snap)
error "SNAP package wont work at 100%, please install it from another package manager or download it manually"
;;
flatpak)
error "FLATPAK package wont work at 100%, please install it from another package manager or download it manually"
;;
*)
error "Unkown package manager"
;;
esac
fi
}
title
check_manager
install_qemu
check_git
clone_repo
success "All done!"
read -p "Do you want to init the init script now? [y/N]" OPTION
case $OPTION in
y|Y)
info "Selected yes, Executing init script now"
./$DIR/init.sh
;;
n|N)
info "Selected no, exiting now"
exit
;;
*)
error "Unrecognized option, assuming no"
exit
;;
esac