1
0

add more alpine knowledge, consolidate postmarketos into alpine

This commit is contained in:
dtb 2022-04-21 00:58:44 -04:00
parent 634ce98c30
commit 9b8f6a0d64
2 changed files with 63 additions and 63 deletions

View File

@ -16,22 +16,76 @@
<SCRIPT SRC="/js/sheets.js" TYPE="application/javascript"></SCRIPT>
<SCRIPT TYPE="application/javascript">window.onload = window.initializesheets;</SCRIPT>
<H1>alpine</H1>
<H3>updated 2021-10-14</H3>
<H3>updated 2022-04-20</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>Setting up a C compilation environment</H2>
<P>You will need the following.</P>
<H2>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>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><B>C standard library headers</B> - <CODE>musl-dev</CODE></LI>
<LI><B>C compiler</B> - <CODE>tcc</CODE>, <CODE>gcc</CODE>, <CODE>clang</CODE></LI>
</UL>
<P>You will want the following.</P>
<UL>
<LI><B>Make utility</B> - <CODE>make</CODE></LI>
<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>.
<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>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>
</BODY>
</HTML>

View File

@ -1,54 +0,0 @@
<!DOCTYPE html>
<HTML LANG="en">
<HEAD>
<LINK HREF="http://www.trinity.moe/postmarketos" 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>postmarketOS</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>postmarketOS</H1>
<H3>updated 2021-11-09</H3>
<HR ALIGN="left" SIZE="1" WIDTH="25%" />
<P>
postmarketOS is based on Alpine Linux and this site's <A HREF="/knowledge/alpine">knowledge article for Alpine</A> applies to postmarketOS as well.
</P>
<H2>Encrypted SD card with LUKS</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>I bought a <A HREF="https://www.amazon.com/gp/product/B09B1JFY24/">SAMSUNG EVO Select 128GB New Generation</A> card (apologies for the Amazon link, it isn't an associate link though), wiped it, and put one partition on it that spanned the whole drive.</P>
<P>See <A HREF="/knowledge/cryptography#luks_partitioning">cryptography#LUKS partitioning</A> for how to make a LUKS partition.</P>
<P>
To have the SD card auto-mount at boot, add an <CODE>fstab(5)</CODE> line for the decrypted block device.
The <CODE>localmount</CODE> OpenRC service will also have to be enabled for the system to read <CODE>fstab(5)</CODE> - <CODE>rc-update add localmount</CODE>.
Then, <CODE>rc-update add dmcrypt boot</CODE> and add an entry in <CODE>/etc/conf.d/dmcrypt</CODE> to automatically luksOpen the volume.
<CODE>dm-crypt</CODE> will need the UUID of the <I>physical</I> block device; in <CODE>blkid(8)</CODE> this will be the line that starts with <CODE>/dev/mmcblk</CODE> or <CODE>/dev/sd[<I>X</I>]</CODE>.
</P>
<H2>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>
</BODY>
</HTML>