This commit is contained in:
Liam Waldron 2023-02-17 17:01:06 -05:00
parent e1ee5022ca
commit b2d646c84a
6 changed files with 93 additions and 1 deletions

74
src/bin/glacier-mkprofile Executable file
View File

@ -0,0 +1,74 @@
#!/bin/sh
source /etc/glacier.conf
usage() {
printf "${0} - Update the Glacier system profile\n"
printf "usage: ${0} [-h] [-v] [-l] PROFILE_NAME\n"
printf "\n"
printf "${0} {-h} Show this message\n"
printf "${0} {-v} Show the current version\n"
printf "${0} {-l} List all available system profiles\n"
printf "\n"
printf "This program is free software.\n"
printf "See the GNU GPL version 3 for details.\n"
}
usage_small() {
printf "usage: ${0} [-h] [-v] [-l] PROFILE_NAME\n"
}
available_profiles() {
printf "${blue}[i]${reset} Available profiles:\n"
printf "x86-musl\n"
printf "x86-glibc\n"
printf "x86-musl-selinux\n"
printf "x86-glibc-selinux\n"
printf "x86-glibc-systemd\n"
printf "x86-musl-multilib\n"
printf "x86-glibc-multilib\n"
}
warn() {
printf "${red}[!!!] WARNING:${reset}\n"
printf "Switching the Glacier profile on an already running system\n"
printf "may cause SERIOUS DAMAGE to the system.\n"
printf "Before switching profiles, do the following:\n"
printf "- Change the git branch on /, corresponding to the profile you want to switch to.\n"
printf "(root)# cd /\n"
printf "(root)# git checkout x86-musl\n"
printf "- Pull in changes.\n"
printf "(root)# git pull\n"
}
mkconfig() {
ROOT_URL="https://git.everestlinux.org/EverestLinux/"
touch /etc/glacier.conf
case ${2} in
x86-musl)
echo "GREPO='${ROOT_URL}/epkgs-x86-musl/raw/branch/main'" >> /etc/glacier.conf
;;
x86-glibc)
echo "GREPO='${ROOT_URL}/epkgs-x86-glibc/raw/branch/main'" >> /etc/glacier.conf
;;
x86-musl-selinux)
echo "GREPO='${ROOT_URL}/epkgs-x86-musl-selinux/raw/branch/main'" >> /etc/glacier.conf
;;
x86-glibc-selinux)
echo "GREPO='${ROOT_URL}/epkgs-x86-glibc-selinux/raw/branch/main'" >> /etc/glacier.conf
;;
x86-glibc-systemd)
echo "GREPO='${ROOT_URL}/epkgs-x86-glibc-systemd/raw/branch/main'" >> /etc/glacier.conf
;;
x86-musl-multilib)
echo "GREPO='${ROOT_URL}/epkgs-x86-musl-multilib/raw/branch/main'" >> /etc/glacier.conf
;;
x86-glibc-multilib)
echo "GREPO='${ROOT_URL}/epkgs-x86-glibc-multilib/raw/branch/main'" >> /etc/glacier.conf
;;
*)
printf "[x] Invalid profile chosen. See 'glacier-mkprofile -l' to see all available profiles.\n"
exit 1
;;
esac
}

View File

@ -42,7 +42,7 @@ dload_pkg() {
# Store all positional parameters ["${@}"] in an array [pkgs=()]
pkgs=("${@}")
# if no packages are specified, exit
if [[ $pkgs == "" ]]; then
if [ $pkgs == "" ]; then
printf "${red}[${error}]${reset} No package(s) were specified.\n"
exit 1
fi

18
src/etc/glacier.conf Normal file
View File

@ -0,0 +1,18 @@
#
# /etc/glacier.conf
#
# Colors and symbols to be used
export red="\033[1;31m"
export green="\033[1;32m"
export yellow="\033[1;33m"
export blue="\033[1;34m"
export reset="\033[m"
export check="\xE2\x9C\x93"
export error="\xE2\x9C\x95"
# Command to be used for downloading packages
export GLACIER_DOWNLOAD_BACKEND="wget --quiet --show-progress"
# Package repository
# WARNING: DO NOT SET OR CHANGE MANUALLY!!!