chamesle

chamesle.org: the site of Chamesle, a small Linux distribution
git clone https://github.com/tortr-rs/chamesle
Log | Files | Refs | README

commit 9193f8bb6cb78a4791ba45697b7d06ae60dbba6b
parent 0d00b60219a4e6535c97103859a120d8a34c1beb
Author: torter <koubbamohamedrayan@gmail.com>
Date:   Mon, 16 Nov 2026 23:11:45 +0000

site: the handbook is about hoard and ebuilds, no mag left outside the news

Diffstat:
Mdocs/docs.html | 12++++++------
Mdocs/download.html | 4++--
Mdocs/handbook-about.html | 18+++++++++---------
Mdocs/handbook-base.html | 18+++++++++---------
Mdocs/handbook-files.html | 25+++++++------------------
Adocs/handbook-hoard.html | 136+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mdocs/handbook-installing.html | 37+++++++++++++++----------------------
Mdocs/handbook-iso.html | 2+-
Mdocs/handbook-kernel.html | 9+++------
Ddocs/handbook-mag.html | 146-------------------------------------------------------------------------------
Mdocs/handbook-maintaining.html | 41+++++++++++++++++++----------------------
Mdocs/handbook-preparing.html | 61+++++++++++++++++++++++++------------------------------------
Mdocs/handbook-rifle.html | 6+++---
13 files changed, 235 insertions(+), 280 deletions(-)

