Compare commits
12 Commits
5aa3c4676b
...
march-22
| Author | SHA1 | Date | |
|---|---|---|---|
| f2680148f3 | |||
| 1d5c03a089 | |||
| c4bb678804 | |||
| ef4cdbf7af | |||
| 7ea16cb542 | |||
| 66fbb7653e | |||
| 3b1b0464be | |||
| f7cb8fe6cf | |||
| 304bd29b08 | |||
| 82335b982b | |||
| 6f5a54175e | |||
| 7dea28cb16 |
@@ -72,7 +72,7 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<footer>
|
<footer>
|
||||||
<p>Copyright (C) 2021-2024 Everest Linux</p>
|
<p>Copyright (C) 2021-2025 Everest Linux</p>
|
||||||
<p>Linux (R) is a registered trademark of Linus Torvalds.</p>
|
<p>Linux (R) is a registered trademark of Linus Torvalds.</p>
|
||||||
<p>Everest Linux is provided AS IS, WITHOUT WARRANTY.</p>
|
<p>Everest Linux is provided AS IS, WITHOUT WARRANTY.</p>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
23
css/nord.css
23
css/nord.css
@@ -100,7 +100,7 @@ html {
|
|||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
width: 50%;
|
width: 50%;
|
||||||
color: #2E3440;
|
color: #D8DEE9;
|
||||||
}
|
}
|
||||||
|
|
||||||
.news {
|
.news {
|
||||||
@@ -181,7 +181,7 @@ warnhead {
|
|||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
padding: 6px;
|
padding: 6px;
|
||||||
width: 50%;
|
width: 50%;
|
||||||
color: #2E3440;
|
color: #D8DEE9;
|
||||||
}
|
}
|
||||||
|
|
||||||
newshead {
|
newshead {
|
||||||
@@ -253,6 +253,13 @@ cil {
|
|||||||
padding: 2px;
|
padding: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cil-inv {
|
||||||
|
font-family: monospace;
|
||||||
|
background-color: #2E3440;
|
||||||
|
color: #ECEFF4;
|
||||||
|
padding: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
wiki {
|
wiki {
|
||||||
border-left-style: solid;
|
border-left-style: solid;
|
||||||
border-left-width: 4px;
|
border-left-width: 4px;
|
||||||
@@ -388,7 +395,13 @@ body, html {
|
|||||||
|
|
||||||
hr {
|
hr {
|
||||||
color: #88c0d0;
|
color: #88c0d0;
|
||||||
height: 20px;
|
width: 50%;
|
||||||
width: 0px;
|
border-width: 4px;
|
||||||
border-width: 0px;
|
border-radius: 5px;
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab {
|
||||||
|
display: inline-block;
|
||||||
|
margin-left: 80px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,7 +108,11 @@
|
|||||||
<p> printf("hello\n");
|
<p> printf("hello\n");
|
||||||
<p>}</p>
|
<p>}</p>
|
||||||
</div>
|
</div>
|
||||||
<p><strong>1.2</strong> Bash/Shell</p>
|
<p><strong>1.2</strong> Best Practices</p>
|
||||||
|
<ul>
|
||||||
|
<p><li>Avoid abbreviation and single letter variables.</li><p>
|
||||||
|
<p><li>Avoid deep nesting.</li></p>
|
||||||
|
</ul>
|
||||||
<h2>2 - Licensing</h2>
|
<h2>2 - Licensing</h2>
|
||||||
<p><strong>2.1</strong> Disclaimer</p>
|
<p><strong>2.1</strong> Disclaimer</p>
|
||||||
<warnhead><strong>WARNING:</strong></warnhead>
|
<warnhead><strong>WARNING:</strong></warnhead>
|
||||||
@@ -140,10 +144,10 @@
|
|||||||
<p>There will be no further discussion.</p>
|
<p>There will be no further discussion.</p>
|
||||||
</div>
|
</div>
|
||||||
<footer>
|
<footer>
|
||||||
<p>Page last updated 02/01/24 @ 08:55</p>
|
<p>Page last updated 03/17/2025 @ 12:00</p>
|
||||||
<p>Page licensed under GNU Free Documentation License 1.3 or later</p>
|
<p>Page licensed under GNU Free Documentation License 1.3 or later</p>
|
||||||
<p>--------------------</p>
|
<p>--------------------</p>
|
||||||
<p>Copyright (C) 2021-2023 Everest Linux</p>
|
<p>Copyright (C) 2021-2025 Everest Linux</p>
|
||||||
<p>Linux (R) is a registered trademark of Linus Torvalds.</p>
|
<p>Linux (R) is a registered trademark of Linus Torvalds.</p>
|
||||||
<p>Everest Linux is provided AS IS, WITHOUT WARRANTY.</p>
|
<p>Everest Linux is provided AS IS, WITHOUT WARRANTY.</p>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -27,6 +27,11 @@
|
|||||||
Back to home
|
Back to home
|
||||||
</button>
|
</button>
|
||||||
<h2>General Recommendations</h2>
|
<h2>General Recommendations</h2>
|
||||||
|
<notehead><strong>NOTE:</strong></notehead>
|
||||||
|
<div class="note">
|
||||||
|
<p>This page is outdated as of 9/17/2024</p>
|
||||||
|
<p>Reason: Glacier v4, esv rewrite, among others</p>
|
||||||
|
</div>
|
||||||
<p>This page will explain how to expand an Everest system from barebones to more usable.</p>
|
<p>This page will explain how to expand an Everest system from barebones to more usable.</p>
|
||||||
<h2>1 - Administration</h2>
|
<h2>1 - Administration</h2>
|
||||||
<p><strong>1.1 </strong>Users</p>
|
<p><strong>1.1 </strong>Users</p>
|
||||||
@@ -106,7 +111,7 @@
|
|||||||
<p>Page last updated 4/04/23 @ 13:34</p>
|
<p>Page last updated 4/04/23 @ 13:34</p>
|
||||||
<p>Page licensed under GNU Free Documentation License 1.3 or later</p>
|
<p>Page licensed under GNU Free Documentation License 1.3 or later</p>
|
||||||
<p>--------------------</p>
|
<p>--------------------</p>
|
||||||
<p>Copyright (C) 2021-2023 Everest Linux</p>
|
<p>Copyright (C) 2021-2025 Everest Linux</p>
|
||||||
<p>Linux (R) is a registered trademark of Linus Torvalds.</p>
|
<p>Linux (R) is a registered trademark of Linus Torvalds.</p>
|
||||||
<p>Everest Linux is provided AS IS, WITHOUT WARRANTY.</p>
|
<p>Everest Linux is provided AS IS, WITHOUT WARRANTY.</p>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -55,12 +55,13 @@
|
|||||||
<li><a href="dev-docs.html">Developer Documentation</a></li>
|
<li><a href="dev-docs.html">Developer Documentation</a></li>
|
||||||
<li><a href="general-recommendations.html">General Recommendations</a></li>
|
<li><a href="general-recommendations.html">General Recommendations</a></li>
|
||||||
<li><a href="intro-to-glacier.html">Introduction to Glacier</a></li>
|
<li><a href="intro-to-glacier.html">Introduction to Glacier</a></li>
|
||||||
|
<li><a href="libglacier.html">libglacier</a></li>
|
||||||
<li><a href="meta-reading.html">Meta: Reading Guide</a></li>
|
<li><a href="meta-reading.html">Meta: Reading Guide</a></li>
|
||||||
<li><a href="musl-or-glibc.html">musl or glibc?</a></li>
|
<li><a href="musl-or-glibc.html">musl or glibc?</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<footer>
|
<footer>
|
||||||
<p>Copyright (C) 2021-2023 Everest Linux</p>
|
<p>Copyright (C) 2021-2025 Everest Linux</p>
|
||||||
<p>Linux (R) is a registered trademark of Linus Torvalds.</p>
|
<p>Linux (R) is a registered trademark of Linus Torvalds.</p>
|
||||||
<p>Everest Linux is provided AS IS, WITHOUT WARRANTY.</p>
|
<p>Everest Linux is provided AS IS, WITHOUT WARRANTY.</p>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -28,13 +28,42 @@
|
|||||||
</button>
|
</button>
|
||||||
<h2>1 - Introduction</h2>
|
<h2>1 - Introduction</h2>
|
||||||
<p>Glacier is the package management system for Glacier. All users should be familiar with how it works.</p>
|
<p>Glacier is the package management system for Glacier. All users should be familiar with how it works.</p>
|
||||||
<h2>2 - Terminology</h2>
|
<h2>2 - Package Indexes</h2>
|
||||||
<p>In this case, the word 'merge' and 'install' mean the same thing.</p>
|
<p>On an Everest system, packages are stored in an "index", of which there are two, the <i>system</i> index and the <i>user</i> index.</p>
|
||||||
<p>A package index is a list of all installed packages on any given Everest system.</p>
|
<p>The system index is located in <cil>/glacier/index</cil>, and the user index is localed in <cil>/usr/glacier/index</cil>.</p>
|
||||||
<p>The local index is managed by all users on the system, and is located in /usr/glacier/index.</p>
|
<p>When you merge a package from a repository, <cil>gpkg</cil> will retrieve the file, execute the relevant instruction sets, and store the package in the user index. <cil>syspkg</cil> will operate on the system index instead. On update, <cil>gpkg</cil> will retrieve the package from the user index and execute the relevant instruction sets. The package will then be moved back into the user index. On removal, the package will be moved to <cil>/tmp</cil> oncde the removal instructions have been executed.</p>
|
||||||
<p>The global index is managed by Git, and is located in /glacier/index.</p>
|
<h2>3 - Repositories</h2>
|
||||||
<p>A system profile describes your base system, including C library, architecture, SELinux support, multilib support, etc.</p>
|
<p>Unlike most distributions, Everest installations include a copy of the package repository on the local system. Rather than downloading packages from a remote server, Glacier clones a package from the local repository.</p>
|
||||||
<h2>3 - Included programs</h2>
|
<p>This presents some advantages:</p>
|
||||||
|
<ul>
|
||||||
|
<li><p>Package modifications can be done easily</p></li>
|
||||||
|
<li><p>In the result of connection loss, Glacier can still be used</p></li>
|
||||||
|
</ul>
|
||||||
|
<p>And also some disadvantages:</p>
|
||||||
|
<ul>
|
||||||
|
<li><p>Security risks may surface if the repository is not kept updated or an unauthorized party makes changes to packages</p></li>
|
||||||
|
</ul>
|
||||||
|
<p>The <cil>glacier-update-pkgdb</cil> program can be used to update the local repository. This should be done regularly (at least once a week) to ensure the newest and most secure packages are available.</p>
|
||||||
|
<h2>4 - The System Profile</h2>
|
||||||
|
<p>An Everest installation includes a system profile. In simple terms, this is a series of environment variables and configurations that tell Glacier which packages it can install. The system profile should not change unless the user intends to migrate profiles.</p>
|
||||||
|
<p>The following environment variables are defined by the system profile:</p>
|
||||||
|
<ul>
|
||||||
|
<li><p><cil>GLACIER_REPO</cil> - The repository which will be downloaded by <cil>glacier-update-pkgdb</cil></p></li>
|
||||||
|
<li><p><cil>GLACIER_ARCH</cil> - The CPU's architecture</p></li>
|
||||||
|
<li><p><cil>GLACIER_TARGET</cil> - The compilation triplet</p></li>
|
||||||
|
<li><p><cil>GLACIER_SYSTEM_PROFILE</cil> - The name of the system profile</p></li>
|
||||||
|
</ul>
|
||||||
|
<p>The following system profiles are available:</p>
|
||||||
|
<ul>
|
||||||
|
<li><p><cil>x86_64-musl</cil></p></li>
|
||||||
|
</ul>
|
||||||
|
<p>The following system profiles are planned for the future:</p>
|
||||||
|
<ul>
|
||||||
|
<li><p><cil>x86_64-glibc</cil></p></li>
|
||||||
|
<li><p><cil>x86_64-musl-nomultilib</cil></p></li>
|
||||||
|
<li><p><cil>x86_64-glibc-nomultilib</cil></p></li>
|
||||||
|
</ul>
|
||||||
|
<h2>5 - Included programs</h2>
|
||||||
<p><strong>3.1 </strong>gpkg</p>
|
<p><strong>3.1 </strong>gpkg</p>
|
||||||
<p><cil>gpkg</cil> is the program most users will be interacting with. It handles the downloading, installation, and logging of packages.</p>
|
<p><cil>gpkg</cil> 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><strong>3.2 </strong>syspkg</p>
|
||||||
@@ -49,13 +78,13 @@
|
|||||||
<p><cil>glacier-mkprofile</cil> makes changes to the system-wide profile. Users should not interact with this unless needed.</p>
|
<p><cil>glacier-mkprofile</cil> makes changes to the system-wide profile. Users should not interact with this unless needed.</p>
|
||||||
<p><strong>3.7 </strong>glacier-update-pkdgb</p>
|
<p><strong>3.7 </strong>glacier-update-pkdgb</p>
|
||||||
<p><cil>glacier-update-pkgdb</cil> syncs the local package database with the remote server. This command should be run periodically to ensure you have the most up-to-date packages.</p>
|
<p><cil>glacier-update-pkgdb</cil> syncs the local package database with the remote server. This command should be run periodically to ensure you have the most up-to-date packages.</p>
|
||||||
<h2>4 - Frontends</h2>
|
<h2>6 - Frontends</h2>
|
||||||
<p>Frontends, or wrappers, may provide additional functionality to Glacier.</p>
|
<p>Frontends, or wrappers, may provide additional functionality to Glacier.</p>
|
||||||
<warnhead><strong>WARNING:</strong></warnhead>
|
<warnhead><strong>WARNING:</strong></warnhead>
|
||||||
<div class="warning">
|
<div class="warning">
|
||||||
<p>Third party frontends and wrapper scripts are not supported. Use them at your own risk.</p>
|
<p>Third party frontends and wrapper scripts are not supported. Use them at your own risk.</p>
|
||||||
</div>
|
</div>
|
||||||
<h2>5 - Merging packages</h2>
|
<h2>7 - Merging packages</h2>
|
||||||
<p><strong>5.1 </strong>Using gpkg</p>
|
<p><strong>5.1 </strong>Using gpkg</p>
|
||||||
<p>To merge a package from a repository:</p>
|
<p>To merge a package from a repository:</p>
|
||||||
<code>(root)# gpkg -f pkg</code>
|
<code>(root)# gpkg -f pkg</code>
|
||||||
@@ -66,7 +95,7 @@
|
|||||||
<p>If you understand these risks, and wish to use <cil>syspkg</cil> anyways, you are acknowledging that things may break.</p>
|
<p>If you understand these risks, and wish to use <cil>syspkg</cil> anyways, you are acknowledging that things may break.</p>
|
||||||
<p>To merge a package:</p>
|
<p>To merge a package:</p>
|
||||||
<code>(root)# syspkg -f pkg</code>
|
<code>(root)# syspkg -f pkg</code>
|
||||||
<h2>6 - Updating packages</h2>
|
<h2>8 - Updating packages</h2>
|
||||||
<p><strong>6.1 </strong>Introduction</p>
|
<p><strong>6.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 <cil>pkgname.old</cil>.</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 <cil>pkgname.old</cil>.</p>
|
||||||
<p><strong>6.2 </strong>Using gpkg</p>
|
<p><strong>6.2 </strong>Using gpkg</p>
|
||||||
@@ -81,7 +110,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
<p>To update a package:</p>
|
<p>To update a package:</p>
|
||||||
<code>(root)# syspkg -u pkg</code>
|
<code>(root)# syspkg -u pkg</code>
|
||||||
<h2>7 - Removing packages</h2>
|
<h2>9 - Removing packages</h2>
|
||||||
<p><strong>7.1 </strong>Introduction</p>
|
<p><strong>7.1 </strong>Introduction</p>
|
||||||
<p>When removing a package, the package info file is moved from the appropriate index to /tmp, and saved as <cil>pkgname.rm</cil>. This means it will be wiped after the next reboot.</p>
|
<p>When removing a package, the package info file is moved from the appropriate index to /tmp, and saved as <cil>pkgname.rm</cil>. This means it will be wiped after the next reboot.</p>
|
||||||
<p><strong>7.2 </strong>Using gpkg</p>
|
<p><strong>7.2 </strong>Using gpkg</p>
|
||||||
@@ -96,7 +125,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<p>If you wish to proceed anyways, you can remove a package with:</p>
|
<p>If you wish to proceed anyways, you can remove a package with:</p>
|
||||||
<code>(root)# syspkg -x pkg</code>
|
<code>(root)# syspkg -x pkg</code>
|
||||||
<h2>8 - Advanced usage</h2>
|
<h2>10 - Advanced usage</h2>
|
||||||
<p><strong>8.1 </strong>Patching packages</p>
|
<p><strong>8.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>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>
|
<p>The officially tested and verified method for patching is as follows:</p>
|
||||||
@@ -109,7 +138,7 @@
|
|||||||
<p>If Glacier's standard package repository is not sufficient, you can use a custom one.</p>
|
<p>If Glacier's standard package repository is not sufficient, you can use a custom one.</p>
|
||||||
<warnhead><strong>WARNING:</strong></warnhead>
|
<warnhead><strong>WARNING:</strong></warnhead>
|
||||||
<div class="warning">
|
<div class="warning">
|
||||||
<p>Ensure the repository you wish to migrate to supports your system profile. For example, if your profile is <cil>x86-musl</cil>, the new repository should offer packages compatible with <cil>x86-musl</cil>.</p>
|
<p>Ensure the repository you wish to migrate to supports your system profile. For example, if your profile is <cil-inv>x86-musl</cil-inv>, the new repository should offer packages compatible with <cil-inv>x86-musl</cil-inv>.</p>
|
||||||
<p>Errors will occur if this is not taken into account.</p>
|
<p>Errors will occur if this is not taken into account.</p>
|
||||||
</div>
|
</div>
|
||||||
<p>To use a custom repository once, to merge a package:</p>
|
<p>To use a custom repository once, to merge a package:</p>
|
||||||
@@ -158,7 +187,7 @@
|
|||||||
<p>GLACIER_SRV_DIR="/etc/glacier/services"</p>
|
<p>GLACIER_SRV_DIR="/etc/glacier/services"</p>
|
||||||
<p>$GLACIER_SRV_DIR/update-pkgdb.hook</p>
|
<p>$GLACIER_SRV_DIR/update-pkgdb.hook</p>
|
||||||
</div>
|
</div>
|
||||||
<h2>9 - Querying packages</h2>
|
<h2>11 - Querying packages</h2>
|
||||||
<p><strong>9.1 </strong>Introduction</p>
|
<p><strong>9.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>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>9.2 </strong>Querying files</p>
|
<p><strong>9.2 </strong>Querying files</p>
|
||||||
@@ -167,7 +196,12 @@
|
|||||||
<p><strong>9.3 </strong>Querying info</p>
|
<p><strong>9.3 </strong>Querying info</p>
|
||||||
<p>Package info can be listed with:</p>
|
<p>Package info can be listed with:</p>
|
||||||
<code>(user)$ gquery -i pkg</code>
|
<code>(user)$ gquery -i pkg</code>
|
||||||
<h2>10 - Writing packages</h2>
|
<h2>12 - Writing packages</h2>
|
||||||
|
<notehead><strong>NOTE:</strong></notehead>
|
||||||
|
<div class="note">
|
||||||
|
<p>This section is outdated as of 9/17/2024</p>
|
||||||
|
<p>Reason: Glacier v4 changes the package format</p>
|
||||||
|
</div>
|
||||||
<p><strong>10.1 </strong>Introduction</p>
|
<p><strong>10.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>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>If you have previous experience writing PKGBUILDs for the AUR, writing Glacier packages should feel very similar.</p>
|
||||||
@@ -227,10 +261,10 @@
|
|||||||
<p>Anything prefixed with "system" refers to the use of 'syspkg'.</p>
|
<p>Anything prefixed with "system" refers to the use of 'syspkg'.</p>
|
||||||
</div>
|
</div>
|
||||||
<footer>
|
<footer>
|
||||||
<p>Page last updated 9/03/23 @ 22:02</p>
|
<p>Page last updated 9/17/24 @ 09:40</p>
|
||||||
<p>Page licensed under GNU Free Documentation License 1.3 or later</p>
|
<p>Page licensed under GNU Free Documentation License 1.3 or later</p>
|
||||||
<p>--------------------</p>
|
<p>--------------------</p>
|
||||||
<p>Copyright (C) 2021-2023 Everest Linux</p>
|
<p>Copyright (C) 2021-2025 Everest Linux</p>
|
||||||
<p>Linux (R) is a registered trademark of Linus Torvalds.</p>
|
<p>Linux (R) is a registered trademark of Linus Torvalds.</p>
|
||||||
<p>Everest Linux is provided AS IS, WITHOUT WARRANTY.</p>
|
<p>Everest Linux is provided AS IS, WITHOUT WARRANTY.</p>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
504
docs/libglacier.html
Normal file
504
docs/libglacier.html
Normal file
@@ -0,0 +1,504 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<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/nord.css"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<!-- Navbar -->
|
||||||
|
<div class="sidenav">
|
||||||
|
<img src="../img/everest-nord.svg" alt="everest-logo">
|
||||||
|
<a href="../index.html">Home</a>
|
||||||
|
<a href="../about.html">About</a>
|
||||||
|
<a href="../install.html">Install</a>
|
||||||
|
<a href="../packages.html">Packages</a>
|
||||||
|
<a href="../download.html">Downloads</a>
|
||||||
|
<a href="home.html">Docs</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>1 - Introduction</h2>
|
||||||
|
<p><cil>libglacier</cil> is the backend library for Glacier. It simplifies many functions and allows users to extend Glacier's functionality.</p>
|
||||||
|
<h2>2 - Installation</h2>
|
||||||
|
<p>In order to install <cil>libglacier</cil>, the following libraries must be installed:</p>
|
||||||
|
<ul>
|
||||||
|
<li><p>libcolor</p></li>
|
||||||
|
<li><p>libconfig</p></li>
|
||||||
|
</ul>
|
||||||
|
<p>Once these libraries are installed, clone the <cil>libglacier</cil> repository:</p>
|
||||||
|
<p><code>$ git clone https://git.everestlinux.org/EverestLinux/libglacier</code></p>
|
||||||
|
<p>Enter the repository and edit the make configuration file:</p>
|
||||||
|
<p><code>$ cd libglacier</code></p>
|
||||||
|
<p><code>$ ${EDITOR} config.mk</code></p>
|
||||||
|
<cautionhead><strong>CAUTION</strong></cautionhead>
|
||||||
|
<div class="caution">
|
||||||
|
<p>Before proceeding with ANY other step, make sure you define <cil_inv>PREFIX</cil_inv> in config.mk.</p>
|
||||||
|
<p>By default this variable is not defined. Results will be unexpected if the library is compiled without <cil_inv>PREFIX</cil_inv> defined.</p>
|
||||||
|
</div>
|
||||||
|
<p>Build the library:</p>
|
||||||
|
<p><code>$ make lib</code></p>
|
||||||
|
<notehead><strong>NOTE</strong></notehead>
|
||||||
|
<div class="note">
|
||||||
|
<p><cil_inv>libglacier</cil_inv> is provided as a static library only.</p>
|
||||||
|
<p>If you wish to compile a shared library instead, you must edit the Makefile</p>
|
||||||
|
</div>
|
||||||
|
<h2>3 - Using libglacier in a program</h2>
|
||||||
|
<p>To use <cil>libglacier</cil> in a program, include the relevant header files:</p>
|
||||||
|
<bigcodehead><strong>CODE:</strong> Including libglacier header files</bigcodehead>
|
||||||
|
<div class="bigcode">
|
||||||
|
<p>#include <glacier/config.h></p>
|
||||||
|
<p>#include <glacier/data.h></p>
|
||||||
|
<p>#include <glacier/log.h></p>
|
||||||
|
<p>#include <glacier/pkgops.h></p>
|
||||||
|
<p>#include <glacier/runtime.h></p>
|
||||||
|
<p>#include <glacier/security.h></p>
|
||||||
|
</div>
|
||||||
|
<p></p>
|
||||||
|
<p>To compile <cil>libglacier</cil> into your program, add the flag <cil>-lglacier</cil> to your build process.</p>
|
||||||
|
<p><code>$ gcc program.c -lglacier -o program</code></p>
|
||||||
|
<p></p>
|
||||||
|
<h2>4 - Configuration Functions</h2>
|
||||||
|
<p><cil>libglacier</cil> supplies functions for parsing and getting values from libconfig-syntax configuration files. While only three are present, more are planned for the future.</p>
|
||||||
|
<p><strong>4.1</strong> init_config</p>
|
||||||
|
<p><cil>init_config</cil> initializes the libconfig library, and allows configuration files to be parsed.</p>
|
||||||
|
<p>No parameters are accepted by <cil>init_config</cil>.</p>
|
||||||
|
<bigcodehead><strong>CODE:</strong> init_config used in a program</bigcodehead>
|
||||||
|
<div class="bigcode">
|
||||||
|
<p>#include <glacier/config.h></p>
|
||||||
|
<p><span class="tab"></span></p>
|
||||||
|
<p>int</p>
|
||||||
|
<p>main()</p>
|
||||||
|
<p>{</p>
|
||||||
|
<p><span class="tab"></span>if (init_config() != 0) {</p>
|
||||||
|
<p><span class="tab"></span><span class="tab"></span>errlog("failed to initialize libconfig");</p>
|
||||||
|
<p><span class="tab"></span><span class="tab"></span>return(EXIT_FAILURE);</p>
|
||||||
|
<p><span class="tab"></span>}</p>
|
||||||
|
<p><span class="tab"></span>else {</p>
|
||||||
|
<p><span class="tab"></span><span class="tab"></span>successlog("Initialized libconfig");</p>
|
||||||
|
<p><span class="tab"></span>}</p>
|
||||||
|
<p>}</p>
|
||||||
|
</div>
|
||||||
|
<p><cil>init_config</cil> returns 0 on success, and 1 on failure.</p>
|
||||||
|
<hr>
|
||||||
|
<p><strong>4.2</strong> die_config</p>
|
||||||
|
<p><cil>die_config</cil> unloads the libconfig library. You should always run this when you're finished with libconfig in order to free memory.</p>
|
||||||
|
<p>No parameters are accepted by <cil>die_config</cil>.</p>
|
||||||
|
<bigcodehead><strong>CODE:</strong> die_config used in a program</bigcodehead>
|
||||||
|
<div class="bigcode">
|
||||||
|
<p>#include <glacier/config.h></p>
|
||||||
|
<p><span class="tab"></span></p>
|
||||||
|
<p>int</p>
|
||||||
|
<p>main()</p>
|
||||||
|
<p>{</p>
|
||||||
|
<p><span class="tab"></span>die_config();</p>
|
||||||
|
<p>}</p>
|
||||||
|
</div>
|
||||||
|
<p><cil>die_config</cil> returns 0 on success, and 1 on failure.</p>
|
||||||
|
<hr>
|
||||||
|
<p><strong>4.3</strong> load_all_from_config</p>
|
||||||
|
<p><cil>load_all_from_config</cil> loads all expected settings from /etc/glacier.cfg.</p>
|
||||||
|
<p>No parameters are accepted by <cil>load_all_from_config</cil>.</p>
|
||||||
|
<bigcodehead><strong>CODE:</strong> load_all_from_config used in a program</bigcodehead>
|
||||||
|
<div class="bigcode">
|
||||||
|
<p>#include <glacier/config.h></p>
|
||||||
|
<p><span class="tab"></span></p>
|
||||||
|
<p>int</p>
|
||||||
|
<p>main()</p>
|
||||||
|
<p>{</p>
|
||||||
|
<p><span class="tab"></span>init_config();</p>
|
||||||
|
<p>}</p>
|
||||||
|
</div>
|
||||||
|
<p><cil>load_all_from_config</cil> returns 0 on success, and 1 on failure.</p>
|
||||||
|
<h2>5 - Data structure functions</h2>
|
||||||
|
<p>Since Glacier is a package manager, <cil>libglacier</cil> provides functions for creating and handling dependency trees.</p>
|
||||||
|
<p><strong>5.1</strong> create_node</p>
|
||||||
|
<p><cil>create_node</cil> creates a node for a dependency tree.</p>
|
||||||
|
<p><cil>create_node</cil> accepts the following parameters:</p>
|
||||||
|
<ul>
|
||||||
|
<li><p><cil>char *data</cil> (the name of the node to create)</p></li>
|
||||||
|
</ul>
|
||||||
|
<bigcodehead><strong>CODE:</strong> create_node used in a program</bigcodehead>
|
||||||
|
<div class="bigcode">
|
||||||
|
<p>#include <glacier/data.h></p>
|
||||||
|
<p><span class="tab"></span></p>
|
||||||
|
<p>int</p>
|
||||||
|
<p>main()</p>
|
||||||
|
<p>{</p>
|
||||||
|
<p><span class="tab"></span>struct node package = create_node("Package");</p>
|
||||||
|
<p>}</p>
|
||||||
|
</div>
|
||||||
|
<p><cil>create_node</cil> returns a node structure.</p>
|
||||||
|
<hr>
|
||||||
|
<p><strong>5.2</strong> add_child</p>
|
||||||
|
<p><cil>add_child</cil> adds a specified child node to a parent node.</p>
|
||||||
|
<p><cil>add_child</cil> accepts the following parameters:</p>
|
||||||
|
<ul>
|
||||||
|
<li><p><cil>struct node *parent</cil> (the parent node which the child will be added to)</p></li>
|
||||||
|
<li><p><cil>struct node *child</cil> (the child node which will be added to the parent node)</p></li>
|
||||||
|
</ul>
|
||||||
|
<bigcodehead><strong>CODE:</strong> add_child used in a program</bigcodehead>
|
||||||
|
<div class="bigcode">
|
||||||
|
<p>#include <glacier/data.h></p>
|
||||||
|
<p><span class="tab"></span></p>
|
||||||
|
<p>int</p>
|
||||||
|
<p>main()</p>
|
||||||
|
<p>{</p>
|
||||||
|
<p><span class="tab"></span>struct node pack = create_node("pack");
|
||||||
|
<p><span class="tab"></span>struct node dep1 = create_node("dep1");
|
||||||
|
<p><span class="tab"></span>add_child(pack, dep1);</p>
|
||||||
|
<p>}</p>
|
||||||
|
</div>
|
||||||
|
<p><cil>add_child</cil> returns 0 on success, and 1 on failure.</p>
|
||||||
|
<hr>
|
||||||
|
<p><strong>5.3</strong> print_tree</p>
|
||||||
|
<p><cil>print_tree</cil> prints a dependency tree specified at its root node.</p>
|
||||||
|
<p><cil>print_tree</cil> accepts the following parameters:</p>
|
||||||
|
<ul>
|
||||||
|
<li><p><cil>struct node *root</cil> (the root node of the tree to print</p></li>
|
||||||
|
<li><p><cil>int level</cil> (the number of levels to descend)</p></li>
|
||||||
|
</ul>
|
||||||
|
<bigcodehead><strong>CODE:</strong> print_tree used in a program</bigcodehead>
|
||||||
|
<div class="bigcode">
|
||||||
|
<p>#include <glacier/data.h></p>
|
||||||
|
<p><span class="tab"></span></p>
|
||||||
|
<p>int</p>
|
||||||
|
<p>main()</p>
|
||||||
|
<p>{</p>
|
||||||
|
<p><span class="tab"></span>struct node pack = create_node("pack");</p>
|
||||||
|
<p><span class="tab"></span>struct node dep1 = create_node("dep1");</p>
|
||||||
|
<p><span class="tab"></span>add_child(pack, dep1);</p>
|
||||||
|
<p><span class="tab"></span>print_tree(pack, 0);</p>
|
||||||
|
<p>}</p>
|
||||||
|
</div>
|
||||||
|
<p><cil>print_tree</cil> returns 0 on success.</p>
|
||||||
|
<hr>
|
||||||
|
<p><strong>5.4</strong> init_queue</p>
|
||||||
|
<p><cil>init_queue</cil> initializes a queue data structure.</p>
|
||||||
|
<notehead><strong>REMOVED FEATURE</strong></notehead>
|
||||||
|
<div class="note">
|
||||||
|
<p>The queue data structure was removed in a recent update (March 2025). This function is no longer available in the current version of libglacier.</p>
|
||||||
|
</div>
|
||||||
|
<p><cil>init_queue</cil> accepts the following parameters:</p>
|
||||||
|
<ul>
|
||||||
|
<li><p><cil>queue *q</cil> (the name of the queue to initialize</p></li>
|
||||||
|
</ul>
|
||||||
|
<bigcodehead><strong>CODE:</strong> init_queue used in a program</bigcodehead>
|
||||||
|
<div class="bigcode">
|
||||||
|
<p>#include <glacier/data.h></p>
|
||||||
|
<p><span class="tab"></span></p>
|
||||||
|
<p>int</p>
|
||||||
|
<p>main()</p>
|
||||||
|
<p>{</p>
|
||||||
|
<p><span class="tab"></span>/* Queue implementation removed */</p>
|
||||||
|
<p>}</p>
|
||||||
|
</div>
|
||||||
|
<h2>6 - Logging Functions</h2>
|
||||||
|
<p>The logging functions <cil>libglacier</cil> provides are designed to allow a uniform style of output. </p>
|
||||||
|
<p>The following logging functions are included:</p>
|
||||||
|
<ul>
|
||||||
|
<li><p><cil>infolog</cil></p></li>
|
||||||
|
<li><p><cil>warnlog</cil></p></li>
|
||||||
|
<li><p><cil>errlog</cil></p></li>
|
||||||
|
<li><p><cil>successlog</cil></p></li>
|
||||||
|
</ul>
|
||||||
|
<p>These four functions accept the following parameters:</p>
|
||||||
|
<ul>
|
||||||
|
<li><p><cil>char MSG</cil> (the message to output</p></li>
|
||||||
|
</ul>
|
||||||
|
<p></p>
|
||||||
|
<notehead><strong>NOTE:</strong></notehead>
|
||||||
|
<div class="note">
|
||||||
|
<p>Logging functions do not require a newline character ('\n'), they will automatically place one after the message.</p>
|
||||||
|
</div>
|
||||||
|
<p></p>
|
||||||
|
<p>All logging functions return 0 on success, and 1 on failure.</p>
|
||||||
|
<bigcodehead><strong>CODE:</strong> Logging functions used in a program</bigcodehead>
|
||||||
|
<div class="bigcode">
|
||||||
|
<p>#include <glacier/log.h></p>
|
||||||
|
<p><span class="tab"></span></p>
|
||||||
|
<p>int</p>
|
||||||
|
<p>main()</p>
|
||||||
|
<p>{</p>
|
||||||
|
<p><span class="tab"></span>infolog("This is an info message");</p>
|
||||||
|
<p><span class="tab"></span>warnlog("This is a warning message");</p>
|
||||||
|
<p><span class="tab"></span>errlog("This is an error message");</p>
|
||||||
|
<p><span class="tab"></span>successlog("This is a success message");</p>
|
||||||
|
<p>}</p>
|
||||||
|
</div>
|
||||||
|
<h2>7 - Package Operation Functions</h2>
|
||||||
|
<p>This section describes the numerous functions related to operations on packages.</p>
|
||||||
|
<p><strong>7.1</strong> mkworkspace</p>
|
||||||
|
<p><cil>mkworkspace</cil> creates a Glacier workspace at <cil>/tmp/glacier-workspace</cil>.</p>
|
||||||
|
<p><cil>mkworkspace</cil> accepts no parameters.</p>
|
||||||
|
<bigcodehead><strong>CODE:</strong> mkworkspace used in a program</bigcodehead>
|
||||||
|
<div class="bigcode">
|
||||||
|
<p>#include <glacier/pkgops.h></p>
|
||||||
|
<p><span class="tab"></span></p>
|
||||||
|
<p>int</p>
|
||||||
|
<p>main()</p>
|
||||||
|
<p>{</p>
|
||||||
|
<p><span class="tab"></span>mkworkspace();</p>
|
||||||
|
<p>}</p>
|
||||||
|
</div>
|
||||||
|
<p><cil>mkworkspace</cil> returns the following values:</p>
|
||||||
|
<ul>
|
||||||
|
<li><p>0 on success</p></li>
|
||||||
|
<li><p>2 on library error</p></li>
|
||||||
|
</ul>
|
||||||
|
<p>Calling <cil>mkworkspace</cil> creates the workspace if it doesn't already exist.</p>
|
||||||
|
<hr>
|
||||||
|
<p><strong>7.2</strong> prepare_pkg</p>
|
||||||
|
<p><cil>prepare_pkg</cil> copies a package archive from the local package database to the workspace, and untars it.</p>
|
||||||
|
<p><cil>prepare_pkg</cil> accepts the following parameters:</p>
|
||||||
|
<ul>
|
||||||
|
<li><p><cil>char PACKAGE[]</cil> (the package file to prepare)</p></li>
|
||||||
|
</ul>
|
||||||
|
<bigcodehead><strong>CODE:</strong> prepare_pkg used in a program</bigcodehead>
|
||||||
|
<div class="bigcode">
|
||||||
|
<p>#include <glacier/pkgops.h></p>
|
||||||
|
<p><span class="tab"></span></p>
|
||||||
|
<p>int</p>
|
||||||
|
<p>main()</p>
|
||||||
|
<p>{</p>
|
||||||
|
<p><span class="tab"></span>prepare_pkg("/glacier/localdb/epkgs-x86_64-musl/foo.tar");</p>
|
||||||
|
<p>}</p>
|
||||||
|
</div>
|
||||||
|
<p><cil>prepare_pkg</cil> returns the following values:</p>
|
||||||
|
<ul>
|
||||||
|
<li><p>0 on success</p></li>
|
||||||
|
<li><p>1 on package does not exist, or error untarring</p></li>
|
||||||
|
</ul>
|
||||||
|
<cautionhead><strong>CAUTION:</strong></cautionhead>
|
||||||
|
<div class="caution">
|
||||||
|
<p>This example presented is not the best. Instead of manually specifying the package directory, you should be calling the system profile.</p>
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
|
<p><strong>7.3</strong> run_make_task</p>
|
||||||
|
<p><cil>run_make_task</cil> runs a specified make task in a package's current working directory.</p>
|
||||||
|
<p><cil>run_make_task</cil> accepts the following parameters:</p>
|
||||||
|
<ul>
|
||||||
|
<li><p><cil>char TASK[]</cil> (the make task to run</p></li>
|
||||||
|
</ul>
|
||||||
|
<bigcodehead><strong>CODE:</strong> run_make_task used in a program</bigcodehead>
|
||||||
|
<div class="bigcode">
|
||||||
|
<p>#include <glacier/pkgops.h></p>
|
||||||
|
<p><span class="tab"></span></p>
|
||||||
|
<p>int</p>
|
||||||
|
<p>main()</p>
|
||||||
|
<p>{</p>
|
||||||
|
<p><span class="tab"></span>prepare_pkg("/glacier/localdb/epkgs-x86_64-musl/foo.tar");</p>
|
||||||
|
<p><span class="tab"></span>run_make_task("installpkg");</p>
|
||||||
|
<p>}</p>
|
||||||
|
</div>
|
||||||
|
<p><cil>run_make_task</cil> returns the following values:</p>
|
||||||
|
<ul>
|
||||||
|
<li><p>0 on success</p></li>
|
||||||
|
<li><p>1 on failure</p></li>
|
||||||
|
</ul>
|
||||||
|
<h2>8 - Runtime Functions</h2>
|
||||||
|
<p>The functions described here are used for various runtime checks.</p>
|
||||||
|
<p><strong>8.1</strong> runtime_exists</p>
|
||||||
|
<p><cil>runtime_exists</cil> checks if necessary runtime files exist and are in their correct locations.</p>
|
||||||
|
<p><cil>runtime_exists</cil> accepts no parameters.</p>
|
||||||
|
<bigcodehead><strong>CODE:</strong> runtime_exists used in a program</bigcodehead>
|
||||||
|
<div class="bigcode">
|
||||||
|
<p>#include <glacier/runtime.h></p>
|
||||||
|
<p><span class="tab"></span></p>
|
||||||
|
<p>int</p>
|
||||||
|
<p>main()</p>
|
||||||
|
<p>{</p>
|
||||||
|
<p><span class="tab"></span>runtime_exists();</p>
|
||||||
|
<p>}</p>
|
||||||
|
</div>
|
||||||
|
<p><cil>runtime_exists</cil> returns no values.</p>
|
||||||
|
<hr>
|
||||||
|
<p><strong>8.2</strong> is_process_root</p>
|
||||||
|
<p><cil>is_process_root</cil> verifies if the process has root privileges to perform package operations.</p>
|
||||||
|
<p><cil>is_process_root</cil> accepts no parameters.</p>
|
||||||
|
<bigcodehead><strong>CODE:</strong> is_process_root used in a program</bigcodehead>
|
||||||
|
<div class="bigcode">
|
||||||
|
<p>#include <glacier/runtime.h></p>
|
||||||
|
<p><span class="tab"></span></p>
|
||||||
|
<p>int</p>
|
||||||
|
<p>main()</p>
|
||||||
|
<p>{</p>
|
||||||
|
<p><span class="tab"></span>if (is_process_root() != 0) {</p>
|
||||||
|
<p><span class="tab"></span><span class="tab"></span>errlog("insufficient permissions to perform package operations");</p>
|
||||||
|
<p><span class="tab"></span><span class="tab"></span>return(EXIT_FAILURE);</p>
|
||||||
|
<p><span class="tab"></span>}</p>
|
||||||
|
<p>}</p>
|
||||||
|
</div>
|
||||||
|
<p><cil>is_process_root</cil> returns the following values:</p>
|
||||||
|
<ul>
|
||||||
|
<li><p>0 on sufficient permissions (process is root)</p></li>
|
||||||
|
<li><p>1 on insufficient permissions (process is not root)</p></li>
|
||||||
|
</ul>
|
||||||
|
<hr>
|
||||||
|
<p><strong>8.3</strong> get_system_profile</p>
|
||||||
|
<p><cil>get_system_profile</cil> fetches the system profile, which contains information about the architecture and libc implementation.</p>
|
||||||
|
<p><cil>get_system_profile</cil> accepts no parameters.</p>
|
||||||
|
<bigcodehead><strong>CODE:</strong> get_system_profile used in a program</bigcodehead>
|
||||||
|
<div class="bigcode">
|
||||||
|
<p>#include <glacier/runtime.h></p>
|
||||||
|
<p><span class="tab"></span></p>
|
||||||
|
<p>int</p>
|
||||||
|
<p>main()</p>
|
||||||
|
<p>{</p>
|
||||||
|
<p><span class="tab"></span>char *profile = get_system_profile();</p>
|
||||||
|
<p><span class="tab"></span>infolog(profile);</p>
|
||||||
|
<p>}</p>
|
||||||
|
</div>
|
||||||
|
<p><cil>get_system_profile</cil> returns a pointer to a string containing the system profile (e.g., "x86_64-musl").</p>
|
||||||
|
<h2>9 - Security Functions</h2>
|
||||||
|
<p>These functions provide security checks for package integrity and signatures.</p>
|
||||||
|
<p><strong>9.1</strong> verify_signature</p>
|
||||||
|
<p><cil>verify_signature</cil> checks if a package's signature is valid against the trusted keyring.</p>
|
||||||
|
<notehead><strong>UPCOMING FEATURE</strong></notehead>
|
||||||
|
<div class="note">
|
||||||
|
<p>This function is planned for a future release and is not yet implemented in the current version of libglacier.</p>
|
||||||
|
</div>
|
||||||
|
<p><cil>verify_signature</cil> accepts the following parameters:</p>
|
||||||
|
<ul>
|
||||||
|
<li><p><cil>char PACKAGE[]</cil> (the package file to verify)</p></li>
|
||||||
|
<li><p><cil>char SIGNATURE[]</cil> (the signature file to check against)</p></li>
|
||||||
|
</ul>
|
||||||
|
<bigcodehead><strong>CODE:</strong> verify_signature used in a program</bigcodehead>
|
||||||
|
<div class="bigcode">
|
||||||
|
<p>#include <glacier/security.h></p>
|
||||||
|
<p><span class="tab"></span></p>
|
||||||
|
<p>int</p>
|
||||||
|
<p>main()</p>
|
||||||
|
<p>{</p>
|
||||||
|
<p><span class="tab"></span>if (verify_signature("package.tar", "package.tar.sig") != 0) {</p>
|
||||||
|
<p><span class="tab"></span><span class="tab"></span>errlog("invalid package signature");</p>
|
||||||
|
<p><span class="tab"></span><span class="tab"></span>return(EXIT_FAILURE);</p>
|
||||||
|
<p><span class="tab"></span>}</p>
|
||||||
|
<p><span class="tab"></span>return(EXIT_SUCCESS);</p>
|
||||||
|
<p>}</p>
|
||||||
|
</div>
|
||||||
|
<p><cil>verify_signature</cil> returns the following values:</p>
|
||||||
|
<ul>
|
||||||
|
<li><p>0 on valid signature</p></li>
|
||||||
|
<li><p>1 on invalid signature</p></li>
|
||||||
|
<li><p>2 on file not found</p></li>
|
||||||
|
</ul>
|
||||||
|
<hr>
|
||||||
|
<p><strong>9.2</strong> check_integrity</p>
|
||||||
|
<p><cil>check_integrity</cil> verifies a package's SHA256 checksum against the expected value.</p>
|
||||||
|
<notehead><strong>UPCOMING FEATURE</strong></notehead>
|
||||||
|
<div class="note">
|
||||||
|
<p>This function is planned for a future release and is not yet implemented in the current version of libglacier.</p>
|
||||||
|
<p>Note that the underlying functions for calculating file hashes (<cil_inv>hash_file()</cil_inv>, <cil_inv>stash_hash()</cil_inv>, <cil_inv>print_hash()</cil_inv>) are already implemented.</p>
|
||||||
|
</div>
|
||||||
|
<p><cil>check_integrity</cil> accepts the following parameters:</p>
|
||||||
|
<ul>
|
||||||
|
<li><p><cil>char PACKAGE[]</cil> (the package file to check)</p></li>
|
||||||
|
<li><p><cil>char EXPECTED_HASH[]</cil> (the expected SHA256 hash)</p></li>
|
||||||
|
</ul>
|
||||||
|
<bigcodehead><strong>CODE:</strong> check_integrity used in a program</bigcodehead>
|
||||||
|
<div class="bigcode">
|
||||||
|
<p>#include <glacier/security.h></p>
|
||||||
|
<p><span class="tab"></span></p>
|
||||||
|
<p>int</p>
|
||||||
|
<p>main()</p>
|
||||||
|
<p>{</p>
|
||||||
|
<p><span class="tab"></span>char *expected = "d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592";</p>
|
||||||
|
<p><span class="tab"></span>if (check_integrity("package.tar", expected) != 0) {</p>
|
||||||
|
<p><span class="tab"></span><span class="tab"></span>errlog("package integrity check failed");</p>
|
||||||
|
<p><span class="tab"></span><span class="tab"></span>return(EXIT_FAILURE);</p>
|
||||||
|
<p><span class="tab"></span>}</p>
|
||||||
|
<p><span class="tab"></span>return(EXIT_SUCCESS);</p>
|
||||||
|
<p>}</p>
|
||||||
|
</div>
|
||||||
|
<p><cil>check_integrity</cil> returns the following values:</p>
|
||||||
|
<ul>
|
||||||
|
<li><p>0 on hash match</p></li>
|
||||||
|
<li><p>1 on hash mismatch</p></li>
|
||||||
|
<li><p>2 on file not found or hash calculation error</p></li>
|
||||||
|
</ul>
|
||||||
|
<h2>10 - Advanced Usage</h2>
|
||||||
|
<p>This section covers more advanced usage patterns for <cil>libglacier</cil>.</p>
|
||||||
|
<p><strong>10.1</strong> Custom dependency tree handling</p>
|
||||||
|
<p>While <cil>libglacier</cil> provides functions for creating and manipulating dependency trees, you might need to implement custom behaviors for resolving dependencies.</p>
|
||||||
|
<bigcodehead><strong>CODE:</strong> Custom dependency resolution</bigcodehead>
|
||||||
|
<div class="bigcode">
|
||||||
|
<p>#include <glacier/data.h></p>
|
||||||
|
<p>#include <glacier/log.h></p>
|
||||||
|
<p><span class="tab"></span></p>
|
||||||
|
<p>int</p>
|
||||||
|
<p>resolve_dependencies(struct node *root)</p>
|
||||||
|
<p>{</p>
|
||||||
|
<p><span class="tab"></span>/* Custom dependency resolution logic here */</p>
|
||||||
|
<p><span class="tab"></span>for (int i = 0; i < root->num_children; i++) {</p>
|
||||||
|
<p><span class="tab"></span><span class="tab"></span>infolog(root->children[i]->data);</p>
|
||||||
|
<p><span class="tab"></span><span class="tab"></span>/* Process child dependencies recursively */</p>
|
||||||
|
<p><span class="tab"></span><span class="tab"></span>resolve_dependencies(root->children[i]);</p>
|
||||||
|
<p><span class="tab"></span>}</p>
|
||||||
|
<p><span class="tab"></span>return(0);</p>
|
||||||
|
<p>}</p>
|
||||||
|
<p><span class="tab"></span></p>
|
||||||
|
<p>int</p>
|
||||||
|
<p>main()</p>
|
||||||
|
<p>{</p>
|
||||||
|
<p><span class="tab"></span>struct node *root = create_node("base-package");</p>
|
||||||
|
<p><span class="tab"></span>struct node *dep1 = create_node("dependency1");</p>
|
||||||
|
<p><span class="tab"></span>struct node *dep2 = create_node("dependency2");</p>
|
||||||
|
<p><span class="tab"></span>add_child(root, dep1);</p>
|
||||||
|
<p><span class="tab"></span>add_child(root, dep2);</p>
|
||||||
|
<p><span class="tab"></span>resolve_dependencies(root);</p>
|
||||||
|
<p><span class="tab"></span>return(EXIT_SUCCESS);</p>
|
||||||
|
<p>}</p>
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
|
<p><strong>10.2</strong> Error handling best practices</p>
|
||||||
|
<p>When using <cil>libglacier</cil>, it's important to implement proper error handling. All functions that return integer status codes should be checked.</p>
|
||||||
|
<bigcodehead><strong>CODE:</strong> Proper error handling</bigcodehead>
|
||||||
|
<div class="bigcode">
|
||||||
|
<p>#include <glacier/config.h></p>
|
||||||
|
<p>#include <glacier/log.h></p>
|
||||||
|
<p>#include <glacier/pkgops.h></p>
|
||||||
|
<p><span class="tab"></span></p>
|
||||||
|
<p>int</p>
|
||||||
|
<p>main()</p>
|
||||||
|
<p>{</p>
|
||||||
|
<p><span class="tab"></span>/* Initialize configuration */</p>
|
||||||
|
<p><span class="tab"></span>if (init_config() != 0) {</p>
|
||||||
|
<p><span class="tab"></span><span class="tab"></span>errlog("failed to initialize configuration");</p>
|
||||||
|
<p><span class="tab"></span><span class="tab"></span>return(EXIT_FAILURE);</p>
|
||||||
|
<p><span class="tab"></span>}</p>
|
||||||
|
<p><span class="tab"></span></p>
|
||||||
|
<p><span class="tab"></span>/* Create workspace */</p>
|
||||||
|
<p><span class="tab"></span>if (mkworkspace() != 0) {</p>
|
||||||
|
<p><span class="tab"></span><span class="tab"></span>errlog("failed to create workspace");</p>
|
||||||
|
<p><span class="tab"></span><span class="tab"></span>die_config();</p>
|
||||||
|
<p><span class="tab"></span><span class="tab"></span>return(EXIT_FAILURE);</p>
|
||||||
|
<p><span class="tab"></span>}</p>
|
||||||
|
<p><span class="tab"></span></p>
|
||||||
|
<p><span class="tab"></span>/* Always clean up resources */</p>
|
||||||
|
<p><span class="tab"></span>die_config();</p>
|
||||||
|
<p><span class="tab"></span>return(EXIT_SUCCESS);</p>
|
||||||
|
<p>}</p>
|
||||||
|
</div>
|
||||||
|
<p></p>
|
||||||
|
<notehead><strong>NOTE:</strong></notehead>
|
||||||
|
<div class="note">
|
||||||
|
<p>Always free resources and clean up configurations when your program exits, even on error paths.</p>
|
||||||
|
<p>This prevents memory leaks and ensures consistent behavior.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<footer>
|
||||||
|
<p>Page last updated 03/22/25 @ 15:45</p>
|
||||||
|
<p>Page licensed under GNU Free Documentation License 1.3 or later</p>
|
||||||
|
<p>--------------------</p>
|
||||||
|
<p>Copyright (C) 2021-2025 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>
|
||||||
@@ -94,7 +94,7 @@
|
|||||||
<p>Page last updated 1/08/2024 @ 17:28</p>
|
<p>Page last updated 1/08/2024 @ 17:28</p>
|
||||||
<p>Page licensed under GNU Free Documentation License 1.3 or later</p>
|
<p>Page licensed under GNU Free Documentation License 1.3 or later</p>
|
||||||
<p>--------------------</p>
|
<p>--------------------</p>
|
||||||
<p>Copyright (C) 2021-2023 Everest Linux</p>
|
<p>Copyright (C) 2021-2025 Everest Linux</p>
|
||||||
<p>Linux (R) is a registered trademark of Linus Torvalds.</p>
|
<p>Linux (R) is a registered trademark of Linus Torvalds.</p>
|
||||||
<p>Everest Linux is provided AS IS, WITHOUT WARRANTY.</p>
|
<p>Everest Linux is provided AS IS, WITHOUT WARRANTY.</p>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -104,7 +104,7 @@
|
|||||||
<p>Page last updated 6/17/23 @ 20:16</p>
|
<p>Page last updated 6/17/23 @ 20:16</p>
|
||||||
<p>Page licensed under GNU Free Documentation License 1.3 or later</p>
|
<p>Page licensed under GNU Free Documentation License 1.3 or later</p>
|
||||||
<p>--------------------</p>
|
<p>--------------------</p>
|
||||||
<p>Copyright (C) 2021-2023 Everest Linux</p>
|
<p>Copyright (C) 2021-2025 Everest Linux</p>
|
||||||
<p>Linux (R) is a registered trademark of Linus Torvalds.</p>
|
<p>Linux (R) is a registered trademark of Linus Torvalds.</p>
|
||||||
<p>Everest Linux is provided AS IS, WITHOUT WARRANTY.</p>
|
<p>Everest Linux is provided AS IS, WITHOUT WARRANTY.</p>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -56,7 +56,7 @@
|
|||||||
<p>Page last updated MM/DD/YY @ HH:MM</p>
|
<p>Page last updated MM/DD/YY @ HH:MM</p>
|
||||||
<p>Page licensed under GNU Free Documentation License 1.3 or later</p>
|
<p>Page licensed under GNU Free Documentation License 1.3 or later</p>
|
||||||
<p>--------------------</p>
|
<p>--------------------</p>
|
||||||
<p>Copyright (C) 2021-2023 Everest Linux</p>
|
<p>Copyright (C) 2021-2025 Everest Linux</p>
|
||||||
<p>Linux (R) is a registered trademark of Linus Torvalds.</p>
|
<p>Linux (R) is a registered trademark of Linus Torvalds.</p>
|
||||||
<p>Everest Linux is provided AS IS, WITHOUT WARRANTY.</p>
|
<p>Everest Linux is provided AS IS, WITHOUT WARRANTY.</p>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
<p>Page last updated MM/DD/YY @ HH:MM</p>
|
<p>Page last updated MM/DD/YY @ HH:MM</p>
|
||||||
<p>Page licensed under GNU Free Documentation License 1.3 or later</p>
|
<p>Page licensed under GNU Free Documentation License 1.3 or later</p>
|
||||||
<p>--------------------</p>
|
<p>--------------------</p>
|
||||||
<p>Copyright (C) 2021-2023 Everest Linux</p>
|
<p>Copyright (C) 2021-2025 Everest Linux</p>
|
||||||
<p>Linux (R) is a registered trademark of Linus Torvalds.</p>
|
<p>Linux (R) is a registered trademark of Linus Torvalds.</p>
|
||||||
<p>Everest Linux is provided AS IS, WITHOUT WARRANTY.</p>
|
<p>Everest Linux is provided AS IS, WITHOUT WARRANTY.</p>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
<code>(user)$ wget https://git.everestlinux.org/EverestLinux/everest/raw/branch/main/releases/SYSTEM_IMAGE</code>
|
<code>(user)$ wget https://git.everestlinux.org/EverestLinux/everest/raw/branch/main/releases/SYSTEM_IMAGE</code>
|
||||||
</div>
|
</div>
|
||||||
<footer>
|
<footer>
|
||||||
<p>Copyright (C) 2021-2024 Everest Linux</p>
|
<p>Copyright (C) 2021-2025 Everest Linux</p>
|
||||||
<p>Linux (R) is a registered trademark of Linus Torvalds.</p>
|
<p>Linux (R) is a registered trademark of Linus Torvalds.</p>
|
||||||
<p>Everest Linux is provided AS IS, WITHOUT WARRANTY.</p>
|
<p>Everest Linux is provided AS IS, WITHOUT WARRANTY.</p>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
<p>Contact security@everestlinux.org to report an issue</p>
|
<p>Contact security@everestlinux.org to report an issue</p>
|
||||||
</div>
|
</div>
|
||||||
<footer>
|
<footer>
|
||||||
<p>Copyright (C) 2021-2024 Everest Linux</p>
|
<p>Copyright (C) 2021-2025 Everest Linux</p>
|
||||||
<p>Linux (R) is a registered trademark of Linus Torvalds.</p>
|
<p>Linux (R) is a registered trademark of Linus Torvalds.</p>
|
||||||
<p>Everest Linux is provided AS IS, WITHOUT WARRANTY.</p>
|
<p>Everest Linux is provided AS IS, WITHOUT WARRANTY.</p>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
10
index.html
10
index.html
@@ -41,6 +41,14 @@
|
|||||||
Installation Guide
|
Installation Guide
|
||||||
</button>
|
</button>
|
||||||
<h2>News</h2>
|
<h2>News</h2>
|
||||||
|
<newshead><strong>10/3/24 - libglacier v4.0.0rc out now</strong></newshead>
|
||||||
|
<div class="news">
|
||||||
|
<p>After 8 months of development, libglacier has been released as v4.0.0rc.</p>
|
||||||
|
<p>While this is technically an unstable development release, it has been tested vigorously and is only labeled as unstable due to the absence of configuration file parsing, which will be added in the next release.</p>
|
||||||
|
<p>This release means that progress on Glacier's frontend programs can finally progress.</p>
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
|
<p></p>
|
||||||
<newshead><strong>7/12/24 - Registration closed for git.everestlinux.org</strong></newshead>
|
<newshead><strong>7/12/24 - Registration closed for git.everestlinux.org</strong></newshead>
|
||||||
<div class="news">
|
<div class="news">
|
||||||
<p>Due to an influx of spam on our Git server, new account registration has been closed.</p>
|
<p>Due to an influx of spam on our Git server, new account registration has been closed.</p>
|
||||||
@@ -179,7 +187,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<footer>
|
<footer>
|
||||||
<p>Copyright (C) 2021-2024 Everest Linux</p>
|
<p>Copyright (C) 2021-2025 Everest Linux</p>
|
||||||
<p>Linux (R) is a registered trademark of Linus Torvalds.</p>
|
<p>Linux (R) is a registered trademark of Linus Torvalds.</p>
|
||||||
<p>Everest Linux is provided AS IS, WITHOUT WARRANTY.</p>
|
<p>Everest Linux is provided AS IS, WITHOUT WARRANTY.</p>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
18
install.html
18
install.html
@@ -79,9 +79,14 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>/mnt/everest/usr</td>
|
<td>/mnt/everest/usr</td>
|
||||||
<td>/usr</td>
|
<td>User partition</td>
|
||||||
<td>No smaller than 25 GB, recommended size varies.</td>
|
<td>No smaller than 25 GB, recommended size varies.</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>/mnt/everest/home</td>
|
||||||
|
<td>Home partition</td>
|
||||||
|
<td>It depends</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>/mnt/everest</td>
|
<td>/mnt/everest</td>
|
||||||
<td>Root filesystem</td>
|
<td>Root filesystem</td>
|
||||||
@@ -135,6 +140,11 @@
|
|||||||
<div class="note">
|
<div class="note">
|
||||||
<p>Make sure you're happy with the system image you choose. While migrating in the future is possible, it requires rebuilding the majority of the system, takes a substantial amount of time, and may present other issues.</p>
|
<p>Make sure you're happy with the system image you choose. While migrating in the future is possible, it requires rebuilding the majority of the system, takes a substantial amount of time, and may present other issues.</p>
|
||||||
</div>
|
</div>
|
||||||
|
<p></p>
|
||||||
|
<warnhead><strong>WARNING:</strong></warnhead>
|
||||||
|
<div class="warning">
|
||||||
|
<p>As a beginner, under NO CIRCUMSTANCES should you use a system image omitting 32 bit libraries unless it is ABSOLUTELY NECESSARY.</p>
|
||||||
|
</div>
|
||||||
<p>Downloading a system image that is severely out of date is not recommended. Many programs, such as the kernel or SSL library will be vulnerable to attacks.</p>
|
<p>Downloading a system image that is severely out of date is not recommended. Many programs, such as the kernel or SSL library will be vulnerable to attacks.</p>
|
||||||
<p>Download a system image with wget:</p>
|
<p>Download a system image with wget:</p>
|
||||||
<code>(user)$ wget https://git.everestlinux.org/EverestLinux/everest/raw/branch/main/releases/SYSTEM_IMAGE.tar.xz</code>
|
<code>(user)$ wget https://git.everestlinux.org/EverestLinux/everest/raw/branch/main/releases/SYSTEM_IMAGE.tar.xz</code>
|
||||||
@@ -146,6 +156,10 @@
|
|||||||
<code>(root)# tar -xpvf SYSTEM_IMAGE --xattrs-include='*.*' --numeric-owner</code>
|
<code>(root)# tar -xpvf SYSTEM_IMAGE --xattrs-include='*.*' --numeric-owner</code>
|
||||||
<p>If this command was run correctly, you shouldn't need to edit any permissions manually.</p>
|
<p>If this command was run correctly, you shouldn't need to edit any permissions manually.</p>
|
||||||
<p>In case permissions were changed, you can use the <cil>prep</cil> command from <cil>everest-build-tools</cil>.</p>
|
<p>In case permissions were changed, you can use the <cil>prep</cil> command from <cil>everest-build-tools</cil>.</p>
|
||||||
|
<cautionhead><strong>CAUTION:</strong></cautionhead>
|
||||||
|
<div class="caution">
|
||||||
|
<p>Caution should be exercised when running <cil-inv>prep</cil-inv> as it can mess with permissions already existing on the system.</p>
|
||||||
|
</div>
|
||||||
<h2>Chrooting into the system mountpoint</h2>
|
<h2>Chrooting into the system mountpoint</h2>
|
||||||
<p>Although we have a relatively complete root filesystem at this point, many essential programs are still missing. These include the kernel and bootloader. Without these, the system is unable to boot. At this point, we must chroot into the new system. This will allow us to complete the system's build process without booting into it.</p>
|
<p>Although we have a relatively complete root filesystem at this point, many essential programs are still missing. These include the kernel and bootloader. Without these, the system is unable to boot. At this point, we must chroot into the new system. This will allow us to complete the system's build process without booting into it.</p>
|
||||||
<p>Chroot into the new system:</p>
|
<p>Chroot into the new system:</p>
|
||||||
@@ -351,7 +365,7 @@
|
|||||||
<p>If you require assistance, reach out to the community on Discord (HJzJUwSmDf) or IRC (#everestlinux on libera.chat)</p>
|
<p>If you require assistance, reach out to the community on Discord (HJzJUwSmDf) or IRC (#everestlinux on libera.chat)</p>
|
||||||
</div>
|
</div>
|
||||||
<footer>
|
<footer>
|
||||||
<p>Copyright (C) 2021-2024 Everest Linux</p>
|
<p>Copyright (C) 2021-2025 Everest Linux</p>
|
||||||
<p>Linux (R) is a registered trademark of Linus Torvalds.</p>
|
<p>Linux (R) is a registered trademark of Linus Torvalds.</p>
|
||||||
<p>Everest Linux is provided AS IS, WITHOUT WARRANTY.</p>
|
<p>Everest Linux is provided AS IS, WITHOUT WARRANTY.</p>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<footer>
|
<footer>
|
||||||
<p>Copyright (C) 2021-2024 Everest Linux</p>
|
<p>Copyright (C) 2021-2025 Everest Linux</p>
|
||||||
<p>Linux (R) is a registered trademark of Linus Torvalds.</p>
|
<p>Linux (R) is a registered trademark of Linus Torvalds.</p>
|
||||||
<p>Everest Linux is provided AS IS, WITHOUT WARRANTY.</p>
|
<p>Everest Linux is provided AS IS, WITHOUT WARRANTY.</p>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
<div class="main">
|
<div class="main">
|
||||||
</div>
|
</div>
|
||||||
<footer>
|
<footer>
|
||||||
<p>Copyright (C) 2021-2024 Everest Linux</p>
|
<p>Copyright (C) 2021-2025 Everest Linux</p>
|
||||||
<p>Linux (R) is a registered trademark of Linus Torvalds.</p>
|
<p>Linux (R) is a registered trademark of Linus Torvalds.</p>
|
||||||
<p>Everest Linux is provided AS IS, WITHOUT WARRANTY.</p>
|
<p>Everest Linux is provided AS IS, WITHOUT WARRANTY.</p>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
Reference in New Issue
Block a user