everest-web/docs/intro-to-glacier.html

205 lines
11 KiB
HTML
Raw Normal View History

2023-04-04 13:36:31 -04:00
<!DOCTYPE html>
<html>
<head>
2023-05-01 10:42:27 -04:00
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Everest Linux - Docs</title>
<link type="text/css" rel="stylesheet" href="../css/everest.css"/>
<link rel="icon" type="image/x-icon" href="../img/favicon.svg"/>
2023-04-04 13:36:31 -04:00
</head>
<body>
<!-- Navbar -->
<div class="sidenav">
2023-04-06 07:42:23 -04:00
<img src="../img/everest-logo.svg" alt="everest-logo">
2023-04-04 13:36:31 -04:00
<a href="../index.html">Home</a>
<a href="../about.html">About</a>
<a href="../install.html">Install</a>
<a href="https://git.everestlinux.org/EverestLinux/glacier-pkgs">Packages</a>
<a href="../download.html">Downloads</a>
<a href="home.html">Docs</a>
<a href="https://git.everestlinux.org/EverestLinux/wiki">Wiki</a>
<a href="../errata.html">Errata</a>
<a href="https://git.everestlinux.org">Git</a>
</div>
<!-- Rest of page -->
<div class="main">
<button onclick="window.location.href='home.html';">
Back to home
</button>
<h2>Introduction</h2>
<p>Glacier is the package management system for Glacier. All users should be familiar with how it works.</p>
<h2>Terminology</h2>
<p>In this case, the word 'merge' and 'install' mean the same thing.</p>
<p>A package index is a list of all installed packages on any given Everest system.</p>
<p>The local index is managed by all users on the system, and is located in /usr/glacier/index.</p>
<p>The global index is managed by Git, and is located in /glacier/index.</p>
<p>A system profile describes your base system, including C library, architecture, SELinux support, multilib support, etc.</p>
<h2>Included programs</h2>
<p><strong>3.1 </strong>gpkg</p>
<p>'gpkg' is the program most users will be interacting with. It handles the downloading, installation, and logging of packages.</p>
<p><strong>3.2 </strong>syspkg</p>
<p>'syspkg' is like 'gpkg', except it operates on the system index, rather than the local index. End users should not use this unless instructed to.</p>
<p><strong>3.3 </strong>glist</p>
<p>'glist' lists all installed packages, allowing the user to filter by name.
<p><strong>3.4 </strong>gquery</p>
<p>'gquery' queries information on a package.</p>
<p><strong>3.5 </strong>glacier-mkprofile</p>
<p>'glacier-mkprofile' makes changes to the system-wide profile. Users should not interact with this unless needed.</p>
2023-05-24 13:19:24 -04:00
<h2>Frontends</h2>
<p>Frontends, or wrappers, may provide additional functionality to Glacier.</p>
<warnhead><strong>WARNING:</strong></warnhead>
<div class="warning">
<p>Third party frontends and wrapper scripts are not supported. Use them at your own risk.</p>
</div>
2023-04-04 13:36:31 -04:00
<h2>Merging packages</h2>
<p><strong>4.1 </strong>Using gpkg</p>
<p>To merge a package from a repository:</p>
<code>(root)# gpkg -f repo/pkg</code>
<p>For instance, to install 'vim' in the 'world' repository:</p>
<code>(root)# gpkg -f world/vim</code>
<p><strong>4.2 </strong>Using syspkg</p>
<p>Using 'syspkg' is not recommended for end users because all changes to the global package index will be overwritten when pulling a new update.</p>
<p>If you understand these risks, and wish to use 'syspkg' anyways, you are acknowledging that things may break.</p>
<p>To merge a package from a repository:</p>
<code>(root)# syspkg -f repo/pkg</code>
<h2>Updating packages</h2>
<p><strong>5.1 </strong>Introduction</p>
<p>When merging a package into any index, the package file is retained in said index. This provides most information needed to keep track of the package, however, when updating, an updated package file will need to be downloaded. Old package files will be retained as 'pkgname.old'.</p>
<p><strong>5.2 </strong>Using gpkg</p>
<p>To update a package:</p>
<code>(root)# gpkg -u repo/pkg</code>
<p><strong>5.3 </strong>Using syspkg</p>
<p>As mentioned above, 'syspkg' is intended for system development, and NOT for end users.</p>
<p>However, 'syspkg -u' has some use cases for end users. These include:</p>
<ul>
<li>Updating a system program WITHOUT pulling a new release from Git</li>
<li>Fixing urgent security vulnerabilities</li>
</ul>
<p>To update a package:</p>
<code>(root)# syspkg -u repo/pkg</code>
<h2>Removing packages</h2>
<p><strong>6.1 </strong>Introduction</p>
<p>When removing a package, the package info file is moved from the appropriate index to /tmp, and saved as 'pkgname.rm'. This means it will be wiped after the next reboot.</p>
<p><strong>6.2 </strong>Using gpkg</p>
<p>To remove a package:</p>
<code>(root)# gpkg -x pkg</code>
<p>Note that no repository name was provided. It is not required, as no files will be downloaded during the removal process.</p>
<p>If a package is a dependency for another, you will be shown the following error:</p>
<code>[x] Could not remove (package_name): is a dependency for (package_name)</code>
<p><strong>6.3 </strong>Using syspkg</p>
<warnhead><strong>WARNING:</strong></warnhead>
<div class="warning">
<p>Removing packages that shipped with the system images WILL cause catastrophic damage. You have been warned.</p>
</div>
<p>If you wish to proceed anyways, you can remove a package with:</p>
<code>(root)# syspkg -x pkg</code>
<h2>Advanced usage</h2>
<p><strong>7.1 </strong>Patching packages</p>
<p>Patching packages is the act of editing a package file to change compile options, optimizations, etc. It is very useful if used correctly.</p>
<p>The officially tested and verified method for patching is as follows:</p>
<ul>
<li>Download the package file with 'gpkg -d'</li>
<li>Edit the package file with a text editor of your choice</li>
<li>Install the locally modified package with 'gpkg -fl pkg'</li>
</ul>
<p><strong>7.2 </strong>Custom package repository</p>
<p>If Glacier's standard package repository is not sufficient, you can use a custom one.</p>
<warnhead><strong>WARNING:</strong></warnhead>
<div class="warning">
<p>Ensure the repository you wish to migrate to supports your system profile. For example, if your profile is 'x86-musl', the new repository should offer packages compatible with 'x86-musl'.</p>
<p>Errors will occur if this is not taken into account.</p>
</div>
<p>To use a custom repository once, to merge a package:</p>
<code>(root)# GREPO=http://some-repo.org gpkg -f repo/pkg</code>
<p>To make the changes persistent, change the 'GREPO' variable in '/etc/glacier.conf':</p>
<fhead><strong>FILE:</strong> /etc/glacier.conf</fhead>
<div class="file">
<p>GREPO="https://some-repo.org</p>
</div>
<p><strong>7.3 </strong>Compile flags</p>
<p>When an operation is performed on a package, 'gpkg' invokes the system's C compiler, which can take flags for compilation.</p>
<p>'MAKEFLAGS', 'CFLAGS', 'CXXFLAGS', and 'LDFLAGS' can be set in '/etc/make.conf'.</p>
<p>It is highly recommended to keep '-static' in 'CFLAGS' and 'LDFLAGS'.</p>
<p><strong>7.4 </strong>Using syspkg</p>
<p>'syspkg' is intended for development use and not for end users. That being said, 'syspkg' can be used for fixing security vulnerabilities without pulling in a new release from git.</p>
<p>Note that all changes to the global package index ('/glacier/index') will be overwritten during an update, where the user invokes 'git pull' on '/'.</p>
<p><strong>7.5 </strong>Whitelisting licenses</p>
<p>Certain license types can be whitelisted or blacklisted. This is useful for controlling which software is installed on your system.</p>
<h2>Querying packages</h2>
<p><strong>8.1 </strong>Introduction</p>
<p>Glacier packages, in ther simplest form, are text files, containing instructions on how the package is built, who made it, what it's called, and what files it includes.</p>
<p><strong>8.2 </strong>Querying files</p>
<p>All files belonging to a package can be listed with:</p>
<code>(user)$ gquery -f pkg</code>
<p><strong>8.3 </strong>Querying info</p>
<p>Package info can be listed with:</p>
<code>(user)$ gquery -i pkg</code>
<h2>Writing packages</h2>
<p><strong>9.1 </strong>Introduction</p>
<p>As mentioned before, Glacier packages are simply text files. This makes them very easy to write and maintain.</p>
<p>If you have previous experience writing PKGBUILDs for the AUR, writing Glacier packages should feel very similar.</p>
<p>In this page, 'nano' will be used as an example.</p>
<p><strong>9.2 </strong>Metadata</p>
<p>Package files start with metadata, which tells Glacier who made the package, what its called, as well as other information.</p>
<p>Double check that all of this information is correct before submitting a package.</p>
<fhead><strong>FILE:</strong> $(pwd)/nano</fhead>
<div class="file">
<p>PACKAGE_NAME="nano"</p>
<p>PACKAGE_VER="7.2"</p>
<p>PACKAGE_DESC="The GNU nano text editor"</p>
<p>MAINTAINER="liamwaldron@everestlinux.org"</p>
<p>LICENSE="GPL v3"</p>
<p>ARCH="x86"</p>
<p>INCLUDED_FILES=("/usr/bin/nano" "/usr/bin/rnano")</p>
</div>
<p>Hopefully, most of these options are self explanatory.</p>
<p>For INCLUDED_FILES, ensure you DON'T include documentation (manpages, etc).</p>
<p><strong>9.3 </strong>Integrity information</p>
<fhead><strong>FILE:</strong> $(pwd)/nano</fhead>
<div class="file">
<p>SHA256SUMS="86f3442768bd2873cec693f83cdf80b4b444ad3cc14760b74361474fc87a4526"</p>
</div>
<p>All packages must include their checksums. When merging a package, 'gpkg' will check the provided checksum against the actual checksum of the package, and if they don't match, the operation will be cancelled.</p>
<p>To get the checksum of a package:</p>
<code>(user)$ sha256sum package</code>
<p><strong>9.4 </strong>Dependency information</p>
<fhead><strong>FILE:</strong> $(pwd)/nano</fhead>
<div class="file">
<p>DEPENDS=("")</p>
<p>CONFLICTS=("")</p>
</div>
<p>Dependency information is extremely important. It allows 'gpkg' to install any dependencies. It also warns the user when a package conflicts with another.</p>
<p>This should be fairly easy to figure out. Most projects will have this listed in their README. If you're the developer, you'll probably already know the dependencies your package requires.</p>
<p><strong>9.5 </strong>Source information</p>
<fhead><strong>FILE:</strong> $(pwd)/nano</fhead>
<div class="file">
<p>PACKAGE_SRC="https://nano-editor.org/dist/v7/nano-7.2.tar.xz</p>
<p>SOURCES=("nano-7.2.tar.xz" "nano-7.2"</p>
</div>
<p>PACKAGE_SRC shows Glacier where the sources for the program can be downloaded from.</p>
<p>SOURCES shows Glacier what PACKAGE_SRC downloads.</p>
<p><strong>9.6 </strong>Functions</p>
<fhead><strong>FILE:</strong> $(pwd)/nano</fhead>
<div class="file">
<p>getsource() {}</p>
<p>buildpkg() {}</p>
<p>installpkg() {}</p>
<p>installpkg_system() {}</p>
<p>removepkg() {}</p>
<p>removepkg_system() {}</p>
<p>updatepkg() {}</p>
<p>updatepkg_system() {}</p>
</div>
<p>Inside of the brackets, enter the commands that are needed to perform each function.</p>
<p>Anything prefixed with "system" refers to the use of 'syspkg'.</p>
</div>
<footer>
<p>Page last updated 4/04/23 @ 13:19</p>
<p>Page licensed under GNU Free Documentation License 1.3 or later</p>
<p>--------------------</p>
<p>Copyright (C) 2021-2023 Everest Linux</p>
<p>Linux (R) is a registered trademark of Linus Torvalds.</p>
<p>Everest Linux is provided AS IS, WITHOUT WARRANTY.</p>
</footer>