-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsystem-setup
More file actions
executable file
·69 lines (63 loc) · 2.27 KB
/
system-setup
File metadata and controls
executable file
·69 lines (63 loc) · 2.27 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
#!/bin/sh -eu
#
# Template VM Image Builder
# Copyright (C) 2017-2026 by Thomas Dreibholz
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Contact: thomas.dreibholz@gmail.com
. /etc/os-release
# ====== Check arguments ==========================================================================
if [ $# -ne 1 ] ; then
cat >&2 <<EOF
Usage: $0 [project]
Examples:
* $0 Basic
* $0 Development
* $0 KDE
* $0 KDE+Development
* $0 HiPerConTracer
EOF
exit 1
fi
PROJECT="$1"
# ====== Ensure that script is run as user, and sudo is available =================================
if [ "$(id -u)" -eq 0 ] || [ ! -x "$(command -v sudo)" ] ; then
echo >&2 "ERROR: Run this script as user with \"sudo\" permissions, not as root!"
exit 1
fi
# ====== Install dependencies of Virtual Machine Image Builder and System Installation Scripts ====
if [ "${ID}" = "debian" ] || [ "${ID}" = "ubuntu" ] ; then
sudo env DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
ca-certificates git joe
elif [ "${ID}" = "fedora" ] ; then
sudo dnf install --setopt=install_weak_deps=False -y git joe
elif [ "${ID}" = "freebsd" ] ; then
sudo pkg install -y git joe
else
echo >&2 "ERROR: Unknown operating system!"
exit 1
fi
# ====== Clone repository of Virtual Machine Image Builder and System Installation Scripts ========
mkdir -p "$HOME/src"
cd "$HOME/src"
if [ ! -e vmimage-builder-scripts ] ; then
git clone https://github.com/simula/nornet-vmimage-builder-scripts vmimage-builder-scripts
cd vmimage-builder-scripts
else
cd vmimage-builder-scripts
git pull
fi
# ====== Run the installation =====================================================================
sudo ./make-direct "${PROJECT}"