halfway done i think

This commit is contained in:
Liam Waldron 2023-03-09 13:57:56 -05:00
parent 3b82053b7c
commit 234033dcdc
9 changed files with 177 additions and 34 deletions

34
README.md Normal file
View File

@ -0,0 +1,34 @@
## Glacier
Glacier is the package management system for Everest Linux. It controls all user-installed packages on the system.
Glacier is designed from the ground up, and uses a simple, PKGBUILD-like format, for ease of use.
## Get started
Glacier requires the following packages:
- Bash (Glacier runtime)
- GNU make
- GCC (or any compatible C compiler)
- Git
- Autoconf
- Automake
To install Glacier, clone this repository:
```
git clone https://git.everestlinux.org/EverestLinux/glacier
cd glacier/install
```
Inside the `install` directory, edit install.conf.dist, ensure all options are adequate, and save as install.conf:
```
EDITOR=your_editor_here
$EDITOR install.conf.dist
```
Run `build.sh` as root:
```
doas ./build.sh install
# OR
sudo ./build.sh install
# OR
su -c ./build.sh install
```

View File

@ -5,18 +5,18 @@
#
# Copyright (C) 2023 Everest Linux
#
# This program is free software: you can redistribute it and/or modify
# Glacier 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,
# Glacier 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 <https://www.gnu.org/licenses/>.
# along with Glacier. If not, see <https://www.gnu.org/licenses/>.
source /etc/glacier.conf
@ -28,7 +28,7 @@ usage() {
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 "Glacier is free software.\n"
printf "See the GNU GPL version 3 for details.\n"
}
@ -53,15 +53,14 @@ warn() {
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 " (root)# cd /\n"
printf " (root)# git checkout x86-musl\n"
printf "- Pull in changes.\n"
printf "(root)# git pull\n"
printf " (root)# git pull\n"
}
mkconfig() {
glacier_conf() {
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
@ -91,6 +90,56 @@ mkconfig() {
esac
}
make_conf() {
case ${2} in
x86-*)
echo "ARCH='x86_64'" >> /etc/make.conf
;;
i386-*)
printf "[x] i386 is not supported.\n"
exit 1
;;
aarch64-*)
printf "[x] aarch64 is not supported.\n"
;;
*)
printf "[x] Unknown architecture. See 'glacier-mkprofile -l' to see all supported architectures.\n"
exit 1
;;
esac
}
glacier_profile_conf() {
touch /etc/glacier/profile.conf
case ${2} in
x86-musl)
echo "GLACIER_SYSTEM_PROFILE='x86-musl'" >> /etc/glacier/profile.conf
;;
x86-glibc)
echo "GLACIER_SYSTEM_PROFILE='x86-glibc'" >> /etc/glacier/profile.conf
;;
x86-musl-selinux)
echo "GLACIER_SYSTEM_PROFILE='x86-musl-selinux'" >> /etc/glacier/profile.conf
;;
x86-glibc-selinux)
echo "GLACIER_SYSTEM_PROFILE='x86-glibc-selinux'" >> /etc/glacier/profile.conf
;;
x86-glibc-systemd)
echo "GLACIER_SYSTEM_PROFILE='x86-glibc-systemd'" >> /etc/glacier/profile.conf
;;
x86-musl-multilib)
echo "GLACIER_SYSTEM_PROFILE='x86-musl-multilib'" >> /etc/glacier/profile.conf
;;
x86-glibc-multilib)
echo "GLACIER_SYSTEM_PROFILE='x86-glibc-multilib'" >> /etc/glacier/profile.conf
;;
*)
printf "[x] Invalid profile chosen. See 'glacier-mkprofile -l' to see all available profiles.\n"
exit 1
;;
esac
}
case ${1} in
-h)
usage "$@"
@ -104,4 +153,9 @@ case ${1} in
-l)
available_profiles "$@"
exit 0
;;
*)
usage_small "$@"
exit 1
;;
esac

View File

@ -5,18 +5,18 @@
#
# Copyright (C) 2023 Everest Linux
#
# This program is free software: you can redistribute it and/or modify
# Glacier 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,
# Glacier 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 <https://www.gnu.org/licenses/>.
# along with Glacier. If not, see <https://www.gnu.org/licenses/>.
source /etc/glacier.conf
@ -29,7 +29,7 @@ usage() {
printf "${0} {-a} Show all packages\n"
printf "${0} {-f} Filter packages by name\n"
printf "\n"
printf "This program is free software.\n"
printf "Glacier is free software.\n"
printf "See the GNU GPL version 3 for details.\n"
}

20
src/bin/gpc Normal file
View File

@ -0,0 +1,20 @@
#!/usr/bin/env sh
# gpc - Check integrity of Glacier packages
# This file is part of Glacier.
#
# Copyright (C) 2023 Everest Linux
#
# Glacier 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.
#
# Glacier 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 Glacier. If not, see <https://www.gnu.org/licenses/>.

View File