diff --git a/docs/docs.html b/docs/docs.html @@ -4,12 +4,12 @@ <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Handbook - Chamesle</title> -<meta name="description" content="The Chamesle handbook, chapter by chapter: preparing, installing by hand, mag, rifle, the base system, the kernel, the live ISO and the files of the system."> +<meta name="description" content="The Chamesle handbook, chapter by chapter: preparing, installing by hand, hoard, rifle, the base system, the kernel, the live ISO and the files of the system."> <link rel="canonical" href="https://chamesle.org/docs.html"> <meta property="og:type" content="website"> <meta property="og:site_name" content="Chamesle"> <meta property="og:title" content="Handbook - Chamesle"> -<meta property="og:description" content="The Chamesle handbook, chapter by chapter: preparing, installing by hand, mag, rifle, the base system, the kernel, the live ISO and the files of the system."> +<meta property="og:description" content="The Chamesle handbook, chapter by chapter: preparing, installing by hand, hoard, rifle, the base system, the kernel, the live ISO and the files of the system."> <meta property="og:url" content="https://chamesle.org/docs.html"> <link rel="stylesheet" href="style.css?13"> </head> @@ -42,13 +42,13 @@ <ul><li><a href="handbook-about.html#s1-1">1.1 What it is</a></li><li><a href="handbook-about.html#s1-2">1.2 The layout of the system</a></li><li><a href="handbook-about.html#s1-3">1.3 Where the sources are</a></li></ul> </li> <li><a href="handbook-preparing.html">Preparing</a> -<ul><li><a href="handbook-preparing.html#s2-1">2.1 What the build host needs</a></li><li><a href="handbook-preparing.html#s2-2">2.2 Building mag and rifle</a></li><li><a href="handbook-preparing.html#s2-3">2.3 Getting the pkgsrc tree</a></li><li><a href="handbook-preparing.html#s2-4">2.4 MAG_REPO</a></li><li><a href="handbook-preparing.html#s2-5">2.5 mag.conf</a></li></ul> +<ul><li><a href="handbook-preparing.html#s2-1">2.1 What the build host needs</a></li><li><a href="handbook-preparing.html#s2-2">2.2 Building hoard and rifle</a></li><li><a href="handbook-preparing.html#s2-3">2.3 Getting the Gentoo tree</a></li><li><a href="handbook-preparing.html#s2-4">2.4 The profile</a></li><li><a href="handbook-preparing.html#s2-5">2.5 make.conf</a></li></ul> </li> <li><a href="handbook-installing.html">Installing by hand</a> <ul><li><a href="handbook-installing.html#s3-1">3.1 chamesle-disk</a></li><li><a href="handbook-installing.html#s3-2">3.2 Partitioning and file systems by hand</a></li><li><a href="handbook-installing.html#s3-3">3.3 Copying the live system</a></li><li><a href="handbook-installing.html#s3-4">3.4 Building the system from source, instead</a></li><li><a href="handbook-installing.html#s3-5">3.5 rifle</a></li><li><a href="handbook-installing.html#s3-6">3.6 fstab</a></li><li><a href="handbook-installing.html#s3-7">3.7 Host name, users, password</a></li><li><a href="handbook-installing.html#s3-8">3.8 The kernel and the boot entry</a></li><li><a href="handbook-installing.html#s3-9">3.9 First boot</a></li></ul> </li> -<li><a href="handbook-mag.html">Using mag</a> -<ul><li><a href="handbook-mag.html#s4-1">4.1 The commands</a></li><li><a href="handbook-mag.html#s4-2">4.2 Installing and removing</a></li><li><a href="handbook-mag.html#s4-3">4.3 Finding things</a></li><li><a href="handbook-mag.html#s4-4">4.4 Installing somewhere else</a></li><li><a href="handbook-mag.html#s4-5">4.5 Other variables</a></li><li><a href="handbook-mag.html#s4-6">4.6 pkgsrc options</a></li><li><a href="handbook-mag.html#s4-7">4.7 Writing a recipe</a></li></ul> +<li><a href="handbook-hoard.html">Using hoard</a> +<ul><li><a href="handbook-hoard.html#s4-1">4.1 The commands</a></li><li><a href="handbook-hoard.html#s4-2">4.2 Installing and removing</a></li><li><a href="handbook-hoard.html#s4-3">4.3 Where it keeps things</a></li><li><a href="handbook-hoard.html#s4-4">4.4 make.conf</a></li><li><a href="handbook-hoard.html#s4-5">4.5 Repositories</a></li><li><a href="handbook-hoard.html#s4-6">4.6 USE flags and keywords</a></li><li><a href="handbook-hoard.html#s4-7">4.7 Binary packages</a></li><li><a href="handbook-hoard.html#s4-8">4.8 Writing an ebuild</a></li></ul> </li> <li><a href="handbook-rifle.html">rifle</a> <ul><li><a href="handbook-rifle.html#s5-1">5.1 What it is</a></li><li><a href="handbook-rifle.html#s5-2">5.2 The tools</a></li><li><a href="handbook-rifle.html#s5-3">5.3 Building</a></li><li><a href="handbook-rifle.html#s5-4">5.4 Tests</a></li></ul> @@ -63,7 +63,7 @@ <ul><li><a href="handbook-iso.html#s8-1">8.1 What it is</a></li><li><a href="handbook-iso.html#s8-2">8.2 How it boots</a></li><li><a href="handbook-iso.html#s8-3">8.3 Trying it in qemu</a></li></ul> </li> <li><a href="handbook-maintaining.html">Maintaining</a> -<ul><li><a href="handbook-maintaining.html#s9-1">9.1 Updating packages</a></li><li><a href="handbook-maintaining.html#s9-2">9.2 Cleaning up</a></li><li><a href="handbook-maintaining.html#s9-3">9.3 C23 and CFLAGS</a></li><li><a href="handbook-maintaining.html#s9-4">9.4 The root&#x27;s compiler and mag relocate</a></li><li><a href="handbook-maintaining.html#s9-5">9.5 libtool</a></li><li><a href="handbook-maintaining.html#s9-6">9.6 Failures you will see</a></li><li><a href="handbook-maintaining.html#s9-7">9.7 Keeping a build</a></li></ul> +<ul><li><a href="handbook-maintaining.html#s9-1">9.1 Updating packages</a></li><li><a href="handbook-maintaining.html#s9-2">9.2 Cleaning up</a></li><li><a href="handbook-maintaining.html#s9-3">9.3 C23 and CFLAGS</a></li><li><a href="handbook-maintaining.html#s9-4">9.4 Installing into a root</a></li><li><a href="handbook-maintaining.html#s9-5">9.5 Build tools</a></li><li><a href="handbook-maintaining.html#s9-6">9.6 Failures you will see</a></li><li><a href="handbook-maintaining.html#s9-7">9.7 Keeping a build</a></li></ul> </li> <li><a href="handbook-files.html">File reference</a> <ul><li><a href="handbook-files.html#s10-1">10.1 On an installed system</a></li><li><a href="handbook-files.html#s10-2">10.2 In the sources</a></li><li><a href="handbook-files.html#s10-3">10.3 Commands in short</a></li></ul> diff --git a/docs/download.html b/docs/download.html @@ -57,13 +57,13 @@ <pre>dd if=chamesle.iso of=/dev/sdX bs=4M status=progress conv=fsync</pre> <h2>What is on it</h2> -<p>A live system with mksh, vim, mag and its recipes, <code>chamesle-chroot</code>, <code>chamesle-disk</code> +<p>A live system with mksh, vim, hoard and the Gentoo tree, <code>chamesle-chroot</code>, <code>chamesle-disk</code> (cfdisk, then vfat for boot and ZFS for the root), the disk tools (sfdisk, mkfs.ext4, mkfs.fat, zpool, zfs) and the handbook in <code>/usr/share/doc/chamesle/</code>. It boots with limine and logs in as root with no password.</p> <h2>What you need</h2> <p>An x86-64 machine with 2 GB of RAM and a disk to install on. The network comes up with DHCP on a wired card; wifi -firmware is added with mag after the install, as the handbook says.</p> +firmware is added with hoard after the install, as the handbook says.</p> <h2>Try it in QEMU first</h2> <pre>qemu-system-x86_64 -cpu max -m 2G -cdrom chamesle.iso -boot d diff --git a/docs/handbook-about.html b/docs/handbook-about.html @@ -45,13 +45,13 @@ <tr><td>kernel</td><td>a prebuilt Linux 6.18 LTS kernel with its modules</td></tr> <tr><td>musl</td><td>the C library</td></tr> <tr><td>rifle</td><td>the coreutils, all in one C file; <code>cat</code>, <code>ls</code>, <code>cp</code> and the rest are links to one program</td></tr> -<tr><td>mag</td><td>the package manager; it reads NetBSD pkgsrc packages as they are, and recipes of its own</td></tr> +<tr><td>hoard</td><td>the package manager, from SPAS; it builds from source and runs Gentoo's ebuilds</td></tr> <tr><td>mksh</td><td>the shell, login shell and <code>/bin/sh</code></td></tr> -<tr><td>init</td><td><code>/sbin/init</code>, a shell script that runs under mksh, in the style of FreeBSD's: <code>/etc/rc</code>, <code>/etc/init.conf</code>, services</td></tr> +<tr><td>init</td><td>Winchester, <code>/sbin/init</code>, a shell script that runs under mksh, in the style of FreeBSD's: <code>/etc/rc</code>, <code>/etc/init.conf</code>, services</td></tr> <tr><td>limine</td><td>the boot loader, BIOS and UEFI</td></tr> </table> -<p>There is nothing from GNU in the system. Two exceptions are on the machine that builds: the kernel's own build tools, and <code>gmake</code>, which musl's Makefile needs.</p> -<p>The package repository is NetBSD's pkgsrc, read directly by <code>mag</code> without <code>bmake</code>. Chamesle adds hand-written recipes only for what pkgsrc does not have: musl, the kernel, its headers and firmware, limine, eudev, kmod, util-linux, iw, libnl, iproute2, usbutils, netbsd-curses, libtool and ZFS. Everything is built on the machine that installs it, so the first install takes a while (LLVM is the longest).</p> +<p>Chamesle is made to be the most UNIX distribution possible. The coreutils are rifle's, the init is Winchester, and the rest is what Gentoo's ebuilds build: GNU software where a package needs it, bash for the ebuilds themselves.</p> +<p>The package repository is Gentoo's, on the musl profile, and <code>hoard</code> runs its ebuilds. Everything is built on the machine that installs it, so the first install takes a while (LLVM is the longest).</p> <h2 id="s1-2">1.2 The layout of the system</h2> <pre>/bin /sbin /lib /lib holds the musl loader and the firmware /usr/bin /usr/sbin programs, /usr/lib libraries, /usr/share data, /usr/include headers @@ -60,19 +60,19 @@ /etc configuration /lib/modules kernel modules, one directory per kernel version /lib/firmware firmware for the hardware, zstd compressed -/var/lib/mag which package owns which file -/var/cache/mag downloaded sources +/var/db/pkg which package owns which file +/var/cache/distfiles downloaded sources /run /tmp tmpfs, made new at every boot</pre> <p>The PATH of a login shell is <code>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</code>. Packages install into <code>/usr</code>.</p> <h2 id="s1-3">1.3 Where the sources are</h2> <table> <tr><th>directory</th><th>what is in it</th></tr> <tr><td><code>system/</code></td><td><code>tools/</code> (<code>chamesle-bootstrap</code>, <code>chamesle-chroot</code>, <code>chamesle-disk</code>), <code>files/</code> (init, rc and the services), <code>iso/</code>, this handbook</td></tr> -<tr><td><code>mag/</code></td><td><code>mag.c</code>, <code>build.sh</code>, <code>tests/run.sh</code>, <code>repo/</code> with the hand recipes and <code>PROVIDES</code></td></tr> +<tr><td><code>SimplePackagemAnagingSystem/</code></td><td>SPAS: the Rust source of <code>hoard</code>, and <code>src/ebuild.sh</code>, the environment ebuilds run in</td></tr> <tr><td><code>rifle/</code></td><td><code>rifle.c</code>, <code>build.sh</code>, <code>tests/run.sh</code></td></tr> -<tr><td>pkgsrc</td><td>NetBSD's package tree, which you fetch yourself (chapter 2)</td></tr> +<tr><td>Gentoo</td><td>the ebuild tree, which <code>hoard sync</code> fetches (chapter 2)</td></tr> </table> -<p>The commands in this book assume the three source trees are in <code>$HOME/src/system</code>, <code>$HOME/src/mag</code> and <code>$HOME/src/rifle</code>. Change the paths if yours are elsewhere.</p> +<p>The commands in this book assume the source trees are in <code>$HOME/src/system</code>, <code>$HOME/src/SimplePackagemAnagingSystem</code> and <code>$HOME/src/rifle</code>. Change the paths if yours are elsewhere.</p> <hr> <p><a href="docs.html">Contents</a> | <a href="handbook-preparing.html">Preparing &rarr;</a></p> </main> diff --git a/docs/handbook-base.html b/docs/handbook-base.html @@ -4,12 +4,12 @@ <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>The base system - Chamesle</title> -<meta name="description" content="/sbin/init is a mksh script, and it works the way FreeBSD&#x27;s init does: the kernel starts it as process 1, it runs"> +<meta name="description" content="The init is called Winchester. /sbin/init is a mksh script, and it works the way FreeBSD&#x27;s init does: the kernel starts it as process 1, it runs"> <link rel="canonical" href="https://chamesle.org/handbook-base.html"> <meta property="og:type" content="website"> <meta property="og:site_name" content="Chamesle"> <meta property="og:title" content="The base system - Chamesle"> -<meta property="og:description" content="/sbin/init is a mksh script, and it works the way FreeBSD&#x27;s init does: the kernel starts it as process 1, it runs"> +<meta property="og:description" content="The init is called Winchester. /sbin/init is a mksh script, and it works the way FreeBSD&#x27;s init does: the kernel starts it as process 1, it runs"> <meta property="og:url" content="https://chamesle.org/handbook-base.html"> <link rel="stylesheet" href="style.css?13"> </head> @@ -38,7 +38,7 @@ <p><a href="handbook-rifle.html">&larr; rifle</a> | <a href="docs.html">Contents</a> | <a href="handbook-kernel.html">The kernel and firmware &rarr;</a></p> <h2>6. The base system</h2> <h2 id="s6-1">6.1 init</h2> -<p><code>/sbin/init</code> is a mksh script, and it works the way FreeBSD's init does: the kernel starts it as process 1, it runs <code>/etc/rc</code>, then it keeps a getty on every tty and waits for a signal. The files are in <code>files/</code> in the sources and <code>chamesle-bootstrap</code> copies them into the root. Step by step:</p> +<p>The init is called Winchester. <code>/sbin/init</code> is a mksh script, and it works the way FreeBSD's init does: the kernel starts it as process 1, it runs <code>/etc/rc</code>, then it keeps a getty on every tty and waits for a signal. The files are in <code>files/</code> in the sources and <code>chamesle-bootstrap</code> copies them into the root. Step by step:</p> <ol> <li><code>PATH</code> is set to <code>/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin</code>. <code>proc</code>, <code>sysfs</code> and <code>devtmpfs</code> are mounted if they are not yet, and what init prints goes to <code>/dev/console</code>.</li> <li>If <code>single</code> is on the kernel command line, init runs <code>sulogin</code> first.</li> @@ -103,7 +103,7 @@ shutdown -p +10 back in ten minutes</pre> <tr><td><code>fstab</code></td><td><code>proc</code>, <code>sysfs</code>, <code>tmpfs</code> on <code>/tmp</code>, plus the lines you add</td></tr> <tr><td><code>profile</code></td><td><code>PATH</code>, <code>EDITOR=vim</code>, <code>PAGER=less</code>, <code>umask 022</code></td></tr> <tr><td><code>os-release</code></td><td><code>NAME=Chamesle</code>, <code>ID=chamesle</code></td></tr> -<tr><td><code>mag.conf</code></td><td><code>JOBS</code> and <code>CFLAGS</code> for mag</td></tr> +<tr><td><code>make.conf</code></td><td><code>MAKEOPTS</code> and <code>CFLAGS</code> for hoard</td></tr> <tr><td><code>skel/</code></td><td>empty directory for the files new homes start from</td></tr> </table> <p>The login shell is mksh and <code>/etc/profile</code> is read by login shells. For a prompt and aliases make <code>~/.mkshrc</code> and set <code>ENV=$HOME/.mkshrc</code> in <code>/etc/profile</code>.</p> @@ -120,21 +120,21 @@ chown 1000:1000 /home/alice</pre> <h2 id="s6-7">6.7 Networking</h2> <p><code>dhcpcd</code> is the DHCP client and is in the base set. For a wired interface:</p> <pre>dhcpcd eth0</pre> -<p><code>dhcpcd</code> without arguments takes every interface. It is the <code>network</code> service, in <code>boot-services</code> by default, so it is up at boot. <code>/sys/class/net/</code> lists the interfaces. For <code>ip</code>, install iproute2 from Chamesle's repo:</p> -<pre>mag install net-misc/iproute2</pre> +<p><code>dhcpcd</code> without arguments takes every interface. It is the <code>network</code> service, in <code>boot-services</code> by default, so it is up at boot. <code>/sys/class/net/</code> lists the interfaces. For <code>ip</code>, install iproute2:</p> +<pre>hoard install sys-apps/iproute2</pre> <p>A static address:</p> <pre>ip addr add 192.168.1.10/24 dev eth0 ip link set eth0 up ip route add default via 192.168.1.1 echo &#x27;nameserver 192.168.1.1&#x27; &gt; /etc/resolv.conf</pre> <h2 id="s6-8">6.8 Wireless</h2> -<p><code>iw</code> talks to the kernel's nl80211. It is in Chamesle's repo, with libnl:</p> -<pre>mag install net-wireless/iw +<p><code>iw</code> talks to the kernel's nl80211. It is in Gentoo's tree, with libnl:</p> +<pre>hoard install net-wireless/iw iw dev the wireless interfaces ip link set wlan0 up iw dev wlan0 scan | grep SSID</pre> <p><code>sys-firmware/wireless-regdb</code> (in the base set) has the regulatory database, and the card's firmware is in <code>/lib/firmware</code> from <code>sys-kernel/linux-firmware</code>. If <code>dmesg</code> says a firmware file failed to load, check that it is there.</p> -<p>For an open network <code>iw dev wlan0 connect NAME</code> is enough. For WPA the connection needs <code>wpa_supplicant</code>; if your pkgsrc tree has it (<code>mag search wpa</code>), install it, give it a configuration file with the <code>ssid</code> and the <code>psk</code>, and run it on the interface. Then <code>dhcpcd wlan0</code>.</p> +<p>For an open network <code>iw dev wlan0 connect NAME</code> is enough. For WPA the connection needs <code>wpa_supplicant</code>; it is <code>net-wireless/wpa_supplicant</code> (<code>hoard search wpa</code>). Install it, give it a configuration file with the <code>ssid</code> and the <code>psk</code>, and run it on the interface. Then <code>dhcpcd wlan0</code>.</p> <h2 id="s6-9">6.9 Mounting and disks</h2> <pre>mount /dev/sdb1 /mnt/usb mount -t vfat -o ro /dev/sdb1 /mnt/usb diff --git a/docs/handbook-files.html b/docs/handbook-files.html @@ -48,19 +48,18 @@ <tr><td><code>/etc/passwd</code>, <code>/etc/group</code>, <code>/etc/shells</code></td><td>accounts, groups, login shells</td></tr> <tr><td><code>/etc/fstab</code></td><td>file systems</td></tr> <tr><td><code>/etc/os-release</code></td><td><code>NAME=Chamesle</code>, <code>ID=chamesle</code></td></tr> -<tr><td><code>/etc/mag.conf</code></td><td>mag's build settings: <code>JOBS</code>, <code>CFLAGS</code>, <code>PKG_DEFAULT_OPTIONS</code>, <code>PKG_OPTIONS.name</code></td></tr> +<tr><td><code>/etc/spas/</code></td><td>hoard's configuration: <code>make.conf</code>, <code>make.profile</code>, <code>repos.conf/</code>, <code>package.use</code> and the rest (section 4.3)</td></tr> <tr><td><code>/boot/limine.conf</code></td><td>the boot entries</td></tr> <tr><td><code>/boot/limine-bios.sys</code></td><td>limine's BIOS stage</td></tr> <tr><td><code>/boot/EFI/BOOT/BOOTX64.EFI</code></td><td>limine for UEFI</td></tr> <tr><td><code>/boot/vmlinuz-V</code>, <code>config-V</code>, <code>System.map-V</code></td><td>the kernel</td></tr> <tr><td><code>/lib/modules/V/</code></td><td>its modules</td></tr> <tr><td><code>/lib/firmware/</code></td><td>firmware</td></tr> -<tr><td><code>/var/lib/mag/</code></td><td>the file list of each installed package</td></tr> -<tr><td><code>/var/cache/mag/</code></td><td>downloaded sources</td></tr> +<tr><td><code>/var/db/pkg/</code></td><td>the file list of each installed package</td></tr> +<tr><td><code>/var/cache/distfiles/</code></td><td>downloaded sources</td></tr> <tr><td><code>/usr/share/limine/</code></td><td>limine's boot files, for installing it</td></tr> <tr><td><code>/usr/share/doc/chamesle/handbook.md</code></td><td>this book, on the live ISO</td></tr> -<tr><td><code>/usr/share/mag/repo/</code></td><td>Chamesle's recipes</td></tr> -<tr><td><code>/usr/pkgsrc/</code></td><td>the pkgsrc tree, from <code>mag sync</code></td></tr> +<tr><td><code>/var/db/repos/gentoo/</code></td><td>the Gentoo tree, from <code>hoard sync</code></td></tr> </table> <h2 id="s10-2">10.2 In the sources</h2> <table> @@ -76,24 +75,14 @@ <tr><td><code>system/iso/profile/limine.conf</code></td><td>the live boot menu</td></tr> <tr><td><code>system/iso/profile/overlay/</code></td><td>files copied over the live root</td></tr> <tr><td><code>system/handbook/handbook.md</code></td><td>this book</td></tr> -<tr><td><code>mag/mag.c</code>, <code>mag/build.sh</code>, <code>mag/c.h</code></td><td>the package manager and its libc</td></tr> -<tr><td><code>mag/tests/run.sh</code></td><td>tests on a fake repo: install, upgrade, remove in a scratch root</td></tr> -<tr><td><code>mag/repo/PROVIDES</code></td><td>pkgsrc packages replaced or skipped, and dependencies added</td></tr> -<tr><td><code>mag/repo/sys-libs/musl</code></td><td>the libc</td></tr> -<tr><td><code>mag/repo/sys-kernel/{linux,linux-headers,linux-firmware,zfs-module}</code></td><td>kernel, headers, firmware, the ZFS module</td></tr> -<tr><td><code>mag/repo/sys-fs/zfs</code></td><td>ZFS userland: <code>zpool</code>, <code>zfs</code></td></tr> -<tr><td><code>mag/repo/sys-boot/limine</code></td><td>the boot loader</td></tr> -<tr><td><code>mag/repo/sys-apps/{eudev,kmod,util-linux,usbutils}</code></td><td>udev, module tools, the basics, usb tools</td></tr> -<tr><td><code>mag/repo/net-libs/libnl</code>, <code>net-wireless/iw</code>, <code>net-misc/iproute2</code></td><td>network tools</td></tr> -<tr><td><code>mag/repo/sys-firmware/{sof-firmware,wireless-regdb}</code></td><td>firmware extras</td></tr> -<tr><td><code>mag/repo/dev-libs/netbsd-curses</code>, <code>dev-build/libtool</code></td><td>curses and libtool</td></tr> +<tr><td><code>SimplePackagemAnagingSystem/src/</code></td><td>hoard, in Rust, and <code>ebuild.sh</code>, the environment ebuilds run in</td></tr> <tr><td><code>rifle/rifle.c</code>, <code>rifle/c.h</code>, <code>rifle/build.sh</code></td><td>the coreutils</td></tr> <tr><td><code>rifle/tests/run.sh</code>, <code>rifle/tests/cases</code></td><td>the comparison tests</td></tr> </table> <h2 id="s10-3">10.3 Commands in short</h2> -<pre>chamesle-bootstrap [-r REPOS] [-s PACKAGES] [-n HOSTNAME] TARGET +<pre>chamesle-bootstrap [-s PACKAGES] [-n HOSTNAME] TARGET mkinitramfs [-m modules] ROOTFS KVER OUT -mag [-nfk] install|remove|upgrade|autoremove|list|info|search|files|owns|deps|rdeps|fetch|build|sync|relocate|hash +hoard [--root DIR] install|upgrade|remove|autoremove|sync|search|info|list|files|owns|env-update|manifest|self-update rifle --install DIR | --list limine bios-install DEVICE</pre> <hr> diff --git a/docs/handbook-hoard.html b/docs/handbook-hoard.html @@ -0,0 +1,136 @@ +<!doctype html> +<html lang="en"> +<head> +<meta charset="utf-8"> +<meta name="viewport" content="width=device-width, initial-scale=1"> +<title>Using hoard - Chamesle</title> +<meta name="description" content="hoard is the package manager of SPAS. It is a replacement for Portage written in Rust, and it runs Gentoo&#x27;s ebuilds. Chamesle"> +<link rel="canonical" href="https://chamesle.org/handbook-hoard.html"> +<meta property="og:type" content="website"> +<meta property="og:site_name" content="Chamesle"> +<meta property="og:title" content="Using hoard - Chamesle"> +<meta property="og:description" content="hoard is the package manager of SPAS. It is a replacement for Portage written in Rust, and it runs Gentoo&#x27;s ebuilds. Chamesle"> +<meta property="og:url" content="https://chamesle.org/handbook-hoard.html"> +<link rel="stylesheet" href="style.css?13"> +</head> +<body> + +<div id="page"> + +<div id="top"> +<h1><a href="./">Chamesle</a></h1> +</div> + +<div id="nav"> +<a href="./">Home</a> | +<a href="download.html">Download</a> | +<b>Handbook</b> | +<a href="packages.html">Packages</a> | +<a href="new.html">News</a> | +<a href="board.html">Board</a> | +<a href="chat.html">Chat</a> | +<a href="source.html">Source</a> | +<a href="https://x22.chamesle.org/">X22</a> | +<a href="about.html">About</a> +</div> + +<main> +<p><a href="handbook-installing.html">&larr; Installing by hand</a> | <a href="docs.html">Contents</a> | <a href="handbook-rifle.html">rifle &rarr;</a></p> +<h2>4. Using hoard</h2> +<p>hoard is the package manager of SPAS. It is a replacement for Portage written in Rust, and it runs Gentoo's ebuilds. Chamesle uses Gentoo's repository on the musl profile, so a package is an ebuild in <code>/var/db/repos/gentoo</code>, and everything is built on the machine that installs it, unless a binary package matches.</p> +<h2 id="s4-1">4.1 The commands</h2> +<pre>hoard install PKG... install, dependencies first (-p pretend, -1 do not add to world, -u -D -N, -jN parallel builds) +hoard upgrade update everything (install -uDN @world) +hoard remove PKG... uninstall +hoard autoremove uninstall what @world and @system no longer need +hoard sync sync the repositories +hoard search REGEX names (-d: descriptions too) +hoard info PKG versions, masks, keywords, USE +hoard list what is installed +hoard files PKG the files a package put on the system +hoard owns PATH which package a file came from +hoard env-update regenerate /etc/profile.env and ld.so.conf +hoard manifest PKG|DIR write the DIST lines of an overlay package&#x27;s Manifest +hoard self-update replace a hand-installed hoard with the newest release</pre> +<p>A package name works without its category (<code>hoard install tree</code>); hoard asks if two categories have it. <code>hoard --root DIR</code> does any of this in another root, which is how a new system is built (chapter 3).</p> +<h2 id="s4-2">4.2 Installing and removing</h2> +<pre>hoard install app-editors/vim +hoard install -p app-misc/fastfetch what would be built, nothing is done +hoard remove vim</pre> +<p><code>install</code> takes the dependencies first, downloads the sources, checks their size, BLAKE2B and SHA512 against the Manifest, builds in a private directory as the <code>portage</code> user without network, and merges the result. Before it touches anything it checks every file against what other packages own, a file under <code>/etc</code> that you changed stays and the new one is written next to it as <code>._cfg0000_name</code>, and each file is replaced atomically, so a running program is never half written.</p> +<p>If a build fails, hoard keeps the build directory. <code>hoard install --resume</code> goes on from the phase that stopped, <code>--skipfirst</code> leaves the failed package out and <code>--keep-going</code> builds everything that does not depend on it.</p> +<h2 id="s4-3">4.3 Where it keeps things</h2> +<table> +<tr><th>what</th><th>where</th></tr> +<tr><td>configuration</td><td><code>/etc/spas</code>: <code>make.conf</code>, <code>make.profile</code>, <code>repos.conf/</code>, <code>package.use</code>, <code>package.accept_keywords</code>, <code>package.mask</code>, <code>package.license</code>, <code>package.env</code> and <code>env/</code></td></tr> +<tr><td>the repositories</td><td><code>/var/db/repos/gentoo</code>, and any overlay you add</td></tr> +<tr><td>installed packages</td><td><code>/var/db/pkg</code>, one directory per package, with its <code>CONTENTS</code></td></tr> +<tr><td>the world file</td><td><code>/var/lib/portage/world</code></td></tr> +<tr><td>downloaded sources</td><td><code>/var/cache/distfiles</code></td></tr> +<tr><td>binary packages</td><td><code>PKGDIR</code>, from <code>/etc/spas/make.conf</code></td></tr> +</table> +<p>If there is no <code>/etc/spas</code>, hoard reads <code>/etc/portage</code> instead, so a machine that has Portage's files is understood as it is.</p> +<h2 id="s4-4">4.4 make.conf</h2> +<p><code>/etc/spas/make.conf</code> holds the build settings, in the shell syntax of Portage's:</p> +<pre>COMMON_FLAGS=&quot;-O2 -pipe -std=gnu17&quot; +CFLAGS=&quot;${COMMON_FLAGS}&quot; +CXXFLAGS=&quot;${COMMON_FLAGS}&quot; +CHOST=&quot;x86_64-pc-linux-musl&quot; +MAKEOPTS=&quot;-j8&quot; +ACCEPT_KEYWORDS=&quot;amd64&quot; +USE=&quot;-systemd&quot;</pre> +<ul> +<li><code>MAKEOPTS</code> is the number of jobs for <code>make</code>, and <code>-jN</code> on the hoard command line is how many packages build at once</li> +<li><code>USE</code> turns features on and off for every package; one package gets its own line in <code>package.use</code></li> +<li><code>ACCEPT_KEYWORDS</code> says how new the packages may be: <code>amd64</code> is stable, <code>~amd64</code> is testing</li> +<li><code>/etc/spas/make.profile</code> is a link to a profile of the tree. Chamesle uses the musl one: <code>ln -sfn /var/db/repos/gentoo/profiles/default/linux/amd64/23.0/musl /etc/spas/make.profile</code></li> +</ul> +<p><code>-std=gnu17</code> matters. clang defaults to C23 now, and a lot of older source does not compile under it (section 9.3).</p> +<h2 id="s4-5">4.5 Repositories</h2> +<p><code>/etc/spas/repos.conf/gentoo.conf</code> names the tree and where it comes from:</p> +<pre>[gentoo] +location = /var/db/repos/gentoo +sync-type = git +sync-uri = https://github.com/gentoo-mirror/gentoo.git</pre> +<p><code>hoard sync</code> brings every repository up to date. A git repository whose newest commit is not validly signed is rolled back, and a tree from rsync is checked against its signed Manifests.</p> +<h2 id="s4-6">4.6 USE flags and keywords</h2> +<p>When nothing satisfies a dependency, hoard works out the smallest change that would (a <code>package.use</code> line, a <code>~amd64</code> keyword or a license), shows it, and writes it to <code>zz-hoard-autounmask</code> in the config directory after you say yes.</p> +<pre>hoard info net-misc/curl the versions, the USE flags and what they are now +echo &quot;net-misc/curl http2 -idn&quot; &gt;&gt; /etc/spas/package.use</pre> +<h2 id="s4-7">4.7 Binary packages</h2> +<p><code>hoard install -g</code> uses prebuilt packages from Gentoo's binary host when the version, slot and every USE flag match, and otherwise builds the ebuild. They are checked against the index and the release key before they are unpacked. <code>-b</code> (or <code>FEATURES=buildpkg</code>) saves everything you build as a <code>.gpkg.tar</code> in <code>PKGDIR</code>, and hoard installs from those the next time the version and USE match.</p> +<h2 id="s4-8">4.8 Writing an ebuild</h2> +<p>If the tree does not have what you want, write an ebuild in an overlay. An overlay is a repository with <code>profiles/repo_name</code>, <code>metadata/layout.conf</code> and <code>category/name/name-VERSION.ebuild</code>:</p> +<pre>EAPI=8 +DESCRIPTION=&quot;nl80211 wireless configuration tool&quot; +HOMEPAGE=&quot;https://wireless.docs.kernel.org/en/latest/en/users/documentation/iw.html&quot; +SRC_URI=&quot;https://cdn.kernel.org/pub/software/network/iw/${P}.tar.xz&quot; +LICENSE=&quot;ISC&quot; +SLOT=&quot;0&quot; +KEYWORDS=&quot;amd64&quot; +DEPEND=&quot;dev-libs/libnl&quot; +RDEPEND=&quot;${DEPEND}&quot; +BDEPEND=&quot;virtual/pkgconfig&quot; + +src_install() { + emake PREFIX=&quot;${EPREFIX}/usr&quot; DESTDIR=&quot;${D}&quot; install +}</pre> +<p><code>hoard manifest net-wireless/iw</code> writes the checksums of the sources into the package's <code>Manifest</code>. Add the overlay to <code>/etc/spas/repos.conf/</code>, run <code>hoard sync</code>, and <code>hoard install net-wireless/iw</code> builds it.</p> +<hr> +<p><a href="handbook-installing.html">&larr; Installing by hand</a> | <a href="docs.html">Contents</a> | <a href="handbook-rifle.html">rifle &rarr;</a></p> +</main> + +<hr> +<div id="foot"> +Something wrong on this page? Tell us on the <a href="board.html">board</a>.<br> +Chamesle is installed by hand, from the <a href="docs.html">handbook</a>.<br> +<a href="https://ko-fi.com/L6N725GI1V">Ko-fi</a><br> +<a href="#" id="edit-link">Edit text</a><br> +$Date: 2026-11-16 $ +</div> + +</div> + +<script src="edit.js"></script> +</body> +</html> diff --git a/docs/handbook-installing.html b/docs/handbook-installing.html @@ -35,7 +35,7 @@ </div> <main> -<p><a href="handbook-preparing.html">&larr; Preparing</a> | <a href="docs.html">Contents</a> | <a href="handbook-mag.html">Using mag &rarr;</a></p> +<p><a href="handbook-preparing.html">&larr; Preparing</a> | <a href="docs.html">Contents</a> | <a href="handbook-hoard.html">Using hoard &rarr;</a></p> <h2>3. Installing by hand</h2> <p>Follow the BIOS or the UEFI variant where they differ. The disk here is <code>/dev/sda</code>; change it to yours. Everything below is run as root on the machine you install from, usually the live ISO, and it erases the disk.</p> <p>There are two ways through 3.1 and 3.2: <code>chamesle-disk</code> does the partitioning and the file systems and leaves the root on ZFS, or you do both yourself. From 3.3 on the steps are the same, and they are yours: <code>chamesle-disk</code> is only a helper.</p> @@ -77,41 +77,34 @@ mount /dev/sda2 /mnt/boot</pre> <pre>tar -C /run/live/rootfs --exclude ./etc/fstab -cf - . | tar -C /mnt -xpf - [ -e /mnt/etc/fstab ] || cp /run/live/rootfs/etc/fstab /mnt/etc/fstab cp /run/live/medium/boot/initrd /mnt/boot/initrd</pre> -<p>That is the whole base system, kernel, modules and ZFS included, as it was when the ISO was made. The copy keeps the fstab chamesle-disk wrote. The firmware for wifi and some network cards is not on the ISO. Add it with mag once the new system runs (section 4), or build everything instead (3.4), which needs a machine with a compiler.</p> +<p>That is the whole base system, kernel, modules and ZFS included, as it was when the ISO was made. The copy keeps the fstab chamesle-disk wrote. The firmware for wifi and some network cards is not on the ISO. Add it with hoard once the new system runs (section 4), or build everything instead (3.4), which needs a machine with a compiler.</p> <p>Work inside the new root with <code>chamesle-chroot</code>:</p> <pre>chamesle-chroot /mnt chamesle-chroot /mnt passwd root</pre> <p>It mounts <code>proc</code>, <code>sys</code>, <code>dev</code>, <code>dev/pts</code> and a tmpfs on <code>run</code> under the directory, copies <code>/etc/resolv.conf</code> into it, runs <code>chroot</code> with an empty environment (<code>HOME=/root</code>, <code>TERM</code>, <code>PATH</code>) and takes the mounts away again when the command ends. Without a command it starts <code>/usr/bin/mksh -l</code>.</p> <p>Then go on with 3.6 (fstab) and the rest. rifle (3.5) is on the ISO already, skip it. The kernel is in <code>/mnt/boot</code> already.</p> <h2 id="s3-4">3.4 Building the system from source, instead</h2> -<p>Point mag at the repositories (section 2.4) and run chamesle-bootstrap:</p> -<pre>export MAG_REPO=$HOME/src/mag/repo:/usr/pkgsrc -$HOME/src/system/tools/chamesle-bootstrap -n yourhostname /mnt</pre> +<p>Have hoard and the tree ready (sections 2.2 to 2.4) and run chamesle-bootstrap:</p> +<pre>$HOME/src/system/tools/chamesle-bootstrap -n yourhostname /mnt</pre> <p>Its usage:</p> -<pre>chamesle-bootstrap [-r REPOS] [-s PACKAGES] [-n HOSTNAME] TARGET</pre> +<pre>chamesle-bootstrap [-s PACKAGES] [-n HOSTNAME] TARGET</pre> <ul> -<li><code>-r</code> sets the repositories, instead of <code>MAG_REPO</code></li> <li><code>-s</code> is the list of packages to install instead of the base set</li> <li><code>-n</code> is the host name, <code>chamesle</code> if not given</li> </ul> -<p>It makes the directories (<code>bin boot dev etc/skel home lib lib/firmware mnt proc root run sbin srv sys tmp usr/bin usr/lib usr/sbin usr/share usr/local/bin var/cache var/lib var/log var/tmp</code>, with <code>tmp</code> and <code>var/tmp</code> mode 1777 and <code>root</code> mode 700), installs everything in <code>files/</code> (init, rc, the services, <code>init.conf</code>), writes the first <code>/etc</code> files (<code>passwd</code>, <code>group</code>, <code>shells</code>, <code>fstab</code>, <code>profile</code>, <code>os-release</code>, <code>mag.conf</code>), and builds the base set into the target with <code>mag</code>:</p> -<pre>sys-libs/musl devel/gmake archivers/libarchive app-arch/bsdtar archivers/pigz shells/mksh sys-apps/util-linux -sys-apps/kmod sys-apps/eudev net/dhcpcd net/tnftp sysutils/e2fsprogs sysutils/dosfstools sys-boot/limine -sys-kernel/linux sys-kernel/linux-firmware sys-firmware/sof-firmware sys-firmware/wireless-regdb editors/vim -sys-fs/zfs sys-kernel/zfs-module lang/clang devel/lld lang/compiler-rt lang/libunwind</pre> -<p><code>lang/clang</code> (with <code>lang/llvm</code> under it), <code>devel/lld</code>, <code>lang/compiler-rt</code> and <code>lang/libunwind</code> are the compiler of the new system: it builds what <code>mag install</code> asks for after <code>mag sync</code>, so no other machine is needed. They are the longest part of the bootstrap. It also copies the recipes of the first repo that has a <code>PROVIDES</code> file into <code>/usr/share/mag/repo</code>, installs <code>chamesle-chroot</code> and <code>chamesle-disk</code>, and runs <code>depmod</code>.</p> -<p>The sources go in <code>/mnt/var/cache/mag</code> and are not fetched twice. An existing file in <code>/etc</code> is never overwritten, so the script can be run again after a failure. A build that fails stops and names the directory it left behind.</p> -<p>Once musl is in the new root, every later package is built with clang aimed at it, with the loader and library paths pointing into <code>/mnt</code>. That lets the programs run on the host while they are built. They need their real paths before you boot the new system:</p> -<pre>MAG_ROOT=/mnt mag relocate</pre> -<p>Run <code>mag relocate</code> again after every <code>MAG_ROOT=/mnt mag install</code> that adds programs (section 9.4).</p> +<p>It makes the directories (<code>bin boot dev etc/skel home lib lib/firmware mnt proc root run sbin srv sys tmp usr/bin usr/lib usr/sbin usr/share usr/local/bin var/cache var/lib var/log var/tmp</code>, with <code>tmp</code> and <code>var/tmp</code> mode 1777 and <code>root</code> mode 700), installs everything in <code>files/</code> (init, rc, the services, <code>init.conf</code>), writes the first <code>/etc</code> files (<code>passwd</code>, <code>group</code>, <code>shells</code>, <code>fstab</code>, <code>profile</code>, <code>os-release</code>, and <code>spas/make.conf</code> with the musl profile), copies the tree into the new root, and builds the base set into the target with <code>hoard --root</code>:</p> +<pre>sys-libs/musl app-shells/bash app-shells/mksh sys-apps/util-linux sys-apps/kmod sys-fs/eudev net-misc/dhcpcd +sys-fs/e2fsprogs sys-fs/dosfstools sys-boot/limine sys-kernel/gentoo-sources sys-kernel/linux-firmware +sys-fs/zfs sys-fs/zfs-kmod app-editors/vim llvm-core/clang llvm-core/lld llvm-runtimes/compiler-rt llvm-runtimes/libunwind</pre> +<p><code>llvm-core/clang</code> (with LLVM under it), <code>lld</code>, <code>compiler-rt</code> and <code>libunwind</code> are the compiler of the new system: it builds what <code>hoard install</code> asks for after <code>hoard sync</code>, so no other machine is needed. They are the longest part of the bootstrap. It also installs <code>chamesle-chroot</code> and <code>chamesle-disk</code>, and runs <code>depmod</code>.</p> +<p>The sources go in <code>/mnt/var/cache/distfiles</code> and are not fetched twice. An existing file in <code>/etc</code> is never overwritten, so the script can be run again after a failure. A build that fails stops and names the directory it left behind, and <code>hoard --root /mnt install --resume</code> goes on from where it stopped.</p> <h2 id="s3-5">3.5 rifle</h2> <p>The base set has no coreutils: they come from rifle. Install it into the new root:</p> <pre>install -m755 $HOME/src/rifle/rifle /mnt/usr/bin/rifle $HOME/src/rifle/rifle --install /mnt/usr/bin</pre> <p><code>rifle --install DIR</code> makes a link for each of its tools in <code>DIR</code>. rifle is built static, so it runs from the host as it is.</p> <p>Add the packages you want now, or after the first boot:</p> -<pre>MAG_ROOT=/mnt mag install editors/vim -MAG_ROOT=/mnt mag relocate</pre> +<pre>hoard --root /mnt install app-editors/vim</pre> <h2 id="s3-6">3.6 fstab</h2> <p>If you used chamesle-disk the file is written. Look at it: the boot partition by UUID on <code>/boot</code>, then <code>proc</code>, <code>sysfs</code> and <code>tmpfs</code>, and nothing for the ZFS datasets, because ZFS mounts them itself.</p> <p>By hand, <code>blkid</code> prints the UUIDs:</p> @@ -161,11 +154,11 @@ reboot</pre> <p>Then:</p> <ol> <li>Bring the network up (section 6.7).</li> -<li><code>mag sync</code> fetches the pkgsrc tree (section 2.3). Mag's own recipes are in <code>/usr/share/mag/repo</code> already and the default <code>MAG_REPO</code> covers both, so <code>mag install name</code> works from then on, and the compiler is in the base set.</li> -<li><code>mag list</code> shows what the bootstrap put on the machine.</li> +<li><code>hoard sync</code> brings the Gentoo tree up to date (section 2.3), so <code>hoard install name</code> works from then on, and the compiler is in the base set.</li> +<li><code>hoard list</code> shows what the bootstrap put on the machine.</li> </ol> <hr> -<p><a href="handbook-preparing.html">&larr; Preparing</a> | <a href="docs.html">Contents</a> | <a href="handbook-mag.html">Using mag &rarr;</a></p> +<p><a href="handbook-preparing.html">&larr; Preparing</a> | <a href="docs.html">Contents</a> | <a href="handbook-hoard.html">Using hoard &rarr;</a></p> </main> <hr> diff --git a/docs/handbook-iso.html b/docs/handbook-iso.html @@ -38,7 +38,7 @@ <p><a href="handbook-kernel.html">&larr; The kernel and firmware</a> | <a href="docs.html">Contents</a> | <a href="handbook-maintaining.html">Maintaining &rarr;</a></p> <h2>8. The live ISO</h2> <h2 id="s8-1">8.1 What it is</h2> -<p>The ISO is a live system to work from. It boots on BIOS and UEFI machines with limine, from a disc or a stick, and has mksh, vim, mag with Chamesle's recipes (<code>mag search</code> and <code>mag info</code> work before <code>mag sync</code>), <code>chamesle-bootstrap</code>, <code>chamesle-chroot</code>, <code>chamesle-disk</code>, the disk tools (<code>cfdisk</code>, <code>sfdisk</code>, <code>mkfs.ext4</code>, <code>mkfs.fat</code>, <code>zpool</code>, <code>zfs</code>) and this handbook in <code>/usr/share/doc/chamesle/handbook.md</code>. It is where you do chapter 3 on a machine that has nothing on it.</p> +<p>The ISO is a live system to work from. It boots on BIOS and UEFI machines with limine, from a disc or a stick, and has mksh, vim, hoard with the Gentoo tree (<code>hoard search</code> and <code>hoard info</code> work before <code>hoard sync</code>), <code>chamesle-bootstrap</code>, <code>chamesle-chroot</code>, <code>chamesle-disk</code>, the disk tools (<code>cfdisk</code>, <code>sfdisk</code>, <code>mkfs.ext4</code>, <code>mkfs.fat</code>, <code>zpool</code>, <code>zfs</code>) and this handbook in <code>/usr/share/doc/chamesle/handbook.md</code>. It is where you do chapter 3 on a machine that has nothing on it.</p> <h2 id="s8-2">8.2 How it boots</h2> <p><code>iso/init</code> looks through <code>/dev/sr*</code>, <code>/dev/sd*</code>, <code>/dev/nvme*n*p*</code>, <code>/dev/vd*</code> and <code>/dev/mmcblk*</code> until it finds one that mounts and has <code>LiveOS/rootfs.sfs</code>. It mounts that squashfs read-only, puts a tmpfs overlay over it, moves the medium and the squashfs to <code>/run/live/medium</code> and <code>/run/live/rootfs</code>, and runs <code>switch_root</code> into the result. Whatever you change in the live system is gone at shutdown.</p> <h2 id="s8-3">8.3 Trying it in qemu</h2> diff --git a/docs/handbook-kernel.html b/docs/handbook-kernel.html @@ -48,11 +48,8 @@ <p>The mirror drops a package when a newer one comes out, so a new kernel is a new <code>version</code> and <code>sha256</code> in the recipe. Edit <code>repo/sys-kernel/linux</code>:</p> <pre>version: 6.18.64 sha256: the new one</pre> -<p>Download the file the <code>url</code> names with the new version filled in, and take the checksum:</p> -<pre>ftp -o FILE URL -mag hash FILE</pre> -<p>Then:</p> -<pre>mag install sys-kernel/linux</pre> +<p>The kernel comes from <code>sys-kernel/gentoo-sources</code>, or from <code>sys-kernel/vanilla-sources</code> for the plain one. Install it, which puts the source in <code>/usr/src</code>:</p> +<pre>hoard install sys-kernel/gentoo-sources</pre> <p>and add an entry in <code>/boot/limine.conf</code> for the new <code>vmlinuz-VERSION</code>. Keep the old one until the new one has booted:</p> <pre>/Chamesle protocol: linux @@ -67,7 +64,7 @@ mag hash FILE</pre> <h2 id="s7-3">7.3 Modules</h2> <p>Modules are <code>.ko</code> files in <code>/lib/modules/VERSION</code>. <code>lsmod</code> shows what is loaded, <code>modprobe name</code> loads a module with what it needs, <code>modinfo name</code> describes it. udev loads the ones the hardware asks for. Modules belong to one kernel build: after installing a new kernel, reboot before loading any.</p> <h2 id="s7-4">7.4 Firmware</h2> -<pre>mag install sys-kernel/linux-firmware</pre> +<pre>hoard install sys-kernel/linux-firmware</pre> <p>puts the firmware for wifi, graphics, ethernet and the rest, compressed with zstd, into <code>/lib/firmware</code>. <code>sys-firmware/sof-firmware</code> has the sound firmware of newer Intel machines. Both are in the base set. A new firmware release is a new <code>version</code> and <code>sha256</code> in <code>repo/sys-kernel/linux-firmware</code>, the same way as the kernel's.</p> <h2 id="s7-5">7.5 An initramfs</h2> <p>A root on ext4 on a common disk (SATA, NVMe, virtio, USB storage) needs none. A root on ZFS needs one: the pool has to be imported before the root can be mounted. A root that needs a module to be reached, or RAID, LVM or an encrypted disk, does.</p> diff --git a/docs/handbook-mag.html b/docs/handbook-mag.html @@ -1,146 +0,0 @@ -<!doctype html> -<html lang="en"> -<head> -<meta charset="utf-8"> -<meta name="viewport" content="width=device-width, initial-scale=1"> -<title>Using mag - Chamesle</title> -<meta name="description" content="add is install and del is remove. mag relocate is the one command not in the usage text: it puts the real"> -<link rel="canonical" href="https://chamesle.org/handbook-mag.html"> -<meta property="og:type" content="website"> -<meta property="og:site_name" content="Chamesle"> -<meta property="og:title" content="Using mag - Chamesle"> -<meta property="og:description" content="add is install and del is remove. mag relocate is the one command not in the usage text: it puts the real"> -<meta property="og:url" content="https://chamesle.org/handbook-mag.html"> -<link rel="stylesheet" href="style.css?13"> -</head> -<body> - -<div id="page"> - -<div id="top"> -<h1><a href="./">Chamesle</a></h1> -</div> - -<div id="nav"> -<a href="./">Home</a> | -<a href="download.html">Download</a> | -<b>Handbook</b> | -<a href="packages.html">Packages</a> | -<a href="new.html">News</a> | -<a href="board.html">Board</a> | -<a href="chat.html">Chat</a> | -<a href="source.html">Source</a> | -<a href="https://x22.chamesle.org/">X22</a> | -<a href="about.html">About</a> -</div> - -<main> -<p><a href="handbook-installing.html">&larr; Installing by hand</a> | <a href="docs.html">Contents</a> | <a href="handbook-rifle.html">rifle &rarr;</a></p> -<h2>4. Using mag</h2> -<h2 id="s4-1">4.1 The commands</h2> -<pre>Usage: mag [-nfk] COMMAND [PACKAGE]... - -install PKG... fetch, build and install, dependencies first -remove PKG... take a package off -upgrade reinstall what the repos have a newer version of -autoremove remove what was only installed as a dependency and is not needed now -list what is installed -info PKG what a recipe says, and whether it is installed -search WORD recipes whose name or desc has WORD -files PKG the files a package put on the system -owns PATH which package a file came from -deps PKG its dependencies, rdeps PKG for what needs it -fetch PKG... only download and check the sources -build PKG build into a stage directory, install nothing -sync download the pkgsrc tree to /usr/pkgsrc -hash FILE... sha256 of files, for writing recipes - --n only say what would happen -f go on when files clash or something needs the package --k keep the build directory</pre> -<p><code>add</code> is <code>install</code> and <code>del</code> is <code>remove</code>. <code>mag relocate</code> is the one command not in the usage text: it puts the real loader and library paths into what was built in a <code>MAG_ROOT</code> (section 4.4). <code>mag --version</code> and <code>mag --help</code> do what they say.</p> -<h2 id="s4-2">4.2 Installing and removing</h2> -<pre>mag install shells/mksh -mag install editors/vim net/tnftp -mag -n install net/tnftp what would be built, nothing is done -mag remove vim</pre> -<p>Packages are named as in the repo, <code>category/name</code>. <code>install</code> takes the dependencies first, downloads the source, checks its sha256 against the recipe or the pkgsrc <code>distinfo</code>, builds into a staging directory, and then installs.</p> -<p>What <code>mag</code> guarantees when it installs:</p> -<ul> -<li>every file is checked against what other packages own before anything is touched; a clash stops it (<code>-f</code> goes on)</li> -<li>files are put in place with a rename, so a running program is never half written</li> -<li>a file under <code>/etc</code> that is already there stays, and the package's version is written next to it as <code>.new</code></li> -<li>each package keeps its file list in <code>var/lib/mag</code>, which is all <code>remove</code>, <code>files</code>, <code>owns</code> and <code>autoremove</code> use</li> -</ul> -<p><code>remove</code> stops when another package needs the one you remove; <code>-f</code> goes on. <code>autoremove</code> takes off the packages that were installed only as dependencies and that nothing needs any more.</p> -<h2 id="s4-3">4.3 Finding things</h2> -<pre>mag search editor names and descriptions -mag info net/tnftp the recipe, its version, whether it is installed, its options -mag deps net/tnftp what it needs -mag rdeps sys-libs/musl what needs it -mag files vim what an installed package put on the disk -mag owns /usr/bin/vim which package a file belongs to -mag list everything installed</pre> -<h2 id="s4-4">4.4 Installing somewhere else</h2> -<p><code>MAG_ROOT=/mnt mag install ...</code> installs and records in <code>/mnt</code> instead of <code>/</code>. This is how a new system is built (chapter 3), and how the root of an ISO is built (chapter 8). The <code>etc/mag.conf</code> inside that root is the one used.</p> -<p>Once the root has musl, mag aims clang at it so that what is built can run on the host (section 9.4). <code>mag relocate</code> puts the real paths back:</p> -<pre>MAG_ROOT=/mnt mag relocate</pre> -<h2 id="s4-5">4.5 Other variables</h2> -<table> -<tr><th>variable</th><th>meaning</th><th>default</th></tr> -<tr><td><code>MAG_ROOT</code></td><td>where to install</td><td><code>/</code></td></tr> -<tr><td><code>MAG_REPO</code></td><td>repositories, split by colons</td><td><code>/usr/share/mag/repo:/usr/pkgsrc</code></td></tr> -<tr><td><code>MAG_SYNC_URL</code></td><td>the file <code>mag sync</code> fetches</td><td>NetBSD's <code>pkgsrc.tar.xz</code></td></tr> -<tr><td><code>MAG_FETCH</code></td><td>the download command, given a file and a URL</td><td><code>ftp -o</code></td></tr> -<tr><td><code>MAG_PREFIX</code></td><td><code>$PREFIX</code> in the steps</td><td><code>/usr</code></td></tr> -<tr><td><code>MAG_JOBS</code></td><td><code>$JOBS</code> in the steps</td><td><code>JOBS</code> of mag.conf, else 4</td></tr> -<tr><td><code>MAG_SH</code></td><td>the shell the steps run under</td><td><code>/bin/sh</code></td></tr> -</table> -<p>mag does not speak https itself; <code>MAG_FETCH</code> does, so <code>ftp</code> has to be on the machine.</p> -<h2 id="s4-6">4.6 pkgsrc options</h2> -<p>Many pkgsrc packages have options (<code>PKG_OPTIONS</code>). mag works them out the way pkgsrc does: the package's suggested options, then <code>PKG_DEFAULT_OPTIONS</code>, then <code>PKG_OPTIONS.name</code>, each word adding an option, or taking it off when it has a minus. Put them in <code>/etc/mag.conf</code>:</p> -<pre>PKG_DEFAULT_OPTIONS=-http2 idn -PKG_OPTIONS.vim=python</pre> -<p><code>mag info net/tnftp</code> shows the options a package ends up with, and its dependencies change with them. The recipes of Chamesle's own repo have no options; they see <code>JOBS</code> and the flags only.</p> -<h2 id="s4-7">4.7 Writing a recipe</h2> -<p>If pkgsrc does not have what you want, write a recipe. It is a file called <code>category/name</code> in a repository that comes before pkgsrc in <code>MAG_REPO</code>. It can also be a directory with a file called <code>recipe</code> in it, when there are patches or other files to carry: <code>$RECIPE_DIR</code> is that directory (<code>repo/dev-build/libtool</code> is one).</p> -<pre>desc: nl80211 wireless configuration tool -version: 6.17 -url: https://cdn.kernel.org/pub/software/network/iw/iw-${version}.tar.xz -sha256: 7d182e498289ab39b257da6780d562e415377107f50358ee5b55b8cfe40b1e33 -deps: net-libs/libnl devel/pkgconf -steps: - make -j$JOBS - make PREFIX=$PREFIX DESTDIR=$DESTDIR install</pre> -<p>The fields:</p> -<ul> -<li><code>desc</code> is the line <code>mag search</code> matches and shows</li> -<li><code>version</code> is also <code>${version}</code> inside <code>url</code></li> -<li><code>url</code> is the source archive; it is unpacked with its first directory stripped</li> -<li><code>sha256</code> is the checksum of that archive; <code>mag hash file.tar.xz</code> prints it</li> -<li><code>deps</code> are other packages, split by spaces, built first</li> -<li><code>steps:</code> is a block of lines that start with a tab, run as a plain <code>sh -e</code> script in the unpacked source</li> -</ul> -<p>The steps see <code>$DESTDIR</code> (everything has to be installed there, never into the real root), <code>$PREFIX</code> (<code>/usr</code>), <code>$JOBS</code>, <code>$NAME</code>, <code>$VERSION</code>, <code>$SRC</code> and <code>$RECIPE_DIR</code>. The package is made from what ends up in <code>$DESTDIR</code>.</p> -<p>Try it without installing:</p> -<pre>mag build net-wireless/iw builds, says where the files are -mag -k build net-wireless/iw keeps the build directory too</pre> -<p>and when it is right:</p> -<pre>mag install net-wireless/iw</pre> -<hr> -<p><a href="handbook-installing.html">&larr; Installing by hand</a> | <a href="docs.html">Contents</a> | <a href="handbook-rifle.html">rifle &rarr;</a></p> -</main> - -<hr> -<div id="foot"> -Something wrong on this page? Tell us on the <a href="board.html">board</a>.<br> -Chamesle is installed by hand, from the <a href="docs.html">handbook</a>.<br> -<a href="https://ko-fi.com/L6N725GI1V">Ko-fi</a><br> -<a href="#" id="edit-link">Edit text</a><br> -$Date: 2026-11-16 $ -</div> - -</div> - -<script src="edit.js"></script> -</body> -</html> diff --git a/docs/handbook-maintaining.html b/docs/handbook-maintaining.html @@ -4,12 +4,12 @@ <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Maintaining - Chamesle</title> -<meta name="description" content="The first says what would be rebuilt, the second reinstalls whatever the repos have a newer version of. pkgsrc itself is"> +<meta name="description" content="sync brings the Gentoo tree up to date (section 2.3), the second says what would be rebuilt, the third rebuilds whatever"> <link rel="canonical" href="https://chamesle.org/handbook-maintaining.html"> <meta property="og:type" content="website"> <meta property="og:site_name" content="Chamesle"> <meta property="og:title" content="Maintaining - Chamesle"> -<meta property="og:description" content="The first says what would be rebuilt, the second reinstalls whatever the repos have a newer version of. pkgsrc itself is"> +<meta property="og:description" content="sync brings the Gentoo tree up to date (section 2.3), the second says what would be rebuilt, the third rebuilds whatever"> <meta property="og:url" content="https://chamesle.org/handbook-maintaining.html"> <link rel="stylesheet" href="style.css?13"> </head> @@ -38,29 +38,27 @@ <p><a href="handbook-iso.html">&larr; The live ISO</a> | <a href="docs.html">Contents</a> | <a href="handbook-files.html">File reference &rarr;</a></p> <h2>9. Maintaining</h2> <h2 id="s9-1">9.1 Updating packages</h2> -<pre>mag -n upgrade -mag upgrade</pre> -<p>The first says what would be rebuilt, the second reinstalls whatever the repos have a newer version of. pkgsrc itself is updated with <code>mag sync</code> (section 2.3). One package: <code>mag install name</code>. When you work with <code>MAG_ROOT</code> set, run <code>mag relocate</code> afterwards.</p> +<pre>hoard sync +hoard upgrade -p +hoard upgrade</pre> +<p><code>sync</code> brings the Gentoo tree up to date (section 2.3), the second says what would be rebuilt, the third rebuilds whatever the tree has a newer version of. One package: <code>hoard install name</code>.</p> <h2 id="s9-2">9.2 Cleaning up</h2> -<pre>mag autoremove dependencies nothing needs any more -rm -rf /var/cache/mag/* downloaded sources; they are fetched again when needed</pre> +<pre>hoard autoremove dependencies nothing needs any more +rm -rf /var/cache/distfiles/* downloaded sources; they are fetched again when needed</pre> <h2 id="s9-3">9.3 C23 and CFLAGS</h2> -<p>clang compiles C as C23 by default. Older programs written for C89 or C99 stop with errors about <code>bool</code>, <code>true</code> or <code>false</code> used as names, or about functions declared as <code>int f()</code> and called with arguments. <code>CFLAGS=-O2 -std=gnu17</code> in <code>mag.conf</code> makes the compiler use C17 for every build. It is in the file chamesle-bootstrap writes; if you wrote your own <code>mag.conf</code> without it, add it.</p> -<p>To see the error of a failed build, run <code>mag -k install name</code>: the build directory is kept, and the error is above the line that says <code>the steps failed, left in ...</code>.</p> -<h2 id="s9-4">9.4 The root's compiler and mag relocate</h2> -<p>When <code>MAG_ROOT</code> has musl in it (<code>usr/lib/crt1.o</code> and <code>usr/lib/libc.so</code>), mag makes a <code>cc</code> script in the build directory and puts it first in <code>PATH</code>, with <code>gcc</code>, <code>clang</code> and <code>c99</code> as links to it. It runs the clang of the host with <code>--target=x86_64-linux-musl</code>, <code>--sysroot</code> and <code>-isystem</code> pointed at the root, lld, compiler-rt, and the loader and library paths set to the ones in the root, so that what was built runs on the host. <code>-lgcc</code>, <code>-lgcc_s</code> and <code>-lgcc_eh</code> are dropped from the command line because compiler-rt replaces them.</p> -<p>A program built that way names <code>/mnt/usr/lib/libc.so</code> as its loader and <code>/mnt/usr/lib</code> as its library path. On the real system neither exists, and running the program says "not found" although the file is there. <code>mag relocate</code> goes through <code>usr</code>, <code>bin</code>, <code>sbin</code> and <code>lib</code> in the root and puts back <code>/lib/ld-musl-x86_64.so.1</code> and <code>/usr/lib</code>. Run it before the first boot and after every install into a <code>MAG_ROOT</code>.</p> -<p>If there is no <code>clang</code> in <code>PATH</code> outside the root, mag stops with "no clang in PATH: it is the compiler for a musl root".</p> -<h2 id="s9-5">9.5 libtool</h2> -<p>pkgsrc packages that use libtool expect a <code>libtool</code> script. <code>dev-build/libtool</code> is a small one of Chamesle's that compiles, links and installs shared and static libraries; kmod, for example, is built with <code>LIBTOOL=libtool</code>. If a package fails at a libtool step, read <code>repo/dev-build/libtool/libtool</code>, and for a package that insists on its own libtool pass <code>LIBTOOL=libtool</code> to its <code>make</code>.</p> +<p>clang compiles C as C23 by default. Older programs written for C89 or C99 stop with errors about <code>bool</code>, <code>true</code> or <code>false</code> used as names, or about functions declared as <code>int f()</code> and called with arguments. <code>CFLAGS="-O2 -std=gnu17"</code> in <code>/etc/spas/make.conf</code> makes the compiler use C17 for every build. It is in the file chamesle-bootstrap writes; if you wrote your own <code>make.conf</code> without it, add it.</p> +<p>To see the error of a failed build, read the log hoard names: the build directory is kept, and <code>hoard install --resume</code> goes on from the phase that stopped.</p> +<h2 id="s9-4">9.4 Installing into a root</h2> +<p><code>hoard --root /mnt install name</code> builds and merges into <code>/mnt</code>, with the configuration of <code>/mnt/etc/spas</code>. Once the root has musl in it, the builds use the clang of the new root, so a package is built for the system it goes into.</p> +<h2 id="s9-5">9.5 Build tools</h2> +<p>Ebuilds call the usual tools by name: <code>make</code>, <code>awk</code>, <code>sed</code>, <code>grep</code>, <code>diff</code>, <code>cmp</code>, <code>install</code>, <code>python3</code>, <code>perl</code>, <code>m4</code>. The coreutils ones are rifle's, and the rest are packages like any other. A name an ebuild asks for that is missing is a package to install, and <code>hoard install -p</code> says which one.</p> <h2 id="s9-6">9.6 Failures you will see</h2> <table> <tr><th>what you see</th><th>why, and what to do</th></tr> -<tr><td><code>no recipe for NAME</code></td><td>the name is in no repo of <code>MAG_REPO</code>; try <code>mag search</code>, and check the pkgsrc path is in <code>MAG_REPO</code></td></tr> -<tr><td>a checksum mismatch</td><td>the download is not the one the recipe names; for the kernel see section 7.2</td></tr> +<tr><td><code>no ebuilds match NAME</code></td><td>the name is in no repository of <code>repos.conf</code>; try <code>hoard search</code>, and run <code>hoard sync</code></td></tr> +<tr><td>a checksum mismatch</td><td>the download is not the one the Manifest names; hoard fetches it again</td></tr> <tr><td><code>no clang in PATH</code></td><td>the build host has no clang outside the new root; install one</td></tr> -<tr><td>a program says <code>not found</code> though the file is there</td><td>its loader path is the one of the build: <code>MAG_ROOT=... mag relocate</code></td></tr> -<tr><td>files clash, or a package cannot be removed</td><td>another package owns the file or needs the package; read what mag says, <code>-f</code> goes on</td></tr> +<tr><td>files clash, or a package cannot be removed</td><td>another package owns the file or needs the package; read what hoard says</td></tr> <tr><td>errors on <code>bool</code>, <code>true</code>, <code>false</code> or on old declarations</td><td>C23; <code>CFLAGS=-O2 -std=gnu17</code> (section 9.3)</td></tr> <tr><td>musl's build fails</td><td><code>gmake</code> is missing on the host</td></tr> <tr><td>"root device not found" at boot</td><td>the kernel cannot see the disk or the file system: it needs a module, use an initramfs (section 7.5)</td></tr> @@ -68,11 +66,10 @@ rm -rf /var/cache/mag/* downloaded sources; they are fetched again when <tr><td>a BIOS machine does not boot</td><td><code>limine bios-install /dev/sda</code> was not run, or <code>limine-bios.sys</code> is not in <code>/boot</code></td></tr> <tr><td>a UEFI machine does not boot</td><td><code>EFI/BOOT/BOOTX64.EFI</code> is not on the EFI partition, or the partition is not of type EFI System</td></tr> <tr><td>a login without a password</td><td>the password field of <code>passwd</code> is empty</td></tr> -<tr><td>no devices in <code>/dev</code></td><td>udev did not start; check that <code>udevd</code> is installed with <code>mag list</code></td></tr> +<tr><td>no devices in <code>/dev</code></td><td>udev did not start; check that <code>udevd</code> is installed with <code>hoard list</code></td></tr> </table> <h2 id="s9-7">9.7 Keeping a build</h2> -<pre>mag -k install name</pre> -<p>keeps the build directory. <code>mag fetch name</code> downloads and checks the sources without building, and <code>mag build name</code> builds into a staging directory and prints where the files are.</p> +<p>hoard keeps the build directory of a failed build, in <code>/var/tmp/portage</code>. <code>hoard install -f name</code> only downloads and checks the sources, and <code>hoard install --resume</code> carries on from the phase that stopped.</p> <hr> <p><a href="handbook-iso.html">&larr; The live ISO</a> | <a href="docs.html">Contents</a> | <a href="handbook-files.html">File reference &rarr;</a></p> </main> diff --git a/docs/handbook-preparing.html b/docs/handbook-preparing.html @@ -40,48 +40,37 @@ <h2 id="s2-1">2.1 What the build host needs</h2> <p>Chamesle is built from a running Linux machine: any distribution, or the live ISO of chapter 8. The host needs:</p> <ul> -<li><code>clang</code> and <code>lld</code>: <code>mag</code> and <code>rifle</code> are built with them, and so is everything in the new system</li> +<li><code>clang</code> and <code>lld</code>: <code>rifle</code> is built with them, and so is everything in the new system</li> +<li><code>cargo</code> and <code>rustc</code>, for <code>hoard</code>, with the musl standard library for <code>x86_64-unknown-linux-musl</code></li> +<li><code>bash</code>, which ebuilds run in</li> <li><code>gmake</code>, for musl</li> -<li><code>ftp</code> (tnftp), which mag uses for downloads (<code>MAG_FETCH</code>)</li> <li><code>tar</code> and a POSIX <code>sh</code></li> <li><code>sfdisk</code>, <code>mkfs.ext4</code> and <code>mkfs.fat</code> to prepare the disk</li> <li><code>blkid</code> to read UUIDs</li> </ul> <p>Plan for about 20 GB of free disk space for the sources and build directories of a first install, and a network connection.</p> -<h2 id="s2-2">2.2 Building mag and rifle</h2> -<p>Both are a single C file with no libc under it:</p> -<pre>cd $HOME/src/mag &amp;&amp; ./build.sh -cd $HOME/src/rifle &amp;&amp; ./build.sh</pre> -<p><code>mag/build.sh</code> leaves <code>./mag</code>. <code>rifle/build.sh</code> leaves <code>./rifle</code> and a <code>bin/</code> directory with a link for every tool. Put <code>mag</code> in your PATH:</p> -<pre>install -m755 $HOME/src/mag/mag /usr/local/bin/mag</pre> -<h2 id="s2-3">2.3 Getting the pkgsrc tree</h2> -<p>Let mag fetch a pkgsrc tree from NetBSD and unpack it into <code>/usr/pkgsrc</code>:</p> -<pre>mag sync</pre> -<p><code>sync</code> downloads <code>https://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc.tar.xz</code> and replaces the tree with it, so it is also how the tree is brought up to date. <code>MAG_SYNC_URL</code> names another file, and under <code>MAG_ROOT</code> the tree goes into <code>$MAG_ROOT/usr/pkgsrc</code>. By hand it is the same thing:</p> -<pre>cd /usr -ftp -o pkgsrc.tar.xz https://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc.tar.xz -tar -xf pkgsrc.tar.xz</pre> -<p>pkgsrc has a directory per category (<code>shells</code>, <code>editors</code>, <code>www</code>, ...) and a directory per package inside it (<code>shells/mksh</code>). <code>mag</code> reads the package's <code>Makefile</code>, <code>distinfo</code> and <code>patches/</code> itself.</p> -<h2 id="s2-4">2.4 MAG_REPO</h2> -<p><code>MAG_REPO</code> is a list of repositories separated by colons. Chamesle's own recipes come first, so they win over pkgsrc when both have a package of the same name:</p> -<pre>export MAG_REPO=$HOME/src/mag/repo:/usr/pkgsrc</pre> -<p>If <code>MAG_REPO</code> is not set, mag looks in <code>/usr/share/mag/repo</code> (Chamesle's own recipes, which the live ISO and every bootstrapped root carry) and then in <code>/usr/pkgsrc</code>, where <code>mag sync</code> puts the tree. <code>MAG_ROOT</code> says where to install; it is the new root during an installation (chapter 3) and unset on a running system.</p> -<p>A file called <code>PROVIDES</code> in a repo tells mag how our recipes meet pkgsrc's. Its lines are:</p> -<pre>pkgsrc/package our/package our package stands in for the pkgsrc one -pkgsrc/package - nothing is needed, the dependency is dropped -needs pkgsrc/package dep a dependency the pkgsrc Makefile forgets</pre> -<p>For example <code>converters/libiconv -</code> (musl has iconv) and <code>needs editors/vim dev-libs/netbsd-curses</code>.</p> -<h2 id="s2-5">2.5 mag.conf</h2> -<p><code>$MAG_ROOT/etc/mag.conf</code> holds the build settings. It uses the syntax of pkgsrc's <code>mk.conf</code>: plain <code>VAR=value</code> lines. <code>chamesle-bootstrap</code> writes a first one for the new system. For the host you build from, make one yourself:</p> -<pre>JOBS=8 -CFLAGS=-O2 -std=gnu17</pre> -<ul> -<li><code>JOBS</code> is <code>$JOBS</code> in the build steps, the number to give <code>make -j</code>. Without it mag uses 4</li> -<li><code>CFLAGS</code>, <code>CXXFLAGS</code>, <code>CPPFLAGS</code> and <code>LDFLAGS</code> are set for every build</li> -<li><code>PKG_DEFAULT_OPTIONS</code> and <code>PKG_OPTIONS.name</code> set pkgsrc options (section 4.6)</li> -<li><code>CONFIGURE_ARGS.name</code> adds arguments to the <code>configure</code> of one pkgsrc package, such as <code>CONFIGURE_ARGS.libtirpc=--disable-gssapi</code></li> -</ul> -<p>The environment wins over the file: <code>MAG_JOBS</code>, <code>CFLAGS</code> and the others, when set, are used as they are.</p> +<h2 id="s2-2">2.2 Building hoard and rifle</h2> +<p>rifle is a single C file with no libc under it:</p> +<pre>cd $HOME/src/rifle &amp;&amp; ./build.sh</pre> +<p><code>rifle/build.sh</code> leaves <code>./rifle</code> and a <code>bin/</code> directory with a link for every tool. hoard is a Rust program. For a system on musl it is built for the musl target, as a static binary:</p> +<pre>cd $HOME/src/SimplePackagemAnagingSystem +cargo build --release --target x86_64-unknown-linux-musl +install -m755 target/x86_64-unknown-linux-musl/release/hoard /usr/local/bin/hoard</pre> +<p>The releases of SPAS have a binary for glibc machines, which is what a Gentoo host uses to start with.</p> +<h2 id="s2-3">2.3 Getting the Gentoo tree</h2> +<pre>mkdir -p /var/db/repos /etc/spas/repos.conf +printf &#x27;[gentoo]\nlocation = /var/db/repos/gentoo\nsync-type = git\nsync-uri = https://github.com/gentoo-mirror/gentoo.git\n&#x27; &gt; /etc/spas/repos.conf/gentoo.conf +hoard sync</pre> +<p><code>sync</code> clones the tree the first time and pulls it after that, so it is also how the tree is brought up to date. Gentoo has a directory per category (<code>app-editors</code>, <code>sys-apps</code>, ...) and a directory per package inside it (<code>app-editors/vim</code>) with the ebuilds, a <code>Manifest</code> and the files they carry.</p> +<h2 id="s2-4">2.4 The profile</h2> +<p>The profile says what a package is built for. Chamesle uses the musl one, and <code>make.profile</code> is a link to it:</p> +<pre>ln -sfn /var/db/repos/gentoo/profiles/default/linux/amd64/23.0/musl /etc/spas/make.profile</pre> +<p><code>--root DIR</code> says where to install; it is the new root during an installation (chapter 3) and left out on a running system. Its own <code>etc/spas</code> is the one used.</p> +<h2 id="s2-5">2.5 make.conf</h2> +<p><code>/etc/spas/make.conf</code> holds the build settings, and section 4.4 has what goes in it. <code>chamesle-bootstrap</code> writes a first one for the new system. For the host you build from, make one yourself:</p> +<pre>CFLAGS=&quot;-O2 -pipe -std=gnu17&quot; +CXXFLAGS=&quot;${CFLAGS}&quot; +MAKEOPTS=&quot;-j8&quot;</pre> <p><code>-std=gnu17</code> matters. clang defaults to C23 now, and a lot of older source does not compile under it (section 9.3).</p> <hr> <p><a href="handbook-about.html">&larr; About Chamesle</a> | <a href="docs.html">Contents</a> | <a href="handbook-installing.html">Installing by hand &rarr;</a></p> diff --git a/docs/handbook-rifle.html b/docs/handbook-rifle.html @@ -35,7 +35,7 @@ </div> <main> -<p><a href="handbook-mag.html">&larr; Using mag</a> | <a href="docs.html">Contents</a> | <a href="handbook-base.html">The base system &rarr;</a></p> +<p><a href="handbook-hoard.html">&larr; Using hoard</a> | <a href="docs.html">Contents</a> | <a href="handbook-base.html">The base system &rarr;</a></p> <h2>5. rifle</h2> <h2 id="s5-1">5.1 What it is</h2> <p>rifle is the coreutils of Chamesle in one C file, <code>rifle.c</code>, on <code>c.h</code>, a one-file libc. It has no GNU code in it and no libc under it. It sorts and compares by bytes, always; there are no locales.</p> @@ -70,9 +70,9 @@ rifle --list the names it knows</pre> <pre>tests/run.sh all the cases tests/run.sh sort the cases that have `sort` in them</pre> <p>Each case in <code>tests/cases</code> runs once under GNU coreutils and once under rifle, and what they print and how they exit are compared. The machine that runs the tests therefore has GNU coreutils for the comparison; the installed system does not. <code>./build.sh</code> has to have run first. A case that starts with <code>@ro</code> runs with the whole file system read-only under <code>bwrap</code>, and is skipped when <code>bwrap</code> is missing.</p> -<p>mag has a test of its own: <code>mag/tests/run.sh</code> builds a fake repo with local tarballs and goes through install, upgrade and remove in a scratch root. It needs ftp, tar and the rifle tools in PATH.</p> +<p>hoard has tests of its own, in the SPAS sources (<code>cargo test</code>).</p> <hr> -<p><a href="handbook-mag.html">&larr; Using mag</a> | <a href="docs.html">Contents</a> | <a href="handbook-base.html">The base system &rarr;</a></p> +<p><a href="handbook-hoard.html">&larr; Using hoard</a> | <a href="docs.html">Contents</a> | <a href="handbook-base.html">The base system &rarr;</a></p> </main> <hr>