separate out linux from unix

This commit is contained in:
dtb 2023-01-02 17:46:46 -05:00
parent 6cbece0716
commit 00a0bb0a4f
19 changed files with 202 additions and 188 deletions

View File

@ -1,5 +1,5 @@
RM = rm -f
TARGETS = game/index.html unix/index.html
TARGETS = game/index.html linux/index.html unix/index.html
all: $(TARGETS)

4
wiki/linux/a.out.m4 Normal file
View File

@ -0,0 +1,4 @@
_header(`a.out')
_bibliography(`
_bentr(`_link(`Re: [PATCH] x86: Remove a.out support', `https://lwn.net/ml/linux-kernel/202203161523.857B469@keescook/')')
')

14
wiki/linux/acpi.m4 Normal file
View File

@ -0,0 +1,14 @@
_header(`ACPI')
_bibliography(`
_bentr(`_ref(`#ACPI')')
')
<P>
logind (as part of SystemD), elogind, acpid, and many desktop environments can manage ACPI events automatically, and sometimes this is configured by default as part of a Linux software distribution.
</P>
_subheader(`acpid(8)')
_bibliography(`
_bentr(`_link(`acpid', `https://sourceforge.net/projects/acpid2/')')
')
<P>
_man(`acpid(8)') is a daemon that can automatically manage ACPI events on Linux.
</P>

48
wiki/linux/audio.m4 Normal file
View File

@ -0,0 +1,48 @@
_header(`Audio')
<P>
Most audio servers recommend that they be run in userspace with user privileges, with PulseAudio going so far as to exiting when run as root without additional configuration.
The Alpine wiki currently recommends _man(`pipewire(1)'), with postmarketOS, which is based on Alpine, coming pre-configured with PipeWire.
PipeWire is relatively new and the typical audio server used is PulseAudio; _ref(`#debian') and many popular Debian-based distributions come pre-configured with PulseAudio.
</P>
_subheader(`ALSA')
_bibliography(`
_bentr(`<A HREF="https://wiki.alpinelinux.org/wiki/Main_Page/Adding_sound">Adding sound</A> (Alpine Linux Wiki)')
_bentr(`<A HREF="https://bbs.archlinux.org/viewtopic.php?id=256857">ALSA lib conf Evaluate error</A>')
_bentr(`<A HREF="https://dev.to/setevoy/linux-alsa-lib-pcmdmixc1108sndpcmdmixopen-unable-to-open-slave-38on">ALSA lib pcm_dmix.c:1108:(snd_pcm_dmix_open) unable to open slave</A>')
')
<P>
The Alpine wiki ("Adding sound") says to install _code(`alsa-conf'), _code(`alsa-lib'), and _code(`alsa-utils'),
add yourself to the _code(`audio') group, and then do some more configuration that I've never needed to do:
Use _man(`alsamixer(1)') to find a working sound card (press _code(`F6') from the first screen ALSAMixer presents)
and edit _code(`/usr/share/alsa/alsa.conf') and change _code(`defaults.ctl.card') and _code(`defaults.pcm.card') to the sound card that works.
</P>
<P>
The Alpine wiki doesn't mention this but you'll need to enable the _code(`alsa') OpenRC service and either start it or reboot.
I also installed _code(`gstreamer') but I don't know why.
</P>
<P>
ALSA is clunky, many people prefer to use a frontend such as Pipewire or PulseAudio that exposes its own interface while remaining compatible with ALSA.
</P>
_subheader(`OSS')
<P>
Deprecated, unfortunately.
</P>
_subheader(`PipeWire')
_bibliography(`
_bentr(`<A HREF="https://wiki.alpinelinux.org/wiki/PipeWire">PipeWire</A> (Alpine Linux Wiki)')
_bentr(`<A HREF="https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/home">PipeWire</A> (FreeDesktop Wiki)')
')
<P>
Provided by the _code(`pipewire') package on Alpine.
</P>
<PRE>
RTKit error: org.freedesktop.DBus.Error.ServiceUnknown
</PRE>
<P>
This means you need _program(`rtkit') installed and running through your initialization system.
</P>
_subheader(`PulseAudio')
<P>
On Alpine you'll need the _program(`pulseaudio'), _program(`pulseaudio-alsa'), and _program(`alsa-plugins-pulse') packages for PulseAudio with ALSA compatibility.
Start _man(`pulseaudio(1)') when you want audio, ideally in your _file(`.xinitrc').
</P>

View File

@ -0,0 +1,31 @@
_header(`Bootstrapping')
<P>
Usually the first program a computer will run is the _ref(`#bootloader'),
which loads the kernel and usually the _ref(`#linux#initramfs') which will handle mounting the system storage.
Then the _ref(`#linux#initialization') system is started, which handles daemons, some of which will handle login.
</P>
<P>
Bootstrapping Linux involves booting an operating system, usually off a temporary storage medium, mounting the intended system storage,
and installing the operating system on the intended storage.
Sometimes distributions come with software that mostly automates this.
</P>
_passage(`veronika on the Alpine Linux Discord server, 2022-12-04T1111+0400',`
<P>bootstrapping things is only useful for rare cases where you actually don`'t want to use the base packages that the installer gets for you automatically, and the installer doesn`'t get in your way of making your own system, instead it suggests you install certain packages, and asks what packages you want installed. If you`'re installing a desktop environment, it will probably ask you which meta package you want (or at least that`'s how I remember it working).</P>
<P>If you have an installer to do the same things with less steps for you, you should use it. Automation is progress, automation is the whole point of all this computer stuff. If you can automate it or make it easier, you probably should, unless you want some control over the process. For example, instead of checking the charge and running a command to put your laptop into battery saver mode, you make a program do it for you. Convenience is key to happy and painless computing</P>
')
<P>
If running very thin installation media, for example, a _ref(`#debian') network install CD, or just need the most up-to-date software possible,
the first step will be to connect to the Internet.
</P>
<P>
Next, if your chosen Linux distribution has a package manager, configure it, use it to initialize the file system on the intended system storage,
and install the necessary system packages to the storage.
Usually distributions have a single <EM>base</EM> package, like _ref(`#arch')'s _package(`base') or _ref(`#alpine')'s _package(`alpine-base').
If it doesn't include any of them, install separately a kernel, initialization system, and userland.
</P>
<P>
Bind mount (_command(`mount -o bind')) _file(`/dev/'), _file(`/proc/'), and _file(`/sys/') to the corresponding locations on the volume to bootstrap
(_code(`for d in dev proc sys; do mount -o bind /$d /[<I>mount</I>]/$d; done')),
then _ref(`#posix#chroot(1)') in and complete the system setup.
Set up additional configuration necessary to boot (including _ref(`#fstab(5)'), _man(`hostname(5)'), _man(`hosts(5)'), and anything necessary for the kernel or initialization).
</P>

4
wiki/linux/devices.m4 Normal file
View File

@ -0,0 +1,4 @@
_header(`Devices')
_bibliography(`
_bentr(`_link(`udev', `https://en.wikipedia.org/wiki/Udev') (Wikipedia)')
')

View File

@ -0,0 +1,8 @@
_subheader(`Distributions')
<P>
Linux is usually obtained as part of a software distribution put together to form a useable operating system.
</P>
_subsubheader(_ref(`#alpine'))
_subsubheader(_ref(`#arch'))
_subsubheader(_ref(`#debian'))

4
wiki/linux/hostname.m4 Normal file
View File

@ -0,0 +1,4 @@
_header(`hostname')
<P>
The special file _file(`/proc/sys/kernel/hostname') directly controls the system hostname in the kernel.
</P>

View File

@ -0,0 +1,9 @@
_header(`Initialization')
_subheader(`OpenRC')
_bibliography(`
_bentr(`_link(`OpenRC', `https://wiki.gentoo.org/wiki/OpenRC') (Gentoo Wiki)')
')
_subheader(`Runit')
_subheader(`S6')
_subheader(`Systemd')

9
wiki/linux/initramfs.m4 Normal file
View File

@ -0,0 +1,9 @@
_header(`initramfs')
_bibliography(`
_bentr(`_link(`Initial ramdisk', `https://en.wikipedia.org/wiki/Initial_ramdisk') (Wikipedia)')
_bentr(`_link(`initramfs', `https://wiki.debian.org/initramfs') (Debian Wiki)')
_bentr(`_link(`initramfs', `https://wiki.ubuntu.com/Initramfs') (Ubuntu Wiki)')
')
<P>
_file(`initramfs') is a _ref(`#archives#cpio') archive that contains a small Linux filesystem with just enough utility to mount the actual operating system's root filesystem.
</P>

40
wiki/linux/linux.m4 Normal file
View File

@ -0,0 +1,40 @@
define(`_DESCRIPTION', `Linux is a Unix-workalike operating system kernel.')dnl
define(`_PAGE', `Linux')dnl
include(`../wiki.m4')dnl
include(`../unix/macros.m4')dnl
<UL>
_bentr(`_link(`How to Linux', `http://tldp.yolinux.com/HOWTO/subdir/HOWTO-INDEX.html')')
_bentr(`_link(`How to Use User Mode Linux', `https://christine.website/blog/howto-usermode-linux-2019-07-07')')
_bentr(`<A HREF="https://www.cs.cmu.edu/~awb/linux.history.html">LINUX's History</A>')
_bentr(`_link(`The Linux Kernel documentation', `https://www.kernel.org/doc/html/v4.17/index.html')')
_bentr(`_link(`LINUX is obsolete', `https://groups.google.com/g/comp.os.minix/c/wlhw16QWltI')')
_bentr(`_link(`Linux From Scratch', `http://www.linuxfromscratch.org/')')
_bentr(`_link(`Move your Linux from BIOS to UEFI in place', `https://www.redhat.com/sysadmin/bios-uefi')')
<LI><A HREF="https://www.collabora.com/news-and-blog/blog/2020/08/27/using-the-linux-kernel-case-insensitive-feature-in-ext4/">Using the Linux kernel's Case-insensitive feature in Ext4</A></LI>
</UL>
include(`a.out.m4')dnl
include(`acpi.m4')dnl
include(`alpine.m4')dnl
include(`arch.m4')dnl
include(`audio.m4')dnl
include(`bootstrapping.m4')dnl
include(`debian.m4')dnl
include(`devices.m4')dnl
include(`distributions.m4')dnl
include(`hostname.m4')dnl
include(`initialization.m4')dnl
include(`initramfs.m4')dnl
include(`util-linux.m4')dnl

17
wiki/linux/login.m4 Normal file
View File

@ -0,0 +1,17 @@
_header(`Login')
_subheader(`logind')
_bibliography(`
_bentr(`<A HREF="https://github.com/elogind/elogind">elogind</A>')
_bentr(`<A HREF="https://wiki.gentoo.org/wiki/Elogind">elogind</A> (Gentoo Wiki)')
_bentr(`<A HREF="https://www.freedesktop.org/software/systemd/man/org.freedesktop.login1.html">org.freedesktop.login1</A>')
_bentr(`<A HREF="https://nixos.wiki/wiki/Logind">logind</A> (NixOS Wiki)')
')
<P>
logind (_code(`systemd-logind.service(8)')) is a component of SystemD that exposes information about active users on the system via the org.freedesktop.login1 D-Bus interface which is used by the popular desktop environments GNOME and KDE.
It also handles _ref(`#ACPI') events.
It can be configured in _code(`logind.conf(5)').
</P>
<P>
On systems without SystemD and with conflicting software, _code(`elogind(8)') may be used.
</P>

5
wiki/linux/macros.m4 Normal file
View File

@ -0,0 +1,5 @@
define(`_command', `_code($1)')dnl
define(`_file', `_code($1)')dnl
define(`_man', `_cite($1)')dnl
define(`_program', `_code($1)')dnl
define(`_package', `_code($1)')dnl

7
wiki/linux/util-linux.m4 Normal file
View File

@ -0,0 +1,7 @@
_subheader(`util-linux')
_bibliography(`
_bentr(`_link(`util-linux', `https://en.wikipedia.org/wiki/Util-linux') (Wikipedia)')
')
<P>
_code(`util-linux') is distributed on all popular Linux distributions and contains utilities users may expect to be already present on their systems, like _man(`more(1)') or _man(`hexdump(1)').
</P>

View File

@ -9,10 +9,6 @@ include(`posix.m4')
include(`acpi.m4')
include(`alpine.m4')
include(`arch.m4')
include(`archives.m4')
include(`bootloader.m4')
@ -21,8 +17,6 @@ include(`C.m4')
include(`culture.m4')
include(`debian.m4')
include(`doas.m4')
include(`editing.m4')

View File

@ -1,183 +1,3 @@
_header(`Linux')
<UL>
_bentr(`_link(`How to Linux', `http://tldp.yolinux.com/HOWTO/subdir/HOWTO-INDEX.html')')
_bentr(`_link(`How to Use User Mode Linux', `https://christine.website/blog/howto-usermode-linux-2019-07-07')')
_bentr(`<A HREF="https://www.cs.cmu.edu/~awb/linux.history.html">LINUX's History</A>')
_bentr(`_link(`The Linux Kernel documentation', `https://www.kernel.org/doc/html/v4.17/index.html')')
_bentr(`_link(`LINUX is obsolete', `https://groups.google.com/g/comp.os.minix/c/wlhw16QWltI')')
_bentr(`_link(`Linux From Scratch', `http://www.linuxfromscratch.org/')')
_bentr(`_link(`Move your Linux from BIOS to UEFI in place', `https://www.redhat.com/sysadmin/bios-uefi')')
<LI><A HREF="https://www.collabora.com/news-and-blog/blog/2020/08/27/using-the-linux-kernel-case-insensitive-feature-in-ext4/">Using the Linux kernel's Case-insensitive feature in Ext4</A></LI>
</UL>
_subheader(`ACPI')
_bibliography(`
_bentr(`_ref(`#ACPI')')
')
<P>
logind (as part of SystemD), elogind, acpid, and many desktop environments can manage ACPI events automatically, and sometimes this is configured by default as part of a Linux software distribution.
</P>
_subsubheader(`acpid(8)')
_bibliography(`
_bentr(`_link(`acpid', `https://sourceforge.net/projects/acpid2/')')
')
<P>
_man(`acpid(8)') is a daemon that can automatically manage ACPI events on Linux.
</P>
_subheader(`a.out')
_bibliography(`
_bentr(`_link(`Re: [PATCH] x86: Remove a.out support', `https://lwn.net/ml/linux-kernel/202203161523.857B469@keescook/')')
')
_subheader(`Audio')
<P>
Most audio servers recommend that they be run in userspace with user privileges, with PulseAudio going so far as to exiting when run as root without additional configuration.
The Alpine wiki currently recommends _man(`pipewire(1)'), with postmarketOS, which is based on Alpine, coming pre-configured with PipeWire.
PipeWire is relatively new and the typical audio server used is PulseAudio; _ref(`#debian') and many popular Debian-based distributions come pre-configured with PulseAudio.
</P>
_subsubheader(`ALSA')
_bibliography(`
_bentr(`<A HREF="https://wiki.alpinelinux.org/wiki/Main_Page/Adding_sound">Adding sound</A> (Alpine Linux Wiki)')
_bentr(`<A HREF="https://bbs.archlinux.org/viewtopic.php?id=256857">ALSA lib conf Evaluate error</A>')
_bentr(`<A HREF="https://dev.to/setevoy/linux-alsa-lib-pcmdmixc1108sndpcmdmixopen-unable-to-open-slave-38on">ALSA lib pcm_dmix.c:1108:(snd_pcm_dmix_open) unable to open slave</A>')
')
<P>
The Alpine wiki ("Adding sound") says to install _code(`alsa-conf'), _code(`alsa-lib'), and _code(`alsa-utils'),
add yourself to the _code(`audio') group, and then do some more configuration that I've never needed to do:
Use _man(`alsamixer(1)') to find a working sound card (press _code(`F6') from the first screen ALSAMixer presents)
and edit _code(`/usr/share/alsa/alsa.conf') and change _code(`defaults.ctl.card') and _code(`defaults.pcm.card') to the sound card that works.
</P>
<P>
The Alpine wiki doesn't mention this but you'll need to enable the _code(`alsa') OpenRC service and either start it or reboot.
I also installed _code(`gstreamer') but I don't know why.
</P>
<P>
ALSA is clunky, many people prefer to use a frontend such as Pipewire or PulseAudio that exposes its own interface while remaining compatible with ALSA.
</P>
_subsubheader(`OSS')
<P>
Deprecated, unfortunately.
</P>
_subsubheader(`PipeWire')
_bibliography(`
_bentr(`<A HREF="https://wiki.alpinelinux.org/wiki/PipeWire">PipeWire</A> (Alpine Linux Wiki)')
_bentr(`<A HREF="https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/home">PipeWire</A> (FreeDesktop Wiki)')
')
<P>
Provided by the _code(`pipewire') package on Alpine.
</P>
<PRE>
RTKit error: org.freedesktop.DBus.Error.ServiceUnknown
</PRE>
<P>
This means you need _program(`rtkit') installed and running through your initialization system.
</P>
_subsubheader(`PulseAudio')
<P>
On Alpine you'll need the _program(`pulseaudio'), _program(`pulseaudio-alsa'), and _program(`alsa-plugins-pulse') packages for PulseAudio with ALSA compatibility.
Start _man(`pulseaudio(1)') when you want audio, ideally in your _file(`.xinitrc').
</P>
_subheader(`Bootstrapping')
<P>
Usually the first program a computer will run is the _ref(`#bootloader'),
which loads the kernel and usually the _ref(`#linux#initramfs') which will handle mounting the system storage.
Then the _ref(`#linux#initialization') system is started, which handles daemons, some of which will handle login.
</P>
<P>
Bootstrapping Linux involves booting an operating system, usually off a temporary storage medium, mounting the intended system storage,
and installing the operating system on the intended storage.
Sometimes distributions come with software that mostly automates this.
</P>
_passage(`veronika on the Alpine Linux Discord server, 2022-12-04T1111+0400',`
<P>bootstrapping things is only useful for rare cases where you actually don`'t want to use the base packages that the installer gets for you automatically, and the installer doesn`'t get in your way of making your own system, instead it suggests you install certain packages, and asks what packages you want installed. If you`'re installing a desktop environment, it will probably ask you which meta package you want (or at least that`'s how I remember it working).</P>
<P>If you have an installer to do the same things with less steps for you, you should use it. Automation is progress, automation is the whole point of all this computer stuff. If you can automate it or make it easier, you probably should, unless you want some control over the process. For example, instead of checking the charge and running a command to put your laptop into battery saver mode, you make a program do it for you. Convenience is key to happy and painless computing</P>
')
<P>
If running very thin installation media, for example, a _ref(`#debian') network install CD, or just need the most up-to-date software possible,
the first step will be to connect to the Internet.
</P>
<P>
Next, if your chosen Linux distribution has a package manager, configure it, use it to initialize the file system on the intended system storage,
and install the necessary system packages to the storage.
Usually distributions have a single <EM>base</EM> package, like _ref(`#arch')'s _package(`base') or _ref(`#alpine')'s _package(`alpine-base').
If it doesn't include any of them, install separately a kernel, initialization system, and userland.
</P>
<P>
Bind mount (_command(`mount -o bind')) _file(`/dev/'), _file(`/proc/'), and _file(`/sys/') to the corresponding locations on the volume to bootstrap
(_code(`for d in dev proc sys; do mount -o bind /$d /[<I>mount</I>]/$d; done')),
then _ref(`#posix#chroot(1)') in and complete the system setup.
Set up additional configuration necessary to boot (including _ref(`#fstab(5)'), _man(`hostname(5)'), _man(`hosts(5)'), and anything necessary for the kernel or initialization).
</P>
_subheader(`Device Management')
_bibliography(`
_bentr(`_link(`udev', `https://en.wikipedia.org/wiki/Udev') (Wikipedia)')
')
_subheader(`Distributions')
<P>
Linux is usually obtained as part of a software distribution put together to form a useable operating system.
</P>
_subsubheader(_ref(`#alpine'))
_subsubheader(_ref(`#arch'))
_subsubheader(_ref(`#debian'))
_subheader(`hostname')
<P>
The special file _file(`/proc/sys/kernel/hostname') directly controls the system hostname in the kernel.
</P>
_subheader(`Initialization')
_subsubheader(`OpenRC')
_bibliography(`
_bentr(`_link(`OpenRC', `https://wiki.gentoo.org/wiki/OpenRC') (Gentoo Wiki)')
')
_subsubheader(`Runit')
_subsubheader(`S6')
_subsubheader(`Systemd')
_subheader(`initramfs')
_bibliography(`
_bentr(`_link(`Initial ramdisk', `https://en.wikipedia.org/wiki/Initial_ramdisk') (Wikipedia)')
_bentr(`_link(`initramfs', `https://wiki.debian.org/initramfs') (Debian Wiki)')
_bentr(`_link(`initramfs', `https://wiki.ubuntu.com/Initramfs') (Ubuntu Wiki)')
')
<P>
_file(`initramfs') is a _ref(`#archives#cpio') archive that contains a small Linux filesystem with just enough utility to mount the actual operating system's root filesystem.
</P>
_subheader(`logind')
_bibliography(`
_bentr(`<A HREF="https://github.com/elogind/elogind">elogind</A>')
_bentr(`<A HREF="https://wiki.gentoo.org/wiki/Elogind">elogind</A> (Gentoo Wiki)')
_bentr(`<A HREF="https://www.freedesktop.org/software/systemd/man/org.freedesktop.login1.html">org.freedesktop.login1</A>')
_bentr(`<A HREF="https://nixos.wiki/wiki/Logind">logind</A> (NixOS Wiki)')
')
<P>
logind (_code(`systemd-logind.service(8)')) is a component of SystemD that exposes information about active users on the system via the org.freedesktop.login1 D-Bus interface which is used by the popular desktop environments GNOME and KDE.
It also handles _ref(`#ACPI') events.
It can be configured in _code(`logind.conf(5)').
</P>
<P>
On systems without SystemD and with conflicting software, _code(`elogind(8)') may be used.
</P>
_subheader(`util-linux')
_bibliography(`
_bentr(`_link(`util-linux', `https://en.wikipedia.org/wiki/Util-linux') (Wikipedia)')
')
<P>
_code(`util-linux') is distributed on all popular Linux distributions and contains utilities users may expect to be already present on their systems, like _man(`more(1)') or _man(`hexdump(1)').
</P>
_subheader(`Xenia')
_bibliography(`
_bentr(`_link(`A hacker fox!', `http://yerf.metafur.org/date/1996-07-14')')
')
<P>
Xenia was an entry for the Linux logo competition which Tux eventually won.
</P>
See _ref(`/linux/').