@ -5,18 +5,18 @@
#
# Copyright (C) 2023 Everest Linux
#
# This program is free software: you can redistribute it and/or modify
# Glacier 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,
# Glacier 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 <https://www.gnu.org/licenses/>.
# along with Glacier. If not, see <https://www.gnu.org/licenses/>.
source /etc/glacier.conf
if [ "$?" != "0" ]; then
@ -39,7 +39,7 @@ usage() {
printf "${0} {-ul --localup} Same as -u, but takes a local directory\n"
printf "${0} {-d --dload} ONLY download a package\n"
printf "\n"
printf "This program is free software.\n"
printf "Glacier is free software.\n"
printf "See the GNU GPL version 3 for details.\n"
}
@ -55,15 +55,17 @@ am_i_root() {
fi
}
check_if_input_is_blank() {
if [[ "${@}" == "" ]]; then
printf "${red}[${error}]${reset} No package(s) specified.\n"
exit 1
fi
}
dload_pkg() {
cd /opt/glacier/workspace
# Store all positional parameters ["${@}"] in an array [pkgs=()]
pkgs=("${@}")
# if no packages are specified, exit
if [ $pkgs == "" ]; then
printf "${red}[${error}]${reset} No package(s) were specified.\n"
exit 1
fi
printf "${blue}[i]${reset} Downloading package(s)...\n"
for i in ${pkgs[@]}; do
${GLACIER_DOWNLOAD_BACKEND} ${GREPO}/${i}
@ -136,7 +138,7 @@ index_pkg() {
mv /opt/glacier/workspace/* /usr/glacier/index
if [ "$?" != "0" ]; then
printf "${yellow}[!]${reset} Packages did not index. To do this manually:\n"
printf "${yellow}[!]${reset} (root) mv /opt/glacier/workspace/* /usr/glacier/index\n"
printf "${yellow}[!]${reset} (root)$ mv /opt/glacier/workspace/* /usr/glacier/index\n"
printf "${yellow}[!]${reset} To avoid this warning in the future, ensure the package index exists and is accessible.\n"
fi
}
@ -153,17 +155,28 @@ case $1 in
;;
-f|--install)
shift
cd /opt/glacier/workspace
am_i_root "$@"
check_if_input_is_blank "$@"
dload_pkg "$@"
checkdeps "$@"
checkconflicts "$@"
get_pkg_sources "$@"
install_pkg "$@"
read -p "$(printf "${blue}[?]${reset} Proceed with this operation? (y/n) ")" -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]; then
get_pkg_sources "$@"
install_pkg "$@"
index_pkg "$@"
elif [[ $REPLY =~ ^[Yy]$ ]]; then
printf "${red}[${error}]${reset} Aborting.\n"
exit 1
fi
exit 0
;;
-u|--update)
shift
cd /opt/glacier/workspace
am_i_root "$@"
check_if_input_is_blank "$@"
dload_pkg "$@"
checkdeps "$@"
checkconflicts "$@"
@ -173,7 +186,9 @@ case $1 in
;;
-x|--remove)
shift
cd /opt/glcier/workspace
am_i_root "$@"
check_if_input_is_blank "$@"
remove_pkg "$@"
exit 0
;;
@ -187,6 +202,7 @@ case $1 in
;;
-d|--dload)
shift
check_if_input_is_blank "$@"
dload_pkg "$@"
exit 0
;;

View File

@ -5,18 +5,18 @@
#
# Copyright (C) 2023 Everest Linux
#
# This program is free software: you can redistribute it and/or modify
# Glacier 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,
# Glacier 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 <https://www.gnu.org/licenses/>.
# along with Glacier. If not, see <https://www.gnu.org/licenses/>.
source /etc/glacier.conf
@ -29,7 +29,7 @@ usage() {
printf "${0} {-f} Query a package's files\n"
printf "${0} {-i} Query a package's info file\n"
printf "\n"
printf "This program is free software.\n"
printf "Glacier is free software.\n"
printf "See the GNU GPL version 3 for details.\n"
}

View File

@ -5,18 +5,18 @@
#
# Copyright (C) 2023 Everest Linux
#
# This program is free software: you can redistribute it and/or modify
# Glacier 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,
# Glacier 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 <https://www.gnu.org/licenses/>.
# along with Glacier. If not, see <https://www.gnu.org/licenses/>.
source /etc/glacier.conf
if [ "$?" != "0" ]; then
@ -38,10 +38,10 @@ usage() {
printf "${0} {-l} Same as -f, but takes a local directory\n"
printf "${0} {-d} ONLY download a package\n"
printf "\n"
printf "NOTE: This program should only be used for building\n"
printf "NOTE: Glacier should only be used for building\n"
printf "system images. Regular users should use 'glacier-mergepkg' instead.\n"
printf "\n"
printf "This program is free software.\n"
printf "Glacier is free software.\n"
printf "See the GNU GPL version 3 for details.\n"
}

View File

@ -14,6 +14,8 @@ export error="\xE2\x9C\x95"
# Command to be used for downloading packages
# This command will be invoked whenever files need to be downloaded
export GLACIER_DOWNLOAD_BACKEND="wget --quiet --show-progress"
# Use this backend for debugging
#export GLACIER_DOWNLOAD_BACKEND="wget"
# Permitted software licenses
# Glacier will install software licensed under what's listed here. Otherwise, it'll quit.

17
src/etc/make.conf Normal file
View File

@ -0,0 +1,17 @@
#
# /etc/make.conf
#
# Number of parallel makejobs. Change this to your CPUs cores + threads.
# Example: 6 cores + 6 threads = 12 parallel makejobs
MAKEFLAGS="-j1"
# Build and compile flags for C and C++ programs.
# Disable these if packages are breaking.
# Using too many optimizations may break packages.
CFLAGS="-O2 -fstack-protector-strong"
CXXFLAGS="${CFLAGS}"
# DO NOT CHANGE ANYTHING ELSE. THESE OPTIONS ARE SET BY `glacier-mkprofile`
# AND ARE TIED TO THE SYSTEM PROFILE. MANUALLY CHANGING THESE OPTIONS
# MAY CAUSE SEVERE BREAKAGE.