handbook-installing.html (17240B)
1 <!doctype html> 2 <html lang="en"> 3 <head> 4 <meta charset="utf-8"> 5 <meta name="viewport" content="width=device-width, initial-scale=1"> 6 <title>Installing - Chamesle</title> 7 <meta name="description" content="The live system has chamesle-install, which asks for the disk, the file system (ZFS, btrfs or ext4), the bootloader"> 8 <link rel="canonical" href="https://chamesle.org/handbook-installing.html"> 9 <meta property="og:type" content="website"> 10 <meta property="og:site_name" content="Chamesle"> 11 <meta property="og:title" content="Installing - Chamesle"> 12 <meta property="og:description" content="The live system has chamesle-install, which asks for the disk, the file system (ZFS, btrfs or ext4), the bootloader"> 13 <meta property="og:url" content="https://chamesle.org/handbook-installing.html"> 14 <link rel="stylesheet" href="style.css?25"> 15 <link rel="icon" href="img/logo.png"> 16 </head> 17 <body> 18 19 <div id="page"> 20 21 <div id="top"> 22 <h1><a href="./"><img src="img/banner.png" alt="Chamesle Linux" width="223" height="56"></a></h1> 23 </div> 24 25 <div id="nav"> 26 <a href="./">Home</a> | 27 <a href="download.html">Download</a> | 28 <b>Handbook</b> | 29 <a href="packages.html">Packages</a> | 30 <a href="new.html">News</a> | 31 <a href="board.html">Board</a> | 32 <a href="chat.html">Chat</a> | 33 <a href="source.html">Source</a> | 34 <a href="https://x22.chamesle.org/">X22</a> | 35 <a href="https://github.com/tortr-rs/mag">mag</a> | 36 <a href="about.html">About</a> 37 </div> 38 39 <main> 40 <p><a href="handbook-preparing.html">← Preparing</a> | <a href="docs.html">Contents</a> | <a href="handbook-mag.html">mag →</a></p> 41 <h2>3. Installing</h2> 42 <p>The live system has <code>chamesle-install</code>, which asks for the disk, the file system (ZFS, btrfs or ext4), the bootloader (limine or GRUB), the firmware (what the machine has is ticked), wifi, the host name, the root password and a user, and then does this chapter on the whole disk. The log is <code>/var/log/chamesle-install.log</code>, and a copy is kept on the new system. The rest of the chapter is the same install by hand, for another layout or to know what it did.</p> 43 <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 live system, and it erases the disk.</p> 44 <p>There are two ways through 3.1 and 3.2: <code>chamesle-disk</code> does the partitioning and the file systems, 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> 45 <h2 id="s3-1">3.1 chamesle-disk</h2> 46 <pre>chamesle-disk /dev/sda 47 chamesle-disk -t btrfs /dev/sda 48 chamesle-disk -t ext4 -y /dev/sda</pre> 49 <p><code>-t</code> is the file system of the root: <code>zfs</code> (the default), <code>btrfs</code> or <code>ext4</code>. btrfs gets the subvolumes <code>@</code> for <code>/</code> and <code>@home</code> for <code>/home</code>, mounted with <code>compress=zstd</code>. <code>-y</code> asks nothing and lays out the whole disk as in the table below.</p> 50 <p>It lists the disk and asks you to type its name before it touches anything. Then it starts <code>cfdisk</code> so you lay out the partitions. Three of them work for BIOS and UEFI both:</p> 51 <table> 52 <tr><th>partition</th><th>size</th><th>type</th><th>use</th></tr> 53 <tr><td>1</td><td>1M</td><td>BIOS boot</td><td>limine's BIOS code, not used on UEFI</td></tr> 54 <tr><td>2</td><td>512M</td><td>EFI System</td><td><code>/boot</code>, FAT32</td></tr> 55 <tr><td>3</td><td>the rest</td><td>Linux filesystem</td><td><code>/</code>, ZFS</td></tr> 56 </table> 57 <p>Write the table and quit cfdisk. chamesle-disk lists the partitions and asks which one is the boot partition and which is the root. Then it does, in this order:</p> 58 <pre>mkfs.fat -F32 BOOT 59 zpool create -f -o ashift=12 -O compression=zstd -O acltype=posixacl -O xattr=sa -O mountpoint=none -R /mnt rpool ROOT 60 zfs create -o mountpoint=/ -o canmount=noauto rpool/root 61 zfs mount rpool/root 62 zfs create -o mountpoint=/home rpool/home 63 zfs create -o mountpoint=/var rpool/var 64 zpool set bootfs=rpool/root rpool</pre> 65 <p>and mounts <code>rpool/root</code>, <code>rpool/home</code> and <code>rpool/var</code> under <code>/mnt</code> and the boot partition on <code>/mnt/boot</code>. It also writes <code>/mnt/etc/fstab</code> with the boot partition by UUID and the <code>proc</code>, <code>sysfs</code> and <code>tmpfs</code> lines. It writes nothing else.</p> 66 <p>ZFS mounts its own datasets, so the fstab does not list them. limine cannot read ZFS: the kernel, the initramfs and <code>limine.conf</code> live on the FAT partition, which is <code>/boot</code>.</p> 67 <p>ZFS on a machine with little memory is slow; on the 256 MB machine use ext4 (3.2).</p> 68 <h2 id="s3-2">3.2 Partitioning and file systems by hand</h2> 69 <p>For a root on ext4. The layout is the one in 3.1, <code>sda1</code> to <code>sda3</code>:</p> 70 <pre>sfdisk /dev/sda <<P 71 label: gpt 72 size=1M, type=21686148-6449-6E6F-744E-656564454649 73 size=512M, type=U 74 type=L 75 P</pre> 76 <p>On an NVMe disk the partitions are <code>/dev/nvme0n1p1</code> and so on. Replace <code>sda1</code>, <code>sda2</code> and <code>sda3</code> throughout.</p> 77 <pre>mkfs.fat -F32 /dev/sda2 78 mkfs.ext4 /dev/sda3 79 mount /dev/sda3 /mnt 80 mkdir /mnt/boot 81 mount /dev/sda2 /mnt/boot</pre> 82 <p>The FAT partition is <code>/boot</code>. The kernel and <code>limine.conf</code> end up there, where limine looks for them on both BIOS and UEFI.</p> 83 <h2 id="s3-3">3.3 chamesle-bootstrap</h2> 84 <pre>chamesle-bootstrap /mnt</pre> 85 <p>That is the whole base. It copies <code>/etc/mag/repos</code> and <code>/etc/mag/keys</code> of the live system into <code>/mnt</code>, runs <code>mag update</code> there, and installs <code>chamesle-base</code>, the kernel (<code>linux-lts</code>) and its firmware with everything they need. The kernel package writes <code>vmlinuz-lts</code> and <code>initramfs-lts</code> into <code>/mnt/boot</code>. It takes as long as the download, a few minutes.</p> 86 <pre>chamesle-bootstrap [-a ARCH] [-n HOSTNAME] [-k KERNEL] [-f FIRMWARE] TARGET [PACKAGE]...</pre> 87 <table> 88 <tr><th>option</th><th>what</th></tr> 89 <tr><td><code>-n</code></td><td>the host name, <code>chamesle</code> if not given</td></tr> 90 <tr><td><code>-f</code></td><td>the firmware package. The default, <code>linux-firmware-none</code>, has no firmware; take the one your hardware needs (7.4)</td></tr> 91 <tr><td><code>-k</code></td><td>the kernel package, <code>linux-lts</code> if not given</td></tr> 92 <tr><td><code>-a</code></td><td>the architecture, the machine's own if not given (3.10)</td></tr> 93 </table> 94 <p>Packages after the target go in too. A ThinkPad with Intel wireless and graphics, with an editor:</p> 95 <pre>chamesle-bootstrap -n t480 -f linux-firmware-intel /mnt vim</pre> 96 <p>What <code>chamesle-base</code> brings: OpenRC and the files of chapter 6, mag, rifle, mksh, busybox for the tools rifle does not have, bash, <code>agetty</code>, eudev, kmod, dhcpcd, e2fsprogs, curl and <code>arch-chroot</code>.</p> 97 <h2 id="s3-4">3.4 Working inside the new root</h2> 98 <pre>arch-chroot /mnt 99 arch-chroot /mnt passwd root</pre> 100 <p><code>arch-chroot</code> is Arch's, the same script. It mounts <code>proc</code>, <code>sys</code>, <code>dev</code>, <code>dev/pts</code>, <code>dev/shm</code>, <code>run</code> and <code>tmp</code> under the directory, puts the live system's <code>/etc/resolv.conf</code> in it, and takes the mounts away again when the command ends. Without a command it starts bash. Inside, <code>mag install name</code> works as on the finished system.</p> 101 <h2 id="s3-5">3.5 fstab</h2> 102 <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> 103 <p>By hand, <code>blkid</code> prints the UUIDs:</p> 104 <pre>blkid /dev/sda2 /dev/sda3</pre> 105 <p>Write <code>/mnt/etc/fstab</code>:</p> 106 <pre>UUID=ROOT-UUID / ext4 defaults 0 1 107 UUID=BOOT-UUID /boot vfat defaults 0 2 108 proc /proc proc defaults 0 0 109 sysfs /sys sysfs defaults 0 0 110 tmpfs /tmp tmpfs nosuid,nodev 0 0</pre> 111 <p>A root on ZFS gets no root line.</p> 112 <h2 id="s3-6">3.6 Host name and password</h2> 113 <p>The host name is in <code>/mnt/etc/hostname</code>, from <code>-n</code>. Set the root password:</p> 114 <pre>arch-chroot /mnt passwd root</pre> 115 <p>The hash goes into <code>/etc/shadow</code>. The login shell of root is mksh.</p> 116 <h2 id="s3-7">3.7 The boot entry</h2> 117 <pre>chamesle-boot /mnt 118 chamesle-boot -b grub /mnt</pre> 119 <p><code>-b grub</code> installs GRUB instead of limine, for UEFI and for BIOS, and writes <code>/boot/grub/grub.cfg</code> the same way.</p> 120 <p>It looks at what is mounted on <code>/mnt</code> and <code>/mnt/boot</code> and</p> 121 <ul> 122 <li>installs <code>limine</code> into the new root, so its boot files and its <code>limine</code> are the same version</li> 123 <li>for a root on ZFS, installs <code>zfs</code> and <code>zfs-lts</code>, adds <code>zfs</code> to the initramfs (7.5) and <code>zfs-import</code> and <code>zfs-mount</code> to the sysinit runlevel; for btrfs, installs <code>btrfs-progs</code>, adds <code>btrfs</code> to the initramfs and puts the subvolume on the kernel command line</li> 124 <li>writes <code>/mnt/boot/limine.conf</code> with an entry for every kernel in <code>/mnt/boot</code>, the root by UUID, or by dataset on ZFS</li> 125 <li>copies <code>BOOTX64.EFI</code> to <code>EFI/BOOT/</code> on the boot partition, for UEFI</li> 126 <li>runs <code>limine bios-install</code> on the disk, for BIOS; on a GPT disk only when it has a BIOS boot partition, else it says the disk boots by UEFI only</li> 127 </ul> 128 <p>An old <code>limine.conf</code> is kept as <code>limine.conf.old</code>. If <code>/boot</code> is not FAT, limine cannot read it; chamesle-boot then writes nothing and prints an entry for the GRUB of the system already on the machine (3.11).</p> 129 <p>What it does by hand follows; skip to 3.8 if it said nothing went wrong.</p> 130 <pre>ls /mnt/boot 131 System.map-7.3.5-0-lts config-7.3.5-0-lts initramfs-lts vmlinuz-lts</pre> 132 <p>The names stay the same when the kernel is updated, so <code>limine.conf</code> is written once. <code>/mnt/boot/limine.conf</code>, with the UUID of the root partition:</p> 133 <pre>timeout: 3 134 135 /Chamesle 136 protocol: linux 137 path: boot():/vmlinuz-lts 138 module_path: boot():/initramfs-lts 139 cmdline: root=UUID=ROOT-UUID modules=sd-mod,usb-storage,nvme,ext4 rootfstype=ext4 quiet</pre> 140 <p><code>boot()</code> is the partition <code>limine.conf</code> is on, which is <code>/boot</code>. The initramfs finds the root, loads the modules on the command line and starts <code>/sbin/init</code>. Take <code>quiet</code> out to see the kernel's messages. For a serial console add <code>console=ttyS0,115200</code>.</p> 141 <p>A root on ZFS names the dataset; the initramfs needs the zfs module, which is section 7.5:</p> 142 <pre> cmdline: root=ZFS=rpool/root rootfstype=zfs quiet</pre> 143 <p>Install limine into the new root, and use its files, not the ones of the live system; the two can differ in version, and limine's BIOS stage only works with a <code>limine-bios.sys</code> of its own version:</p> 144 <pre>arch-chroot /mnt mag install limine</pre> 145 <h3 id="bios">BIOS</h3> 146 <pre>cp /mnt/usr/share/limine/limine-bios.sys /mnt/boot/ 147 arch-chroot /mnt limine bios-install /dev/sda</pre> 148 <p><code>limine bios-install</code> writes the loader to the start of the disk and into the BIOS boot partition, which a GPT disk needs (3.1). <code>limine-bios.sys</code> on the FAT partition is the part it loads.</p> 149 <h3 id="uefi">UEFI</h3> 150 <pre>mkdir -p /mnt/boot/EFI/BOOT 151 cp /mnt/usr/share/limine/BOOTX64.EFI /mnt/boot/EFI/BOOT/</pre> 152 <p>The firmware starts <code>EFI/BOOT/BOOTX64.EFI</code> of the EFI System partition by itself.</p> 153 <p>Do both and the disk boots either way.</p> 154 <h2 id="s3-8">3.8 First boot</h2> 155 <pre>umount -R /mnt 156 zpool export rpool 157 reboot</pre> 158 <p>Leave out <code>zpool export</code> if the root is not on ZFS.</p> 159 <p>Take out the installation medium. limine shows the entry for three seconds and boots the kernel. OpenRC mounts the file systems, starts the services of the runlevels and puts a login on the ttys. Log in as root. <code>dhcpcd</code> brings up a cable at boot; for wireless see section 6.8.</p> 160 <h2 id="s3-9">3.9 What to install next</h2> 161 <pre>mag install vim htop tmux 162 mag search irc</pre> 163 <p>Chapter 4 has the rest, chapter 10 a graphical desktop.</p> 164 <h2 id="s3-10">3.10 32-bit machines</h2> 165 <p>On a 32-bit PC (Pentium 4, Athlon XP and the like) boot the ISO on another machine, or install from any Linux there (2.2), and give the architecture:</p> 166 <pre>chamesle-bootstrap -a x86 /mnt</pre> 167 <p>The x86 repository has the same packages, built for i686 with SSE2. <code>-a x86</code> is written to <code>/mnt/etc/mag/arch</code>, and mag keeps to it from then on. <code>rifle</code> is only built for x86_64, so on x86 busybox gives the coreutils. limine boots 32-bit BIOS machines as well; the entry is the same.</p> 168 <h2 id="s3-11">3.11 Next to another system</h2> 169 <p>To keep a Linux that is already on the disk, Chamesle goes on a partition of its own and the other system's GRUB boots both. The other system is not changed, except for one GRUB entry. Make a backup first; shrinking a file system that is in use is not possible, so it is done from the ISO.</p> 170 <p>Say the disk has an EFI partition <code>nvme0n1p1</code> and the other system's ext4 root <code>nvme0n1p2</code>, 238G with 100G free. Shrink it to 170G and make the file system fit its partition again:</p> 171 <pre>e2fsck -f /dev/nvme0n1p2 172 resize2fs /dev/nvme0n1p2 170G 173 cfdisk /dev/nvme0n1</pre> 174 <p>In cfdisk resize <code>nvme0n1p2</code> to 171G (a little more than the file system, never less), make <code>nvme0n1p3</code> in the free space, write and quit. Then</p> 175 <pre>resize2fs /dev/nvme0n1p2 176 mkfs.ext4 /dev/nvme0n1p3 177 mount /dev/nvme0n1p3 /mnt</pre> 178 <p>Leave the EFI partition alone and do not mount anything on <code>/mnt/boot</code>: the kernel stays in <code>/boot</code> on the ext4 root, where GRUB reads it. Go on with 3.3 to 3.6. <code>chamesle-boot /mnt</code> then prints a GRUB entry; boot the other system, put the entry at the end of its <code>/etc/grub.d/40_custom</code> and run <code>grub-mkconfig -o /boot/grub/grub.cfg</code>.</p> 179 <p>To use the same home in both, mount the other root in Chamesle and bind its <code>/home</code>, in <code>/etc/fstab</code>:</p> 180 <pre>UUID=OTHER-ROOT-UUID /old ext4 defaults 0 2 181 /old/home /home none bind 0 0</pre> 182 <p>and make your user with the same name, user number and group number as there (<code>id</code> on the other system says them):</p> 183 <pre>mkdir /old 184 addgroup -g 1000 alice 185 adduser -H -u 1000 -G alice alice</pre> 186 <p><code>-H</code> makes no home, since the other system's is used: the files, the dotfiles and the settings of the programs are the same in both systems.</p> 187 <h2 id="s3-12">3.12 The glibc Chamesle</h2> 188 <p>The install is the same, with <code>-l glibc</code> for chamesle-bootstrap. ZFS is not there: neither Artix nor Arch carries it, so the root is btrfs or ext4.</p> 189 <pre>chamesle-disk -t btrfs -y /dev/sda 190 chamesle-bootstrap -l glibc -n box -f "linux-firmware-intel linux-firmware-realtek" /mnt networkmanager networkmanager-openrc</pre> 191 <p>The repos and keyrings come from <code>/usr/share/chamesle/glibc</code> on the live system. <code>-k</code> is the kernel (<code>linux-lts</code>, or <code>linux</code>, <code>linux-zen</code>); <code>-f</code> the firmware, split by vendor as in Arch (<code>linux-firmware-amdgpu</code>, <code>-nvidia</code>, <code>-atheros</code>, <code>-broadcom</code>, <code>-mediatek</code>, or <code>linux-firmware</code> for all of it). For an NVIDIA card, add <code>nvidia-open-lts nvidia-utils</code> (<code>nvidia-open</code> with <code>linux</code>). Users are made with <code>useradd</code>, services have their names from Artix (<code>NetworkManager</code>, <code>iwd</code>):</p> 192 <pre>echo root:PASSWORD | arch-chroot /mnt chpasswd 193 arch-chroot /mnt useradd -m -G wheel,video,input,audio alice 194 arch-chroot /mnt passwd alice 195 arch-chroot /mnt rc-update del dhcpcd default 196 arch-chroot /mnt rc-update add NetworkManager default 197 chamesle-boot /mnt</pre> 198 <p>chamesle-boot sees the glibc system and writes the entries for mkinitcpio's <code>initramfs-linux-lts.img</code>. The base keeps the name Chamesle where Artix's packages would put theirs: os-release, the release files, GRUB's menu and the line OpenRC boots with (<code>/usr/lib/chamesle/brand</code>, run again by a hook when those packages come).</p> 199 <hr> 200 <p><a href="handbook-preparing.html">← Preparing</a> | <a href="docs.html">Contents</a> | <a href="handbook-mag.html">mag →</a></p> 201 </main> 202 203 <hr> 204 <div id="foot"> 205 Something wrong on this page? Tell us on the <a href="board.html">board</a>.<br> 206 Chamesle installs with <code>chamesle-install</code>, or by hand from the <a href="docs.html">handbook</a>.<br> 207 <a href="https://ko-fi.com/L6N725GI1V">Ko-fi</a><br> 208 <a href="#" id="edit-link">Edit text</a><br> 209 $Date: 2026-11-23 $ 210 </div> 211 212 </div> 213 214 <script src="edit.js"></script> 215 </body> 216 </html>