Added elementary OS support (#130)

* Added elementary OS support

* Updated README.md

* Added pretty name for elementary OS
This commit is contained in:
Yannick Mauray 2021-10-19 13:04:16 +02:00 committed by GitHub
parent 9eb455c295
commit 516ececfbd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 45 additions and 4 deletions

View file

@ -14,6 +14,7 @@ function list_all() {
FUNC="${OS}"
fi
case ${OS} in
elementary) DISPLAY_NAME="elementary OS";;
freebsd) DISPLAY_NAME="FreeBSD";;
linuxmint) DISPLAY_NAME="Linux Mint";;
macos) DISPLAY_NAME="macOS";;
@ -39,8 +40,9 @@ function list_all() {
}
function os_support() {
echo fedora \
echo elementary \
freebsd \
fedora \
kubuntu \
linuxmint \
lubuntu \
@ -56,6 +58,10 @@ function os_support() {
xubuntu
}
function releases_elementary() {
echo 6_0
}
function releases_freebsd(){
echo 12_2 \
13_0
@ -395,7 +401,10 @@ function make_vm_config() {
local GUEST=""
IMAGE_FILE="${1}"
ISO_FILE="${2}"
if [[ "${OS}" == "freebsd" ]]; then
if [[ "${OS}" == "elementary" ]]; then
GUEST="linux"
IMAGE_TYPE="iso"
elif [[ "${OS}" == "freebsd" ]]; then
GUEST="freebsd"
IMAGE_TYPE="iso"
elif [[ "${OS}" == "fedora" ]]; then
@ -450,6 +459,24 @@ function start_vm_info() {
echo
}
function get_elementary() {
case ${RELEASE} in
6_0) VERSION=${RELEASE//_/.};;
*)
echo "ERROR! elementary OS ${RELEASE} is not a supported release."
releases_elementary
exit 1
;;
esac
ISO=elementaryos-6.0-stable.20211005.iso
URL="https://ams3.dl.elementary.io/download/MTYzNDU5MDA5NA==/${ISO}"
make_vm_dir
web_get ${URL} ${VM_PATH}
make_vm_config ${ISO}
start_vm_info
}
function get_freebsd() {
# For future releases, use dvd1 iso files.
local URL=""
@ -835,7 +862,9 @@ if [ -n "${2}" ]; then
RELEASE="${2,,}"
else
echo "ERROR! You must specify an OS release name."
if [ "${OS}" == "freebsd" ]; then
if [ "${OS}" == "elementary" ]; then
releases_elementary
elif [ "${OS}" == "freebsd" ]; then
releases_freebsd
elif [ "${OS}" == "fedora" ]; then
releases_fedora
@ -857,7 +886,9 @@ fi
VM_PATH="${OS}-${RELEASE}"
if [ "${OS}" == "macos" ]; then
if [ "${OS}" == "elementary" ]; then
get_elementary
elif [ "${OS}" == "macos" ]; then
get_macos
elif [[ "${OS}" == "freebsd" ]]; then
get_freebsd