1
0
src/homepage/knowledge/alpine.html

147 lines
7.2 KiB
HTML

<!DOCTYPE html>
<HTML LANG="en">
<HEAD>
<LINK HREF="http://www.trinity.moe/knowledge/alpine" REL="canonical" />
<LINK HREF="https://raw.githubusercontent.com/devenblake/homepage/main/favicon.ico" REL="shortcut icon" TYPE="image/x-icon" />
<LINK HREF="/css/blank.css" ID="styling" REL="stylesheet" />
<META CHARSET="UTF-8" />
<META CONTENT="noindex" NAME="googlebot" /> <!-- FUCK GOOGLE -->
<META CONTENT="interest-cohort=()" HTTP-EQUIV="Permissions-Policy" /> <!-- FUCK GOOGLE -->
<META NAME="viewport" CONTENT="width=device-width, initial-scale=1" />
<TITLE>knowledge/alpine</TITLE>
</HEAD>
<BODY>
<P><A HREF="/">~ Return to the rest of the site</A></P>
<SCRIPT SRC="/js/cookies.js" TYPE="application/javascript"></SCRIPT>
<SCRIPT SRC="/js/sheets.js" TYPE="application/javascript"></SCRIPT>
<SCRIPT TYPE="application/javascript">window.onload = window.initializesheets;</SCRIPT>
<H1>alpine</H1>
<H3>updated 2022-04-21</H3>
<HR ALIGN="left" SIZE="1" WIDTH="25%" />
<H2>Resources</H2>
<UL>
<LI><A HREF="https://pkgs.alpinelinux.org/contents">Alpine repositories content search</A></LI>
</UL>
<H2>Alpine: Always install manual pages</H2>
<P>
Alpine doesn't include man pages in program packages to save on space, instead keeping them in <CODE>[<I>package</I>]-doc</CODE> sibling packages.
To always install doc packages with program packages, <CODE>apk add docs</CODE>.
</P>
<H2>Arch and Artix: Install essential packages</H2>
<P>
On Artix, use <CODE>basestrap(8)</CODE>.
On Arch, use <CODE>pacstrap(8)</CODE>.
</P>
<P>
At a minimum you need <CODE>base</CODE> on both Arch and Artix.
On Artix, you need to select the initialization you want to use: <CODE>66</CODE>, <CODE>dinit</CODE>, <CODE>openrc</CODE>, <CODE>runit</CODE>, or <CODE>s6-base</CODE>.
On both Arch and Artix, select a kernel; <CODE>linux</CODE>, <CODE>linux-lts</CODE>, or another Linux configuration or fork.
Arch says you need to install <CODE>linux-firmware</CODE>, technically you don't need to do so but you should.
Artix says you need to install the appropriate elogind package (<CODE>elogind-$(<B>INIT_SYSTEM</B>)</CODE>; e.g. <CODE>elogind-66</CODE>).
This isn't necessary if you aren't using elogind, but you <I>most likely</I> want elogind.
Install <CODE>base-devel</CODE> if you plan on using the AUR or if you don't know what the AUR is yet.
</P>
<P>
It's also a good idea to install any utilities you'll need on the bootstrapped system.
Text editors, network managers or utilities, and other administration tools, for example.
Manual utilities such as <CODE>man-db</CODE> and others would also be useful.
</P>
<H2>Common utilities</H2>
<P>A lot of common utilities such as <CODE>lsblk(8)</CODE> and <CODE>more(1)</CODE> are provided by <CODE>util-linux</CODE> which is not installed by default.</P>
<H3>C language</H3>
<UL>
<LI>Compiler: <CODE>tcc</CODE>, <CODE>gcc</CODE>, <CODE>clang</CODE></LI>
<LI>Standard library headers: <CODE>musl-dev</CODE></LI>
<LI>Standard library documentation: <CODE>man-pages</CODE>, <CODE>man-pages-posix</CODE></LI>
</UL>
<P>Also see the <CODE>build-base</CODE> metapackage.</P>
<H3>LUKS</H3>
<P><CODE>cryptsetup</CODE> and <CODE>e2fsprogs</CODE>.</P>
<H3>Manual viewer</H3>
<P><CODE>mandoc</CODE></P>
<H3>Make</H3>
<P><CODE>make</CODE></P>
<H3>Login manager</H3>
<P><CODE>elogind</CODE></P>
<H3>Stream Pager</H3>
<P><CODE>less</CODE></P>
<H3>Task manager</H3>
<P><CODE>top(1)</CODE> comes with busybox; see its derivatives such as <CODE>htop</CODE> for curses-based alternatives.</P>
<H3>Text editing</H3>
<P>
<CODE>emacs</CODE> and <CODE>vim</CODE> come to mind.
A particularly shoddy attempt at <CODE>ed(1)</CODE> is provided by busybox but will please nobody.
busybox's <CODE>vi(1)</CODE> on the other hand is a very useable implementation of the original.
</P>
<H2>fstab</H2>
<P>See <CODE>fstab(5).</P>
<P>postmarketOS requires that the <CODE>localmount</CODE> OpenRC service be enabled for the system to read <CODE>fstab(5)</CODE>.
<P>Arch and Artix have fstab generators at <CODE>genfstab(8)</CODE> and <CODE>fstabgen(8)</CODE> respectively in their installation scripts.</P>
<H2>Mount LUKS encrypted partitions at boot</H2>
<H3>Sources</H3>
<UL>
<LI><A HREF="https://www.howtoforge.com/automatically-unlock-luks-encrypted-drives-with-a-keyfile/">Automatically Unlock LUKS Encrypted Drives With A Keyfile</A></LI>
<LI><A HREF="https://wiki.gentoo.org/wiki/Dm-crypt">Dm-crypt</A> (Gentoo Wiki)</LI>
<LI><A HREF="https://wiki.alpinelinux.org/wiki/LVM_on_LUKS">LVM on LUKS</A> (Alpine Wiki)</LI>
</UL>
<P>See <A HREF="/knowledge/cryptography#luks_partitioning">cryptography#LUKS partitioning</A> for how to make a LUKS partition.</P>
<P>
<CODE>cryptsetup-openrc</CODE> provides a <CODE>dmcrypt</CODE> service for OpenRC.
Make sure that service is added to runlevel boot and then configure <CODE>/etc/conf.d/dmcrypt</CODE>, and accordingly fstab.
<CODE>dmcrypt</CODE> will need the UUID of the <I>physical</I> block device while fstab (if being configured with UUIDs will need the UUID of the decrypted block device in the device mapper.
</P>
<H2>Partitions and filesystems</H2>
<H3>See also</H3>
<UL>
<LI><A HREF="https://wiki.archlinux.org/title/EFI_system_partition">EFI system partition (Arch Wiki)</A></LI>
<LI><A HREF="https://wiki.artixlinux.org/Main/Installation#Partition_your_disk_.28BIOS.29">Installation#Partition your disk - Artix wiki</A></LI>
<LI><A HREF="https://wiki.archlinux.org/title/Installation_guide#Partition_the_disks">Installation guide#Partition the disks - Arch wiki</A></LI>
</UL>
<P>
Don't use partitioners included with OS media where the same job can be done by <A HREF="https://gparted.org/">GParted</A> (which has live media available) or another good general-purpose partitioner.
BSDs and Plan 9 are exceptions to this rule due to their exotic partitioning systems.
Using utilities from a shell or TUIs does not make you "cooler" than someone who needs a GUI for partitioning; in some cases, messing up partitioning can have serious consequences, so it's always nice to have some idiot-proofing.
I always partition my disks with the GParted live media.
</P>
<P>
You should do your own research on how you should partition your disks.
I personally use separate partitions for /boot, /home, /, and swap.
Your needs will vary.
</P>
<P>
<B>Please note that a separate boot partition is mandatory if you intend to boot via (U)EFI.</B>
Check out the linked pages in the "See also" section.
</P>
<P>
Use <CODE>mkfs(8)</CODE> for creating filesystems and <CODE>mount(8)</CODE> for mounting partitions' filesystems.
</P>
<H2>postmarketOS: Random MAC address generation on Wifi</H2>
<P>
By default, postmarketOS will generate a random software MAC address when connecting to a new WLAN network.
You can disable this by adding a NetworkManager rule.
In <CODE>/etc/NetworkManager/conf.d/</CODE> you can make a file with any name that has the following:
</P>
<P><CODE><PRE>
[device]
wifi.scan-rand-mac-address=no
</PRE></CODE></P>
<P>
On a live system you can then <CODE>rc-service networkmanager restart</CODE> to restart NetworkManager and have it load the new configuration.
</P>
<H2>WiFi</H2>
<P>
I use <CODE>iwd(8)</CODE> and <CODE>iwctl(8)</CODE>.
Some prefer NetworkManager and I believe that's the default on Debian.
The Artix wiki suggests connman.
</P>
</BODY>
</HTML>