<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Sertonix</id>
	<title>Alpine Linux - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Sertonix"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Sertonix"/>
	<updated>2026-05-02T22:36:10Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Sertonix/Freedom_of_choice&amp;diff=32000</id>
		<title>User:Sertonix/Freedom of choice</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Sertonix/Freedom_of_choice&amp;diff=32000"/>
		<updated>2026-01-31T21:00:43Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: add capsudo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is an overview over the different available programms, etc. that can be selected from when using alpine. It is also intended as a reference what should be documented and what could be supported.&lt;br /&gt;
&lt;br /&gt;
== Bootloaders ==&lt;br /&gt;
* See: [[Bootloaders]]&lt;br /&gt;
* Also: {{Pkg|systemd-boot}}&lt;br /&gt;
&lt;br /&gt;
== Kernel ==&lt;br /&gt;
* See: [[Kernels]]&lt;br /&gt;
&lt;br /&gt;
== Libc ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|musl}} || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| [https://www.gnu.org/software/libc/ glibc] || style=&amp;quot;background:red&amp;quot; | None || [[Running glibc programs]]&lt;br /&gt;
|-&lt;br /&gt;
| without aka static || style=&amp;quot;background:orange&amp;quot; | depends on package || Note that this only means no libc at runtime&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://gitlab.alpinelinux.org/alpine/tsc/-/issues/17 alpine-glibc]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Libc Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
== Initramfs ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|mkinitfs}} || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dracut}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|booster}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| [https://github.com/illiliti/tinyramfs tinyramfs] || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:red&amp;quot; | None || may require [[custom Kernel]], [https://kisslinux.org/install#021 kisslinux without initramfs]&lt;br /&gt;
|}&lt;br /&gt;
* See also: [[Initramfs init]]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Initramfs Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
== PID 1 ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| busybox init || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dinit}} || style=&amp;quot;background:orange&amp;quot; | In testing || Shutdown commands are prefixed with {{ic|dinit-}}. eg {{ic|dinit-reboot}}&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|s6-linux-init}} || style=&amp;quot;background:orange&amp;quot; | Works || Requires manually running {{ic|s6-linux-init-maker}}&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|openrc-init}} || style=&amp;quot;background:orange&amp;quot; | Manual setup ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dumb-init}} || style=&amp;quot;background:silver&amp;quot; | Needs testing || For containers&lt;br /&gt;
|-&lt;br /&gt;
| runit-init || style=&amp;quot;background:silver&amp;quot; | Needs testing || [https://dev.alpinelinux.org/~clandmeter/other/forum.alpinelinux.org/comment/383.html#comment-383 runit-init starting OpenRC]&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|epoch}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| custom || style=&amp;quot;background:lime&amp;quot; | Full || For example in docker containers&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Init_system Gentoo Wiki]&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Init Archwiki]&lt;br /&gt;
&lt;br /&gt;
== Service Manager ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[OpenRC]] || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dinit}} || style=&amp;quot;background:orange&amp;quot; | In testing || {{Pkg|dinit-alpine}} includes service files&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|s6-rc}} || style=&amp;quot;background:orange&amp;quot; | Works || Not integrated. For containers there is {{Pkg|s6-overlay}}&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|runit}} || style=&amp;quot;background:orange&amp;quot; | As OpenRC service ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|daemontools}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|daemontools-encore}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|supervisor}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| busybox runit || style=&amp;quot;background:red&amp;quot; | None || Not enabled in a busybox package&lt;br /&gt;
|-&lt;br /&gt;
| systemd || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full || Requires to replace {{Pkg|alpine-base}} with custom set of packages (See {{Issue|71686}})&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Init_system Gentoo Wiki]&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Init Archwiki]&lt;br /&gt;
&lt;br /&gt;
== System Logs ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[Syslog#busybox_syslog|busybox syslog]] || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|rsyslog}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|syslog-ng}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{pkg|socklog}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| [https://skarnet.org/software/s6/s6-socklog.html s6-socklog] from {{pkg|s6}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd-journald || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|}&lt;br /&gt;
* See also: [[Syslog]]&lt;br /&gt;
&lt;br /&gt;
== [[Device Manager]] ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[mdev]] || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| [[mdevd]] || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| [[eudev]] || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| vdev || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd-udev || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Power Managment ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[busybox acpid]] || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|acpid}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|elogind}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd-logind || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Power_management Archwiki]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Power_management Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
== DHCP Client ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[Udhcpc|busybox udhcpc]] || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dhcpcd}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dhclient}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| without aka static || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|}&lt;br /&gt;
* See also: [[Configure Networking]]&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Network_configuration#DHCP Archwiki]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Resolv.conf Gentoo Wiki - resolv.conf]&lt;br /&gt;
&lt;br /&gt;
== Wi-Fi ==&lt;br /&gt;
* See: [[Wi-Fi]]&lt;br /&gt;
* Also supported: {{pkg|eiwd}}&lt;br /&gt;
&lt;br /&gt;
== Seat/Session Managnent ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[elogind]] || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|seatd}} || style=&amp;quot;background:lime&amp;quot; | Full || seats only&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|turnstile}} || style=&amp;quot;background:silver&amp;quot; | needs testing || session only&lt;br /&gt;
|-&lt;br /&gt;
| systemd-logind || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full || Not recommended with graphical enviroment&lt;br /&gt;
|}&lt;br /&gt;
* [https://wiki.gentoo.org/wiki/Seatd Gentoo Wiki - seatd]&lt;br /&gt;
* [https://wiki.gentoo.org/wiki/Elogind Gentoo Wiki - elogind]&lt;br /&gt;
* [https://wiki.archlinux.org/title/Init#logind ArchWiki - systemd-logind]&lt;br /&gt;
* [https://chimera-linux.org/docs/configuration/seat Chimera Linux docs]&lt;br /&gt;
&lt;br /&gt;
== Login ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Supports [[PAM]] !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| busybox login || style=&amp;quot;background:lime&amp;quot; | Full || style=&amp;quot;background:red&amp;quot; | No || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|greetd}} || style=&amp;quot;background:lime&amp;quot; | Full || style=&amp;quot;background:lime&amp;quot; | Yes || requires greeter&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|shadow-login}} || style=&amp;quot;background:lime&amp;quot; | Full || style=&amp;quot;background:lime&amp;quot; | Yes ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|util-linux-login}} || style=&amp;quot;background:lime&amp;quot; | Full || style=&amp;quot;background:lime&amp;quot; | Yes ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd-logind || style=&amp;quot;background:red&amp;quot; | None || style=&amp;quot;background:lime&amp;quot; | Yes || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full || style=&amp;quot;background:red&amp;quot; | No ||&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Login Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
== Shell Utils ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|busybox}} || style=&amp;quot;background:lime&amp;quot; | Full || Dependency of {{pkg|alpine-base}}&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|busybox-extras}} || style=&amp;quot;background:lime&amp;quot; | Full || Some commands that are missing in the main {{Pkg|busybox}} package&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|util-linux}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| [[GNU_core_utilities|coreutils]] || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|s6-portable-utils}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|s6-linux-utils}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|toybox}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|sbase}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|ubase}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:red&amp;quot; | None || A lot of implicit dependency&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Core_utilities Archwiki]&lt;br /&gt;
&lt;br /&gt;
== Shell ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| busybox ash || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|bash}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dash}} || style=&amp;quot;background:lime&amp;quot; | Full || When used as /bin/sh this may cause breakage.&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|yash}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| busybox hush || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:red&amp;quot; | None || sometimes implicit dependency&lt;br /&gt;
|}&lt;br /&gt;
* See also: [[Change default shell]]&lt;br /&gt;
* See proposal: [https://gitlab.alpinelinux.org/alpine/tsc/-/issues/39 replace busybox ash with another /bin/sh]&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Command-line_shell Archwiki]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Shell Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
== SU ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| {{ic|su}} from {{Pkg|busybox-suid}} || style=&amp;quot;background:lime&amp;quot; | Full || default, can&#039;t be removed by default ({{issue|11730}})&lt;br /&gt;
|-&lt;br /&gt;
| {{ic|su}} from {{Pkg|shadow-login}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{ic|su}} from {{Pkg|util-linux-login}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|sudo}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|doas}} || style=&amp;quot;background:lime&amp;quot; | Full || sudo shim using doas: {{Pkg|doas-sudo-shim}}&lt;br /&gt;
|-&lt;br /&gt;
| [https://skarnet.org/software/s6/s6-sudo.html s6-sudo] || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|capsudo}} || style=&amp;quot;background:orange&amp;quot; | In development ||&lt;br /&gt;
|-&lt;br /&gt;
| run0 || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SSL/TLS ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|openssl}} || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|libressl}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|bearssl}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://gitlab.alpinelinux.org/alpine/tsc/-/issues/28 consider LibreSSL as default OpenSSL provider again]&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Transport_Layer_Security Archwiki]&lt;br /&gt;
* See also: [https://github.com/haproxy/wiki/wiki/SSL-Libraries-Support-Status haproxy SSL Libraries Support Status]&lt;br /&gt;
&lt;br /&gt;
== Cron ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|cronie}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dcron}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|fcron}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| vixie-cron || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| scron || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd.timer || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full || {{Pkg|alpine-baselayout}} includes cron specific directories though&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Cron Archwiki]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Cron Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
== SSH ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[Setting_up_a_SSH_server#OpenSSH|openssh]] || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| [[Setting_up_a_SSH_server#Dropbear|dropbear]] || style=&amp;quot;background:lime&amp;quot; | Full || provide {{ic|ssh}} command {{pkg|dropbear-ssh}}&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Secure_Shell Archwiki]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/SSH Gentoo Wiki - OpenSSH]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Dropbear Gentoo Wiki - Dropbear]&lt;br /&gt;
&lt;br /&gt;
== Desktop ==&lt;br /&gt;
* See: [[Desktop environments and Window managers]]&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Architecture|Alpine Architecture]]&lt;br /&gt;
* [https://gitlab.alpinelinux.org/alpine/tsc/-/issues/55 Future of busybox]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Alpine_Package_Keeper&amp;diff=31773</id>
		<title>Alpine Package Keeper</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Alpine_Package_Keeper&amp;diff=31773"/>
		<updated>2025-12-09T22:42:55Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: force-broken-world is independently of disless/sys installs a bad idea. Avoid disless users from considering to use the option&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!--For searching: apk, APK--&amp;gt;&lt;br /&gt;
{{TOC right}}&lt;br /&gt;
This page documents the Alpine Package Keeper(APK), the package manager in Alpine Linux. Refer to the excellent guide [https://docs.alpinelinux.org/user-handbook/0.1a/Working/apk.html Working with APK] from Alpine Linux documentation project to learn the basics quickly. &lt;br /&gt;
&lt;br /&gt;
[[Software management#Graphical software manager|Graphical software managers]] can be used for certain basic package management tasks like adding/removing and upgrading packages.&lt;br /&gt;
&lt;br /&gt;
Package management in RAM-based installs like [[Installation#Diskless_Mode|Diskless]] mode and [[Data Disk Mode|Data disk]] mode require [[#Package management in Diskless mode|additional step using lbu]]. &lt;br /&gt;
&lt;br /&gt;
== apk v3 ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Add {{Pill_Clickable||v3 only|green|palegreen|right|Alpine Package Keeper#apk_v3}} in every section which deals with apk v3 only feature.This section and associated pill templates are needed until v3.22 reaches EOL on 2027-05-01. --&amp;gt;&lt;br /&gt;
{{Pill_clickable||v3 only|green|palegreen|right|Release Notes for Alpine 3.23.0#apk-tools_v3}}&lt;br /&gt;
With the release of Alpine Linux [[Release Notes for Alpine 3.23.0|v3.23]], the Alpine package manager has transitioned to [https://gitlab.alpinelinux.org/alpine/apk-tools/-/releases/v3.0.0 apk-tools v3], but the index and package formats are still at v2. apk v3 targets backwards compatibility and new features are flagged on the relevant sections of this page as seen on the right side. The diff output of the documentation between V2 and V3 is [[Apk/apkv3 doc diff|available here]] for reference.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The {{pkg|apk-tools}} provides &#039;&#039;&#039;apk&#039;&#039;&#039; and it supports the following operations:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;width:100%; border:1px #0771a6 solid; background:#f9f9f9; text-align:left; border-collapse:collapse;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:black; color:white&amp;quot;  colspan=2 align=center |Package installation and removal&lt;br /&gt;
|-&lt;br /&gt;
|[[#Add a Package|add]]  || Add or modify constraints in [[#World|WORLD]] and commit changes&lt;br /&gt;
|-&lt;br /&gt;
|[[#Remove a Package|del]] || Remove constraints from [[#World|WORLD]] and commit changes&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:black; color:white&amp;quot;  colspan=2 align=center |System maintenance&lt;br /&gt;
|-&lt;br /&gt;
|[[#apk fix|fix ]]    || Fix, reinstall or upgrade packages without modifying [[#World|WORLD]]&lt;br /&gt;
|-&lt;br /&gt;
|[[#Update Package list|update]]|| Update repository indexes&lt;br /&gt;
|-&lt;br /&gt;
|[[#Upgrade a Running System|upgrade]]|| Install upgrades available from repositories&lt;br /&gt;
|-&lt;br /&gt;
|[[#Local Cache|cache]]  || Manage the local package cache&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:black; color:white&amp;quot;  colspan=2 align=center |Querying package information&lt;br /&gt;
|-&lt;br /&gt;
|[[#apk query|query]]   || Query information about packages by various criteria&lt;br /&gt;
|-&lt;br /&gt;
|[[#Listing installed packages|list]] || List packages matching a pattern or other criteria&lt;br /&gt;
|-&lt;br /&gt;
|[[#apk dot|dot]]   || Render dependencies as [https://graphviz.org/ graphviz] graphs&lt;br /&gt;
|-&lt;br /&gt;
|[[#apk policy|policy]]|| Show repository policy for packages&lt;br /&gt;
|-&lt;br /&gt;
|[[#Search for Packages|search]]  || Search for packages by name or description&lt;br /&gt;
|-&lt;br /&gt;
|[[#Information on Packages|info]]  || Give detailed information about packages or repositories&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:black; color:white&amp;quot;  colspan=2 align=center |Repository and package maintenance&lt;br /&gt;
|-&lt;br /&gt;
|mkndx    || Create repository index (v3) file from packages&lt;br /&gt;
|-&lt;br /&gt;
|mkpkg  || Create package (v3)&lt;br /&gt;
|-&lt;br /&gt;
|index   || Create repository index (v2) file from packages&lt;br /&gt;
|-&lt;br /&gt;
|fetch  || Download packages from repositories to a local directory&lt;br /&gt;
|-&lt;br /&gt;
|manifest|| Show checksums of package contents&lt;br /&gt;
|-&lt;br /&gt;
|extract || Extract package file contents&lt;br /&gt;
|-&lt;br /&gt;
|verify   || Verify package integrity and signature&lt;br /&gt;
|-&lt;br /&gt;
|adbsign || Sign, resign or recompress v3 packages and indexes&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:black; color:white&amp;quot;  colspan=2 align=center |Miscellaneous&lt;br /&gt;
|-&lt;br /&gt;
|audit|| Audit system for changes&lt;br /&gt;
|-&lt;br /&gt;
|stats  || Show statistics about repositories and installations&lt;br /&gt;
|-&lt;br /&gt;
|version|| Compare package versions or perform tests on version strings&lt;br /&gt;
|-&lt;br /&gt;
|adbdump|| Dump v3 files in textual representation&lt;br /&gt;
|-&lt;br /&gt;
|adbgen  || Generate v3 files from text representation&lt;br /&gt;
|-&lt;br /&gt;
|convdb  || Convert v2 installed database to v3 format&lt;br /&gt;
|-&lt;br /&gt;
|convndx || Convert v2 indexes to v3 format&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Packages and Repositories  ==&lt;br /&gt;
{{Main|Repositories}}&lt;br /&gt;
Official software packages for Alpine Linux have the extension &amp;lt;code&amp;gt;.apk&amp;lt;/code&amp;gt;, and are often called &amp;quot;a-packs&amp;quot;. Packages in Alpine Linux are organized into [[Repositories|&#039;&#039;&#039;repositories&#039;&#039;&#039;]] and are defined in the {{Path|/etc/apk/repositories}} file. [[Apk spec#Package Format V2|apk v2]] packages are digitally signed tar.gz archives containing programs, configuration files, and dependency metadata. &lt;br /&gt;
&lt;br /&gt;
=== Subpackages ===&lt;br /&gt;
&lt;br /&gt;
In Alpine Linux, software packages are thinned out and split into subpackages to give more control over what features are installed and keeps the installation as small and efficient as possible. &lt;br /&gt;
&lt;br /&gt;
Subpackages related to service files, documentation and shell completions are installed automatically by the package manager using &#039;&#039;&#039;auto-install&#039;&#039;&#039; rule based on [[APKBUILD_Reference#install_if|install_if]] directive. For example, if {{pkg|zsh}} is already installed, on installing any package with {{pkg|*zsh-completion*}} subpackage, apk automatically installs the associated subpackage. The {{pkg|docs}} meta package for pulling in [[Alpine_Linux:FAQ#Why_don&#039;t_I_have_man_pages_or_where_is_the_&#039;man&#039;_command?|all documentation]] works the same way.&lt;br /&gt;
&lt;br /&gt;
Alpine Linux [https://pkgs.alpinelinux.org package database] page shows the list of available subpackages for any package.&lt;br /&gt;
&lt;br /&gt;
== World ==&lt;br /&gt;
&lt;br /&gt;
At {{Path|/etc/apk/world}}, apk maintains the world, that is, a list of constraints the package selection needs to fulfill. World describes the desired system state. {{Path|/etc/apk/world}} is a plaintext file with one constraint using dependency notation per line. Each line has the format:&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;code&amp;gt;[!]NAME{@tag}{[&amp;lt;&amp;gt;~=]version}&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
There can be only one line with a given package NAME in the file and except the package NAME, all the other options are optional.&lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;!&#039;&#039;&#039; is used for [[#Masking a specific package|masking a specific package]] &lt;br /&gt;
*  &#039;&#039;&#039;@tag&#039;&#039;&#039; allows apk to use the [[Repositories#Tagged_repository|tagged repository]] for the named package &lt;br /&gt;
*  &#039;&#039;&#039;[&amp;lt;&amp;gt;~=]version&#039;&#039;&#039; are used for [[#Package pinning|package pinning]].&lt;br /&gt;
&lt;br /&gt;
The commands {{ic|apk add foo}} and {{ic|apk del bar}} manipulate the desired state by adding or removing packages &amp;lt;code&amp;gt;foo&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;bar&amp;lt;/code&amp;gt; respectively as a dependency constraint in {{Path|/etc/apk/world}}. If the {{Path|/etc/apk/world}} is edited manually, run the command [[#apk fix|apk fix]] to apply the changes. &lt;br /&gt;
&lt;br /&gt;
Every constraint listed in {{Path|/etc/apk/world}} must be solvable in order for the system to be considered correct, and no transaction may be committed that is incorrect. If apk cannot verify the correctness of the requested change, it will back out adding the constraint before attempting to change what packages are actually installed on the system. Thus apk will never [[#ERROR:_unsatisfiable_constraints|commit]] a change to the system that leaves it unbootable. &lt;br /&gt;
&lt;br /&gt;
{{Warning| The option {{ic|force-broken-world}}, will delete world constraints until a solution without conflicts is found to boot. This does not allow installation of packages with unjustifiable dependencies. Using this will likely result in unexpected removal of some packages.}}&lt;br /&gt;
&lt;br /&gt;
== Update Package list ==&lt;br /&gt;
&lt;br /&gt;
Alpine Linux [[Repositories|&#039;&#039;&#039;repositories&#039;&#039;&#039;]] change as packages are added and upgraded. To get the latest list of available packages, use the &#039;&#039;update&#039;&#039; command.  This command downloads the {{Path|APKINDEX.tar.gz}} from each repository and stores it in the local cache, typically {{Path|/var/cache/apk/}}, {{Path|/var/lib/apk/}} or {{Path|/etc/apk/cache/}}. {{Cmd|# apk update}}&lt;br /&gt;
&lt;br /&gt;
Adding the &amp;lt;code&amp;gt;--update-cache&amp;lt;/code&amp;gt;, or for short &amp;lt;code&amp;gt;-U&amp;lt;/code&amp;gt; switch to another apk command, as in &amp;lt;code&amp;gt;apk --update-cache upgrade&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;apk -U add ...&amp;lt;/code&amp;gt;, the command has the same effect as first running &amp;lt;code&amp;gt;apk update&amp;lt;/code&amp;gt; before the other apk command.&lt;br /&gt;
&lt;br /&gt;
It is a good idea to always do an &#039;&#039;&#039;update&#039;&#039;&#039; right &#039;&#039;&#039;before&#039;&#039;&#039; doing an &#039;&#039;&#039;upgrade or add&#039;&#039;&#039; command. That way the command will install the latest available packages from the repositories.&lt;br /&gt;
&lt;br /&gt;
== Add a Package ==&lt;br /&gt;
&lt;br /&gt;
Use &#039;&#039;&#039;add&#039;&#039;&#039; to install packages from a [[Repositories|&#039;&#039;&#039;repository&#039;&#039;&#039;]]. Any necessary dependencies are also installed. If you have multiple repositories, the &#039;&#039;&#039;add&#039;&#039;&#039; command installs the newest package. {{Cmd|&amp;lt;nowiki&amp;gt;# apk add openssh&lt;br /&gt;
# apk add openssh openntp vim &amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Packages from a [[Repositories#Tagged repository|tagged repository]] can be installed by adding tags to them:{{cmd|# apk add wireguard-go@testing}}&lt;br /&gt;
&lt;br /&gt;
A specific package can also be [[#Package pinning|held back or pinned]] at a specific level or version. &lt;br /&gt;
&lt;br /&gt;
=== Add a local Package ===&lt;br /&gt;
&lt;br /&gt;
To install a locally available apk package, for example if this device has no internet access but you can upload apk packages directly to it, use the &#039;&#039;&#039;--allow-untrusted&#039;&#039;&#039; flag: {{cmd|# apk add --allow-untrusted /path/to/file.apk}}&lt;br /&gt;
&lt;br /&gt;
Note that multiple packages can be given.  When installing a local package, all dependencies should also be specified.  For example:&lt;br /&gt;
&lt;br /&gt;
{{cmd|# apk add --allow-untrusted /var/tig-2.2-r0.apk /var/git-2.11.1-20.apk}}&lt;br /&gt;
&lt;br /&gt;
== Remove a Package  ==&lt;br /&gt;
&lt;br /&gt;
Use &#039;&#039;&#039;del&#039;&#039;&#039; to remove a package along with dependencies that are no longer needed.{{cmd|&amp;lt;nowiki&amp;gt;# apk del openssh&lt;br /&gt;
# apk del openssh openntp vim&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== Upgrade a Running System ==&lt;br /&gt;
{{Seealso|Upgrading Alpine Linux to a new release branch}}&lt;br /&gt;
To get the latest security upgrades and bugfixes available for all the installed packages from the [[Repositories#Release_Branches|current release branch]] of a running system, always [[#Update Package list| update the packages list]] before issuing the &#039;&#039;&#039;upgrade&#039;&#039;&#039; command as shown below:{{cmd|&amp;lt;nowiki&amp;gt;# apk update&lt;br /&gt;
# apk upgrade &amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Or, combining the same into one single command:{{cmd|# apk -U upgrade}}&lt;br /&gt;
&lt;br /&gt;
To upgrade only &#039;&#039;specific&#039;&#039; packages, use the &#039;&#039;&#039;upgrade&#039;&#039;&#039; command and specify them: {{cmd|&amp;lt;nowiki&amp;gt;# apk update&lt;br /&gt;
# apk upgrade busybox&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
When upgrading packages, the package manager may create &amp;lt;var&amp;gt;apk-new&amp;lt;/var&amp;gt; files to avoid overwriting configuration files. Once the packages are updated, remember to [[#Handling apk-new files|handle such &amp;lt;var&amp;gt;apk-new&amp;lt;var&amp;gt;]] files.&lt;br /&gt;
&lt;br /&gt;
Here is an example, showing the procedure on a system that has [[Repositories#Using testing repository|testing repository tagged]]:&lt;br /&gt;
&amp;lt;Pre&amp;gt;&lt;br /&gt;
 # apk update&lt;br /&gt;
 fetch &amp;lt;nowiki&amp;gt;https://dl-3.alpinelinux.org/alpine/v3.6/main/x86_64/APKINDEX.tar.gz&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 fetch &amp;lt;nowiki&amp;gt;https://dl-3.alpinelinux.org/alpine/v3.6/community/x86_64/APKINDEX.tar.gz&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 fetch &amp;lt;nowiki&amp;gt;https://dl-3.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 v3.6.2-191-gf98d79930f &amp;lt;nowiki&amp;gt;[https://dl-3.alpinelinux.org/alpine/v3.6/main]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 v3.6.2-190-ga5d68c47df &amp;lt;nowiki&amp;gt;[https://dl-3.alpinelinux.org/alpine/v3.6/community]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 v3.6.0-4624-g11f1b9c8ab &amp;lt;nowiki&amp;gt;[https://dl-3.alpinelinux.org/alpine/edge/testing]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 OK: 20118 distinct packages available&lt;br /&gt;
 &lt;br /&gt;
 # apk upgrade&lt;br /&gt;
 (1/2) Upgrading extra-cmake-modules@testing (5.38.0-r0 -&amp;gt; 5.39.0-r0)&lt;br /&gt;
 (2/2) Upgrading extra-cmake-modules-doc@testing (5.38.0-r0 -&amp;gt; 5.39.0-r0)&lt;br /&gt;
 Executing mdocml-apropos-1.14.1-r0.trigger&lt;br /&gt;
 OK: 2635 MiB in 803 packages&lt;br /&gt;
&amp;lt;/Pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Upgrading &amp;quot;diskless&amp;quot; and &amp;quot;data&amp;quot; disk mode installs ===&lt;br /&gt;
&lt;br /&gt;
When upgrading packages, the kernel and firmware packages are &#039;&#039;&#039;not&#039;&#039;&#039; upgraded. Upgrading them requires [[Diskless Mode#update-kernel script|&#039;&#039;&#039;update-kernel&#039;&#039;&#039;]] script.&lt;br /&gt;
&lt;br /&gt;
=== Handling apk-new files ===&lt;br /&gt;
&lt;br /&gt;
apk avoids overwriting configuration files in the {{path|/etc}} directory. Whenever apk installs a file there, but realizes a potentially edited one is already present, it will write its file to that filename with {{path|.apk-new}} appended. When upgrading, you see a message like below: {{Cmd|# apk upgrade &lt;br /&gt;
(1/2) Upgrading openrc-user-pam (0.62.2-r2 -&amp;gt; 0.62.2-r3)&lt;br /&gt;
(2/2) Upgrading openrc (0.62.2-r2 -&amp;gt; 0.62.2-r3)&lt;br /&gt;
openrc-0.62.2-r3: installing file to etc/rc.conf.apk-new&lt;br /&gt;
openrc-0.62.2-r3.post-upgrade: Executing script}} &lt;br /&gt;
&lt;br /&gt;
You may handle these by hand, or use [[Alpine configuration management scripts#update-conf|update-conf]] utility. &lt;br /&gt;
&lt;br /&gt;
* To check for changes to configurations from the new packages: {{Cmd|# update-conf -a -l}}&lt;br /&gt;
* Simply invoking it will present you with the difference between the two files, and offer various choices for dealing with the conflicts.{{Cmd|# update-conf}}&lt;br /&gt;
&lt;br /&gt;
=== Autoupdate tool for apk ===&lt;br /&gt;
&lt;br /&gt;
Alpine Linux [https://github.com/jirutka/apk-autoupdate tool for automatic updates] is available as {{pkg|apk-autoupdate}} package. It can be used with [[Cron]] to enable unattended, automatic upgrades of packages.&lt;br /&gt;
&lt;br /&gt;
== Package management in Diskless mode ==&lt;br /&gt;
&lt;br /&gt;
Besides using [[#Local Cache|Local Cache]], all package management tasks in [[Diskless Mode|diskless]] and [[Data Disk Mode|Data disk]] mode systems like adding, removing and [[#Upgrading &amp;quot;diskless&amp;quot; and &amp;quot;data&amp;quot; disk mode installs|upgrading]] packages requires running the command: {{Cmd|&#039;&#039;&#039;# [[Alpine_local_backup#Committing changes|lbu commit]]&#039;&#039;&#039;}}&lt;br /&gt;
&lt;br /&gt;
Only when the above command is run, the changes will take effect on next reboot.&lt;br /&gt;
&lt;br /&gt;
== apk query ==&lt;br /&gt;
{{Pill_clickable||v3 only|green|palegreen|right|Alpine Package Keeper#apk_v3}}&lt;br /&gt;
The query applet is a superset of [[#Information on Packages|info]], [[#Listing installed packages|list]] and [[#Search for Packages|search]] commands to interrogate the installed database and indexes for information related to packages. The command outputs human readable format in addition to json and yaml output.&lt;br /&gt;
&lt;br /&gt;
== Search for Packages ==&lt;br /&gt;
&lt;br /&gt;
{{Tip|Alpine Linux provides a specialized [https://pkgs.alpinelinux.org web interface] dedicated to looking through various available packages.}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;search&#039;&#039;&#039; command searches the repository Index files for installable packages. &lt;br /&gt;
&lt;br /&gt;
The return format is &#039;&#039;&#039;Package&#039;&#039;&#039;-&#039;&#039;&#039;Version&#039;&#039;&#039;. Omit &#039;&#039;&#039;Version&#039;&#039;&#039; for &#039;&#039;apk add &#039;&#039;&#039;Package&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
* To list all packages available, along with their descriptions: {{cmd|$ apk search -v}}&lt;br /&gt;
* To list all packages are part of the ACF system: {{cmd|$ apk search -v &#039;acf*&#039; }}&lt;br /&gt;
* To list all packages that list NTP as part of their description, use the &#039;&#039;-d&#039;&#039; or &#039;&#039;--description&#039;&#039; option: {{cmd|$ apk search -v --description &#039;NTP&#039; }}&lt;br /&gt;
* To list all packages that provide the &amp;lt;code&amp;gt;git&amp;lt;/code&amp;gt; command: {{cmd|$ apk search -v &#039;cmd:git&#039;}}&lt;br /&gt;
&lt;br /&gt;
== Information on Packages ==&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;info&#039;&#039;&#039; command provides information on the contents of packages, their dependencies, and which files belong to a package.&lt;br /&gt;
&lt;br /&gt;
For a given package, each element can be chosen (for example, &#039;&#039;-w&#039;&#039; to show just the webpage information), or all information displayed with the &#039;&#039;-a&#039;&#039; command.&lt;br /&gt;
&lt;br /&gt;
Example: {{cmd|$ apk info -a zlib}}&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;zlib-1.2.5-r1 description:&#039;&#039;&#039;&lt;br /&gt;
 A compression/decompression Library&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;&#039;zlib-1.2.5-r1 webpage:&#039;&#039;&#039;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;https://zlib.net&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;&#039;zlib-1.2.5-r1 installed size:&#039;&#039;&#039;&lt;br /&gt;
 94208&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;&#039;zlib-1.2.5-r1 depends on:&#039;&#039;&#039;&lt;br /&gt;
 libc0.9.32&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;&#039;zlib-1.2.5-r1 is required by:&#039;&#039;&#039;&lt;br /&gt;
 libcrypto1.0-1.0.0-r0&lt;br /&gt;
 apk-tools-2.0.2-r4&lt;br /&gt;
 openssh-client-5.4_p1-r2&lt;br /&gt;
 openssh-5.4_p1-r2&lt;br /&gt;
 libssl1.0-1.0.0-r0&lt;br /&gt;
 freeswitch-1.0.6-r6&lt;br /&gt;
 atop-1.25-r0 &lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;&#039;zlib-1.2.5-r1 contains:&#039;&#039;&#039;&lt;br /&gt;
 lib/libz.so.1.2.5&lt;br /&gt;
 lib/libz.so.1&lt;br /&gt;
 lib/libz.so &lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;&#039;zlib-1.2.5-r1 triggers:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As shown in the example you can determine&lt;br /&gt;
* The &#039;&#039;&#039;description&#039;&#039;&#039; of the package (&#039;&#039;-d&#039;&#039; or &#039;&#039;--description&#039;&#039;)&lt;br /&gt;
* The &#039;&#039;&#039;webpage&#039;&#039;&#039; where the application is hosted (&#039;&#039;-w&#039;&#039; or &#039;&#039;--webpage&#039;&#039;)&lt;br /&gt;
* The &#039;&#039;&#039;size&#039;&#039;&#039; the package will require once installed (in bytes) (&#039;&#039;-s&#039;&#039; or &#039;&#039;--size&#039;&#039;)&lt;br /&gt;
* What packages are required to use this one  (&#039;&#039;&#039;depends&#039;&#039;&#039;) (&#039;&#039;-R&#039;&#039; or &#039;&#039;--depends&#039;&#039;)&lt;br /&gt;
* What packages require this one to be installed (&#039;&#039;&#039;required by&#039;&#039;&#039;) (&#039;&#039;-r&#039;&#039; or &#039;&#039;--rdepends&#039;&#039;)&lt;br /&gt;
* The &#039;&#039;&#039;contents&#039;&#039;&#039; of the package, that is, which files it installs (&#039;&#039;-L&#039;&#039; or &#039;&#039;--contents&#039;&#039;)&lt;br /&gt;
* Any &#039;&#039;&#039;triggers&#039;&#039;&#039; this package sets. (&#039;&#039;-t&#039;&#039; or &#039;&#039;--triggers&#039;&#039;) Listed here are directories that are watched; if a change happens to the directory, then the trigger script is run at the end of the apk add/delete. For example, doing a depmod once after installing all packages that add kernel modules.&lt;br /&gt;
&lt;br /&gt;
===  Check file ownership ===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;info&#039;&#039;&#039; command is also useful to determine which package a file belongs to.  For example: {{cmd|$ apk info --who-owns /sbin/lbu}} &lt;br /&gt;
will display&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/sbin/lbu is owned by alpine-conf-x.x-rx&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===  Check Dependencies ===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;info&#039;&#039;&#039; command specific to check package dependency and reverse dependency is explained below:&lt;br /&gt;
&lt;br /&gt;
The option &#039;&#039;&#039;-R&#039;&#039;&#039; or &#039;&#039;&#039;--depends&#039;&#039;&#039; lists the dependencies of the package: {{Cmd|$ apk info --depends pipewire}} &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pipewire-1.0.6-r1 depends on:&lt;br /&gt;
/bin/sh&lt;br /&gt;
so:libc.musl-x86_64.so.1&lt;br /&gt;
so:libpipewire-0.3.so.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The option &#039;&#039;&#039;-r&#039;&#039;&#039; or  &#039;&#039;&#039;--rdepends&#039;&#039;&#039; lists the  reverse dependencies of the package (all other packages which depend on the package). {{Cmd|$ apk info --rdepends pipewire}}  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pipewire-1.0.6-r1 is required by:&lt;br /&gt;
xdg-desktop-portal-wlr-0.7.1-r0&lt;br /&gt;
pipewire-pulse-1.0.6-r1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Listing installed packages ===&lt;br /&gt;
&lt;br /&gt;
To list all installed packages, use: {{Cmd|$ apk info}}&lt;br /&gt;
&lt;br /&gt;
To list all installed packages in alphabetical order, with a description of each, do:{{Cmd|$ apk -vv info|sort}}&lt;br /&gt;
&lt;br /&gt;
To list packages locally installed that are not longer available in repositories, use {{Cmd|$ apk list --orphaned}}&lt;br /&gt;
&lt;br /&gt;
To browse details of installed package in a &amp;quot;TUI&amp;quot; with:{{Cmd|&amp;lt;nowiki&amp;gt;$ apk list --installed -q | fzf --preview &#039;apk query {1}&#039;&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
To list subpackages for a package, for e.g {{pkg|util-linux}}:{{Cmd|$ apk list --quiet --origin util-linux}}&lt;br /&gt;
&lt;br /&gt;
The apk tool does not have a subcommand to list manually-installed packages that do not have reverse dependencies. To get this information on a traditional system that is not using [[Alpine local backup|lbu]], try this script. Note that this approach will also list core packages like alpine-base that should not be removed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
apk info | grep -ve &#039;-doc$&#039; | sort | while read pkg&lt;br /&gt;
        do&lt;br /&gt;
                rdep=`apk info -qr &amp;quot;$pkg&amp;quot;`&lt;br /&gt;
                [ -z &amp;quot;$rdep&amp;quot; ] &amp;amp;&amp;amp; echo $pkg&lt;br /&gt;
        done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Local Cache ==&lt;br /&gt;
{{Seealso|Local APK cache}}&lt;br /&gt;
APK can keep a cache of installed packages on a local disk. HDD or [[Installation#System_Disk_Mode|sys mode]] installs don&#039;t need an apk cache, it still allows to serve packages over the network, though, e.g. to get installed by other local machines.&lt;br /&gt;
&lt;br /&gt;
{{Note|For [[Diskless Mode|diskless]] installations, [[Local APK cache|local package cache]] is needed to automatically (re-)install packages when booting.}} &lt;br /&gt;
&lt;br /&gt;
When newer packages are added to the cache over time, the older versions of the packages default to remain in the cache directory.  The older versions of packages can be removed with the &#039;&#039;&#039;clean&#039;&#039;&#039; command.  {{cmd|# apk cache clean}} Or to see what is deleted include the verbose switch: {{cmd|# apk -v cache clean}}&lt;br /&gt;
&lt;br /&gt;
If packages got deleted accidentally from the cache directory, then use the &#039;&#039;&#039;download&#039;&#039;&#039; command, {{cmd|# apk cache download}}&lt;br /&gt;
&lt;br /&gt;
The above two steps can be combined  into one with the &#039;&#039;&#039;sync&#039;&#039;&#039; command - this cleans out old packages and downloads missing packages. {{cmd|# apk cache -v sync}}&lt;br /&gt;
&lt;br /&gt;
== apk dot ==&lt;br /&gt;
&lt;br /&gt;
The dot option renders package dependencies as {{pkg|graphviz}} graphs.[[File:Seatd dependencies.png|800px|center|alt=Seatd dependencies|Seatd dependencies]] Steps to use the dot option is documented below:&lt;br /&gt;
# Save the output of apk dot option to a dot file.{{Cmd|$ apk dot seatd &amp;gt; seatd_dependencies.dot}}&lt;br /&gt;
# Use &amp;lt;code&amp;gt;dot&amp;lt;/code&amp;gt; utility from {{pkg|graphviz}} package to convert the {{Path|seatd_dependencies.dot}} file into a graphical format such as PNG, PDF, or SVG. {{Cmd|$ dot -Tpng seatd_dependencies.dot -o seatd_dependencies.png}}&lt;br /&gt;
&lt;br /&gt;
== apk fix ==&lt;br /&gt;
&lt;br /&gt;
If a package is specified, the &#039;&#039;&#039;fix&#039;&#039;&#039; subcommand applies repair strategies to correct errors in the installation of the specified packages. If no packages are specified, this command synchronizes all the installed packages with the [[#World|desired system state]].&lt;br /&gt;
&lt;br /&gt;
== apk policy ==&lt;br /&gt;
&lt;br /&gt;
To display the repository a package was installed from and will be updated from, plus any [[#Repository_pinning|tagged]] or enabled repositories where it is also offered, if any, for this architecture - its &#039;&#039;&#039;policy&#039;&#039;&#039;: {{Cmd|$ apk policy &#039;&#039;package&#039;&#039;}}&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ apk policy vlc&lt;br /&gt;
 vlc policy:&lt;br /&gt;
  2.2.6-r1:&lt;br /&gt;
    lib/apk/db/installed&lt;br /&gt;
    https://dl-3.alpinelinux.org/alpine/v3.7/community&lt;br /&gt;
  3.0.0_rc2-r1:&lt;br /&gt;
    @edgecommunity https://dl-3.alpinelinux.org/alpine/edge/community&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuration file ==&lt;br /&gt;
{{Pill_clickable||v3 only|green|palegreen|right|Alpine Package Keeper#apk_v3}}&lt;br /&gt;
Support for config file for setting  default global options has been enabled. The user defined config file {{path|/etc/config/apk}}, if present overrides the {{path|/lib/apk/config}}, intended for distribution default options. To override the default config file name, the environment variable {{ic|APK_CONFIG}} can be used.&lt;br /&gt;
&lt;br /&gt;
The configuration file contains one long option per line as shown here for reference:{{Cat|/etc/config/apk|no-cache &lt;br /&gt;
timeout 120}}&lt;br /&gt;
&lt;br /&gt;
The following aliases are available: {{ic|cache}} equals {{ic|cache yes}} and {{ic|no-cache}} equals {{ic|cache no}}.&lt;br /&gt;
&lt;br /&gt;
== Transaction logs == &lt;br /&gt;
{{Pill_clickable||v3 only|green|palegreen|right|Alpine Package Keeper#apk_v3}}&lt;br /&gt;
All apk commands which modify the database i.e write transactions are logged to {{Path|/var/log/apk.log}}. To disable the writing of the log file, the configuration option {{ic|logfile}} in the [[#Configuration file|configuration file]] must be set as follows:{{Cat|/etc/config/apk|logfile no}}&lt;br /&gt;
&lt;br /&gt;
== Advanced APK Usage ==&lt;br /&gt;
&lt;br /&gt;
=== Commandline repository options ===&lt;br /&gt;
&lt;br /&gt;
By default, the &#039;&#039;&#039;apk&#039;&#039;&#039; utility will use the system repositories for all operations. This behavior can be overridden by the following options:&lt;br /&gt;
{|&lt;br /&gt;
| --repositories-file REPOFILE&lt;br /&gt;
| Override the system repositories by specifying a repositories file.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;-X|--repository REPO&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| Specify a supplemental repository that will be used in addition to the system repositories. This option can be provided multiple times.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{cmd|# apk add cherokee --update-cache --repository https://dl-cdn.alpinelinux.org/alpine/edge/testing/ --allow-untrusted}}&lt;br /&gt;
&lt;br /&gt;
=== Package pinning ===&lt;br /&gt;
{{Seealso|Repositories#Tagged repository}}&lt;br /&gt;
&lt;br /&gt;
In certain cases, you may want to upgrade a system, but keep a specific package at a specific level or version by pinning a Package. It is possible to add &amp;quot;sticky&amp;quot; or versioned dependencies. &lt;br /&gt;
&lt;br /&gt;
{{Warning| If you desire deterministic, repeatable package installation (such as with containerized environments) via package pinning, it is important to understand your package repo&#039;s version retention rules. Always pin to a package version that is intended for your [[Repositories#Release_Branches|release branch]]. Pinning to a version on the [[Repositories#Edge|edge]] branch may stop working after the package version is revoked from the repo.}}&lt;br /&gt;
&lt;br /&gt;
For instance, to hold the &#039;&#039;asterisk&#039;&#039; package to the 1.6.2 level or lower:{{cmd|&amp;lt;nowiki&amp;gt;# apk add asterisk=1.6.0.21-r0&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
or {{cmd|# apk add &#039;asterisk&amp;lt;1.6.1&#039;}}&lt;br /&gt;
&lt;br /&gt;
To upgrade the entire system, keeping the asterisk package at the 1.6.0 or lower level:{{cmd|# apk upgrade}}&lt;br /&gt;
&lt;br /&gt;
To later upgrade to the current version, and ensure that 1.6.1 is the minimum version used. {{cmd|# apk add &#039;asterisk&amp;gt;1.6.1&#039;}}&lt;br /&gt;
&lt;br /&gt;
You can also use &amp;quot;fuzzy&amp;quot; version matching to pin the version to a major/minor release. To match any version of asterisk that starts with 1.6 (such as 1.6.0.21-r0 or 1.6.9.31-r9) use the command: {{cmd|&amp;lt;nowiki&amp;gt;# apk add &#039;asterisk=~1.6&#039;&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
==== Holding a specific package back ====&lt;br /&gt;
See [[#Package pinning|Package pinning]]&lt;br /&gt;
&lt;br /&gt;
=== Masking a specific package ===&lt;br /&gt;
&lt;br /&gt;
In case a package is pulled in yet is superfluous or unwanted, or if it were to be installed and conflict with another, one could &#039;&#039;mask&#039;&#039; it i.e. &#039;&#039;exclude it&#039;&#039; from being installed unless &#039;&#039;&#039;apk&#039;&#039;&#039; is later instructed &#039;&#039;explicitly&#039;&#039; to add it.  To mask/exclude an unwanted package hypothetically called &#039;&#039;foo&#039;&#039;:&lt;br /&gt;
{{Cmd|# apk add &#039;!foo&#039;}}&lt;br /&gt;
Beforehand, ensure that the &#039;&#039;&#039;&#039;&#039;package is not installed&#039;&#039;&#039;&#039;&#039;.  If so, &#039;&#039;uninstall it first&#039;&#039;, as otherwise, it would become an &#039;&#039;&amp;quot;orphaned package&amp;quot;&#039;&#039;:  installed, yet not being managed by the &#039;&#039;&#039;apk&#039;&#039;&#039; package keeper, which could cause an obfuscated problem(s) if it or its dependencies linger and later conflict with another package;  it could be harder to trace the issue(s) then.&lt;br /&gt;
&lt;br /&gt;
The package then appears negated in &#039;&#039;world&#039;&#039;:&lt;br /&gt;
{{Cat|/etc/apk/world|fon&lt;br /&gt;
!foo&lt;br /&gt;
fop}}&lt;br /&gt;
&lt;br /&gt;
The exclamation mark (!) is often used in logic and IT to express negation.  &lt;br /&gt;
Be sure to &#039;&#039;&#039;employ the single quotes&#039;&#039;&#039; (&#039;) so as to avoid an unintended interpretation by the shell interpreter.  Say, if the command were effected in a &#039;&#039;&#039;bash&#039;&#039;&#039; shell without using quotes, {{ic|!}} may be interpreted as &#039;history expansion&#039;, as opposed to &#039;negate installation&#039;, as intended.  The single quotes enclose the package/package versions, with or with the negation, to be handed directly to the &#039;&#039;&#039;apk&#039;&#039;&#039; tool and is then not interpreted by the shell.&lt;br /&gt;
&lt;br /&gt;
==== Unmasking a specific package ====&lt;br /&gt;
&lt;br /&gt;
Simply install it &#039;&#039;explicitly&#039;&#039; using &#039;&#039;&#039;apk&#039;&#039;&#039;.  Say:&lt;br /&gt;
{{Cmd|# apk add foo}}&lt;br /&gt;
Uninstall it afterwards, if not required.&amp;lt;/br&amp;gt;&lt;br /&gt;
Alternatively, delete the line in {{Path|/etc/apk/world}} where the package is negated.  Be sure not to leave any spurious character.&lt;br /&gt;
&lt;br /&gt;
=== Commit hooks ===&lt;br /&gt;
&lt;br /&gt;
If you&#039;d like to trigger an action or run a certain script on every commit made by apk, there&#039;s a built-in method for that. On every commit apk looks for executables located in the &amp;quot;/etc/apk/commit_hooks.d/&amp;quot; directory, and executes them both before and after the commit. To provide some way to selectively run hooks either before or after a change is commited by apk, the scripts are called with &amp;quot;pre-commit&amp;quot; or &amp;quot;post-commit&amp;quot; as argument 1.&lt;br /&gt;
This is an example of a hook to do different things before and after commit:&lt;br /&gt;
&lt;br /&gt;
{{cmd|1=#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
if [ &amp;quot;$1&amp;quot; = &amp;quot;pre-commit&amp;quot; ]; then&lt;br /&gt;
    do_something&lt;br /&gt;
&lt;br /&gt;
elif [ &amp;quot;$1&amp;quot; = &amp;quot;post-commit&amp;quot; ]; then&lt;br /&gt;
    do_something_else&lt;br /&gt;
fi}}&lt;br /&gt;
&lt;br /&gt;
Commit hooks are $PATH-aware, so for the sake of security it&#039;s recommended to specify absolute paths to executables.&lt;br /&gt;
&lt;br /&gt;
==  Rosetta Stone ==&lt;br /&gt;
	&lt;br /&gt;
[[Comparison with other distros#Comparison chart/Rosetta Stone|Rosetta Stone]] or a Comparison chart shows how standard things related to package management are done in Alpine Linux compared to other popular distributions. &lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== ERROR: unable to select packages ===&lt;br /&gt;
&lt;br /&gt;
This error typically indicates that the package manager cannot find a suitable package to install. On issuing a command to add a package for eg: {{ic|# apk add labwc}}, you may receive below error message:&lt;br /&gt;
&amp;lt;Pre&amp;gt;&lt;br /&gt;
ERROR: unable to select packages:&lt;br /&gt;
 labwc (no such package):&lt;br /&gt;
 required by: world[labwc]&lt;br /&gt;
&amp;lt;/Pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above error indicates {{pkg|labwc}} does not exist in the [[Repositories|repositories]] currently configured in {{Path|/etc/apk/repositories}}. Ensure that &amp;lt;code&amp;gt;community&amp;lt;/code&amp;gt; repository is [[Repositories#Managing_repositories|enabled]], as by default only &amp;lt;code&amp;gt;main&amp;lt;/code&amp;gt; repository is enabled. You may also want to check [https://pkgs.alpinelinux.org/packages packages database] to identify the correct package name and the [[Repositories|repository]] in which the package is available.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Pre&amp;gt;&lt;br /&gt;
ERROR: unable to select packages:&lt;br /&gt;
  so:libxml2.so.2 (no such package):&lt;br /&gt;
    required by: llvm19-libs-19.1.7-r1[so:libxml2.so.2]&lt;br /&gt;
&amp;lt;/Pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above error message may occur in [[Edge|Edge]] branch in certain other situations, even if all the necessary [[Repositories|repositories]] are enabled. Temporary non-availability of the packages from the repositories can occur, when software packages are [https://build.alpinelinux.org/ rebuilt]. You may want to wait for some time to try again.&lt;br /&gt;
&lt;br /&gt;
=== ERROR: unsatisfiable constraints === &lt;br /&gt;
&lt;br /&gt;
This error signifies a dependency conflict. It means that the package you&#039;re trying to install has dependencies that cannot be simultaneously satisfied within the current package repository. &lt;br /&gt;
&lt;br /&gt;
You may want to check [https://pkgs.alpinelinux.org/packages packages database] to identify the correct package name and version and the [[Repositories|repository]] in which the package is available. &lt;br /&gt;
&lt;br /&gt;
=== WARNING: This apk-tools is OLD! ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;apk update&#039;&#039;&#039;, &#039;&#039;&#039;apk upgrade&#039;&#039;&#039; or &#039;&#039;&#039;apk add&#039;&#039;&#039; may report the following: &lt;br /&gt;
 WARNING: This apk-tools is OLD! Some packages might not function properly&lt;br /&gt;
&lt;br /&gt;
This may happen if you are running Alpine Linux stable version with a [[Repositories#Edge|Edge]] package(s) also installed.  One resolution is to consider upgrading {{pkg|apk-tools}}. If edge/main is already [[Repositories#Tagged repository|tagged]] as &#039;&#039;@edgemain&#039;&#039; in your {{Path|/etc/apk/repositories}} file, then try: {{Cmd|# apk add --upgrade apk-tools@edgemain}}&lt;br /&gt;
&lt;br /&gt;
=== ERROR:  UNTRUSTED signature ===&lt;br /&gt;
&lt;br /&gt;
This happens when the release version changes. You need to update the local apk keys.&lt;br /&gt;
&lt;br /&gt;
If you have already updated your repositories, allow them to update without the trusted key:&lt;br /&gt;
{{Cmd|# apk update --allow-untrusted}}&lt;br /&gt;
&lt;br /&gt;
Then install the keys upgrade:&lt;br /&gt;
{{Cmd|# apk fix --upgrade --allow-untrusted alpine-keys}}&lt;br /&gt;
&lt;br /&gt;
Now updates and upgrades should proceed normally.&lt;br /&gt;
&lt;br /&gt;
Alternative, the updated alpine-keys package may be obtained, verified, installed directly, as covered earlier, prior to a repository update.&lt;br /&gt;
&lt;br /&gt;
=== ERROR: unable to select packages: breaks: world ===&lt;br /&gt;
&lt;br /&gt;
{{Cmd|&amp;lt;nowiki&amp;gt;# apk add vim&lt;br /&gt;
ERROR: unable to select packages:&lt;br /&gt;
  vim-common-9.1.1566-r0:&lt;br /&gt;
    breaks: world[!vim-common]&lt;br /&gt;
    satisfies: vim-9.1.1566-r0[vim-common=9.1.1566-r0]&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
When issuing package management commands, the above error will arise, if the command cannot be solved without breaking the [[#World|World]]. &amp;lt;!-- This probaly has to be added to it&#039;s own section for package exclusion&lt;br /&gt;
If the {{Path|/etc/apk/world}} file has a constraint {{ic|!vim-common}}, then issuing the command to install {{pkg|vim}} will fail, as {{pkg|vim}} has a dependency on {{pkg|vim-common}} as shown [[#ERROR: unable to select packages: breaks: world|below]]. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== World updated but the following packages are not removed === &lt;br /&gt;
&lt;br /&gt;
On issuing a command to remove a package for eg: {{ic|# apk del btrfs-progs}}, you may receive below error message:&lt;br /&gt;
&amp;lt;Pre&amp;gt;&lt;br /&gt;
World updated, but the following packages are not removed due to:&lt;br /&gt;
  btrfs-progs: btrbk&lt;br /&gt;
&amp;lt;/Pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, the removal of package {{Pkg|btrfs-progs}} affects another package {{Pkg|btrbk}} in the constraints file [[#World|/etc/apk/world]]. So the package {{Pkg|btrfs-progs}} will be removed from the constraints file, but not removed from the system. The {{Pkg|btrfs-progs}} will remain in the system, until the constraint i.e {{Pkg|btrbk}} which depends on {{Pkg|btrfs-progs}} is removed. &lt;br /&gt;
&lt;br /&gt;
If {{ic|apk del btrbk}} is issued, the package {{Pkg|btrfs-progs}} will be automatically removed from system as the constraint {{Pkg|btrfs-progs}} does not exist in {{Path|/etc/apk/world}}.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [https://git.alpinelinux.org/apk-tools/tree/doc/apk.8.scd Manual for apk(8)]&lt;br /&gt;
* [https://git.alpinelinux.org/apk-tools/tree/doc/apk-world.5.scd Manual for apk-world(5)]&lt;br /&gt;
* [https://pkgs.alpinelinux.org Official web interface for packages] &lt;br /&gt;
* [[Software management]]&lt;br /&gt;
* [https://ariadne.space/2021/04/24/why-apktools-is-different-than.html  Why apk-tools is different than other package managers]&lt;br /&gt;
* [https://ariadne.space/2021/10/30/spelunking-through-the-apktools-dependency.html spelunking through the apk-tools dependency solver]&lt;br /&gt;
* [https://whynothugo.nl/journal/2023/02/18/in-praise-of-alpine-and-apk/ In praise of alpine and apk]&lt;br /&gt;
* [https://www.cyberciti.biz/faq/10-alpine-linux-apk-command-examples/ 10 Alpine Linux apk Command Examples]&lt;br /&gt;
[[Category:Package Manager]]&lt;br /&gt;
[[Category:System_Administration]]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Create_Alpine_Linux_PV_DomU&amp;diff=31772</id>
		<title>Create Alpine Linux PV DomU</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Create_Alpine_Linux_PV_DomU&amp;diff=31772"/>
		<updated>2025-12-09T22:32:57Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: /* Install the guest */ fix path of initramfs&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Obtain a copy of Alpine Linux ==&lt;br /&gt;
&lt;br /&gt;
To create an Alpine Linux paravirtualized (PV) DomU you&#039;ll need an Alpine Linux iso.&lt;br /&gt;
&lt;br /&gt;
Download the latest alpine-virt iso from https://alpinelinux.org/downloads/&lt;br /&gt;
&lt;br /&gt;
In this example we&#039;ll use {{path|/data/}} for the download and disk images.&lt;br /&gt;
&lt;br /&gt;
==Mount the ISO image ==&lt;br /&gt;
&lt;br /&gt;
Next, mount the iso so you can read the kernel and initramfs:&lt;br /&gt;
&lt;br /&gt;
{{cmd | mount -t iso9660 -o loop /data/alpine-virt-{{AlpineLatest}}-x86_64.iso  /media/cdrom }}&lt;br /&gt;
&lt;br /&gt;
Now you have the kernel in {{path|/media/cdrom/boot/vmlinuz-virt}} and initramfs in {{path|/media/cdrom/boot/initramfs-virt}}.&lt;br /&gt;
&lt;br /&gt;
Alternatively you can use {{path|uniso}} or {{path|7z}} to extract the content to a temporary area.&lt;br /&gt;
&lt;br /&gt;
== Create the disk image ==&lt;br /&gt;
Now you need to create an empty file to be used as the hard drive of the DomU (in this example we are using a 3GB disk):&lt;br /&gt;
&lt;br /&gt;
{{cmd | &amp;lt;nowiki&amp;gt;dd if=/dev/zero of=/data/a1.img bs=1M count=3000&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Alternatively, if an LVM volume group (e.g. vg1) with free space is available on dom0, create a logical volume for Alpine:&lt;br /&gt;
&lt;br /&gt;
{{cmd | &amp;lt;nowiki&amp;gt;sudo lvcreate -n alpine -L 10g vg1&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== Create a DomU config file that boots the ISO image ==&lt;br /&gt;
Next, create a basic DomU configuration file, so you can launch the pv guest iso (save it where you like, although the most common place is {{path|/etc/xen/}}).&lt;br /&gt;
&lt;br /&gt;
{{cat | /etc/xen/a1.cfg | &amp;lt;nowiki&amp;gt;# Alpine Linux PV DomU&lt;br /&gt;
&lt;br /&gt;
# Kernel paths for install&lt;br /&gt;
kernel = &amp;quot;/media/cdrom/boot/vmlinuz-virt&amp;quot;&lt;br /&gt;
ramdisk = &amp;quot;/media/cdrom/boot/initramfs-virt&amp;quot;&lt;br /&gt;
extra=&amp;quot;modules=loop,squashfs console=hvc0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Path to HDD and iso file&lt;br /&gt;
disk = [&lt;br /&gt;
        &#039;format=raw, vdev=xvda, access=w, target=/data/a1.img&#039;,&lt;br /&gt;
        &#039;format=raw, vdev=xvdc, access=r, devtype=cdrom, target=/data/alpine-virt-&amp;lt;/nowiki&amp;gt;{{AlpineLatest}}&amp;lt;nowiki&amp;gt;-x86_64.iso&#039;&lt;br /&gt;
       ]&lt;br /&gt;
&lt;br /&gt;
# Network configuration&lt;br /&gt;
vif = [&#039;bridge=br0&#039;]&lt;br /&gt;
&lt;br /&gt;
# DomU settings&lt;br /&gt;
memory = 512&lt;br /&gt;
name = &amp;quot;alpine-a1&amp;quot;&lt;br /&gt;
vcpus = 1&lt;br /&gt;
maxvcpus = 1&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
If using LVM, replace {{path|/data/a1.img}} with {{path|/dev/vg1/alpine}} in the disk specification. &lt;br /&gt;
&lt;br /&gt;
== Install the guest ==&lt;br /&gt;
Now that you have the necessary files, you can start the DomU to proceed with the install:&lt;br /&gt;
&lt;br /&gt;
{{cmd|xl create -f /etc/xen/a1.cfg  -c}}&lt;br /&gt;
&lt;br /&gt;
Log into the system with user &amp;quot;root&amp;quot; and no password.&lt;br /&gt;
&lt;br /&gt;
After configuring the basic system, you will be asked where would you like to install Alpine. Choose xvda and sys.&lt;br /&gt;
&lt;br /&gt;
That will create three partitions on your disk. xvda1 for {{path|/boot}}, xvda2 for swap and xvda3 for {{path|/}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available disks are:&lt;br /&gt;
  xvda	(3.1 GB  )&lt;br /&gt;
Which disk(s) would you like to use? (or &#039;?&#039; for help or &#039;none&#039;) [none] xvda&lt;br /&gt;
The following disk is selected:&lt;br /&gt;
  xvda	(3.1 GB  )&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039; or &#039;?&#039; for help) [?] sys&lt;br /&gt;
WARNING: The following disk(s) will be erased:&lt;br /&gt;
  xvda	(3.1 GB  )&lt;br /&gt;
WARNING: Erase the above disk(s) and continue? [y/N]: y&lt;br /&gt;
Initializing partitions on /dev/xvda...&lt;br /&gt;
Creating file systems...&lt;br /&gt;
Installing system on /dev/xvda3:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Installation is complete. Please reboot.&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you reboot, the pv bootloader pvgrub, will look to {{path|/boot/grub/grub.cfg}} for its menu, so create that file first. &lt;br /&gt;
&lt;br /&gt;
Mount the boot partition and create a {{path|grub/grub.cfg}} file for pvgrub. (Note that grub.cfg is for pvgrub2 which replaced pvgrub1 and its menu.lst beginning in 2013.)&lt;br /&gt;
&lt;br /&gt;
{{cmd |&amp;lt;nowiki&amp;gt;mount /dev/xvda1 /mnt&lt;br /&gt;
mkdir /mnt/grub&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Install a basic text editor like {{pkg|nano}} or {{pkg|vim}}:&amp;lt;br/&amp;gt;&lt;br /&gt;
{{cmd | apk add nano}}&lt;br /&gt;
&lt;br /&gt;
If using nano, enter:&amp;lt;br/&amp;gt;&lt;br /&gt;
{{cmd | nano /mnt/grub/grub.cfg}}&lt;br /&gt;
&lt;br /&gt;
Then add the following to create a basic grub2 configuration file:&lt;br /&gt;
{{cat | /mnt/grub/grub.cfg |&amp;lt;nowiki&amp;gt;menuentry &#039;alpine-xen&#039; {&lt;br /&gt;
    set root=(xen/xvda,msdos1)&lt;br /&gt;
    linux /boot/vmlinuz-virt root=/dev/xvda3 modules=ext4 console=hvc0&lt;br /&gt;
    initrd /boot/initramfs-virt&lt;br /&gt;
 }&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Finally, Ctrl-S to save, Ctrl-X to exit nano.&lt;br /&gt;
&lt;br /&gt;
Unmount and power off.&lt;br /&gt;
{{cmd |umount /mnt&lt;br /&gt;
poweroff}}&lt;br /&gt;
&lt;br /&gt;
== Adjust the domU config file to boot from fresh install ==&lt;br /&gt;
&lt;br /&gt;
In your Dom0, edit your DomU config file to boot with pvgrub.&lt;br /&gt;
&lt;br /&gt;
{{cat | /etc/xen/a1.cfg |&amp;lt;nowiki&amp;gt;# Alpine Linux PV DomU&lt;br /&gt;
&lt;br /&gt;
kernel = &amp;quot;/usr/lib/grub-xen/grub-x86_64-xen.bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Path to HDD and iso file&lt;br /&gt;
disk = [&lt;br /&gt;
        &#039;format=raw, vdev=xvda, access=w, target=/data/a1.img&#039;&lt;br /&gt;
       ]&lt;br /&gt;
&lt;br /&gt;
# Network configuration&lt;br /&gt;
vif = [&#039;bridge=br0&#039;]&lt;br /&gt;
&lt;br /&gt;
# DomU settings&lt;br /&gt;
memory = 512&lt;br /&gt;
name = &amp;quot;alpine-a1&amp;quot;&lt;br /&gt;
vcpus = 1&lt;br /&gt;
maxvcpus = 1&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Make sure that grub-xenhost is installed.&lt;br /&gt;
{{cmd | apk add grub-xenhost}}&lt;br /&gt;
&lt;br /&gt;
Remember to unmount the loopback iso image.&lt;br /&gt;
{{cmd | umount /media/cdrom}}&lt;br /&gt;
&lt;br /&gt;
The next time you boot, you&#039;ll be presented with the grub boot menu, and your VM will boot.&lt;br /&gt;
&lt;br /&gt;
== Using Legacy pvgrub ==&lt;br /&gt;
&lt;br /&gt;
To use Legacy pvgrub you need to use a {{path|/boot/grub/menu.lst}} instead of {{path|/boot/grub/grub.cfg}}.&lt;br /&gt;
&lt;br /&gt;
{{cat | /etc/xen/a1.cfg |&amp;lt;nowiki&amp;gt;default 0&lt;br /&gt;
timeout 2&lt;br /&gt;
title alpine-xen-pv&lt;br /&gt;
root (hd0,0)&lt;br /&gt;
kernel /boot/vmlinuz-virt root=/dev/xvda3 modules=ext4 console=hvc0&lt;br /&gt;
initrd /boot/initramfs-virt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
And in {{path|/etc/xen/a1.cfg}} you need to change the &#039;kernel&#039; loader to&lt;br /&gt;
{{cat | /etc/xen/a1.cfg |&amp;lt;nowiki&amp;gt;...&lt;br /&gt;
kernel = &amp;quot;/usr/lib/xen/boot/pv-grub-x86_64.gz&amp;quot;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [https://www.linkedin.com/pulse/setting-up-alpine-linux-370-domu-vm-xenserver-72-ali-poursamadi Setting up Alpine Linux 3.7.0 as a domU VM on XenServer 7.2]&lt;br /&gt;
&lt;br /&gt;
[[Category:Virtualization]]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Git&amp;diff=31144</id>
		<title>Git</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Git&amp;diff=31144"/>
		<updated>2025-10-05T13:02:52Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: fix broken link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document describes how to use [https://git-scm.com git] for Alpine Linux development. If you just want to browse all the available Alpine git repositories, [https://git.alpinelinux.org git.alpinelinux.org] shows them all.&lt;br /&gt;
&lt;br /&gt;
If you are new to git and need quick reference, check [[#Git Basics|Git Basics]]. For more info, refer [[#Further reading|further reading]] section.&lt;br /&gt;
&lt;br /&gt;
== General git workflow ==&lt;br /&gt;
&lt;br /&gt;
There are two ways to work with the Alpine git repository. &lt;br /&gt;
* without write access.&lt;br /&gt;
* with write access.&lt;br /&gt;
&lt;br /&gt;
Most contributors to Alpine linux will be working [[#Forking a repository|with a forked repository]]. Only [https://docs.alpinelinux.org/governance/0.1b/Teams/developers.html Alpine Developers] have write access. &lt;br /&gt;
&lt;br /&gt;
Follow this [[Creating_an_Alpine_package#Overview|overview]] to [[Creating an Alpine package|create a package]] or [[Creating patches|submit a patch]] even without write access.&lt;br /&gt;
&lt;br /&gt;
=== Configure your global git config ===&lt;br /&gt;
{{:Include:Git configuration}}&lt;br /&gt;
If you want to use git with colored output use:{{Cmd|git config --global color.ui true&lt;br /&gt;
git config --global core.pager more}}&lt;br /&gt;
{{Tip|If you want to use git with proxy server:{{Cmd|git config --global http.proxy &amp;lt;nowiki&amp;gt;http://proxy_ip:proxy_port&amp;lt;/nowiki&amp;gt;}}}}&lt;br /&gt;
&lt;br /&gt;
=== Creating a gitlab account ===&lt;br /&gt;
&lt;br /&gt;
Visit [https://gitlab.alpinelinux.org Alpine gitlab] to create a gitlab account.&lt;br /&gt;
&lt;br /&gt;
=== Forking a repository ===&lt;br /&gt;
&lt;br /&gt;
To [[Creating an Alpine package|create an Alpine package]] or [[Creating patches|submit a patch]] without write access to the Alpine repository, you need to fork the desired repository. [[#Creating a gitlab account|Create a gitlab account]], if not already done.&lt;br /&gt;
&lt;br /&gt;
Create a fork for &#039;&#039;&#039;aports&#039;&#039;&#039; at https://gitlab.alpinelinux.org/alpine/aports. Refer [https://docs.gitlab.com/ee/user/project/repository/forking_workflow.html#creating-a-fork Gitlab docs] if you&#039;re having problems with that. &lt;br /&gt;
&lt;br /&gt;
Once created, the fork resides on the Gitlab server, until you [[#Cloning your forked repository|clone your fork]].&lt;br /&gt;
&lt;br /&gt;
=== Cloning your forked repository ===&lt;br /&gt;
&lt;br /&gt;
You can clone your [[#Forking a repository|forked]] repository, by replacing $USER with the nickname of your Gitlab account and $REPO in the git command: {{Cmd|$ git clone &amp;lt;nowiki&amp;gt;git@gitlab.alpinelinux.org:$USER/$REPO.git&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Before you clone the &#039;&#039;&#039;aports&#039;&#039;&#039; repository, switch to the directory you want to have the {{Path|aports/}} directory. To clone your [[#Forking a repository|forked]] &#039;&#039;&#039;aports&#039;&#039;&#039; repository with only the last 3 revisions, replace $USER and issue the command: {{Cmd|$ git clone &amp;lt;nowiki&amp;gt;git@gitlab.alpinelinux.org:$USER/aports.git&amp;lt;/nowiki&amp;gt; --depth 3}}&lt;br /&gt;
&lt;br /&gt;
To see the full log of the trunk, use the command below: {{Cmd|git log}}&lt;br /&gt;
&lt;br /&gt;
{{Tip|To update your old clone, see [[Include:Git_Basics#Rebasing_against_upstream_master|rebasing]].}}&lt;br /&gt;
&lt;br /&gt;
=== Cloning aports repository ===&lt;br /&gt;
&lt;br /&gt;
You can also clone the Alpine Linux aports repository instead of [[#Cloning your forked repository|forked repository]] using the command: {{Cmd|$ git clone &amp;lt;nowiki&amp;gt;git://git.alpinelinux.org/aports.git&amp;lt;/nowiki&amp;gt;}} &lt;br /&gt;
&lt;br /&gt;
Unless you have necessary permissions, you will not be able to push your changes back to the repository.&lt;br /&gt;
&lt;br /&gt;
== Git Basics ==&lt;br /&gt;
{{:Include:Git Basics}}&lt;br /&gt;
&lt;br /&gt;
== Quality assurance ==&lt;br /&gt;
{{:Development using git:Quality assurance}}&lt;br /&gt;
&lt;br /&gt;
== Further reading ==&lt;br /&gt;
{{:Development_using_git:Documentation}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Creating_an_Alpine_package|Submit new packages]]&lt;br /&gt;
* [[Creating an Alpine package]]&lt;br /&gt;
* [[Package Maintainers]]&lt;br /&gt;
* [[Development_using_git:Developer_repositories|Developer repositories]]&lt;br /&gt;
* [[Development_using_git:Cgit| Using Cgit]]&lt;br /&gt;
* [[Gitolite]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Git]]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Include:Git_configuration&amp;diff=31143</id>
		<title>Include:Git configuration</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Include:Git_configuration&amp;diff=31143"/>
		<updated>2025-10-05T12:59:25Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: The name doesn&amp;#039;t need to be a full name and some people might be scared when making it seem like it&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Configure your name and email address in git. This name and email address will show up in all your commits: {{Cmd|$ git config --global user.name &amp;quot;Your Name&amp;quot;&lt;br /&gt;
$ git config --global user.email &amp;quot;your@email.address&amp;quot;}}&lt;br /&gt;
&lt;br /&gt;
Using &amp;lt;tt&amp;gt;git config&amp;lt;/tt&amp;gt; without &amp;lt;tt&amp;gt;--global&amp;lt;/tt&amp;gt; let you configure other details for a specific git repository.&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Git&amp;diff=31142</id>
		<title>Git</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Git&amp;diff=31142"/>
		<updated>2025-10-05T12:55:44Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: Not having write access is the standard for almost all contributors, not only new ones&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document describes how to use [https://git-scm.com git] for Alpine Linux development. If you just want to browse all the available Alpine git repositories, [https://git.alpinelinux.org git.alpinelinux.org] shows them all.&lt;br /&gt;
&lt;br /&gt;
If you are new to git and need quick reference, check [[#Git Basics|Git Basics]]. For more info, refer [[#Further reading|further reading]] section.&lt;br /&gt;
&lt;br /&gt;
== General git workflow ==&lt;br /&gt;
&lt;br /&gt;
There are two ways to work with the Alpine git repository. &lt;br /&gt;
* without write access.&lt;br /&gt;
* with write access.&lt;br /&gt;
&lt;br /&gt;
Most contributors to Alpine linux will be working [[#Submitting work without write access|without write access]]. Only [https://docs.alpinelinux.org/governance/0.1b/Teams/developers.html Alpine Developers] have write access. &lt;br /&gt;
&lt;br /&gt;
Follow this [[Creating_an_Alpine_package#Overview|overview]] to [[Creating an Alpine package|create a package]] or [[Creating patches|submit a patch]] even without write access.&lt;br /&gt;
&lt;br /&gt;
=== Configure your global git config ===&lt;br /&gt;
{{:Include:Git configuration}}&lt;br /&gt;
If you want to use git with colored output use:{{Cmd|git config --global color.ui true&lt;br /&gt;
git config --global core.pager more}}&lt;br /&gt;
{{Tip|If you want to use git with proxy server:{{Cmd|git config --global http.proxy &amp;lt;nowiki&amp;gt;http://proxy_ip:proxy_port&amp;lt;/nowiki&amp;gt;}}}}&lt;br /&gt;
&lt;br /&gt;
=== Creating a gitlab account ===&lt;br /&gt;
&lt;br /&gt;
Visit [https://gitlab.alpinelinux.org Alpine gitlab] to create a gitlab account.&lt;br /&gt;
&lt;br /&gt;
=== Forking a repository ===&lt;br /&gt;
&lt;br /&gt;
To [[Creating an Alpine package|create an Alpine package]] or [[Creating patches|submit a patch]] without write access to the Alpine repository, you need to fork the desired repository. [[#Creating a gitlab account|Create a gitlab account]], if not already done.&lt;br /&gt;
&lt;br /&gt;
Create a fork for &#039;&#039;&#039;aports&#039;&#039;&#039; at https://gitlab.alpinelinux.org/alpine/aports. Refer [https://docs.gitlab.com/ee/user/project/repository/forking_workflow.html#creating-a-fork Gitlab docs] if you&#039;re having problems with that. &lt;br /&gt;
&lt;br /&gt;
Once created, the fork resides on the Gitlab server, until you [[#Cloning your forked repository|clone your fork]].&lt;br /&gt;
&lt;br /&gt;
=== Cloning your forked repository ===&lt;br /&gt;
&lt;br /&gt;
You can clone your [[#Forking a repository|forked]] repository, by replacing $USER with the nickname of your Gitlab account and $REPO in the git command: {{Cmd|$ git clone &amp;lt;nowiki&amp;gt;git@gitlab.alpinelinux.org:$USER/$REPO.git&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Before you clone the &#039;&#039;&#039;aports&#039;&#039;&#039; repository, switch to the directory you want to have the {{Path|aports/}} directory. To clone your [[#Forking a repository|forked]] &#039;&#039;&#039;aports&#039;&#039;&#039; repository with only the last 3 revisions, replace $USER and issue the command: {{Cmd|$ git clone &amp;lt;nowiki&amp;gt;git@gitlab.alpinelinux.org:$USER/aports.git&amp;lt;/nowiki&amp;gt; --depth 3}}&lt;br /&gt;
&lt;br /&gt;
To see the full log of the trunk, use the command below: {{Cmd|git log}}&lt;br /&gt;
&lt;br /&gt;
{{Tip|To update your old clone, see [[Include:Git_Basics#Rebasing_against_upstream_master|rebasing]].}}&lt;br /&gt;
&lt;br /&gt;
=== Cloning aports repository ===&lt;br /&gt;
&lt;br /&gt;
You can also clone the Alpine Linux aports repository instead of [[#Cloning your forked repository|forked repository]] using the command: {{Cmd|$ git clone &amp;lt;nowiki&amp;gt;git://git.alpinelinux.org/aports.git&amp;lt;/nowiki&amp;gt;}} &lt;br /&gt;
&lt;br /&gt;
Unless you have necessary permissions, you will not be able to push your changes back to the repository.&lt;br /&gt;
&lt;br /&gt;
== Git Basics ==&lt;br /&gt;
{{:Include:Git Basics}}&lt;br /&gt;
&lt;br /&gt;
== Quality assurance ==&lt;br /&gt;
{{:Development using git:Quality assurance}}&lt;br /&gt;
&lt;br /&gt;
== Further reading ==&lt;br /&gt;
{{:Development_using_git:Documentation}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Creating_an_Alpine_package|Submit new packages]]&lt;br /&gt;
* [[Creating an Alpine package]]&lt;br /&gt;
* [[Package Maintainers]]&lt;br /&gt;
* [[Development_using_git:Developer_repositories|Developer repositories]]&lt;br /&gt;
* [[Development_using_git:Cgit| Using Cgit]]&lt;br /&gt;
* [[Gitolite]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Git]]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=APKBUILD_examples:Rust&amp;diff=31141</id>
		<title>APKBUILD examples:Rust</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=APKBUILD_examples:Rust&amp;diff=31141"/>
		<updated>2025-10-05T12:51:44Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: use CHOST instead of CTARGET like in the latest newapkbuild&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Considerations ==&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;cargo-auditable&amp;lt;/code&amp;gt; to encode dependency information into binaries.&lt;br /&gt;
&lt;br /&gt;
Most Rust projects use &amp;lt;code&amp;gt;cargo&amp;lt;/code&amp;gt; to fetch Rust library dependencies. The current convention it to use &amp;lt;code&amp;gt;options=&amp;quot;net&amp;quot;&amp;lt;/code&amp;gt; fetch these during the &amp;lt;code&amp;gt;prepare()&amp;lt;/code&amp;gt; phase. Use the &amp;lt;code&amp;gt;--locked&amp;lt;/code&amp;gt; flag to ensure that the exact same versions of dependencies are fetched on each rebuild. If a package is missing a lockfile, include one with the aport and attempt to recommend upstream to include one.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Basic example ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
maintainer=&amp;quot;Hugo Osvaldo Barrera &amp;lt;hugo@whynothugo.nl&amp;gt;&amp;quot;&lt;br /&gt;
pkgname=harper&lt;br /&gt;
pkgver=0.59.0&lt;br /&gt;
pkgrel=0&lt;br /&gt;
pkgdesc=&amp;quot;Grammar checker that respects your privacy&amp;quot;&lt;br /&gt;
url=&amp;quot;https://github.com/elijah-potter/harper&amp;quot;&lt;br /&gt;
arch=&amp;quot;all&amp;quot;&lt;br /&gt;
license=&amp;quot;Apache-2.0&amp;quot;&lt;br /&gt;
makedepends=&amp;quot;cargo-auditable rust&amp;quot;&lt;br /&gt;
source=&amp;quot;harper-$pkgver.tar.gz::https://github.com/elijah-potter/harper/archive/v$pkgver/harper-$pkgver.tar.gz&amp;quot;&lt;br /&gt;
options=&amp;quot;net&amp;quot;&lt;br /&gt;
&lt;br /&gt;
prepare() {&lt;br /&gt;
	default_prepare&lt;br /&gt;
&lt;br /&gt;
	cargo fetch --target=&amp;quot;$CHOST&amp;quot; --locked&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
build() {&lt;br /&gt;
	cargo auditable build --release --frozen&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
check() {&lt;br /&gt;
	cargo test --frozen&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
package() {&lt;br /&gt;
	install -Dm755 target/release/harper-cli &amp;quot;$pkgdir&amp;quot;/usr/bin/harper-cli&lt;br /&gt;
	install -Dm755 target/release/harper-ls &amp;quot;$pkgdir&amp;quot;/usr/bin/harper-ls&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sha512sums=&amp;quot;&lt;br /&gt;
e5be781b33ba624e2447464a51ff8c0b565a42d7bf957c2fd6655f4bf312211fcf669bbb152b62a57494f89fd7fbee7eda37bbbaf7a61c5d4c8c9684ffe687bd  harper-0.48.0.tar.gz&lt;br /&gt;
&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[APKBUILD examples]]&lt;br /&gt;
* [[Creating an Alpine package]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]] [[Category:Rust]]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Eudev&amp;diff=30876</id>
		<title>Eudev</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Eudev&amp;diff=30876"/>
		<updated>2025-09-06T17:52:05Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: Explicitly mention that a different device manager should be setup first&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:eudev}}&lt;br /&gt;
[https://github.com/eudev-project/eudev eudev] is a [[Device_Manager|device manager]] that provides a drop-in replacement for systemd udev. It is therefore recommended for full blown desktop environments.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
The easy way to setup eudev is through the [[#Setup_script|setup script]]. Only advanced users are recommended to do [[#Manual installation|manual installation]].&lt;br /&gt;
&lt;br /&gt;
=== Setup script ===&lt;br /&gt;
{{:Include:Setup Device Manager}}&lt;br /&gt;
&lt;br /&gt;
No need for further configuration steps as the above script takes care of all necessary changes.&lt;br /&gt;
&lt;br /&gt;
=== Manual installation ===&lt;br /&gt;
&lt;br /&gt;
You need to install {{pkg|eudev}} itself. {{cmd|# apk add {{pkg|eudev}} {{pkg|udev-init-scripts}}}}&lt;br /&gt;
&lt;br /&gt;
Proceed to [[#Configuration|Configuration]] step to configure eudev.&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
=== Service management ===&lt;br /&gt;
&lt;br /&gt;
{{Note| If you already have a [[Device_Manager|device manager]] installed, you need to disable it before you enable eudev, to avoid conflicts during next reboot.}} &lt;br /&gt;
&lt;br /&gt;
To use eudev as device manager enable the following services. &lt;br /&gt;
&lt;br /&gt;
{{cmd|&amp;lt;nowiki&amp;gt;# rc-update add udev sysinit&lt;br /&gt;
# rc-update add udev-trigger sysinit&lt;br /&gt;
# rc-update add udev-settle sysinit&lt;br /&gt;
# rc-update add udev-postmount default&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
If you are not running in a [[Chroot]], you will also want to start eudev. {{Note| If you already have a [[Device_Manager|device manager]] installed, you need to stop it before you start eudev.}} &lt;br /&gt;
&lt;br /&gt;
{{cmd|&amp;lt;nowiki&amp;gt;# rc-service udev start&lt;br /&gt;
# rc-service udev-trigger start&lt;br /&gt;
# rc-service udev-settle start&lt;br /&gt;
# rc-service udev-postmount start &amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Whenever udev rules are changed, for the changes to take immediate effect, use the command:{{Cmd|&amp;lt;nowiki&amp;gt;# udevadm control --reload-rules&lt;br /&gt;
# udevadm trigger&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
A reboot is usually necessary for the rule changes to fully take effect.&lt;br /&gt;
&lt;br /&gt;
=== Predictable network interface names ===&lt;br /&gt;
&lt;br /&gt;
eudev can automatically assign predictable, stable network [[Configure Networking#Interface configuration|interface names]]  for all local Ethernet, WLAN and WWAN interfaces instead of the traditional interface naming scheme (&amp;quot;eth0&amp;quot;, &amp;quot;eth1&amp;quot;, &amp;quot;wlan0&amp;quot;, ...). &lt;br /&gt;
&lt;br /&gt;
If you want [https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/ predictable network interface names], install the {{pkg|eudev-netifnames}} package. {{cmd|# apk add {{pkg|eudev-netifnames}}}}&lt;br /&gt;
&lt;br /&gt;
== Manual removal ==&lt;br /&gt;
&lt;br /&gt;
{{warning|Use [[#Setup script|Setup script]] to change device manager. Manual removal of a device manager without first setting up an alternative may cause unexpected issues.}}&lt;br /&gt;
&lt;br /&gt;
If you are not running in a chroot you need to stop the service first.{{cmd|&amp;lt;nowiki&amp;gt;# rc-service udev stop&lt;br /&gt;
# rc-service udev-postmount stop&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Then disable the services. {{cmd|&amp;lt;nowiki&amp;gt;# rc-update delete udev sysinit&lt;br /&gt;
# rc-update delete udev-trigger sysinit&lt;br /&gt;
# rc-update delete udev-settle sysinit&lt;br /&gt;
# rc-update delete udev-postmount default&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
You might also want to uninstall the packages since they are not used anymore. {{cmd|# apk del {{pkg|eudev}} {{pkg|udev-init-scripts}}}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[:Category:Device_Manager|Device Managers]]&lt;br /&gt;
* [https://wiki.gentoo.org/wiki/Eudev Gentoo wiki eudev]&lt;br /&gt;
* [https://wiki.archlinux.org/title/Udev Archwiki udev]&lt;br /&gt;
* [[Gamepad]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Device_Manager]]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Device_Manager&amp;diff=30875</id>
		<title>Device Manager</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Device_Manager&amp;diff=30875"/>
		<updated>2025-09-06T17:46:52Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: udev can be made to work without other systemd components&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A device manager is a program that manages [https://en.wikipedia.org/wiki/Device_file device files] in the [https://en.wikipedia.org/wiki/Devfs /dev] directory. Permissions and changes in {{path|/dev}} are handled by it.&lt;br /&gt;
&lt;br /&gt;
Alpine linux has several device managers available:&lt;br /&gt;
* &#039;&#039;&#039;[[mdev]]&#039;&#039;&#039; (from {{pkg|busybox}}) is the default.&lt;br /&gt;
* &#039;&#039;&#039;[[mdevd]]&#039;&#039;&#039; is standalone, compatible with mdev, more efficient.&lt;br /&gt;
* &#039;&#039;&#039;[[eudev]]&#039;&#039;&#039; is a complex, full-featured one.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;udev&#039;&#039;&#039; is not available in Alpine Linux, use [[eudev]] instead which includes patches to make to work better without other systemd components.&lt;br /&gt;
&lt;br /&gt;
{{:Include:Setup Device Manager}}&lt;br /&gt;
&lt;br /&gt;
== Do I need a device manager? ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Yes!&#039;&#039;&#039; Even for very specific use cases you would most likely just create a custom device manager.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Mdev#libudev_replacement|libudev replacement]]&lt;br /&gt;
* [https://wiki.gentoo.org/wiki/Device_file Gentoo Wiki - Device file]&lt;br /&gt;
&lt;br /&gt;
[[Category:Device Manager]]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=How_to_make_a_custom_ISO_image_with_mkimage&amp;diff=30815</id>
		<title>How to make a custom ISO image with mkimage</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=How_to_make_a_custom_ISO_image_with_mkimage&amp;diff=30815"/>
		<updated>2025-08-29T16:14:20Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: Trim required packages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document explains how to build a custom ISO image using the new mkimage scripts located in [[aports]] directory.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
First make sure we have the needed tools&lt;br /&gt;
{{Cmd|apk add abuild alpine-conf syslinux xorriso squashfs-tools grub}}&lt;br /&gt;
For efi you should add the following: &lt;br /&gt;
{{Cmd|apk add mtools}}&lt;br /&gt;
&lt;br /&gt;
Then create signing keys&lt;br /&gt;
{{Cmd|abuild-keygen -a}}&lt;br /&gt;
&lt;br /&gt;
Clone (or update) the [https://gitlab.alpinelinux.org/alpine/aports git repository].&lt;br /&gt;
{{Cmd|git clone --depth&amp;amp;#61;1 https://gitlab.alpinelinux.org/alpine/aports.git}}&lt;br /&gt;
&lt;br /&gt;
Make sure your /tmp is large enough.  If you have the default 1GB /tmp, then create a local one with:&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir -pv ~/tmp&lt;br /&gt;
export TMPDIR=~/tmp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
The mkimg scripts are shipped with pre-configured profiles.&lt;br /&gt;
&lt;br /&gt;
The format is &#039;&#039;&#039;mkimg.$PROFILENAME.sh&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to have a custom ISO, you should create your own &#039;&#039;&#039;mkimg.$PROFILENAME.sh&#039;&#039;&#039; script.&lt;br /&gt;
&lt;br /&gt;
This is an example used to make a ZFS module, overlayfs (which enables r/w mode for /lib/modules), a serial console output and some other useful apks to build a simple NAS:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;export PROFILENAME=nas&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat &amp;lt;&amp;lt; EOF &amp;gt; ~/aports/scripts/mkimg.$PROFILENAME.sh&lt;br /&gt;
profile_$PROFILENAME() {&lt;br /&gt;
        profile_standard&lt;br /&gt;
        kernel_cmdline=&amp;quot;unionfs_size=512M console=tty0 console=ttyS0,115200&amp;quot;&lt;br /&gt;
        syslinux_serial=&amp;quot;0 115200&amp;quot;&lt;br /&gt;
        kernel_addons=&amp;quot;zfs&amp;quot;&lt;br /&gt;
        apks=&amp;quot;\$apks iscsi-scst zfs-scripts zfs zfs-utils-py&lt;br /&gt;
                cciss_vol_status lvm2 mdadm mkinitfs mtools nfs-utils&lt;br /&gt;
                parted rsync sfdisk syslinux util-linux xfsprogs&lt;br /&gt;
                dosfstools ntfs-3g&lt;br /&gt;
                &amp;quot;&lt;br /&gt;
        local _k _a&lt;br /&gt;
        for _k in \$kernel_flavors; do&lt;br /&gt;
                apks=&amp;quot;\$apks linux-\$_k&amp;quot;&lt;br /&gt;
                for _a in \$kernel_addons; do&lt;br /&gt;
                        apks=&amp;quot;\$apks \$_a-\$_k&amp;quot;&lt;br /&gt;
                done&lt;br /&gt;
        done&lt;br /&gt;
        apks=&amp;quot;\$apks linux-firmware&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Making packages available on boot ==&lt;br /&gt;
&lt;br /&gt;
A package may be made available in the live system by defining the generation of an apkovl which contains a corresponding /etc/apk/world file, and adding that overlay definition to the mkimg-profile, e.g. with `apkovl=&amp;quot;genapkovl-mkimgoverlay.sh&amp;quot;`&lt;br /&gt;
&lt;br /&gt;
Note that to *use* your added apks, you have to install them, with {{ic|apk add}}.&lt;br /&gt;
&lt;br /&gt;
The definition may be done as in the [https://github.com/alpinelinux/aports/blob/master/scripts/genapkovl-dhcp.sh genapkovl-dhcp.sh] example.&lt;br /&gt;
Copy the relevant parts (including the rc_add lines) into a `genapkovl-mkimgoverlay.sh` file and add the package(s) that should be installed in the live system on separate lines in the file contents for /etc/apk/world.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|cp ~/aports/scripts/genapkovl-dhcp.sh ~/aports/scripts/genapkovl-mkimgoverlay.sh}}&lt;br /&gt;
&lt;br /&gt;
Edit the file to add:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
mkdir -p &amp;quot;$tmp&amp;quot;/etc/apk&lt;br /&gt;
makefile root:root 0644 &amp;quot;$tmp&amp;quot;/etc/apk/world &amp;lt;&amp;lt;EOF&lt;br /&gt;
alpine-base&lt;br /&gt;
&amp;lt;apk1-service&amp;gt;&lt;br /&gt;
&amp;lt;apk2-service&amp;gt;&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
rc_add &amp;lt;apk1-service&amp;gt; boot&lt;br /&gt;
rc_add &amp;lt;apk2-service&amp;gt; boot&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in the relevant locations.&lt;br /&gt;
&lt;br /&gt;
Then edit the profile build script above and add:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apkovl=&amp;quot;aports/scripts/genapkovl-mkimgoverlay.sh&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
immediately after the last apks= line.&lt;br /&gt;
&lt;br /&gt;
== Create the ISO ==&lt;br /&gt;
&lt;br /&gt;
{{Cmd|mkimage.sh	[--tag RELEASE] [--outdir OUTDIR] [--workdir WORKDIR]&lt;br /&gt;
		[--arch ARCH] [--profile PROFILE] [--hostkeys] [--simulate]&lt;br /&gt;
		[--repository REPO] [--extra-repository REPO] [--yaml FILE]&lt;br /&gt;
mkimage.sh	--help&lt;br /&gt;
&lt;br /&gt;
options:&lt;br /&gt;
--arch			Specify which architecture images to build&lt;br /&gt;
			(default: x86_64)&lt;br /&gt;
--hostkeys		Copy system apk signing keys to created images&lt;br /&gt;
--outdir		Specify directory for the created images&lt;br /&gt;
--profile		Specify which profiles to build&lt;br /&gt;
--repository		Package repository to use for the image create&lt;br /&gt;
--extra-repository	Add repository to search packages from&lt;br /&gt;
--simulate		Don&#039;t execute commands&lt;br /&gt;
--tag			Build images for tag RELEASE&lt;br /&gt;
--workdir		Specify temporary working directory (cache)&lt;br /&gt;
--yaml&lt;br /&gt;
&lt;br /&gt;
known profiles: ali rpi uboot base minirootfs standard vanilla extended virt xen}}&lt;br /&gt;
&lt;br /&gt;
{{Tip| You can use the --repository option multiple times, which is very useful when mixing local and official repositories. The --extra-repository option is  there only for backward-compatibility.}}&lt;br /&gt;
&lt;br /&gt;
Then create the actual ISO.&lt;br /&gt;
In this example we will use the edge version x86_64:&lt;br /&gt;
{{Cmd|sh aports/scripts/mkimage.sh --tag edge \&lt;br /&gt;
	--outdir ~/iso \&lt;br /&gt;
	--arch x86_64 \&lt;br /&gt;
	--repository &amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/edge/main&amp;lt;/nowiki&amp;gt; \&lt;br /&gt;
	--profile $PROFILENAME&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* If you want to make a customized installer, you need to create &amp;lt;code&amp;gt;.default_boot_services&amp;lt;/code&amp;gt; which will cause &amp;lt;code&amp;gt;mkinitfs&amp;lt;/code&amp;gt; to create the defaults for the live image.&lt;br /&gt;
&lt;br /&gt;
* Several parts of this doc can be automated with a script, like the repository/arch/outdir settings.&lt;br /&gt;
Those steps are left to you and your imagination :)&lt;br /&gt;
&lt;br /&gt;
== Testing your ISO image ==&lt;br /&gt;
&lt;br /&gt;
[[QEMU#Live_mode|QEMU]] is useful for a quick test of your newly created ISO image.&lt;br /&gt;
This ISO build process has been tested to work and generate an ISO with auto-installed APKs as of Nov 20, 2023 with Alpine edge. &lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[How to make a custom ISO image]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Package Manager]]&lt;br /&gt;
[[Category:ISO]]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=How_to_make_a_custom_ISO_image_with_mkimage&amp;diff=30814</id>
		<title>How to make a custom ISO image with mkimage</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=How_to_make_a_custom_ISO_image_with_mkimage&amp;diff=30814"/>
		<updated>2025-08-29T16:08:39Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: The key doesn&amp;#039;t need to be in /etc/apk/keys (when not using --hostkeys) anymore&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document explains how to build a custom ISO image using the new mkimage scripts located in [[aports]] directory.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
First make sure we have the needed tools&lt;br /&gt;
{{Cmd|apk add alpine-sdk alpine-conf syslinux xorriso squashfs-tools grub}}&lt;br /&gt;
For efi you should add the following: &lt;br /&gt;
{{Cmd|apk add mtools dosfstools}}&lt;br /&gt;
&lt;br /&gt;
Then create signing keys&lt;br /&gt;
{{Cmd|abuild-keygen -a}}&lt;br /&gt;
&lt;br /&gt;
Clone (or update) the [https://gitlab.alpinelinux.org/alpine/aports git repository].&lt;br /&gt;
{{Cmd|git clone --depth&amp;amp;#61;1 https://gitlab.alpinelinux.org/alpine/aports.git}}&lt;br /&gt;
&lt;br /&gt;
Make sure your /tmp is large enough.  If you have the default 1GB /tmp, then create a local one with:&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir -pv ~/tmp&lt;br /&gt;
export TMPDIR=~/tmp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
The mkimg scripts are shipped with pre-configured profiles.&lt;br /&gt;
&lt;br /&gt;
The format is &#039;&#039;&#039;mkimg.$PROFILENAME.sh&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to have a custom ISO, you should create your own &#039;&#039;&#039;mkimg.$PROFILENAME.sh&#039;&#039;&#039; script.&lt;br /&gt;
&lt;br /&gt;
This is an example used to make a ZFS module, overlayfs (which enables r/w mode for /lib/modules), a serial console output and some other useful apks to build a simple NAS:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;export PROFILENAME=nas&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat &amp;lt;&amp;lt; EOF &amp;gt; ~/aports/scripts/mkimg.$PROFILENAME.sh&lt;br /&gt;
profile_$PROFILENAME() {&lt;br /&gt;
        profile_standard&lt;br /&gt;
        kernel_cmdline=&amp;quot;unionfs_size=512M console=tty0 console=ttyS0,115200&amp;quot;&lt;br /&gt;
        syslinux_serial=&amp;quot;0 115200&amp;quot;&lt;br /&gt;
        kernel_addons=&amp;quot;zfs&amp;quot;&lt;br /&gt;
        apks=&amp;quot;\$apks iscsi-scst zfs-scripts zfs zfs-utils-py&lt;br /&gt;
                cciss_vol_status lvm2 mdadm mkinitfs mtools nfs-utils&lt;br /&gt;
                parted rsync sfdisk syslinux util-linux xfsprogs&lt;br /&gt;
                dosfstools ntfs-3g&lt;br /&gt;
                &amp;quot;&lt;br /&gt;
        local _k _a&lt;br /&gt;
        for _k in \$kernel_flavors; do&lt;br /&gt;
                apks=&amp;quot;\$apks linux-\$_k&amp;quot;&lt;br /&gt;
                for _a in \$kernel_addons; do&lt;br /&gt;
                        apks=&amp;quot;\$apks \$_a-\$_k&amp;quot;&lt;br /&gt;
                done&lt;br /&gt;
        done&lt;br /&gt;
        apks=&amp;quot;\$apks linux-firmware&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Making packages available on boot ==&lt;br /&gt;
&lt;br /&gt;
A package may be made available in the live system by defining the generation of an apkovl which contains a corresponding /etc/apk/world file, and adding that overlay definition to the mkimg-profile, e.g. with `apkovl=&amp;quot;genapkovl-mkimgoverlay.sh&amp;quot;`&lt;br /&gt;
&lt;br /&gt;
Note that to *use* your added apks, you have to install them, with {{ic|apk add}}.&lt;br /&gt;
&lt;br /&gt;
The definition may be done as in the [https://github.com/alpinelinux/aports/blob/master/scripts/genapkovl-dhcp.sh genapkovl-dhcp.sh] example.&lt;br /&gt;
Copy the relevant parts (including the rc_add lines) into a `genapkovl-mkimgoverlay.sh` file and add the package(s) that should be installed in the live system on separate lines in the file contents for /etc/apk/world.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|cp ~/aports/scripts/genapkovl-dhcp.sh ~/aports/scripts/genapkovl-mkimgoverlay.sh}}&lt;br /&gt;
&lt;br /&gt;
Edit the file to add:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
mkdir -p &amp;quot;$tmp&amp;quot;/etc/apk&lt;br /&gt;
makefile root:root 0644 &amp;quot;$tmp&amp;quot;/etc/apk/world &amp;lt;&amp;lt;EOF&lt;br /&gt;
alpine-base&lt;br /&gt;
&amp;lt;apk1-service&amp;gt;&lt;br /&gt;
&amp;lt;apk2-service&amp;gt;&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
rc_add &amp;lt;apk1-service&amp;gt; boot&lt;br /&gt;
rc_add &amp;lt;apk2-service&amp;gt; boot&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in the relevant locations.&lt;br /&gt;
&lt;br /&gt;
Then edit the profile build script above and add:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apkovl=&amp;quot;aports/scripts/genapkovl-mkimgoverlay.sh&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
immediately after the last apks= line.&lt;br /&gt;
&lt;br /&gt;
== Create the ISO ==&lt;br /&gt;
&lt;br /&gt;
{{Cmd|mkimage.sh	[--tag RELEASE] [--outdir OUTDIR] [--workdir WORKDIR]&lt;br /&gt;
		[--arch ARCH] [--profile PROFILE] [--hostkeys] [--simulate]&lt;br /&gt;
		[--repository REPO] [--extra-repository REPO] [--yaml FILE]&lt;br /&gt;
mkimage.sh	--help&lt;br /&gt;
&lt;br /&gt;
options:&lt;br /&gt;
--arch			Specify which architecture images to build&lt;br /&gt;
			(default: x86_64)&lt;br /&gt;
--hostkeys		Copy system apk signing keys to created images&lt;br /&gt;
--outdir		Specify directory for the created images&lt;br /&gt;
--profile		Specify which profiles to build&lt;br /&gt;
--repository		Package repository to use for the image create&lt;br /&gt;
--extra-repository	Add repository to search packages from&lt;br /&gt;
--simulate		Don&#039;t execute commands&lt;br /&gt;
--tag			Build images for tag RELEASE&lt;br /&gt;
--workdir		Specify temporary working directory (cache)&lt;br /&gt;
--yaml&lt;br /&gt;
&lt;br /&gt;
known profiles: ali rpi uboot base minirootfs standard vanilla extended virt xen}}&lt;br /&gt;
&lt;br /&gt;
{{Tip| You can use the --repository option multiple times, which is very useful when mixing local and official repositories. The --extra-repository option is  there only for backward-compatibility.}}&lt;br /&gt;
&lt;br /&gt;
Then create the actual ISO.&lt;br /&gt;
In this example we will use the edge version x86_64:&lt;br /&gt;
{{Cmd|sh aports/scripts/mkimage.sh --tag edge \&lt;br /&gt;
	--outdir ~/iso \&lt;br /&gt;
	--arch x86_64 \&lt;br /&gt;
	--repository &amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/edge/main&amp;lt;/nowiki&amp;gt; \&lt;br /&gt;
	--profile $PROFILENAME&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* If you want to make a customized installer, you need to create &amp;lt;code&amp;gt;.default_boot_services&amp;lt;/code&amp;gt; which will cause &amp;lt;code&amp;gt;mkinitfs&amp;lt;/code&amp;gt; to create the defaults for the live image.&lt;br /&gt;
&lt;br /&gt;
* Several parts of this doc can be automated with a script, like the repository/arch/outdir settings.&lt;br /&gt;
Those steps are left to you and your imagination :)&lt;br /&gt;
&lt;br /&gt;
== Testing your ISO image ==&lt;br /&gt;
&lt;br /&gt;
[[QEMU#Live_mode|QEMU]] is useful for a quick test of your newly created ISO image.&lt;br /&gt;
This ISO build process has been tested to work and generate an ISO with auto-installed APKs as of Nov 20, 2023 with Alpine edge. &lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[How to make a custom ISO image]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Package Manager]]&lt;br /&gt;
[[Category:ISO]]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=How_to_make_a_custom_ISO_image_with_mkimage&amp;diff=30813</id>
		<title>How to make a custom ISO image with mkimage</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=How_to_make_a_custom_ISO_image_with_mkimage&amp;diff=30813"/>
		<updated>2025-08-29T15:57:45Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: mkimage creates outdir automatically&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document explains how to build a custom ISO image using the new mkimage scripts located in [[aports]] directory.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
First make sure we have the needed tools&lt;br /&gt;
{{Cmd|apk add alpine-sdk alpine-conf syslinux xorriso squashfs-tools grub}}&lt;br /&gt;
For efi you should add the following: &lt;br /&gt;
{{Cmd|apk add mtools dosfstools}}&lt;br /&gt;
&lt;br /&gt;
Then create signing keys (-i installs them in /etc/apk/keys which is required for later)&lt;br /&gt;
{{Cmd|abuild-keygen -i -a}}&lt;br /&gt;
&lt;br /&gt;
{{Tip| Make sure your public keys are placed in /etc/apk/keys/ (example: build-xxxxxxxx.rsa.pub)}}&lt;br /&gt;
{{Cmd|ls /etc/apk/keys/}}&lt;br /&gt;
&lt;br /&gt;
Clone (or update) the [https://gitlab.alpinelinux.org/alpine/aports git repository].&lt;br /&gt;
{{Cmd|git clone --depth&amp;amp;#61;1 https://gitlab.alpinelinux.org/alpine/aports.git}}&lt;br /&gt;
&lt;br /&gt;
Make sure your /tmp is large enough.  If you have the default 1GB /tmp, then create a local one with:&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir -pv ~/tmp&lt;br /&gt;
export TMPDIR=~/tmp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
The mkimg scripts are shipped with pre-configured profiles.&lt;br /&gt;
&lt;br /&gt;
The format is &#039;&#039;&#039;mkimg.$PROFILENAME.sh&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to have a custom ISO, you should create your own &#039;&#039;&#039;mkimg.$PROFILENAME.sh&#039;&#039;&#039; script.&lt;br /&gt;
&lt;br /&gt;
This is an example used to make a ZFS module, overlayfs (which enables r/w mode for /lib/modules), a serial console output and some other useful apks to build a simple NAS:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;export PROFILENAME=nas&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat &amp;lt;&amp;lt; EOF &amp;gt; ~/aports/scripts/mkimg.$PROFILENAME.sh&lt;br /&gt;
profile_$PROFILENAME() {&lt;br /&gt;
        profile_standard&lt;br /&gt;
        kernel_cmdline=&amp;quot;unionfs_size=512M console=tty0 console=ttyS0,115200&amp;quot;&lt;br /&gt;
        syslinux_serial=&amp;quot;0 115200&amp;quot;&lt;br /&gt;
        kernel_addons=&amp;quot;zfs&amp;quot;&lt;br /&gt;
        apks=&amp;quot;\$apks iscsi-scst zfs-scripts zfs zfs-utils-py&lt;br /&gt;
                cciss_vol_status lvm2 mdadm mkinitfs mtools nfs-utils&lt;br /&gt;
                parted rsync sfdisk syslinux util-linux xfsprogs&lt;br /&gt;
                dosfstools ntfs-3g&lt;br /&gt;
                &amp;quot;&lt;br /&gt;
        local _k _a&lt;br /&gt;
        for _k in \$kernel_flavors; do&lt;br /&gt;
                apks=&amp;quot;\$apks linux-\$_k&amp;quot;&lt;br /&gt;
                for _a in \$kernel_addons; do&lt;br /&gt;
                        apks=&amp;quot;\$apks \$_a-\$_k&amp;quot;&lt;br /&gt;
                done&lt;br /&gt;
        done&lt;br /&gt;
        apks=&amp;quot;\$apks linux-firmware&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Making packages available on boot ==&lt;br /&gt;
&lt;br /&gt;
A package may be made available in the live system by defining the generation of an apkovl which contains a corresponding /etc/apk/world file, and adding that overlay definition to the mkimg-profile, e.g. with `apkovl=&amp;quot;genapkovl-mkimgoverlay.sh&amp;quot;`&lt;br /&gt;
&lt;br /&gt;
Note that to *use* your added apks, you have to install them, with {{ic|apk add}}.&lt;br /&gt;
&lt;br /&gt;
The definition may be done as in the [https://github.com/alpinelinux/aports/blob/master/scripts/genapkovl-dhcp.sh genapkovl-dhcp.sh] example.&lt;br /&gt;
Copy the relevant parts (including the rc_add lines) into a `genapkovl-mkimgoverlay.sh` file and add the package(s) that should be installed in the live system on separate lines in the file contents for /etc/apk/world.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|cp ~/aports/scripts/genapkovl-dhcp.sh ~/aports/scripts/genapkovl-mkimgoverlay.sh}}&lt;br /&gt;
&lt;br /&gt;
Edit the file to add:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
mkdir -p &amp;quot;$tmp&amp;quot;/etc/apk&lt;br /&gt;
makefile root:root 0644 &amp;quot;$tmp&amp;quot;/etc/apk/world &amp;lt;&amp;lt;EOF&lt;br /&gt;
alpine-base&lt;br /&gt;
&amp;lt;apk1-service&amp;gt;&lt;br /&gt;
&amp;lt;apk2-service&amp;gt;&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
rc_add &amp;lt;apk1-service&amp;gt; boot&lt;br /&gt;
rc_add &amp;lt;apk2-service&amp;gt; boot&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in the relevant locations.&lt;br /&gt;
&lt;br /&gt;
Then edit the profile build script above and add:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apkovl=&amp;quot;aports/scripts/genapkovl-mkimgoverlay.sh&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
immediately after the last apks= line.&lt;br /&gt;
&lt;br /&gt;
== Create the ISO ==&lt;br /&gt;
&lt;br /&gt;
{{Cmd|mkimage.sh	[--tag RELEASE] [--outdir OUTDIR] [--workdir WORKDIR]&lt;br /&gt;
		[--arch ARCH] [--profile PROFILE] [--hostkeys] [--simulate]&lt;br /&gt;
		[--repository REPO] [--extra-repository REPO] [--yaml FILE]&lt;br /&gt;
mkimage.sh	--help&lt;br /&gt;
&lt;br /&gt;
options:&lt;br /&gt;
--arch			Specify which architecture images to build&lt;br /&gt;
			(default: x86_64)&lt;br /&gt;
--hostkeys		Copy system apk signing keys to created images&lt;br /&gt;
--outdir		Specify directory for the created images&lt;br /&gt;
--profile		Specify which profiles to build&lt;br /&gt;
--repository		Package repository to use for the image create&lt;br /&gt;
--extra-repository	Add repository to search packages from&lt;br /&gt;
--simulate		Don&#039;t execute commands&lt;br /&gt;
--tag			Build images for tag RELEASE&lt;br /&gt;
--workdir		Specify temporary working directory (cache)&lt;br /&gt;
--yaml&lt;br /&gt;
&lt;br /&gt;
known profiles: ali rpi uboot base minirootfs standard vanilla extended virt xen}}&lt;br /&gt;
&lt;br /&gt;
{{Tip| You can use the --repository option multiple times, which is very useful when mixing local and official repositories. The --extra-repository option is  there only for backward-compatibility.}}&lt;br /&gt;
&lt;br /&gt;
Then create the actual ISO.&lt;br /&gt;
In this example we will use the edge version x86_64:&lt;br /&gt;
{{Cmd|sh aports/scripts/mkimage.sh --tag edge \&lt;br /&gt;
	--outdir ~/iso \&lt;br /&gt;
	--arch x86_64 \&lt;br /&gt;
	--repository &amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/edge/main&amp;lt;/nowiki&amp;gt; \&lt;br /&gt;
	--profile $PROFILENAME&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* If you want to make a customized installer, you need to create &amp;lt;code&amp;gt;.default_boot_services&amp;lt;/code&amp;gt; which will cause &amp;lt;code&amp;gt;mkinitfs&amp;lt;/code&amp;gt; to create the defaults for the live image.&lt;br /&gt;
&lt;br /&gt;
* Several parts of this doc can be automated with a script, like the repository/arch/outdir settings.&lt;br /&gt;
Those steps are left to you and your imagination :)&lt;br /&gt;
&lt;br /&gt;
== Testing your ISO image ==&lt;br /&gt;
&lt;br /&gt;
[[QEMU#Live_mode|QEMU]] is useful for a quick test of your newly created ISO image.&lt;br /&gt;
This ISO build process has been tested to work and generate an ISO with auto-installed APKs as of Nov 20, 2023 with Alpine edge. &lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[How to make a custom ISO image]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Package Manager]]&lt;br /&gt;
[[Category:ISO]]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=How_to_make_a_custom_ISO_image_with_mkimage&amp;diff=30812</id>
		<title>How to make a custom ISO image with mkimage</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=How_to_make_a_custom_ISO_image_with_mkimage&amp;diff=30812"/>
		<updated>2025-08-29T15:56:40Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: mkimg.*.sh don&amp;#039;t need to be marked as executable&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document explains how to build a custom ISO image using the new mkimage scripts located in [[aports]] directory.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
First make sure we have the needed tools&lt;br /&gt;
{{Cmd|apk add alpine-sdk alpine-conf syslinux xorriso squashfs-tools grub}}&lt;br /&gt;
For efi you should add the following: &lt;br /&gt;
{{Cmd|apk add mtools dosfstools}}&lt;br /&gt;
&lt;br /&gt;
Then create signing keys (-i installs them in /etc/apk/keys which is required for later)&lt;br /&gt;
{{Cmd|abuild-keygen -i -a}}&lt;br /&gt;
&lt;br /&gt;
{{Tip| Make sure your public keys are placed in /etc/apk/keys/ (example: build-xxxxxxxx.rsa.pub)}}&lt;br /&gt;
{{Cmd|ls /etc/apk/keys/}}&lt;br /&gt;
&lt;br /&gt;
Clone (or update) the [https://gitlab.alpinelinux.org/alpine/aports git repository].&lt;br /&gt;
{{Cmd|git clone --depth&amp;amp;#61;1 https://gitlab.alpinelinux.org/alpine/aports.git}}&lt;br /&gt;
&lt;br /&gt;
Make sure your /tmp is large enough.  If you have the default 1GB /tmp, then create a local one with:&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir -pv ~/tmp&lt;br /&gt;
export TMPDIR=~/tmp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
The mkimg scripts are shipped with pre-configured profiles.&lt;br /&gt;
&lt;br /&gt;
The format is &#039;&#039;&#039;mkimg.$PROFILENAME.sh&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to have a custom ISO, you should create your own &#039;&#039;&#039;mkimg.$PROFILENAME.sh&#039;&#039;&#039; script.&lt;br /&gt;
&lt;br /&gt;
This is an example used to make a ZFS module, overlayfs (which enables r/w mode for /lib/modules), a serial console output and some other useful apks to build a simple NAS:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;export PROFILENAME=nas&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat &amp;lt;&amp;lt; EOF &amp;gt; ~/aports/scripts/mkimg.$PROFILENAME.sh&lt;br /&gt;
profile_$PROFILENAME() {&lt;br /&gt;
        profile_standard&lt;br /&gt;
        kernel_cmdline=&amp;quot;unionfs_size=512M console=tty0 console=ttyS0,115200&amp;quot;&lt;br /&gt;
        syslinux_serial=&amp;quot;0 115200&amp;quot;&lt;br /&gt;
        kernel_addons=&amp;quot;zfs&amp;quot;&lt;br /&gt;
        apks=&amp;quot;\$apks iscsi-scst zfs-scripts zfs zfs-utils-py&lt;br /&gt;
                cciss_vol_status lvm2 mdadm mkinitfs mtools nfs-utils&lt;br /&gt;
                parted rsync sfdisk syslinux util-linux xfsprogs&lt;br /&gt;
                dosfstools ntfs-3g&lt;br /&gt;
                &amp;quot;&lt;br /&gt;
        local _k _a&lt;br /&gt;
        for _k in \$kernel_flavors; do&lt;br /&gt;
                apks=&amp;quot;\$apks linux-\$_k&amp;quot;&lt;br /&gt;
                for _a in \$kernel_addons; do&lt;br /&gt;
                        apks=&amp;quot;\$apks \$_a-\$_k&amp;quot;&lt;br /&gt;
                done&lt;br /&gt;
        done&lt;br /&gt;
        apks=&amp;quot;\$apks linux-firmware&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Making packages available on boot ==&lt;br /&gt;
&lt;br /&gt;
A package may be made available in the live system by defining the generation of an apkovl which contains a corresponding /etc/apk/world file, and adding that overlay definition to the mkimg-profile, e.g. with `apkovl=&amp;quot;genapkovl-mkimgoverlay.sh&amp;quot;`&lt;br /&gt;
&lt;br /&gt;
Note that to *use* your added apks, you have to install them, with {{ic|apk add}}.&lt;br /&gt;
&lt;br /&gt;
The definition may be done as in the [https://github.com/alpinelinux/aports/blob/master/scripts/genapkovl-dhcp.sh genapkovl-dhcp.sh] example.&lt;br /&gt;
Copy the relevant parts (including the rc_add lines) into a `genapkovl-mkimgoverlay.sh` file and add the package(s) that should be installed in the live system on separate lines in the file contents for /etc/apk/world.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|cp ~/aports/scripts/genapkovl-dhcp.sh ~/aports/scripts/genapkovl-mkimgoverlay.sh}}&lt;br /&gt;
&lt;br /&gt;
Edit the file to add:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
mkdir -p &amp;quot;$tmp&amp;quot;/etc/apk&lt;br /&gt;
makefile root:root 0644 &amp;quot;$tmp&amp;quot;/etc/apk/world &amp;lt;&amp;lt;EOF&lt;br /&gt;
alpine-base&lt;br /&gt;
&amp;lt;apk1-service&amp;gt;&lt;br /&gt;
&amp;lt;apk2-service&amp;gt;&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
rc_add &amp;lt;apk1-service&amp;gt; boot&lt;br /&gt;
rc_add &amp;lt;apk2-service&amp;gt; boot&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in the relevant locations.&lt;br /&gt;
&lt;br /&gt;
Then edit the profile build script above and add:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apkovl=&amp;quot;aports/scripts/genapkovl-mkimgoverlay.sh&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
immediately after the last apks= line.&lt;br /&gt;
&lt;br /&gt;
== Create the ISO ==&lt;br /&gt;
&lt;br /&gt;
{{Cmd|mkimage.sh	[--tag RELEASE] [--outdir OUTDIR] [--workdir WORKDIR]&lt;br /&gt;
		[--arch ARCH] [--profile PROFILE] [--hostkeys] [--simulate]&lt;br /&gt;
		[--repository REPO] [--extra-repository REPO] [--yaml FILE]&lt;br /&gt;
mkimage.sh	--help&lt;br /&gt;
&lt;br /&gt;
options:&lt;br /&gt;
--arch			Specify which architecture images to build&lt;br /&gt;
			(default: x86_64)&lt;br /&gt;
--hostkeys		Copy system apk signing keys to created images&lt;br /&gt;
--outdir		Specify directory for the created images&lt;br /&gt;
--profile		Specify which profiles to build&lt;br /&gt;
--repository		Package repository to use for the image create&lt;br /&gt;
--extra-repository	Add repository to search packages from&lt;br /&gt;
--simulate		Don&#039;t execute commands&lt;br /&gt;
--tag			Build images for tag RELEASE&lt;br /&gt;
--workdir		Specify temporary working directory (cache)&lt;br /&gt;
--yaml&lt;br /&gt;
&lt;br /&gt;
known profiles: ali rpi uboot base minirootfs standard vanilla extended virt xen}}&lt;br /&gt;
&lt;br /&gt;
{{Tip| You can use the --repository option multiple times, which is very useful when mixing local and official repositories. The --extra-repository option is  there only for backward-compatibility.}}&lt;br /&gt;
&lt;br /&gt;
Create an iso directory in your home dir:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|mkdir -p ~/iso}}&lt;br /&gt;
&lt;br /&gt;
Then create the actual ISO.&lt;br /&gt;
In this example we will use the edge version x86_64:&lt;br /&gt;
{{Cmd|sh aports/scripts/mkimage.sh --tag edge \&lt;br /&gt;
	--outdir ~/iso \&lt;br /&gt;
	--arch x86_64 \&lt;br /&gt;
	--repository &amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/edge/main&amp;lt;/nowiki&amp;gt; \&lt;br /&gt;
	--profile $PROFILENAME&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* If you want to make a customized installer, you need to create &amp;lt;code&amp;gt;.default_boot_services&amp;lt;/code&amp;gt; which will cause &amp;lt;code&amp;gt;mkinitfs&amp;lt;/code&amp;gt; to create the defaults for the live image.&lt;br /&gt;
&lt;br /&gt;
* Several parts of this doc can be automated with a script, like the repository/arch/outdir settings.&lt;br /&gt;
Those steps are left to you and your imagination :)&lt;br /&gt;
&lt;br /&gt;
== Testing your ISO image ==&lt;br /&gt;
&lt;br /&gt;
[[QEMU#Live_mode|QEMU]] is useful for a quick test of your newly created ISO image.&lt;br /&gt;
This ISO build process has been tested to work and generate an ISO with auto-installed APKs as of Nov 20, 2023 with Alpine edge. &lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[How to make a custom ISO image]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Package Manager]]&lt;br /&gt;
[[Category:ISO]]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=How_to_make_a_custom_ISO_image_with_mkimage&amp;diff=30811</id>
		<title>How to make a custom ISO image with mkimage</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=How_to_make_a_custom_ISO_image_with_mkimage&amp;diff=30811"/>
		<updated>2025-08-29T15:48:54Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: remove &amp;#039;apk update&amp;#039; since mkimage uses it&amp;#039;s own temporary apk cache&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document explains how to build a custom ISO image using the new mkimage scripts located in [[aports]] directory.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
First make sure we have the needed tools&lt;br /&gt;
{{Cmd|apk add alpine-sdk alpine-conf syslinux xorriso squashfs-tools grub}}&lt;br /&gt;
For efi you should add the following: &lt;br /&gt;
{{Cmd|apk add mtools dosfstools}}&lt;br /&gt;
&lt;br /&gt;
Then create signing keys (-i installs them in /etc/apk/keys which is required for later)&lt;br /&gt;
{{Cmd|abuild-keygen -i -a}}&lt;br /&gt;
&lt;br /&gt;
{{Tip| Make sure your public keys are placed in /etc/apk/keys/ (example: build-xxxxxxxx.rsa.pub)}}&lt;br /&gt;
{{Cmd|ls /etc/apk/keys/}}&lt;br /&gt;
&lt;br /&gt;
Clone (or update) the [https://gitlab.alpinelinux.org/alpine/aports git repository].&lt;br /&gt;
{{Cmd|git clone --depth&amp;amp;#61;1 https://gitlab.alpinelinux.org/alpine/aports.git}}&lt;br /&gt;
&lt;br /&gt;
Make sure your /tmp is large enough.  If you have the default 1GB /tmp, then create a local one with:&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir -pv ~/tmp&lt;br /&gt;
export TMPDIR=~/tmp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
The mkimg scripts are shipped with pre-configured profiles.&lt;br /&gt;
&lt;br /&gt;
The format is &#039;&#039;&#039;mkimg.$PROFILENAME.sh&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to have a custom ISO, you should create your own &#039;&#039;&#039;mkimg.$PROFILENAME.sh&#039;&#039;&#039; script.&lt;br /&gt;
&lt;br /&gt;
This is an example used to make a ZFS module, overlayfs (which enables r/w mode for /lib/modules), a serial console output and some other useful apks to build a simple NAS:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;export PROFILENAME=nas&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat &amp;lt;&amp;lt; EOF &amp;gt; ~/aports/scripts/mkimg.$PROFILENAME.sh&lt;br /&gt;
profile_$PROFILENAME() {&lt;br /&gt;
        profile_standard&lt;br /&gt;
        kernel_cmdline=&amp;quot;unionfs_size=512M console=tty0 console=ttyS0,115200&amp;quot;&lt;br /&gt;
        syslinux_serial=&amp;quot;0 115200&amp;quot;&lt;br /&gt;
        kernel_addons=&amp;quot;zfs&amp;quot;&lt;br /&gt;
        apks=&amp;quot;\$apks iscsi-scst zfs-scripts zfs zfs-utils-py&lt;br /&gt;
                cciss_vol_status lvm2 mdadm mkinitfs mtools nfs-utils&lt;br /&gt;
                parted rsync sfdisk syslinux util-linux xfsprogs&lt;br /&gt;
                dosfstools ntfs-3g&lt;br /&gt;
                &amp;quot;&lt;br /&gt;
        local _k _a&lt;br /&gt;
        for _k in \$kernel_flavors; do&lt;br /&gt;
                apks=&amp;quot;\$apks linux-\$_k&amp;quot;&lt;br /&gt;
                for _a in \$kernel_addons; do&lt;br /&gt;
                        apks=&amp;quot;\$apks \$_a-\$_k&amp;quot;&lt;br /&gt;
                done&lt;br /&gt;
        done&lt;br /&gt;
        apks=&amp;quot;\$apks linux-firmware&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set the script as executable:&lt;br /&gt;
{{Cmd|chmod +x ~/aports/scripts/mkimg.$PROFILENAME.sh}}&lt;br /&gt;
&lt;br /&gt;
== Making packages available on boot ==&lt;br /&gt;
&lt;br /&gt;
A package may be made available in the live system by defining the generation of an apkovl which contains a corresponding /etc/apk/world file, and adding that overlay definition to the mkimg-profile, e.g. with `apkovl=&amp;quot;genapkovl-mkimgoverlay.sh&amp;quot;`&lt;br /&gt;
&lt;br /&gt;
Note that to *use* your added apks, you have to install them, with {{ic|apk add}}.&lt;br /&gt;
&lt;br /&gt;
The definition may be done as in the [https://github.com/alpinelinux/aports/blob/master/scripts/genapkovl-dhcp.sh genapkovl-dhcp.sh] example.&lt;br /&gt;
Copy the relevant parts (including the rc_add lines) into a `genapkovl-mkimgoverlay.sh` file and add the package(s) that should be installed in the live system on separate lines in the file contents for /etc/apk/world.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|cp ~/aports/scripts/genapkovl-dhcp.sh ~/aports/scripts/genapkovl-mkimgoverlay.sh}}&lt;br /&gt;
&lt;br /&gt;
Edit the file to add:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
mkdir -p &amp;quot;$tmp&amp;quot;/etc/apk&lt;br /&gt;
makefile root:root 0644 &amp;quot;$tmp&amp;quot;/etc/apk/world &amp;lt;&amp;lt;EOF&lt;br /&gt;
alpine-base&lt;br /&gt;
&amp;lt;apk1-service&amp;gt;&lt;br /&gt;
&amp;lt;apk2-service&amp;gt;&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
rc_add &amp;lt;apk1-service&amp;gt; boot&lt;br /&gt;
rc_add &amp;lt;apk2-service&amp;gt; boot&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in the relevant locations.&lt;br /&gt;
&lt;br /&gt;
Then edit the profile build script above and add:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apkovl=&amp;quot;aports/scripts/genapkovl-mkimgoverlay.sh&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
immediately after the last apks= line.&lt;br /&gt;
&lt;br /&gt;
== Create the ISO ==&lt;br /&gt;
&lt;br /&gt;
{{Cmd|mkimage.sh	[--tag RELEASE] [--outdir OUTDIR] [--workdir WORKDIR]&lt;br /&gt;
		[--arch ARCH] [--profile PROFILE] [--hostkeys] [--simulate]&lt;br /&gt;
		[--repository REPO] [--extra-repository REPO] [--yaml FILE]&lt;br /&gt;
mkimage.sh	--help&lt;br /&gt;
&lt;br /&gt;
options:&lt;br /&gt;
--arch			Specify which architecture images to build&lt;br /&gt;
			(default: x86_64)&lt;br /&gt;
--hostkeys		Copy system apk signing keys to created images&lt;br /&gt;
--outdir		Specify directory for the created images&lt;br /&gt;
--profile		Specify which profiles to build&lt;br /&gt;
--repository		Package repository to use for the image create&lt;br /&gt;
--extra-repository	Add repository to search packages from&lt;br /&gt;
--simulate		Don&#039;t execute commands&lt;br /&gt;
--tag			Build images for tag RELEASE&lt;br /&gt;
--workdir		Specify temporary working directory (cache)&lt;br /&gt;
--yaml&lt;br /&gt;
&lt;br /&gt;
known profiles: ali rpi uboot base minirootfs standard vanilla extended virt xen}}&lt;br /&gt;
&lt;br /&gt;
{{Tip| You can use the --repository option multiple times, which is very useful when mixing local and official repositories. The --extra-repository option is  there only for backward-compatibility.}}&lt;br /&gt;
&lt;br /&gt;
Create an iso directory in your home dir:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|mkdir -p ~/iso}}&lt;br /&gt;
&lt;br /&gt;
Then create the actual ISO.&lt;br /&gt;
In this example we will use the edge version x86_64:&lt;br /&gt;
{{Cmd|sh aports/scripts/mkimage.sh --tag edge \&lt;br /&gt;
	--outdir ~/iso \&lt;br /&gt;
	--arch x86_64 \&lt;br /&gt;
	--repository &amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/edge/main&amp;lt;/nowiki&amp;gt; \&lt;br /&gt;
	--profile $PROFILENAME&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* If you want to make a customized installer, you need to create &amp;lt;code&amp;gt;.default_boot_services&amp;lt;/code&amp;gt; which will cause &amp;lt;code&amp;gt;mkinitfs&amp;lt;/code&amp;gt; to create the defaults for the live image.&lt;br /&gt;
&lt;br /&gt;
* Several parts of this doc can be automated with a script, like the repository/arch/outdir settings.&lt;br /&gt;
Those steps are left to you and your imagination :)&lt;br /&gt;
&lt;br /&gt;
== Testing your ISO image ==&lt;br /&gt;
&lt;br /&gt;
[[QEMU#Live_mode|QEMU]] is useful for a quick test of your newly created ISO image.&lt;br /&gt;
This ISO build process has been tested to work and generate an ISO with auto-installed APKs as of Nov 20, 2023 with Alpine edge. &lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[How to make a custom ISO image]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Package Manager]]&lt;br /&gt;
[[Category:ISO]]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=How_to_make_a_custom_ISO_image_with_mkimage&amp;diff=30810</id>
		<title>How to make a custom ISO image with mkimage</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=How_to_make_a_custom_ISO_image_with_mkimage&amp;diff=30810"/>
		<updated>2025-08-29T15:47:21Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: remove mention of build user since no root privileges are required by mkimage&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document explains how to build a custom ISO image using the new mkimage scripts located in [[aports]] directory.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
First make sure we have the needed tools&lt;br /&gt;
{{Cmd|apk add alpine-sdk alpine-conf syslinux xorriso squashfs-tools grub}}&lt;br /&gt;
For efi you should add the following: &lt;br /&gt;
{{Cmd|apk add mtools dosfstools}}&lt;br /&gt;
&lt;br /&gt;
Then create signing keys (-i installs them in /etc/apk/keys which is required for later)&lt;br /&gt;
{{Cmd|abuild-keygen -i -a}}&lt;br /&gt;
&lt;br /&gt;
{{Tip| Make sure your public keys are placed in /etc/apk/keys/ (example: build-xxxxxxxx.rsa.pub)}}&lt;br /&gt;
{{Cmd|ls /etc/apk/keys/}}&lt;br /&gt;
&lt;br /&gt;
Clone (or update) the [https://gitlab.alpinelinux.org/alpine/aports git repository].&lt;br /&gt;
{{Cmd|git clone --depth&amp;amp;#61;1 https://gitlab.alpinelinux.org/alpine/aports.git}}&lt;br /&gt;
&lt;br /&gt;
Make sure the apk index is up to date (so apk can find the packages):&lt;br /&gt;
{{Cmd|doas apk update}}&lt;br /&gt;
&lt;br /&gt;
Make sure your /tmp is large enough.  If you have the default 1GB /tmp, then create a local one with:&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir -pv ~/tmp&lt;br /&gt;
export TMPDIR=~/tmp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
The mkimg scripts are shipped with pre-configured profiles.&lt;br /&gt;
&lt;br /&gt;
The format is &#039;&#039;&#039;mkimg.$PROFILENAME.sh&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to have a custom ISO, you should create your own &#039;&#039;&#039;mkimg.$PROFILENAME.sh&#039;&#039;&#039; script.&lt;br /&gt;
&lt;br /&gt;
This is an example used to make a ZFS module, overlayfs (which enables r/w mode for /lib/modules), a serial console output and some other useful apks to build a simple NAS:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;export PROFILENAME=nas&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat &amp;lt;&amp;lt; EOF &amp;gt; ~/aports/scripts/mkimg.$PROFILENAME.sh&lt;br /&gt;
profile_$PROFILENAME() {&lt;br /&gt;
        profile_standard&lt;br /&gt;
        kernel_cmdline=&amp;quot;unionfs_size=512M console=tty0 console=ttyS0,115200&amp;quot;&lt;br /&gt;
        syslinux_serial=&amp;quot;0 115200&amp;quot;&lt;br /&gt;
        kernel_addons=&amp;quot;zfs&amp;quot;&lt;br /&gt;
        apks=&amp;quot;\$apks iscsi-scst zfs-scripts zfs zfs-utils-py&lt;br /&gt;
                cciss_vol_status lvm2 mdadm mkinitfs mtools nfs-utils&lt;br /&gt;
                parted rsync sfdisk syslinux util-linux xfsprogs&lt;br /&gt;
                dosfstools ntfs-3g&lt;br /&gt;
                &amp;quot;&lt;br /&gt;
        local _k _a&lt;br /&gt;
        for _k in \$kernel_flavors; do&lt;br /&gt;
                apks=&amp;quot;\$apks linux-\$_k&amp;quot;&lt;br /&gt;
                for _a in \$kernel_addons; do&lt;br /&gt;
                        apks=&amp;quot;\$apks \$_a-\$_k&amp;quot;&lt;br /&gt;
                done&lt;br /&gt;
        done&lt;br /&gt;
        apks=&amp;quot;\$apks linux-firmware&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set the script as executable:&lt;br /&gt;
{{Cmd|chmod +x ~/aports/scripts/mkimg.$PROFILENAME.sh}}&lt;br /&gt;
&lt;br /&gt;
== Making packages available on boot ==&lt;br /&gt;
&lt;br /&gt;
A package may be made available in the live system by defining the generation of an apkovl which contains a corresponding /etc/apk/world file, and adding that overlay definition to the mkimg-profile, e.g. with `apkovl=&amp;quot;genapkovl-mkimgoverlay.sh&amp;quot;`&lt;br /&gt;
&lt;br /&gt;
Note that to *use* your added apks, you have to install them, with {{ic|apk add}}.&lt;br /&gt;
&lt;br /&gt;
The definition may be done as in the [https://github.com/alpinelinux/aports/blob/master/scripts/genapkovl-dhcp.sh genapkovl-dhcp.sh] example.&lt;br /&gt;
Copy the relevant parts (including the rc_add lines) into a `genapkovl-mkimgoverlay.sh` file and add the package(s) that should be installed in the live system on separate lines in the file contents for /etc/apk/world.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|cp ~/aports/scripts/genapkovl-dhcp.sh ~/aports/scripts/genapkovl-mkimgoverlay.sh}}&lt;br /&gt;
&lt;br /&gt;
Edit the file to add:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
mkdir -p &amp;quot;$tmp&amp;quot;/etc/apk&lt;br /&gt;
makefile root:root 0644 &amp;quot;$tmp&amp;quot;/etc/apk/world &amp;lt;&amp;lt;EOF&lt;br /&gt;
alpine-base&lt;br /&gt;
&amp;lt;apk1-service&amp;gt;&lt;br /&gt;
&amp;lt;apk2-service&amp;gt;&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
rc_add &amp;lt;apk1-service&amp;gt; boot&lt;br /&gt;
rc_add &amp;lt;apk2-service&amp;gt; boot&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in the relevant locations.&lt;br /&gt;
&lt;br /&gt;
Then edit the profile build script above and add:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apkovl=&amp;quot;aports/scripts/genapkovl-mkimgoverlay.sh&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
immediately after the last apks= line.&lt;br /&gt;
&lt;br /&gt;
== Create the ISO ==&lt;br /&gt;
&lt;br /&gt;
{{Cmd|mkimage.sh	[--tag RELEASE] [--outdir OUTDIR] [--workdir WORKDIR]&lt;br /&gt;
		[--arch ARCH] [--profile PROFILE] [--hostkeys] [--simulate]&lt;br /&gt;
		[--repository REPO] [--extra-repository REPO] [--yaml FILE]&lt;br /&gt;
mkimage.sh	--help&lt;br /&gt;
&lt;br /&gt;
options:&lt;br /&gt;
--arch			Specify which architecture images to build&lt;br /&gt;
			(default: x86_64)&lt;br /&gt;
--hostkeys		Copy system apk signing keys to created images&lt;br /&gt;
--outdir		Specify directory for the created images&lt;br /&gt;
--profile		Specify which profiles to build&lt;br /&gt;
--repository		Package repository to use for the image create&lt;br /&gt;
--extra-repository	Add repository to search packages from&lt;br /&gt;
--simulate		Don&#039;t execute commands&lt;br /&gt;
--tag			Build images for tag RELEASE&lt;br /&gt;
--workdir		Specify temporary working directory (cache)&lt;br /&gt;
--yaml&lt;br /&gt;
&lt;br /&gt;
known profiles: ali rpi uboot base minirootfs standard vanilla extended virt xen}}&lt;br /&gt;
&lt;br /&gt;
{{Tip| You can use the --repository option multiple times, which is very useful when mixing local and official repositories. The --extra-repository option is  there only for backward-compatibility.}}&lt;br /&gt;
&lt;br /&gt;
Create an iso directory in your home dir:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|mkdir -p ~/iso}}&lt;br /&gt;
&lt;br /&gt;
Then create the actual ISO.&lt;br /&gt;
In this example we will use the edge version x86_64:&lt;br /&gt;
{{Cmd|sh aports/scripts/mkimage.sh --tag edge \&lt;br /&gt;
	--outdir ~/iso \&lt;br /&gt;
	--arch x86_64 \&lt;br /&gt;
	--repository &amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/edge/main&amp;lt;/nowiki&amp;gt; \&lt;br /&gt;
	--profile $PROFILENAME&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* If you want to make a customized installer, you need to create &amp;lt;code&amp;gt;.default_boot_services&amp;lt;/code&amp;gt; which will cause &amp;lt;code&amp;gt;mkinitfs&amp;lt;/code&amp;gt; to create the defaults for the live image.&lt;br /&gt;
&lt;br /&gt;
* Several parts of this doc can be automated with a script, like the repository/arch/outdir settings.&lt;br /&gt;
Those steps are left to you and your imagination :)&lt;br /&gt;
&lt;br /&gt;
== Testing your ISO image ==&lt;br /&gt;
&lt;br /&gt;
[[QEMU#Live_mode|QEMU]] is useful for a quick test of your newly created ISO image.&lt;br /&gt;
This ISO build process has been tested to work and generate an ISO with auto-installed APKs as of Nov 20, 2023 with Alpine edge. &lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[How to make a custom ISO image]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Package Manager]]&lt;br /&gt;
[[Category:ISO]]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=How_to_make_a_custom_ISO_image_with_mkimage&amp;diff=30809</id>
		<title>How to make a custom ISO image with mkimage</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=How_to_make_a_custom_ISO_image_with_mkimage&amp;diff=30809"/>
		<updated>2025-08-29T15:43:24Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: remove grub-efi mention: https://gitlab.alpinelinux.org/alpine/aports/-/commit/5147450891cc9db4c2615b7c0ac4b978bd3797c8&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document explains how to build a custom ISO image using the new mkimage scripts located in [[aports]] directory.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
First make sure we have the needed tools&lt;br /&gt;
{{Cmd|apk add alpine-sdk alpine-conf syslinux xorriso squashfs-tools grub doas}}&lt;br /&gt;
For efi you should add the following: &lt;br /&gt;
{{Cmd|apk add mtools dosfstools}}&lt;br /&gt;
&lt;br /&gt;
Create a user (e.g. build) and add them to the abuild group:&lt;br /&gt;
{{Cmd|adduser build -G abuild}}&lt;br /&gt;
&lt;br /&gt;
Give the user root-like permissions:&lt;br /&gt;
{{Cmd|vi /etc/doas.d/doas.conf}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
permit persist :abuild&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change to the build user: &lt;br /&gt;
{{Cmd|su - build}}&lt;br /&gt;
&lt;br /&gt;
Then create signing keys (-i installs them in /etc/apk/keys which is required for later)&lt;br /&gt;
{{Cmd|abuild-keygen -i -a}}&lt;br /&gt;
&lt;br /&gt;
{{Tip| Make sure your public keys are placed in /etc/apk/keys/ (example: build-xxxxxxxx.rsa.pub)}}&lt;br /&gt;
{{Cmd|ls /etc/apk/keys/}}&lt;br /&gt;
&lt;br /&gt;
Clone (or update) the [https://gitlab.alpinelinux.org/alpine/aports git repository].&lt;br /&gt;
{{Cmd|git clone --depth&amp;amp;#61;1 https://gitlab.alpinelinux.org/alpine/aports.git}}&lt;br /&gt;
&lt;br /&gt;
Make sure the apk index is up to date (so apk can find the packages):&lt;br /&gt;
{{Cmd|doas apk update}}&lt;br /&gt;
&lt;br /&gt;
Make sure your /tmp is large enough.  If you have the default 1GB /tmp, then create a local one with:&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir -pv ~/tmp&lt;br /&gt;
export TMPDIR=~/tmp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
The mkimg scripts are shipped with pre-configured profiles.&lt;br /&gt;
&lt;br /&gt;
The format is &#039;&#039;&#039;mkimg.$PROFILENAME.sh&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to have a custom ISO, you should create your own &#039;&#039;&#039;mkimg.$PROFILENAME.sh&#039;&#039;&#039; script.&lt;br /&gt;
&lt;br /&gt;
This is an example used to make a ZFS module, overlayfs (which enables r/w mode for /lib/modules), a serial console output and some other useful apks to build a simple NAS:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;export PROFILENAME=nas&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat &amp;lt;&amp;lt; EOF &amp;gt; ~/aports/scripts/mkimg.$PROFILENAME.sh&lt;br /&gt;
profile_$PROFILENAME() {&lt;br /&gt;
        profile_standard&lt;br /&gt;
        kernel_cmdline=&amp;quot;unionfs_size=512M console=tty0 console=ttyS0,115200&amp;quot;&lt;br /&gt;
        syslinux_serial=&amp;quot;0 115200&amp;quot;&lt;br /&gt;
        kernel_addons=&amp;quot;zfs&amp;quot;&lt;br /&gt;
        apks=&amp;quot;\$apks iscsi-scst zfs-scripts zfs zfs-utils-py&lt;br /&gt;
                cciss_vol_status lvm2 mdadm mkinitfs mtools nfs-utils&lt;br /&gt;
                parted rsync sfdisk syslinux util-linux xfsprogs&lt;br /&gt;
                dosfstools ntfs-3g&lt;br /&gt;
                &amp;quot;&lt;br /&gt;
        local _k _a&lt;br /&gt;
        for _k in \$kernel_flavors; do&lt;br /&gt;
                apks=&amp;quot;\$apks linux-\$_k&amp;quot;&lt;br /&gt;
                for _a in \$kernel_addons; do&lt;br /&gt;
                        apks=&amp;quot;\$apks \$_a-\$_k&amp;quot;&lt;br /&gt;
                done&lt;br /&gt;
        done&lt;br /&gt;
        apks=&amp;quot;\$apks linux-firmware&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set the script as executable:&lt;br /&gt;
{{Cmd|chmod +x ~/aports/scripts/mkimg.$PROFILENAME.sh}}&lt;br /&gt;
&lt;br /&gt;
== Making packages available on boot ==&lt;br /&gt;
&lt;br /&gt;
A package may be made available in the live system by defining the generation of an apkovl which contains a corresponding /etc/apk/world file, and adding that overlay definition to the mkimg-profile, e.g. with `apkovl=&amp;quot;genapkovl-mkimgoverlay.sh&amp;quot;`&lt;br /&gt;
&lt;br /&gt;
Note that to *use* your added apks, you have to install them, with {{ic|apk add}}.&lt;br /&gt;
&lt;br /&gt;
The definition may be done as in the [https://github.com/alpinelinux/aports/blob/master/scripts/genapkovl-dhcp.sh genapkovl-dhcp.sh] example.&lt;br /&gt;
Copy the relevant parts (including the rc_add lines) into a `genapkovl-mkimgoverlay.sh` file and add the package(s) that should be installed in the live system on separate lines in the file contents for /etc/apk/world.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|cp ~/aports/scripts/genapkovl-dhcp.sh ~/aports/scripts/genapkovl-mkimgoverlay.sh}}&lt;br /&gt;
&lt;br /&gt;
Edit the file to add:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
mkdir -p &amp;quot;$tmp&amp;quot;/etc/apk&lt;br /&gt;
makefile root:root 0644 &amp;quot;$tmp&amp;quot;/etc/apk/world &amp;lt;&amp;lt;EOF&lt;br /&gt;
alpine-base&lt;br /&gt;
&amp;lt;apk1-service&amp;gt;&lt;br /&gt;
&amp;lt;apk2-service&amp;gt;&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
rc_add &amp;lt;apk1-service&amp;gt; boot&lt;br /&gt;
rc_add &amp;lt;apk2-service&amp;gt; boot&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in the relevant locations.&lt;br /&gt;
&lt;br /&gt;
Then edit the profile build script above and add:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apkovl=&amp;quot;aports/scripts/genapkovl-mkimgoverlay.sh&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
immediately after the last apks= line.&lt;br /&gt;
&lt;br /&gt;
== Create the ISO ==&lt;br /&gt;
&lt;br /&gt;
{{Cmd|mkimage.sh	[--tag RELEASE] [--outdir OUTDIR] [--workdir WORKDIR]&lt;br /&gt;
		[--arch ARCH] [--profile PROFILE] [--hostkeys] [--simulate]&lt;br /&gt;
		[--repository REPO] [--extra-repository REPO] [--yaml FILE]&lt;br /&gt;
mkimage.sh	--help&lt;br /&gt;
&lt;br /&gt;
options:&lt;br /&gt;
--arch			Specify which architecture images to build&lt;br /&gt;
			(default: x86_64)&lt;br /&gt;
--hostkeys		Copy system apk signing keys to created images&lt;br /&gt;
--outdir		Specify directory for the created images&lt;br /&gt;
--profile		Specify which profiles to build&lt;br /&gt;
--repository		Package repository to use for the image create&lt;br /&gt;
--extra-repository	Add repository to search packages from&lt;br /&gt;
--simulate		Don&#039;t execute commands&lt;br /&gt;
--tag			Build images for tag RELEASE&lt;br /&gt;
--workdir		Specify temporary working directory (cache)&lt;br /&gt;
--yaml&lt;br /&gt;
&lt;br /&gt;
known profiles: ali rpi uboot base minirootfs standard vanilla extended virt xen}}&lt;br /&gt;
&lt;br /&gt;
{{Tip| You can use the --repository option multiple times, which is very useful when mixing local and official repositories. The --extra-repository option is  there only for backward-compatibility.}}&lt;br /&gt;
&lt;br /&gt;
Create an iso directory in your home dir:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|mkdir -p ~/iso}}&lt;br /&gt;
&lt;br /&gt;
Then create the actual ISO.&lt;br /&gt;
In this example we will use the edge version x86_64:&lt;br /&gt;
{{Cmd|sh aports/scripts/mkimage.sh --tag edge \&lt;br /&gt;
	--outdir ~/iso \&lt;br /&gt;
	--arch x86_64 \&lt;br /&gt;
	--repository &amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/edge/main&amp;lt;/nowiki&amp;gt; \&lt;br /&gt;
	--profile $PROFILENAME&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* If you want to make a customized installer, you need to create &amp;lt;code&amp;gt;.default_boot_services&amp;lt;/code&amp;gt; which will cause &amp;lt;code&amp;gt;mkinitfs&amp;lt;/code&amp;gt; to create the defaults for the live image.&lt;br /&gt;
&lt;br /&gt;
* Several parts of this doc can be automated with a script, like the repository/arch/outdir settings.&lt;br /&gt;
Those steps are left to you and your imagination :)&lt;br /&gt;
&lt;br /&gt;
== Testing your ISO image ==&lt;br /&gt;
&lt;br /&gt;
[[QEMU#Live_mode|QEMU]] is useful for a quick test of your newly created ISO image.&lt;br /&gt;
This ISO build process has been tested to work and generate an ISO with auto-installed APKs as of Nov 20, 2023 with Alpine edge. &lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[How to make a custom ISO image]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Package Manager]]&lt;br /&gt;
[[Category:ISO]]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Shell_management&amp;diff=30659</id>
		<title>Shell management</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Shell_management&amp;diff=30659"/>
		<updated>2025-08-07T12:01:13Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: remove always true condition&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The default shell used by Alpine Linux is the [[BusyBox]] variant of the [[BusyBox#Ash_shell|ash]] shell. This page explains how to use the default shell and various ways to change the default shell in Alpine Linux. &lt;br /&gt;
&lt;br /&gt;
== Ash shell == &lt;br /&gt;
&lt;br /&gt;
Alpine Linux uses [[Busybox]] Ash shell for its default shell. It is a standard POSIX shell derived from Debian Ash variant. &lt;br /&gt;
&lt;br /&gt;
One&#039;s ~/.bashrc file (or, alternatively, a different shell alias file) could be considered as a basis, say, for an {{Path|~/.ashrc}} file, reviewing it carefully for syntax/cli variants against that of Ash shell. For non-login, interactive shells refer to [[#Setting alias|Setting alias]] section.&lt;br /&gt;
&lt;br /&gt;
{{Tip|Use {{pkg|checkbashisms}} script to perform basic checks for the presence of bashisms in scripts and help remove them.}}&lt;br /&gt;
&lt;br /&gt;
=== Setting alias ===&lt;br /&gt;
&lt;br /&gt;
For interactive non-login shells, Busybox Ash and other POSIX shells do NOT automatically read a startup file like {{Path|~/.ashrc}}. To ensure that both login and non-login interactive shells work consistently, use &#039;&#039;&#039;ENV&#039;&#039;&#039; environment variable in {{Path|~/.profile}} to refer {{Path|~/.ashrc}} file. &lt;br /&gt;
&lt;br /&gt;
# Edit the {{Path|~/.profile}} as follows: {{Cat|~/.profile|&amp;lt;nowiki&amp;gt;...&lt;br /&gt;
export ENV=&amp;quot;$HOME/.ashrc&amp;quot; &amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
# Now aliases can be added in the startup file {{Path|~/.ashrc}} as follows: {{Cat|~/.ashrc|&amp;lt;nowiki&amp;gt;# ~/.ashrc: interactive shell configuration for BusyBox Ash&lt;br /&gt;
&lt;br /&gt;
# Custom Aliases&lt;br /&gt;
alias ls=&#039;ls --color=auto&#039;&lt;br /&gt;
alias grep=&#039;grep --color=auto&#039;&lt;br /&gt;
&lt;br /&gt;
# You may want to put all your additions into a separate file like&lt;br /&gt;
# ~/.ash_aliases, instead of adding them here directly.&lt;br /&gt;
&lt;br /&gt;
if [ -f ~/.ash_aliases ]; then&lt;br /&gt;
    . ~/.ash_aliases&lt;br /&gt;
fi&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== Available shells ==&lt;br /&gt;
&lt;br /&gt;
Most of the popular shells are available in Alpine Linux repositories as can be seen from the below list. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;width:100%; border:1px #0771a6 solid; background:#f9f9f9; text-align:left; border-collapse:collapse;&amp;quot;&lt;br /&gt;
|-style=&amp;quot;background:#333333; color:#ffffff; font-size: 1.2em; text-align:center;&amp;quot;&lt;br /&gt;
|width=&amp;quot;10%&amp;quot; | Name &lt;br /&gt;
|width=&amp;quot;36%&amp;quot; | URL &lt;br /&gt;
|Remarks&lt;br /&gt;
|-&lt;br /&gt;
|{{Pkg|bash}}|| https://www.gnu.org/software/bash/bash.html||The GNU Bourne Again shell&lt;br /&gt;
|-&lt;br /&gt;
|{{Pkg|zsh}} || https://www.zsh.org/||Very advanced and programmable command interpreter&lt;br /&gt;
|-&lt;br /&gt;
|{{Pkg|fish}} ||https://fishshell.com/||Modern interactive commandline shell&lt;br /&gt;
|-&lt;br /&gt;
|{{pkg|dash}} ||http://gondor.apana.org.au/~herbert/dash/||Small and fast POSIX-compliant shell&lt;br /&gt;
|-&lt;br /&gt;
|{{pkg|oksh}} ||https://github.com/ibara/oksh||Portable OpenBSD ksh, based on pdksh&lt;br /&gt;
|-&lt;br /&gt;
|{{pkg|loksh}} ||https://github.com/dimkr/loksh||A Linux port of OpenBSD&#039;s ksh&lt;br /&gt;
|-&lt;br /&gt;
|{{pkg|yash}} ||https://magicant.github.io/yash||Yet another shell&lt;br /&gt;
|-&lt;br /&gt;
|{{pkg|tcsh}} ||https://github.com/tcsh-org/tcsh||extended C-shell&lt;br /&gt;
|-&lt;br /&gt;
|{{pkg|nsh}} ||https://github.com/nuta/nsh||A command-line shell like fish, but POSIX compatible&lt;br /&gt;
|-&lt;br /&gt;
|{{pkg|elvish}} ||https://elv.sh||Friendly and expressive Unix shell&lt;br /&gt;
|-&lt;br /&gt;
|{{pkg|nushell}} ||https://www.nushell.sh||A new type of shell&lt;br /&gt;
|-&lt;br /&gt;
|{{pkg|murex}} ||https://murex.rocks/||Intuitive, typed and content aware shell&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To install any of the above shells, say for eg: {{pkg|bash}} shell: {{Cmd|# apk add {{pkg|bash}} {{pkg|bash-completion}}}}&lt;br /&gt;
&lt;br /&gt;
== Change default shell == &lt;br /&gt;
&lt;br /&gt;
There are various ways to change the default shell in Alpine Linux. You can revert back to [[#ash|ash]] shell at anytime with the same steps. &lt;br /&gt;
&lt;br /&gt;
{{Note|After performing the below step, you need to log out and login again for these changes to take effect.}}&lt;br /&gt;
&lt;br /&gt;
=== By hand ===&lt;br /&gt;
&lt;br /&gt;
Edit {{Path|/etc/passwd}} manually using an editor of your choice. An example line for a user named &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; is: {{Cat|/etc/passwd|...&lt;br /&gt;
user:x:1000:1000:user:/home/user:/bin/ash&lt;br /&gt;
...&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Change {{Path|/bin/ash}} to point to the path of a shell from {{Path|/etc/shells}}. Take care to not delete/mangle the line, as it would make you unable to log in again. The &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; should be the user you are changing the default login shell for.&lt;br /&gt;
&lt;br /&gt;
=== Using chsh command ===&lt;br /&gt;
&lt;br /&gt;
To use {{ic|chsh}} command, install the {{pkg|shadow}} package: {{Cmd|# apk add shadow}}&lt;br /&gt;
And use chsh: {{Cmd|# chsh username}}&lt;br /&gt;
Now enter the path for the shell you want to use (e.g {{Path|/bin/zsh}})&lt;br /&gt;
and press {{Key|Enter}} to confirm this change. The shell should exist in {{Path|/etc/shells}}.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [https://linux.die.net/man/1/dash dash Manual]&lt;br /&gt;
* [https://git.busybox.net/busybox/tree/shell/README Ash README]&lt;br /&gt;
* [https://git.busybox.net/busybox/tree/shell Ash source code]&lt;br /&gt;
* [https://pubs.opengroup.org/onlinepubs/9799919799/ POSIX standard]&lt;br /&gt;
* [https://stackoverflow.com/questions/38024160/how-to-get-etc-profile-to-run-automatically-in-alpine-docker/38025686#38025686 stackoverflow on ash shell]&lt;br /&gt;
&lt;br /&gt;
[[Category:Shell]]&lt;br /&gt;
[[Category:System Administration]]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Sertonix/Freedom_of_choice&amp;diff=30555</id>
		<title>User:Sertonix/Freedom of choice</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Sertonix/Freedom_of_choice&amp;diff=30555"/>
		<updated>2025-07-22T16:21:10Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: remove suckless tools (they weren&amp;#039;t supported anyways)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is an overview over the different available programms, etc. that can be selected from when using alpine. It is also intended as a reference what should be documented and what could be supported.&lt;br /&gt;
&lt;br /&gt;
== Bootloaders ==&lt;br /&gt;
* See: [[Bootloaders]]&lt;br /&gt;
* Also: {{Pkg|systemd-boot}}&lt;br /&gt;
&lt;br /&gt;
== Kernel ==&lt;br /&gt;
* See: [[Kernels]]&lt;br /&gt;
&lt;br /&gt;
== Libc ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|musl}} || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| [https://www.gnu.org/software/libc/ glibc] || style=&amp;quot;background:red&amp;quot; | None || [[Running glibc programs]]&lt;br /&gt;
|-&lt;br /&gt;
| without aka static || style=&amp;quot;background:orange&amp;quot; | depends on package || Note that this only means no libc at runtime&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://gitlab.alpinelinux.org/alpine/tsc/-/issues/17 alpine-glibc]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Libc Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
== Initramfs ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|mkinitfs}} || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dracut}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|booster}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| [https://github.com/illiliti/tinyramfs tinyramfs] || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:red&amp;quot; | None || may require [[custom Kernel]], [https://kisslinux.org/install#021 kisslinux without initramfs]&lt;br /&gt;
|}&lt;br /&gt;
* See also: [[Initramfs init]]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Initramfs Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
== PID 1 ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| busybox init || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dinit}} || style=&amp;quot;background:orange&amp;quot; | In testing || Shutdown commands are prefixed with {{ic|dinit-}}. eg {{ic|dinit-reboot}}&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|s6-linux-init}} || style=&amp;quot;background:orange&amp;quot; | Works || Requires manually running {{ic|s6-linux-init-maker}}&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|openrc-init}} || style=&amp;quot;background:orange&amp;quot; | Manual setup ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dumb-init}} || style=&amp;quot;background:silver&amp;quot; | Needs testing || For containers&lt;br /&gt;
|-&lt;br /&gt;
| runit-init || style=&amp;quot;background:silver&amp;quot; | Needs testing || [https://dev.alpinelinux.org/~clandmeter/other/forum.alpinelinux.org/comment/383.html#comment-383 runit-init starting OpenRC]&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|epoch}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| custom || style=&amp;quot;background:lime&amp;quot; | Full || For example in docker containers&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Init_system Gentoo Wiki]&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Init Archwiki]&lt;br /&gt;
&lt;br /&gt;
== Service Manager ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[OpenRC]] || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dinit}} || style=&amp;quot;background:orange&amp;quot; | In testing || {{Pkg|dinit-alpine}} includes service files&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|s6-rc}} || style=&amp;quot;background:orange&amp;quot; | Works || Not integrated. For containers there is {{Pkg|s6-overlay}}&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|runit}} || style=&amp;quot;background:orange&amp;quot; | As OpenRC service ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|daemontools}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|daemontools-encore}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|supervisor}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| busybox runit || style=&amp;quot;background:red&amp;quot; | None || Not enabled in a busybox package&lt;br /&gt;
|-&lt;br /&gt;
| systemd || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full || Requires to replace {{Pkg|alpine-base}} with custom set of packages (See {{Issue|71686}})&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Init_system Gentoo Wiki]&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Init Archwiki]&lt;br /&gt;
&lt;br /&gt;
== System Logs ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[Syslog#busybox_syslog|busybox syslog]] || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|rsyslog}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|syslog-ng}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{pkg|socklog}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| [https://skarnet.org/software/s6/s6-socklog.html s6-socklog] from {{pkg|s6}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd-journald || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|}&lt;br /&gt;
* See also: [[Syslog]]&lt;br /&gt;
&lt;br /&gt;
== [[Device Manager]] ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[mdev]] || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| [[mdevd]] || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| [[eudev]] || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| vdev || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd-udev || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Power Managment ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[busybox acpid]] || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|acpid}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|elogind}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd-logind || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Power_management Archwiki]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Power_management Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
== DHCP Client ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[Udhcpc|busybox udhcpc]] || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dhcpcd}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dhclient}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| without aka static || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|}&lt;br /&gt;
* See also: [[Configure Networking]]&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Network_configuration#DHCP Archwiki]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Resolv.conf Gentoo Wiki - resolv.conf]&lt;br /&gt;
&lt;br /&gt;
== Wi-Fi ==&lt;br /&gt;
* See: [[Wi-Fi]]&lt;br /&gt;
* Also supported: {{pkg|eiwd}}&lt;br /&gt;
&lt;br /&gt;
== Seat/Session Managnent ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[elogind]] || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|seatd}} || style=&amp;quot;background:lime&amp;quot; | Full || seats only&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|turnstile}} || style=&amp;quot;background:silver&amp;quot; | needs testing || session only&lt;br /&gt;
|-&lt;br /&gt;
| systemd-logind || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full || Not recommended with graphical enviroment&lt;br /&gt;
|}&lt;br /&gt;
* [https://wiki.gentoo.org/wiki/Seatd Gentoo Wiki - seatd]&lt;br /&gt;
* [https://wiki.gentoo.org/wiki/Elogind Gentoo Wiki - elogind]&lt;br /&gt;
* [https://wiki.archlinux.org/title/Init#logind ArchWiki - systemd-logind]&lt;br /&gt;
* [https://chimera-linux.org/docs/configuration/seat Chimera Linux docs]&lt;br /&gt;
&lt;br /&gt;
== Login ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Supports [[PAM]] !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| busybox login || style=&amp;quot;background:lime&amp;quot; | Full || style=&amp;quot;background:red&amp;quot; | No || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|greetd}} || style=&amp;quot;background:lime&amp;quot; | Full || style=&amp;quot;background:lime&amp;quot; | Yes || requires greeter&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|shadow-login}} || style=&amp;quot;background:lime&amp;quot; | Full || style=&amp;quot;background:lime&amp;quot; | Yes ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|util-linux-login}} || style=&amp;quot;background:lime&amp;quot; | Full || style=&amp;quot;background:lime&amp;quot; | Yes ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd-logind || style=&amp;quot;background:red&amp;quot; | None || style=&amp;quot;background:lime&amp;quot; | Yes || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full || style=&amp;quot;background:red&amp;quot; | No ||&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Login Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
== Shell Utils ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|busybox}} || style=&amp;quot;background:lime&amp;quot; | Full || Dependency of {{pkg|alpine-base}}&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|busybox-extras}} || style=&amp;quot;background:lime&amp;quot; | Full || Some commands that are missing in the main {{Pkg|busybox}} package&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|util-linux}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| [[GNU_core_utilities|coreutils]] || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|s6-portable-utils}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|s6-linux-utils}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|toybox}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|sbase}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|ubase}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:red&amp;quot; | None || A lot of implicit dependency&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Core_utilities Archwiki]&lt;br /&gt;
&lt;br /&gt;
== Shell ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| busybox ash || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|bash}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dash}} || style=&amp;quot;background:lime&amp;quot; | Full || When used as /bin/sh this may cause breakage.&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|yash}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| busybox hush || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:red&amp;quot; | None || sometimes implicit dependency&lt;br /&gt;
|}&lt;br /&gt;
* See also: [[Change default shell]]&lt;br /&gt;
* See proposal: [https://gitlab.alpinelinux.org/alpine/tsc/-/issues/39 replace busybox ash with another /bin/sh]&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Command-line_shell Archwiki]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Shell Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
== SU ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| {{ic|su}} from {{Pkg|busybox-suid}} || style=&amp;quot;background:lime&amp;quot; | Full || default, can&#039;t be removed by default ({{issue|11730}})&lt;br /&gt;
|-&lt;br /&gt;
| {{ic|su}} from {{Pkg|shadow-login}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{ic|su}} from {{Pkg|util-linux-login}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|sudo}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|doas}} || style=&amp;quot;background:lime&amp;quot; | Full || sudo shim using doas: {{Pkg|doas-sudo-shim}}&lt;br /&gt;
|-&lt;br /&gt;
| [https://skarnet.org/software/s6/s6-sudo.html s6-sudo] || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SSL/TLS ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|openssl}} || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|libressl}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|bearssl}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://gitlab.alpinelinux.org/alpine/tsc/-/issues/28 consider LibreSSL as default OpenSSL provider again]&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Transport_Layer_Security Archwiki]&lt;br /&gt;
* See also: [https://github.com/haproxy/wiki/wiki/SSL-Libraries-Support-Status haproxy SSL Libraries Support Status]&lt;br /&gt;
&lt;br /&gt;
== Cron ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|cronie}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dcron}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|fcron}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| vixie-cron || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| scron || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd.timer || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full || {{Pkg|alpine-baselayout}} includes cron specific directories though&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Cron Archwiki]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Cron Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
== SSH ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[Setting_up_a_SSH_server#OpenSSH|openssh]] || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| [[Setting_up_a_SSH_server#Dropbear|dropbear]] || style=&amp;quot;background:lime&amp;quot; | Full || provide {{ic|ssh}} command {{pkg|dropbear-ssh}}&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Secure_Shell Archwiki]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/SSH Gentoo Wiki - OpenSSH]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Dropbear Gentoo Wiki - Dropbear]&lt;br /&gt;
&lt;br /&gt;
== Desktop ==&lt;br /&gt;
* See: [[Desktop environments and Window managers]]&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Architecture|Alpine Architecture]]&lt;br /&gt;
* [https://gitlab.alpinelinux.org/alpine/tsc/-/issues/55 Future of busybox]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Sertonix/Freedom_of_choice&amp;diff=30554</id>
		<title>User:Sertonix/Freedom of choice</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Sertonix/Freedom_of_choice&amp;diff=30554"/>
		<updated>2025-07-22T16:20:01Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: systemd-boot is now packaged&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is an overview over the different available programms, etc. that can be selected from when using alpine. It is also intended as a reference what should be documented and what could be supported.&lt;br /&gt;
&lt;br /&gt;
== Bootloaders ==&lt;br /&gt;
* See: [[Bootloaders]]&lt;br /&gt;
* Also: {{Pkg|systemd-boot}}&lt;br /&gt;
&lt;br /&gt;
== Kernel ==&lt;br /&gt;
* See: [[Kernels]]&lt;br /&gt;
&lt;br /&gt;
== Libc ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|musl}} || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| [https://www.gnu.org/software/libc/ glibc] || style=&amp;quot;background:red&amp;quot; | None || [[Running glibc programs]]&lt;br /&gt;
|-&lt;br /&gt;
| without aka static || style=&amp;quot;background:orange&amp;quot; | depends on package || Note that this only means no libc at runtime&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://gitlab.alpinelinux.org/alpine/tsc/-/issues/17 alpine-glibc]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Libc Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
== Initramfs ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|mkinitfs}} || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dracut}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|booster}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| [https://github.com/illiliti/tinyramfs tinyramfs] || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:red&amp;quot; | None || may require [[custom Kernel]], [https://kisslinux.org/install#021 kisslinux without initramfs]&lt;br /&gt;
|}&lt;br /&gt;
* See also: [[Initramfs init]]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Initramfs Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
== PID 1 ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| busybox init || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dinit}} || style=&amp;quot;background:orange&amp;quot; | In testing || Shutdown commands are prefixed with {{ic|dinit-}}. eg {{ic|dinit-reboot}}&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|s6-linux-init}} || style=&amp;quot;background:orange&amp;quot; | Works || Requires manually running {{ic|s6-linux-init-maker}}&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|openrc-init}} || style=&amp;quot;background:orange&amp;quot; | Manual setup ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dumb-init}} || style=&amp;quot;background:silver&amp;quot; | Needs testing || For containers&lt;br /&gt;
|-&lt;br /&gt;
| runit-init || style=&amp;quot;background:silver&amp;quot; | Needs testing || [https://dev.alpinelinux.org/~clandmeter/other/forum.alpinelinux.org/comment/383.html#comment-383 runit-init starting OpenRC]&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|epoch}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| [https://core.suckless.org/sinit/ sinit] || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| custom || style=&amp;quot;background:lime&amp;quot; | Full || For example in docker containers&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Init_system Gentoo Wiki]&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Init Archwiki]&lt;br /&gt;
&lt;br /&gt;
== Service Manager ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[OpenRC]] || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dinit}} || style=&amp;quot;background:orange&amp;quot; | In testing || {{Pkg|dinit-alpine}} includes service files&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|s6-rc}} || style=&amp;quot;background:orange&amp;quot; | Works || Not integrated. For containers there is {{Pkg|s6-overlay}}&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|runit}} || style=&amp;quot;background:orange&amp;quot; | As OpenRC service ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|daemontools}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|daemontools-encore}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|supervisor}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| busybox runit || style=&amp;quot;background:red&amp;quot; | None || Not enabled in a busybox package&lt;br /&gt;
|-&lt;br /&gt;
| [https://core.suckless.org/svc/ svc] || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full || Requires to replace {{Pkg|alpine-base}} with custom set of packages (See {{Issue|71686}})&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Init_system Gentoo Wiki]&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Init Archwiki]&lt;br /&gt;
&lt;br /&gt;
== System Logs ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[Syslog#busybox_syslog|busybox syslog]] || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|rsyslog}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|syslog-ng}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{pkg|socklog}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| [https://skarnet.org/software/s6/s6-socklog.html s6-socklog] from {{pkg|s6}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd-journald || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|}&lt;br /&gt;
* See also: [[Syslog]]&lt;br /&gt;
&lt;br /&gt;
== [[Device Manager]] ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[mdev]] || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| [[mdevd]] || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| [[eudev]] || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| [https://core.suckless.org/smdev/ smdev] || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| vdev || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd-udev || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Power Managment ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[busybox acpid]] || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|acpid}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|elogind}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd-logind || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Power_management Archwiki]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Power_management Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
== DHCP Client ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[Udhcpc|busybox udhcpc]] || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dhcpcd}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dhclient}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| [https://core.suckless.org/sdhcp/ sdhcp] || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| without aka static || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|}&lt;br /&gt;
* See also: [[Configure Networking]]&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Network_configuration#DHCP Archwiki]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Resolv.conf Gentoo Wiki - resolv.conf]&lt;br /&gt;
&lt;br /&gt;
== Wi-Fi ==&lt;br /&gt;
* See: [[Wi-Fi]]&lt;br /&gt;
* Also supported: {{pkg|eiwd}}&lt;br /&gt;
&lt;br /&gt;
== Seat/Session Managnent ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[elogind]] || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|seatd}} || style=&amp;quot;background:lime&amp;quot; | Full || seats only&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|turnstile}} || style=&amp;quot;background:silver&amp;quot; | needs testing || session only&lt;br /&gt;
|-&lt;br /&gt;
| systemd-logind || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full || Not recommended with graphical enviroment&lt;br /&gt;
|}&lt;br /&gt;
* [https://wiki.gentoo.org/wiki/Seatd Gentoo Wiki - seatd]&lt;br /&gt;
* [https://wiki.gentoo.org/wiki/Elogind Gentoo Wiki - elogind]&lt;br /&gt;
* [https://wiki.archlinux.org/title/Init#logind ArchWiki - systemd-logind]&lt;br /&gt;
* [https://chimera-linux.org/docs/configuration/seat Chimera Linux docs]&lt;br /&gt;
&lt;br /&gt;
== Login ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Supports [[PAM]] !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| busybox login || style=&amp;quot;background:lime&amp;quot; | Full || style=&amp;quot;background:red&amp;quot; | No || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|greetd}} || style=&amp;quot;background:lime&amp;quot; | Full || style=&amp;quot;background:lime&amp;quot; | Yes || requires greeter&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|shadow-login}} || style=&amp;quot;background:lime&amp;quot; | Full || style=&amp;quot;background:lime&amp;quot; | Yes ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|util-linux-login}} || style=&amp;quot;background:lime&amp;quot; | Full || style=&amp;quot;background:lime&amp;quot; | Yes ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd-logind || style=&amp;quot;background:red&amp;quot; | None || style=&amp;quot;background:lime&amp;quot; | Yes || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full || style=&amp;quot;background:red&amp;quot; | No ||&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Login Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
== Shell Utils ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|busybox}} || style=&amp;quot;background:lime&amp;quot; | Full || Dependency of {{pkg|alpine-base}}&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|busybox-extras}} || style=&amp;quot;background:lime&amp;quot; | Full || Some commands that are missing in the main {{Pkg|busybox}} package&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|util-linux}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| [[GNU_core_utilities|coreutils]] || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|s6-portable-utils}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|s6-linux-utils}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|toybox}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|sbase}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|ubase}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:red&amp;quot; | None || A lot of implicit dependency&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Core_utilities Archwiki]&lt;br /&gt;
&lt;br /&gt;
== Shell ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| busybox ash || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|bash}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dash}} || style=&amp;quot;background:lime&amp;quot; | Full || When used as /bin/sh this may cause breakage.&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|yash}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| busybox hush || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:red&amp;quot; | None || sometimes implicit dependency&lt;br /&gt;
|}&lt;br /&gt;
* See also: [[Change default shell]]&lt;br /&gt;
* See proposal: [https://gitlab.alpinelinux.org/alpine/tsc/-/issues/39 replace busybox ash with another /bin/sh]&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Command-line_shell Archwiki]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Shell Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
== SU ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| {{ic|su}} from {{Pkg|busybox-suid}} || style=&amp;quot;background:lime&amp;quot; | Full || default, can&#039;t be removed by default ({{issue|11730}})&lt;br /&gt;
|-&lt;br /&gt;
| {{ic|su}} from {{Pkg|shadow-login}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{ic|su}} from {{Pkg|util-linux-login}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|sudo}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|doas}} || style=&amp;quot;background:lime&amp;quot; | Full || sudo shim using doas: {{Pkg|doas-sudo-shim}}&lt;br /&gt;
|-&lt;br /&gt;
| [https://skarnet.org/software/s6/s6-sudo.html s6-sudo] || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SSL/TLS ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|openssl}} || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|libressl}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|bearssl}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://gitlab.alpinelinux.org/alpine/tsc/-/issues/28 consider LibreSSL as default OpenSSL provider again]&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Transport_Layer_Security Archwiki]&lt;br /&gt;
* See also: [https://github.com/haproxy/wiki/wiki/SSL-Libraries-Support-Status haproxy SSL Libraries Support Status]&lt;br /&gt;
&lt;br /&gt;
== Cron ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|cronie}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dcron}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|fcron}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| vixie-cron || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| scron || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd.timer || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full || {{Pkg|alpine-baselayout}} includes cron specific directories though&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Cron Archwiki]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Cron Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
== SSH ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[Setting_up_a_SSH_server#OpenSSH|openssh]] || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| [[Setting_up_a_SSH_server#Dropbear|dropbear]] || style=&amp;quot;background:lime&amp;quot; | Full || provide {{ic|ssh}} command {{pkg|dropbear-ssh}}&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Secure_Shell Archwiki]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/SSH Gentoo Wiki - OpenSSH]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Dropbear Gentoo Wiki - Dropbear]&lt;br /&gt;
&lt;br /&gt;
== Desktop ==&lt;br /&gt;
* See: [[Desktop environments and Window managers]]&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Architecture|Alpine Architecture]]&lt;br /&gt;
* [https://gitlab.alpinelinux.org/alpine/tsc/-/issues/55 Future of busybox]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=APKBUILD_Reference&amp;diff=29227</id>
		<title>APKBUILD Reference</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=APKBUILD_Reference&amp;diff=29227"/>
		<updated>2025-03-10T12:54:21Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: /* User-defined variables */ fix sonameprefix example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;APKBUILDs are the scripts that are created in order to build Alpine packages using the [[Abuild and Helpers|abuild]] tool.&lt;br /&gt;
&lt;br /&gt;
See [[aports]] for details on Alpine&#039;s official ports repository.&lt;br /&gt;
&lt;br /&gt;
This page is intended to serve as a reference for creating APKBUILDs; if this is your first time creating a package for Alpine Linux, please see [[Creating an Alpine package]].&lt;br /&gt;
&lt;br /&gt;
= Legend =&lt;br /&gt;
The following notes will assist you in understanding this document.&lt;br /&gt;
&lt;br /&gt;
In description text:&lt;br /&gt;
* If a variable is not prefixed with a &#039;&#039;$&#039;&#039;, it will be represented by italics (i.e., &#039;&#039;srcdir&#039;&#039; ).&lt;br /&gt;
* Functions will also be represented by italics, but will also end with a pair of parentheses (i.e., &#039;&#039;build()&#039;&#039; ).&lt;br /&gt;
* Shell commands will be represented &amp;lt;code&amp;gt;like this&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Variables =&lt;br /&gt;
{{Note|Variables that contain a path (e.g. &#039;&#039;$srcdir&#039;&#039; and &#039;&#039;$pkgdir&#039;&#039;) should always be quoted using double quotes (i.e., &#039;&#039;&amp;quot;$srcdir&amp;quot;&#039;&#039;).  This is done to prevent things from breaking, should the user have the APKBUILD in a directory path that contains spaces.}}&lt;br /&gt;
{{Note|All arbitrary variable and function names should be prefixed with an underscore character ( _ ) to avoid name clashes with the internals of abuild (for example, &#039;&#039;_luaversions&#039;&#039;).}}&lt;br /&gt;
&lt;br /&gt;
These variables are all well documented in &amp;lt;code&amp;gt;man 5 APKBUILD&amp;lt;/code&amp;gt; ([https://gitlab.alpinelinux.org/alpine/abuild/-/blob/master/APKBUILD.5.scd man page source]).&lt;br /&gt;
&lt;br /&gt;
== User-defined variables ==&lt;br /&gt;
The following variables should be defined by the user:&lt;br /&gt;
==== maintainer ====&lt;br /&gt;
: Name and email address of the maintainer of the package.&lt;br /&gt;
: A well-formatted example is &amp;lt;code&amp;gt;maintainer=&amp;quot;John Snow &amp;lt;john_snow@thewall.net&amp;gt;&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== arch ====&lt;br /&gt;
: Package architecture(s) to build for.  Can be one or several seperated by whitespace of: &#039;&#039;&#039;[[x86]], [[x86_64]], [[armv7]], [[armhf]], [[aarch64]], [[ppc64le]], [[s390x]], [[riscv64]], all&#039;&#039;&#039;, or &#039;&#039;&#039;noarch&#039;&#039;&#039;, where &#039;&#039;&#039;all&#039;&#039;&#039; means all architectures, and &#039;&#039;&#039;noarch&#039;&#039;&#039; means it&#039;s architecture-independent (e.g., a pure-python package). Architectures can be negated using the ! character to exclude them from the list of supported architectures. E.g. &#039;&#039;&#039;arch=&amp;quot;all !ppc64le&amp;quot;&#039;&#039;&#039; means that the package is allowed to be built on all architectures but the ppc64le architecture.&lt;br /&gt;
: {{Tip|To determine if your APKBUILD can use &#039;&#039;&#039;noarch&#039;&#039;&#039;: First specify &#039;&#039;&#039;all&#039;&#039;&#039; and then build the package by executing &amp;lt;code&amp;gt;abuild -r&amp;lt;/code&amp;gt;.  Watch the output towards the end for warnings saying that &#039;&#039;&#039;noarch&#039;&#039;&#039; can be used.  If the main package and all subpackages, if you have any subpackages, give a warning saying that &#039;&#039;&#039;noarch&#039;&#039;&#039; can be used, then you can use &#039;&#039;&#039;noarch&#039;&#039;&#039;.}}&lt;br /&gt;
&lt;br /&gt;
==== depends ====&lt;br /&gt;
: Run-time dependency package(s) that are not shared-object dependencies.  Shared objects dependencies are auto-detected and should not be specified here. To specify a conflicting package, add the package name prefixed with a &#039;!&#039;.&lt;br /&gt;
&lt;br /&gt;
==== depends_dev ====&lt;br /&gt;
: Run-time dependency package(s) for the &#039;&#039;&#039;$pkgname-dev&#039;&#039;&#039; subpackage.&lt;br /&gt;
&lt;br /&gt;
: {{Note|From ncopa on IRC: To find out if you need to add a package to depends_dev have a look at *requires* in usr/lib/pkgconfig/*.pc. With libtool it gets more complicated, but we should delete the .la files. Also check if there are any  /usr/bin/*-configure #!/bin/bash #!/usr/bin/perl or Python. Sometimes scripts or similar are generated at build time (i.e autoconf automake) then you normally don&#039;t need add those to depends_dev. You can also just add all -dev makedepends to depends_dev but it will slow the build process a little bit (more build dependencies).}}&lt;br /&gt;
&lt;br /&gt;
==== depends_doc ====&lt;br /&gt;
: Run-time dependency package(s) for the &#039;&#039;&#039;$pkgname-doc&#039;&#039;&#039; subpackage.&lt;br /&gt;
&lt;br /&gt;
==== depends_openrc ====&lt;br /&gt;
: Run-time dependency package(s) for the &#039;&#039;&#039;$pkgname-openrc&#039;&#039;&#039; subpackage.&lt;br /&gt;
&lt;br /&gt;
==== depends_libs ====&lt;br /&gt;
: Run-time dependency package(s) for the &#039;&#039;&#039;$pkgname-libs&#039;&#039;&#039; subpackage.&lt;br /&gt;
&lt;br /&gt;
==== depends_static ====&lt;br /&gt;
: Run-time dependency package(s) for the &#039;&#039;&#039;$pkgname-static&#039;&#039;&#039; subpackage.&lt;br /&gt;
&lt;br /&gt;
==== checkdepends ====&lt;br /&gt;
: Dependencies that are only required during the check phase, they are only installed if the check option is enabled&lt;br /&gt;
&lt;br /&gt;
==== giturl ====&lt;br /&gt;
:Git repository from which &amp;lt;code&amp;gt;abuild checkout&amp;lt;/code&amp;gt; checks out. You can checkout a specific branch in git by adding &amp;lt;code&amp;gt;-b $branch&amp;lt;/code&amp;gt;.&lt;br /&gt;
==== install ====&lt;br /&gt;
: There are 6 different types of install scripts.  Install scripts are named &#039;&#039;&#039;$pkgname.action&#039;&#039;&#039;, where &#039;&#039;&#039;action&#039;&#039;&#039; can be:  &#039;&#039;&#039;pre-install, post-install, pre-upgrade, post-upgrade, pre-deinstall&#039;&#039;&#039;, or &#039;&#039;&#039;post-deinstall&#039;&#039;&#039;.  For example, if &#039;&#039;pkgname&#039;&#039; is set to &#039;&#039;&#039;mypackage&#039;&#039;&#039; and &#039;&#039;install&#039;&#039; is set to &#039;&#039;&#039;$pkgname.post-install&#039;&#039;&#039;, then a script named &#039;&#039;&#039;mypackage.post-install&#039;&#039;&#039; must exist along-side the APKBUILD.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;{{Note|Always use &amp;lt;code&amp;gt;/bin/sh&amp;lt;/code&amp;gt; for the command-line interpreter on the [https://en.wikipedia.org/wiki/Shebang_%28Unix%29 shebang line] of your install scripts.}}&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following are the different types of install scripts in detail:&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.pre-install =====&lt;br /&gt;
: This script is executed &#039;&#039;before installing&#039;&#039; the package.  Typical use is when the package needs a group and a user to be created. For example:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
addgroup -S clamav 2&amp;gt;/dev/null&lt;br /&gt;
adduser -S -D -H -h /var/lib/clamav -s /sbin/nologin -G clamav -g clamav clamav 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
{{Note|If the script exits with a failure (e.g., if the user already exists), the package will not be installed and &amp;lt;code&amp;gt;apk&amp;lt;/code&amp;gt; will exit with failure, hence the &amp;lt;code&amp;gt;exit 0&amp;lt;/code&amp;gt; at the end.}}&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.post-install =====&lt;br /&gt;
: This script is executed &#039;&#039;after installing&#039;&#039; the package.&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.pre-upgrade =====&lt;br /&gt;
: This script is executed &#039;&#039;before upgrading/downgrading/reinstalling&#039;&#039; the package. Note that exiting with failure will not cause apk to exit with failure, but will mark the package as broken.&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.post-upgrade =====&lt;br /&gt;
: This script is executed &#039;&#039;after upgrading/downgrading/reinstalling&#039;&#039; the package.&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.pre-deinstall =====&lt;br /&gt;
: This script is executed &#039;&#039;before uninstalling&#039;&#039; the package.&lt;br /&gt;
: {{Note|If the script exits with failure, &amp;lt;code&amp;gt;apk&amp;lt;/code&amp;gt; will not uninstall the package.}}&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.post-deinstall =====&lt;br /&gt;
: This script is executed &#039;&#039;after uninstalling&#039;&#039; the package.&lt;br /&gt;
&lt;br /&gt;
==== install_if ====&lt;br /&gt;
:install_if can be used when a package needs to be installed when some packages are already installed or are in the dependency tree. It works in reverse to the &#039;&#039;recommends&#039;&#039; feature, that other package managers provide.&lt;br /&gt;
&lt;br /&gt;
: Typically this is used in a subpackage that should provide files which make sense with another package. For example:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
subpackages=&amp;quot;$pkgname-bash-completion:bashcomp:noarch&amp;quot;&lt;br /&gt;
...&lt;br /&gt;
bashcomp() {&lt;br /&gt;
	pkgdesc=&amp;quot;Bash completions for $pkgname&amp;quot;&lt;br /&gt;
	install_if=&amp;quot;$pkgname=$pkgver-r$pkgrel bash-completion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	install -Dm644 &amp;quot;$builddir&amp;quot;/doc/bash_completion/aria2c \&lt;br /&gt;
		&amp;quot;$subpkgdir&amp;quot;/usr/share/bash-completion/completions/_aria2c&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
From the aria2c APKBUILD. Note that the custom bashcomp() function is only necessary, because the files are not in /usr/share/bash-completion.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:In general, install_if should only be used with &#039;&#039;&#039;at least one versioned constraint&#039;&#039;&#039;. Otherwise, a package that was implicitly installed by install_if and then removed from the binary repositories, will not get purged with &amp;lt;code&amp;gt;apk upgrade&amp;lt;/code&amp;gt;. [https://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/10720#note_121298]&lt;br /&gt;
&lt;br /&gt;
==== license ====&lt;br /&gt;
: License(s) for the package, for example &amp;lt;code&amp;gt;GPL-3.0-or-later&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;BSD-2-Clause&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;MIT&amp;lt;/code&amp;gt; [[Creating_an_Alpine_package#license|(details)]].&lt;br /&gt;
&lt;br /&gt;
==== makedepends ====&lt;br /&gt;
: Build-time dependency package(s). For cross compiling support, split it into &amp;lt;code&amp;gt;makedepends_build&amp;lt;/code&amp;gt; (native system) and &amp;lt;code&amp;gt;makedepends_host&amp;lt;/code&amp;gt; (foreign system).&lt;br /&gt;
&lt;br /&gt;
==== sha256sums/sha512sums ====&lt;br /&gt;
: Checksums for the files/URLs listed in &#039;&#039;source&#039;&#039;.  The checksums are normally generated and updated by executing &amp;lt;code&amp;gt;abuild checksum&amp;lt;/code&amp;gt; and should be the last item in the APKBUILD.&lt;br /&gt;
&lt;br /&gt;
New packages should use only sha512sums. Support for md5sums and sha1sums was dropped.&lt;br /&gt;
&lt;br /&gt;
==== options ====&lt;br /&gt;
: Build-time options for the package.&lt;br /&gt;
&lt;br /&gt;
: {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Option&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;!archcheck&amp;lt;/code&amp;gt;&lt;br /&gt;
| Do not try to verify that the architecture of the binary files is the same architecture as abuild should build for. One example where it makes sense to set this are packages with firmware files, that get executed on another CPU (such as WiFi firmware).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;!check&amp;lt;/code&amp;gt;&lt;br /&gt;
| Do not try to run the &amp;lt;code&amp;gt;check()&amp;lt;/code&amp;gt; function. Please always add a short comment after the &amp;lt;code&amp;gt;!check&amp;lt;/code&amp;gt; about why it&#039;s disabled. [https://github.com/alpinelinux/aports/pull/2322#discussion_r142545300] Creating a very simple check function, that calls &amp;lt;code&amp;gt;program --version&amp;lt;/code&amp;gt; is worse than disabling tests completely because it gives the false impression that the package is thoroughly tested with the testsuite from upstream. [https://github.com/alpinelinux/aports/pull/7326#discussion_r278797457]&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;checkroot&amp;lt;/code&amp;gt;&lt;br /&gt;
| Specifies that the package&#039;s test suite will be run in &#039;&#039;fakeroot&#039;&#039;. This is necessary for some test suites which fail when run as non-root.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;net&amp;lt;/code&amp;gt;&lt;br /&gt;
| Allows network access when run in &#039;&#039;rootbld&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;!strip&amp;lt;/code&amp;gt;&lt;br /&gt;
| Avoid stripping symbols from binaries.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;suid&amp;lt;/code&amp;gt;&lt;br /&gt;
| Allow [https://en.wikipedia.org/wiki/Setuid setuid] binaries.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;!tracedeps&amp;lt;/code&amp;gt;&lt;br /&gt;
| Do not automatically find dependencies (e.g. by using &amp;lt;code&amp;gt;ldd&amp;lt;/code&amp;gt; to find dynamic libraries, which the resulting binary links against).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;chmod-clean&amp;lt;/code&amp;gt;&lt;br /&gt;
| Make all files writable in the src/ directory. Useful for packages that make files read-only in the process of building packages (go modules).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;toolchain&amp;lt;/code&amp;gt;&lt;br /&gt;
| Don&#039;t warn when g++ is in makedepends&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;!dbg&amp;lt;/code&amp;gt;&lt;br /&gt;
| Don&#039;t create debugging subpackage&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ldpath-recursive&amp;lt;/code&amp;gt;&lt;br /&gt;
| Scan directories recursively when creating .so providers&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;!spdx&amp;lt;/code&amp;gt;&lt;br /&gt;
| Do not check if the license= field has a SPDX compliant license&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;textrels&amp;lt;/code&amp;gt;&lt;br /&gt;
| Don&#039;t error out when text relocations are found&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;charset.alias&amp;lt;/code&amp;gt;&lt;br /&gt;
| Don&#039;t error out if /usr/lib/charset.alias is found&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;libtool&amp;lt;/code&amp;gt;&lt;br /&gt;
| Don&#039;t delete libtool .la files&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;!fhs&amp;lt;/code&amp;gt;&lt;br /&gt;
| Don&#039;t enforce checks on path that follow the FHS&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== pkgdesc ====&lt;br /&gt;
: A brief, one-line description of what the package does.&lt;br /&gt;
&lt;br /&gt;
: Here&#039;s an example from the OpenSSH client package:&lt;br /&gt;
: &amp;lt;pre&amp;gt;pkgdesc=&amp;quot;Port of OpenBSD&#039;s free SSH release - client&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== pkggroups ====&lt;br /&gt;
: System group(s) to be created during build-time.  System group(s) should also be created in the &#039;&#039;&#039;[[APKBUILD Reference#.24pkgname.pre-install|$pkgname.pre-install]]&#039;&#039;&#039; script, so that the system group(s) are also created prior to package installation for run-time use.&lt;br /&gt;
==== pkgname ====&lt;br /&gt;
: The name of the package.  All letters should be lowercase.&lt;br /&gt;
: {{Note|When creating an APKBUILD of a module or library for another package, we use some common package prefixes, such as: &#039;&#039;lua-&#039;&#039;, &#039;&#039;perl-&#039;&#039;, &#039;&#039;php-&#039;&#039;, and &#039;&#039;py3-&#039;&#039;.  Search aports for other common prefixes.}}&lt;br /&gt;
&lt;br /&gt;
==== pkgrel ====&lt;br /&gt;
: Alpine package release number.  Starts at 0 (zero).  Always increment &#039;&#039;pkgrel&#039;&#039; when making updates to an aport; reset &#039;&#039;pkgrel&#039;&#039; to 0 (zero) when incrementing &#039;&#039;pkgver&#039;&#039;.&lt;br /&gt;
==== pkgusers ====&lt;br /&gt;
: System user(s) to be created during build-time.  System user(s) should also be created in the &#039;&#039;&#039;[[APKBUILD Reference#.24pkgname.pre-install|$pkgname.pre-install]]&#039;&#039;&#039; script, so that the system user(s) are also created prior to package installation for run-time use.&lt;br /&gt;
==== pkgver ====&lt;br /&gt;
: The version of the software being packaged. Format for valid versions: &amp;lt;code&amp;gt;{digit}{.digit}...{letter}{_suf{#}}...{-r#}&amp;lt;/code&amp;gt; [https://git.alpinelinux.org/cgit/apk-tools/tree/src/version.c#n17]&lt;br /&gt;
: A Suffix &amp;lt;code&amp;gt;suf&amp;lt;/code&amp;gt; in the above format can be one of the following to indicate that the release is &#039;&#039;less recent&#039;&#039; than the version without the suffix: &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;beta&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;rc&amp;lt;/code&amp;gt; [https://git.alpinelinux.org/cgit/apk-tools/tree/src/version.c#n75]&lt;br /&gt;
: These are for indicating &#039;&#039;more recent&#039;&#039; releases: &amp;lt;code&amp;gt;cvs&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;svn&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;git&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hg&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; [https://git.alpinelinux.org/cgit/apk-tools/tree/src/version.c#n76]&lt;br /&gt;
: All other suffices are invalid. To package a specific git commit, the date of the commit gets appended to the latest release, e.g. &amp;lt;code&amp;gt;1.0.0_git20180204&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== provides ====&lt;br /&gt;
: List of package names (and optionally version info) this package provides.&lt;br /&gt;
&lt;br /&gt;
: If package with a version is provided (provides=&#039;foo=1.2&#039;) apk will consider it as an alternate name and it will automatically consider the package for installation by the alternate name, and conflict with other packages having the same name, or provides.&lt;br /&gt;
&lt;br /&gt;
: If version is not provided (provides=&#039;foo&#039;), apk will consider it as virtual package name. Several package with same non-versioned provides can be installed simultaneously. However, none of them will be installed by default when requested by the virtual name - instead, error message is given and user is asked to choose which package providing the virtual name should be installed.&lt;br /&gt;
==== provider_priority ====&lt;br /&gt;
: A numeric value which is used by apk-tools to break ties when choosing a virtual package to satisfy a dependency. Higher values have higher priority. The primary use case is to specify the primary package that satisfies a virtual (provider).&lt;br /&gt;
==== replaces ====&lt;br /&gt;
: Allow this package to be installed at the same time as the listed packages, even if they have conflicting files. The files from this package will override (&amp;quot;take over&amp;quot;) the conflicting files.&lt;br /&gt;
&lt;br /&gt;
: This can be used to override config files with &amp;quot;policy packages&amp;quot; [https://gitlab.alpinelinux.org/alpine/apk-tools/-/commit/89d003f8c2e5a92655ee778f7bfa5c0e85ddbed4].&lt;br /&gt;
&lt;br /&gt;
: Another use case is renaming packages (or moving files from one package to another): &amp;quot;replaces&amp;quot; will avoid the file conflict error that apk reports if it happens to install the new package before uninstalling the old package [https://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/10724#note_132872].&lt;br /&gt;
&lt;br /&gt;
: A common misconception is that &amp;quot;replaces&amp;quot; is used to replace packages (like in [https://wiki.archlinux.org/index.php/PKGBUILD#replaces PKGBUILD]). This is not the case, it is only for solving file conflicts. To let apk consider installing one package instead of another one, refer to [[#provides|provides]] (with the version).&lt;br /&gt;
&lt;br /&gt;
==== replaces_priority ====&lt;br /&gt;
: The priority of the replaces. If multiple packages replace files of each other, then the package with the highest &#039;&#039;replaces_priority&#039;&#039; will win.&lt;br /&gt;
&lt;br /&gt;
==== source ====&lt;br /&gt;
: The source variable is not only used to list the remote source files to fetch, it is also used to list the local files that abuild will need in order to build the apk. Examples of such local files include: init.d files, conf.d files, install files (see [[APKBUILD Reference#install|install variable]]), patches, and all other necessary files.&lt;br /&gt;
&lt;br /&gt;
: Here are few things to note:&lt;br /&gt;
&lt;br /&gt;
:* When you are finished adding local and/or remote files to &#039;&#039;source&#039;&#039;, you can execute the following command to add their checksums to the APKBUILD file:&lt;br /&gt;
:: {{Cmd|abuild checksum}}&lt;br /&gt;
:: {{Note|When later updating the content of &#039;&#039;source&#039;&#039;, or updating a file that is listed in &#039;&#039;source&#039;&#039;, you must also update their checksums again with the same command.}}&lt;br /&gt;
&lt;br /&gt;
:* When the remote file is hosted at SourceForge, it&#039;s best to specify the special mirrors link used by SourceForge:&lt;br /&gt;
:: &amp;lt;pre&amp;gt;http://downloads.sourceforge.net/software/software-$pkgver.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
:: (or similar depending on the package).&lt;br /&gt;
&lt;br /&gt;
:* You can set target filename (eg &#039;save as...&#039;) by prefixing the URI with &#039;&#039;filename::&#039;&#039;. This is useful when the remote filename is not specified in the URI (ie, does not end in &#039;/software-1.0.tar.gz&#039;), such as:&lt;br /&gt;
:: &amp;lt;pre&amp;gt;http://oss.example.org/?get=software&amp;amp;ver=1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
:: or when the filename is braindead, like githubs&#039; download tags:&lt;br /&gt;
:: &amp;lt;pre&amp;gt;https://github.com/software/software/archive/v$pkgver.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
:: The above two examples needs a target filename prefix:&lt;br /&gt;
:: &amp;lt;pre&amp;gt;$pkgname-$pkgver.tar.gz::http://oss.example.org/?get=software&amp;amp;ver=$pkgver&amp;lt;/pre&amp;gt;&lt;br /&gt;
:: and:&lt;br /&gt;
:: &amp;lt;pre&amp;gt;$pkgname-$pkgver.tar.gz::https://github.com/software/software/archive/v$pkgver.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:* abuild currently supports the following protocols for remote file retrieval:&lt;br /&gt;
:** http&lt;br /&gt;
:** https&lt;br /&gt;
:** ftp&lt;br /&gt;
&lt;br /&gt;
:* abuild currently supports the following archive types/archive file extensions:&lt;br /&gt;
:** .tar (only in Alpine &amp;gt;= 2.5)&lt;br /&gt;
:** .tar.gz / .tgz&lt;br /&gt;
:** .tar.bz2&lt;br /&gt;
:** .tar.lz (only in Alpine &amp;gt;=3.7)&lt;br /&gt;
:** .tar.lzma&lt;br /&gt;
:** .tar.xz&lt;br /&gt;
:** .zip&lt;br /&gt;
&lt;br /&gt;
:* &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; should only include variables that change often like &amp;lt;code&amp;gt;pkgver&amp;lt;/code&amp;gt; or a commit ID. CI will warn you if you include &amp;lt;code&amp;gt;pkgname&amp;lt;/code&amp;gt; in source. Other variables like for example &amp;lt;code&amp;gt;_pkgname&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;_pyname&amp;lt;/code&amp;gt; do not belong in &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; either.&lt;br /&gt;
&lt;br /&gt;
==== subpackages ====&lt;br /&gt;
: Subpackages built from this APKBUILD.  abuild will parse this variable and try to find a subpackage split function.  The split function must &#039;&#039;move&#039;&#039; files that do not belong in the main package, from &#039;&#039;$pkgdir&#039;&#039; to &#039;&#039;$subpkgdir&#039;&#039;.  Files and directories can also be &#039;&#039;copied&#039;&#039; from &#039;&#039;$startdir&#039;&#039; and &#039;&#039;$srcdir&#039;&#039; to &#039;&#039;$subpkgdir&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
: The split function can be specified in 1 of 3 different methods:&lt;br /&gt;
:# subpkgname:&#039;&#039;&#039;splitfunc&#039;&#039;&#039;&lt;br /&gt;
:# $pkgname-&#039;&#039;&#039;splitfunc&#039;&#039;&#039;&lt;br /&gt;
:# &#039;&#039;&#039;splitfunc&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
: {{Note|Split function names &#039;&#039;&#039;cannot&#039;&#039;&#039; use hyphens; use the first method above if the subpackage name contains a hyphen (-) character, like this: &#039;&#039;subpkg-name:subpkg_name&#039;&#039;, where &amp;lt;code&amp;gt;subpkg-name&amp;lt;/code&amp;gt; is the name of the &#039;&#039;&#039;subpackage&#039;&#039;&#039; and &amp;lt;code&amp;gt;subpkg_name&amp;lt;/code&amp;gt; is the name of the &#039;&#039;&#039;subpackage&#039;s split function&#039;&#039;&#039;.}}&lt;br /&gt;
&lt;br /&gt;
: {{Tip|For more information, see the [[APKBUILD_examples:Subpackages|Subpackages example]].}}&lt;br /&gt;
&lt;br /&gt;
==== triggers ====&lt;br /&gt;
: Apk-tools can &amp;quot;monitor&amp;quot; directories and execute a trigger if any package installed/uninstalled any file in the monitored dir. The triggers are always executed after the apk action (install, uninstall, upgrade).&lt;br /&gt;
&lt;br /&gt;
: The triggers are specified in the format: &#039;&#039;scriptname&#039;&#039;=&#039;&#039;pathlist&#039;&#039; where &#039;&#039;scriptname&#039;&#039; is the (sub)package name + .trigger suffix and pathlist is : separated list of the dirs to monitor.&lt;br /&gt;
&lt;br /&gt;
: The &#039;&#039;&#039;triggers&#039;&#039;&#039; variable must include the triggers for subpackages too if they have any.&lt;br /&gt;
&lt;br /&gt;
: It is possible to use wildcards (*) in the dir list.&lt;br /&gt;
&lt;br /&gt;
==== url ====&lt;br /&gt;
: The homepage for the package.  This is to help users find upstream documentation and other information regarding the package.&lt;br /&gt;
&lt;br /&gt;
==== langdir ====&lt;br /&gt;
: Path to where the language files are located for the &#039;&#039;&#039;-lang&#039;&#039;&#039; subpackage, defaults to &#039;&#039;&#039;/usr/share/locale&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== pcprefix ====&lt;br /&gt;
: Prefix all provides derived from parsing pkg-config Requires: with the value in this variable, example: &#039;&#039;&#039;&#039;pcprefix=&amp;quot;foo:&amp;quot;&#039;&#039;&#039; will produce &#039;&#039;&#039;pc:foo:bar&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== sonameprefix ====&lt;br /&gt;
: Prefix all provides derived from parsing shared objects with the value in this variable, example: &#039;&#039;&#039;sonameprefix=&amp;quot;foo:&amp;quot;&#039;&#039;&#039; will produce &#039;&#039;&#039;so:foo:bar.so.X&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Functions =&lt;br /&gt;
{{Note|All functions that are not &#039;&#039;prepare()&#039;&#039;, &#039;&#039;build()&#039;&#039;, &#039;&#039;check()&#039;&#039; and &#039;&#039;package()&#039;&#039; should consider the current working directory as undefined, and should therefore use the [[APKBUILD Reference#abuild-defined_variables|abuild-defined directory variables]] to their advantage.}}&lt;br /&gt;
&lt;br /&gt;
 sanitycheck() -&amp;gt; clean()-&amp;gt; fetch() -&amp;gt; verify() -&amp;gt; unpack() -&amp;gt; prepare() -&amp;gt; mkusers() -&amp;gt; build() -&amp;gt; check() -&amp;gt; package() -&amp;gt; subpackages() -&amp;gt; language packs -&amp;gt; apk -&amp;gt; cleanup()&lt;br /&gt;
&lt;br /&gt;
== abuild-defined functions ==&lt;br /&gt;
The following functions are provided by abuild and can be overridden, but it is strongly discouraged on code review for some functions:&lt;br /&gt;
&lt;br /&gt;
==== fetch() ====&lt;br /&gt;
: Downloads remote sources listed in &#039;&#039;source&#039;&#039; to &#039;&#039;SRCDEST&#039;&#039; (&#039;&#039;SRCDEST&#039;&#039; is configured in &#039;&#039;/etc/abuild.conf&#039;&#039;) and creates symlinks in &#039;&#039;$srcdir&#039;&#039;.&lt;br /&gt;
==== unpack() ====&lt;br /&gt;
: unpack() will call default_unpack().&lt;br /&gt;
&lt;br /&gt;
: [https://github.com/alpinelinux/abuild/blob/v3.1.0/abuild.in#L403 default_unpack()] unpacks .tar, .tgz, .tar.gz, .tar.lz (only available in Alpine &amp;gt;=3.7), .tar.bz2, .tar.lzma, .tar.xz, and .zip archives from a symlink in &#039;&#039;$srcdir&#039;&#039; associated with &#039;&#039;$SRCDEST&#039;&#039; (or distfiles folder) resulting in an unpacked folder in &#039;&#039;$srcdir&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== dev() ====&lt;br /&gt;
: Subpackage function for the &#039;&#039;&#039;$pkgname-dev&#039;&#039;&#039; package is used to collect developer files and folders for use in other packages in the compilation process nothing more.  Without specifying a custom &#039;&#039;dev()&#039;&#039; function, abuild will call its internal &#039;&#039;dev()&#039;&#039; function, which in turn calls default_dev().&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;[https://github.com/alpinelinux/abuild/blob/v3.1.0/abuild.in#L1605 default_dev()]&#039;&#039; will move any &#039;&#039;include&#039;&#039; folder and folders containing &#039;&#039;*.[acho]&#039;&#039; (static archive, c source, c header file, object file), &#039;&#039;*.prl&#039;&#039; file extension patterns in &#039;&#039;&amp;quot;$pkgdir&amp;quot;/{lib,usr}&#039;&#039; to &#039;&#039;&amp;quot;$subpkgdir&amp;quot;/{lib,usr}&#039;&#039; recursively; and &#039;&#039;*.so&#039;&#039; files from &#039;&#039;&amp;quot;$pkgdir&amp;quot;/{lib,usr/lib}&#039;&#039; to &#039;&#039;&amp;quot;$subpkgdir&amp;quot;/{lib,usr/lib}&#039;&#039;.  It will also scan and move &#039;&#039;usr/{include,lib/{pkgconfig,cmake,qt*/mkspecs},share/{aclocal,gettext,vala/vapi,gir-[0-9]*,qt*/mkspecs},bin/*-config}}&#039;&#039; developer only folders in &#039;&#039;$pkgdir&#039;&#039; and transfer them to &#039;&#039;$subpkgdir&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
: In general, default_dev() will support packages that share pkg-config, C programming language API, shared and static libraries, Autotools, gettext, Vala programming language bindings, Python GObject introspection, a provided custom pkg-config like command (*-config), Qt, and CMake.  If you have packages that have C++, other languages, other build system, etc; you need to manually move those developer files only if they are to be used in other packages.&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;&#039;Important&#039;&#039;&#039;: For default_dev() to be called as in no dev(), you need to explicitly add subpackages=&amp;quot;$pkgname-dev&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== doc() ====&lt;br /&gt;
: Subpackage function for the &#039;&#039;&#039;$pkgname-doc&#039;&#039;&#039; package whose job is only to collect documentation folders from $pkgdir nothing more.  Without specifying a custom &#039;&#039;doc()&#039;&#039; function, abuild will call its internal &#039;&#039;doc()&#039;&#039; function, which in turn calls default_doc().&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;[https://github.com/alpinelinux/abuild/blob/v3.1.0/abuild.in#L1519 default_doc()]&#039;&#039; will move &#039;&#039;&amp;quot;$pkgdir&amp;quot;/usr/share/{doc,man,info,html,sgml,licenses,gtk-doc,ri,help}&#039;&#039; to &#039;&#039;$subpkgdir&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
: Overriding this function is strongly discouraged.  Packaging docs should be done in the package() function while letting abuild automatically collect the doc folders.&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;&#039;Important&#039;&#039;&#039;: For default_doc() to be called as in no doc(), you need to explicitly add subpackages=&amp;quot;$pkgname-doc&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== openrc() ====&lt;br /&gt;
: Subpackage function for the &#039;&#039;&#039;$pkgname-openrc&#039;&#039;&#039; package whose job is to collect OpenRC service files that are in /etc/init.d and /etc/conf.d.&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;[https://github.com/alpinelinux/abuild/blob/v3.1.0/abuild.in#L1661 default_openrc()]&#039;&#039; will move &#039;&#039;&amp;quot;$pkgdir&amp;quot;/etc/{conf,init}.d&#039;&#039; to &#039;&#039;$subpkgdir&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
: Overriding this function is strongly discouraged. Packaging OpenRC service definitions should be in the package() function while letting abuild automatically collect the openrc folders.&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;&#039;Important&#039;&#039;&#039;: for default_openrc() to be called as in no openrc(), you need to explicitly add subpackages=&amp;quot;$pkgname-openrc&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== static() ====&lt;br /&gt;
: Subpackage function for the &#039;&#039;&#039;$pkgname-static&#039;&#039;&#039; package whose job is to collect static libraries that are stored in /lib and /usr/lib.&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;[https://github.com/alpinelinux/abuild/blob/v3.4.0_rc4/abuild.in#L1748 default_static()]&#039;&#039; will move all static libraries (files ending with .a) from &#039;&#039;&amp;quot;$pkgdir&amp;quot;/lib&#039;&#039; and &#039;&#039;&amp;quot;$pkgdir&amp;quot;/usr/lib&#039;&#039; to their equivalents in &#039;&#039;$subpkgdir&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
: Overriding this function is strongly discouraged. Packaging static libraries should be done in the package() function while letting abuild automatically collect the static libraries.&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;&#039;Important&#039;&#039;&#039;: for default_static() to be called as in no static(), you need to explicitly add subpackages=&amp;quot;$pkgname-static&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== snapshot() ====&lt;br /&gt;
: &#039;&#039;&#039;Optional&#039;&#039;&#039;.  For live APKBUILDs or those with a _cvs, _svn, _git, _hg in their version number, you should create a snapshot function only if there is no download link to an archive file (.zip, .tar.gz, ...) to the commit/hash/tag.  The purpose of the snapshot function is to create an archive of the source code so that the package source code is deterministic, and it doesn&#039;t waste time to fetch the source code but bypasses the download step after snapshotting.  Those that download the source code from a git repository will follow head or the latest change to the source code.  It is better to archive the source code as a zip / tar.gz / tar.bz2 up to the commit or the tag which you are trying to build a package.  If it is not deterministic or not every part of the code frozen in time for every dependency and the main project, then the patches will fail or the package may fail to compile when you revisit the package months or years to backport a patch.&lt;br /&gt;
&lt;br /&gt;
: The default [https://github.com/alpinelinux/abuild/blob/v3.1.0/abuild.in#L2310 snapshot()] function has variables associated with it:&lt;br /&gt;
:* $disturl - the base-url of the place to autoupload the snapshot&lt;br /&gt;
:* $svnurl - Subversion repository &lt;br /&gt;
:* $giturl - Git repository&lt;br /&gt;
&lt;br /&gt;
: The default snapshot() can only support one repository.  It is better to override it if there are multiple repositories involved in your package.  CVS, Mercurial (hg), and alternative version control systems must override the default snapshot().&lt;br /&gt;
&lt;br /&gt;
: See [[APKBUILD_examples:Git_checkout]] to how to use it with git.  It takes 2-3 general steps.  Clone the repository; check it out at a specific revision/commit or tag; then you use an archiver to dump it in the &#039;&#039;$SRCDEST&#039;&#039; variable which points to the distfiles folder and the base path to the full path to the archive that you want to create.  You do this for every internal dependency that the package pulls.&lt;br /&gt;
&lt;br /&gt;
: After you have created your snapshot function, you use &amp;lt;code&amp;gt;abuild snapshot&amp;lt;/code&amp;gt; to run it.  &lt;br /&gt;
&lt;br /&gt;
: The archives produced by the snapshot will be saved in &#039;&#039;/var/cache/distfiles&#039;&#039; or whatever you set for &#039;&#039;$SRCDEST&#039;&#039;.  You may need to create symlinks to the archive if the archive is not saved to the Alpine server.&lt;br /&gt;
&lt;br /&gt;
: After you snapshot it, you need to produce the checksums with &amp;lt;code&amp;gt;abuild checksum&amp;lt;/code&amp;gt; to use it in the APKBUILD creation process.&lt;br /&gt;
&lt;br /&gt;
: This feature is available since Alpine &amp;gt;=2.6.&lt;br /&gt;
&lt;br /&gt;
==== default_prepare() ====&lt;br /&gt;
&lt;br /&gt;
:  Before build preparation it handles set of patches inside &amp;lt;code&amp;gt;$srcdir&amp;lt;/code&amp;gt; and prints failed ones.&lt;br /&gt;
&lt;br /&gt;
== User-defined functions ==&lt;br /&gt;
The following functions should be defined by the user: &lt;br /&gt;
&lt;br /&gt;
==== prepare() ====&lt;br /&gt;
: {{note|Please adjust old APKBUILDs, which still have a &#039;&#039;prepare()&#039;&#039; function that does the same as the &#039;&#039;default_prepare()&#039;&#039; when you edit them anyway.}}&lt;br /&gt;
: &#039;&#039;&#039;&#039;&#039;Optional&#039;&#039;.&#039;&#039;&#039;  Used for build preparation: patches, etc, should be applied here. When you don&#039;t specify a custom &#039;&#039;prepare()&#039;&#039;, the built-in &#039;&#039;default_prepare()&#039;&#039; from abuild will be used. It applies patches already (always prepare them in the &amp;lt;code&amp;gt;-p1&amp;lt;/code&amp;gt; format), so &#039;&#039;&#039;usually it makes sense to not create a custom &#039;&#039;prepare()&#039;&#039; function at all!&#039;&#039;&#039; If you do create one, call &#039;&#039;default_prepare()&#039;&#039; inside it:&lt;br /&gt;
&lt;br /&gt;
: Before default_prepare gets called, you can define &#039;&#039;patch_args&#039;&#039; to supply the argument to the patch command in global scope then throw away prepare() so it is unnecessary to use the old template code floating around to patch.  patch_args and autopatching is only available in Alpine &amp;gt;=3.4.  See [[Creating_an_Alpine_package#Patches]] to fix the patch that uses a different patch level (-pX).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prepare() {&lt;br /&gt;
    default_prepare&lt;br /&gt;
    # your custom code here&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== build() ====&lt;br /&gt;
: &#039;&#039;&#039;Required.&#039;&#039;&#039;  This is the compilation stage.  This function will be called as the current user (unless the &#039;&#039;package()&#039;&#039; function is missing - for compatibility reasons).  If no compilation is needed, the function should be removed.&lt;br /&gt;
&lt;br /&gt;
: To enable or disable CFLAGS, CXXFLAGS, CMake with option, or configure option per arch, use the CARCH variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
local cmakeoptions=&lt;br /&gt;
case &amp;quot;$CARCH&amp;quot; in&lt;br /&gt;
        aarch64*|arm*|ppc64le|x86|s390x) cmakeoptions=&amp;quot;$cmakeoptions -DWITH_OPENMP=OFF&amp;quot; ;;&lt;br /&gt;
        x86_64)                          cmakeoptions=&amp;quot;$cmakeoptions -DWITH_OPENMP=ON&amp;quot; ;;&lt;br /&gt;
        *)                               msg &amp;quot;Unable to determine architecture from (CARCH=$CARCH)&amp;quot; ; return 1 ;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: The block can be used in other parts of the APKBUILD even in global.&lt;br /&gt;
&lt;br /&gt;
==== check() ====&lt;br /&gt;
: &#039;&#039;&#039;Required if functionality exists.&#039;&#039;&#039; This function is called right after the build stage.  It should check that the packaged thing is actually working, typically by running (integration) tests, if provided by upstream.  If there’s no (easy) way how to test the package, you can declare that it does not want to use &#039;&#039;check()&#039;&#039; by adding &amp;quot;!check&amp;quot; into the &#039;&#039;options&#039;&#039; variable (&amp;lt;code&amp;gt;options=&amp;quot;!check&amp;quot;&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
: default_check() does nothing.  You need to manually explicitly call the unit tests or test suite yourself.  When you run the test, the program should return with an exit code of 0, indicating the tests were a success.  Unit tests or test suites will do feature tests, per function correctness check, fuzz testing, benchmarks.&lt;br /&gt;
&lt;br /&gt;
: A package may also require additional testing frameworks packages that are external dependencies.  You should add those to the &#039;&#039;checkdepends=&#039;&#039; in Alpine &amp;gt;=3.6 or &#039;&#039;makedepends=&#039;&#039; for older for backporters.  If the testing framework is not available, you need to create a package for it.  If it requires a specific version of a testing framework, consider making it an internal dependency or a new package with a package name containing the major and minor version number like the python packages.&lt;br /&gt;
&lt;br /&gt;
: Generally speaking, you should define the check functions for libraries, large programs like web browsers, or compilers and interpreters, cryptographic/security/anonymity stuff, mission critical stuff, PCI compliance/money/accounting software, server software with a lot of stakeholders or consumers.  Soon for the new policy change will have virtually &#039;&#039;&#039;all packages with testing capabilities be required to have a working and defined check() function&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
: There are times when the unit tests do not work, just because the test itself is broken, new unimplemented feature, external factors not taken into consideration, unbundling path differences, breakage caused by ccache, missing test dependency or version mismatch dependency as in python2 vs python3, test scripts only work for particular language implementation like only supporting python2 but not python3 having used the 2to3 conversion script.  If a unit test is known not to work, you may need to patch it to omit that test or fix it; but, certain tests should not be disabled if it is important.  You may need to alter the references to uncompiled internal dependencies to work with the external dependencies instead.  For ccache, you can either disable it or remove it from the PATH environmental variable before running tests.&lt;br /&gt;
&lt;br /&gt;
{{Note|Tests for graphical applications and toolkits might work on a X11 user setup but will fail on the server unless run with xvfb-run.}}&lt;br /&gt;
&lt;br /&gt;
: If you don&#039;t add the &#039;&#039;check()&#039;&#039; and the &#039;&#039;options=&#039;&#039;, this is what you will see:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt;&amp;gt;&amp;gt; WARNING: py-webtest*: APKBUILD does not run any tests!&lt;br /&gt;
    Alpine policy will soon require that packages have any relevant testsuites run during the build process.&lt;br /&gt;
    To fix, either define a check() function, or declare !check in $options to indicate the package does not have a testsuite.&lt;br /&gt;
&lt;br /&gt;
: If you do not do a check or disable it, you must state there is no testsuite in comment form (#) next to options=&amp;quot;!check&amp;quot; for the code reviewers.&lt;br /&gt;
&lt;br /&gt;
: To run test suite with autotools do:&lt;br /&gt;
&lt;br /&gt;
  make check&lt;br /&gt;
&lt;br /&gt;
: To run the test suite with python setuptools:&lt;br /&gt;
&lt;br /&gt;
  python2 setup.py test&lt;br /&gt;
  python3 setup.py test&lt;br /&gt;
&lt;br /&gt;
: For python it should be &#039;&#039;&#039;test&#039;&#039;&#039; not check.  Check for python setuptools will check the packaging metadata fields[https://docs.python.org/3/distutils/examples.html#checking-a-package] only but not run the unit tests.  There should be verbose output also.  The dependencies for the tests are found in test_require in the setup.py.&lt;br /&gt;
&lt;br /&gt;
: If it says &amp;lt;code&amp;gt;Ran 0 tests in 0.000s&amp;lt;/code&amp;gt; that is not acceptable.  check() will say it was good but it is not actually correct.  It needs to run the test suite with an alternative method like &amp;lt;code&amp;gt;tox -e py27,py36&amp;lt;/code&amp;gt; if you see a tox.ini file.&lt;br /&gt;
&lt;br /&gt;
: You want to do it for each implementation to ensure that the API calls are correct per implementation but ncopa said it was just fine with python3.&lt;br /&gt;
&lt;br /&gt;
: If there is a circular dependency for the checkdepends=, you need to disable the check and put the reason next to &amp;lt;code&amp;gt;options=&amp;quot;!check&amp;quot;&amp;lt;/code&amp;gt; that there is a circular dependency.  You should disable it for the package that package that is least important or least security risk.  The other solution is to make the conflicting dependency an internal dependency but making sure that it doesn&#039;t pull it at check time.  This way they can both preform tests properly.&lt;br /&gt;
&lt;br /&gt;
==== package() ====&lt;br /&gt;
: &#039;&#039;&#039;Required.&#039;&#039;&#039;  This is the packaging stage.  Here, the built application and support files should be installed into &#039;&#039;&#039;$pkgdir&#039;&#039;&#039;.  If this is a metapackage, this function can contain a single line: &amp;lt;code&amp;gt;mkdir -p &amp;quot;$pkgdir&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|Building in fakeroot will reduce performance for parallel builds dramatically.  It is for this reason that we split the build and package process into two separate functions.}}&lt;br /&gt;
&lt;br /&gt;
= Special Operators =&lt;br /&gt;
&lt;br /&gt;
== $pkgname~$pkgver ==&lt;br /&gt;
&lt;br /&gt;
Specifies a required &amp;lt;code&amp;gt;$pkgver&amp;lt;/code&amp;gt; for [[apk]] to satisfy the &amp;lt;code&amp;gt;$pkgname&amp;lt;/code&amp;gt; requirement. &amp;lt;code&amp;gt;~&amp;lt;/code&amp;gt; ignores revisions of the package version. For example &amp;lt;code&amp;gt;superd~0.6&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;$depends&amp;lt;/code&amp;gt; will ensure superd with package version 0.6 is installed as a run-time dependency for the package.&lt;br /&gt;
&lt;br /&gt;
== $pkgname&amp;gt;=$pkgver ==&lt;br /&gt;
&lt;br /&gt;
Specifies the installed package version must be greater than or equal to &amp;lt;code&amp;gt;$pkgver&amp;lt;/code&amp;gt; for [[apk]] to satisfy the &amp;lt;code&amp;gt;$pkgname&amp;lt;/code&amp;gt; requirement.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
The [[APKBUILD examples]] page will assist you in understanding how to create an APKBUILD.&lt;br /&gt;
&lt;br /&gt;
= Version =&lt;br /&gt;
&lt;br /&gt;
This document assumes abuild for Alpine Edge.  For older releases of abuild, some of these features may not be available if you are using an older release.  A link to the implementation is linked for researchers and backporters.&lt;br /&gt;
&lt;br /&gt;
For more information see [[APKBUILD_versions]].&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=APKBUILD_Reference&amp;diff=29223</id>
		<title>APKBUILD Reference</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=APKBUILD_Reference&amp;diff=29223"/>
		<updated>2025-03-10T11:30:20Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: /* md5sums/sha256sums/sha512sums */ support for md5sums/sha1sums was dropped&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;APKBUILDs are the scripts that are created in order to build Alpine packages using the [[Abuild and Helpers|abuild]] tool.&lt;br /&gt;
&lt;br /&gt;
See [[aports]] for details on Alpine&#039;s official ports repository.&lt;br /&gt;
&lt;br /&gt;
This page is intended to serve as a reference for creating APKBUILDs; if this is your first time creating a package for Alpine Linux, please see [[Creating an Alpine package]].&lt;br /&gt;
&lt;br /&gt;
= Legend =&lt;br /&gt;
The following notes will assist you in understanding this document.&lt;br /&gt;
&lt;br /&gt;
In description text:&lt;br /&gt;
* If a variable is not prefixed with a &#039;&#039;$&#039;&#039;, it will be represented by italics (i.e., &#039;&#039;srcdir&#039;&#039; ).&lt;br /&gt;
* Functions will also be represented by italics, but will also end with a pair of parentheses (i.e., &#039;&#039;build()&#039;&#039; ).&lt;br /&gt;
* Shell commands will be represented &amp;lt;code&amp;gt;like this&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Variables =&lt;br /&gt;
{{Note|Variables that contain a path (e.g. &#039;&#039;$srcdir&#039;&#039; and &#039;&#039;$pkgdir&#039;&#039;) should always be quoted using double quotes (i.e., &#039;&#039;&amp;quot;$srcdir&amp;quot;&#039;&#039;).  This is done to prevent things from breaking, should the user have the APKBUILD in a directory path that contains spaces.}}&lt;br /&gt;
{{Note|All arbitrary variable and function names should be prefixed with an underscore character ( _ ) to avoid name clashes with the internals of abuild (for example, &#039;&#039;_luaversions&#039;&#039;).}}&lt;br /&gt;
&lt;br /&gt;
These variables are all well documented in &amp;lt;code&amp;gt;man 5 APKBUILD&amp;lt;/code&amp;gt; ([https://gitlab.alpinelinux.org/alpine/abuild/-/blob/master/APKBUILD.5.scd man page source]).&lt;br /&gt;
&lt;br /&gt;
== User-defined variables ==&lt;br /&gt;
The following variables should be defined by the user:&lt;br /&gt;
==== maintainer ====&lt;br /&gt;
: Name and email address of the maintainer of the package.&lt;br /&gt;
: A well-formatted example is &amp;lt;code&amp;gt;maintainer=&amp;quot;John Snow &amp;lt;john_snow@thewall.net&amp;gt;&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== arch ====&lt;br /&gt;
: Package architecture(s) to build for.  Can be one or several seperated by whitespace of: &#039;&#039;&#039;[[x86]], [[x86_64]], [[armv7]], [[armhf]], [[aarch64]], [[ppc64le]], [[s390x]], [[riscv64]], all&#039;&#039;&#039;, or &#039;&#039;&#039;noarch&#039;&#039;&#039;, where &#039;&#039;&#039;all&#039;&#039;&#039; means all architectures, and &#039;&#039;&#039;noarch&#039;&#039;&#039; means it&#039;s architecture-independent (e.g., a pure-python package). Architectures can be negated using the ! character to exclude them from the list of supported architectures. E.g. &#039;&#039;&#039;arch=&amp;quot;all !ppc64le&amp;quot;&#039;&#039;&#039; means that the package is allowed to be built on all architectures but the ppc64le architecture.&lt;br /&gt;
: {{Tip|To determine if your APKBUILD can use &#039;&#039;&#039;noarch&#039;&#039;&#039;: First specify &#039;&#039;&#039;all&#039;&#039;&#039; and then build the package by executing &amp;lt;code&amp;gt;abuild -r&amp;lt;/code&amp;gt;.  Watch the output towards the end for warnings saying that &#039;&#039;&#039;noarch&#039;&#039;&#039; can be used.  If the main package and all subpackages, if you have any subpackages, give a warning saying that &#039;&#039;&#039;noarch&#039;&#039;&#039; can be used, then you can use &#039;&#039;&#039;noarch&#039;&#039;&#039;.}}&lt;br /&gt;
&lt;br /&gt;
==== depends ====&lt;br /&gt;
: Run-time dependency package(s) that are not shared-object dependencies.  Shared objects dependencies are auto-detected and should not be specified here. To specify a conflicting package, add the package name prefixed with a &#039;!&#039;.&lt;br /&gt;
&lt;br /&gt;
==== depends_dev ====&lt;br /&gt;
: Run-time dependency package(s) for the &#039;&#039;&#039;$pkgname-dev&#039;&#039;&#039; subpackage.&lt;br /&gt;
&lt;br /&gt;
: {{Note|From ncopa on IRC: To find out if you need to add a package to depends_dev have a look at *requires* in usr/lib/pkgconfig/*.pc. With libtool it gets more complicated, but we should delete the .la files. Also check if there are any  /usr/bin/*-configure #!/bin/bash #!/usr/bin/perl or Python. Sometimes scripts or similar are generated at build time (i.e autoconf automake) then you normally don&#039;t need add those to depends_dev. You can also just add all -dev makedepends to depends_dev but it will slow the build process a little bit (more build dependencies).}}&lt;br /&gt;
&lt;br /&gt;
==== depends_doc ====&lt;br /&gt;
: Run-time dependency package(s) for the &#039;&#039;&#039;$pkgname-doc&#039;&#039;&#039; subpackage.&lt;br /&gt;
&lt;br /&gt;
==== depends_openrc ====&lt;br /&gt;
: Run-time dependency package(s) for the &#039;&#039;&#039;$pkgname-openrc&#039;&#039;&#039; subpackage.&lt;br /&gt;
&lt;br /&gt;
==== depends_libs ====&lt;br /&gt;
: Run-time dependency package(s) for the &#039;&#039;&#039;$pkgname-libs&#039;&#039;&#039; subpackage.&lt;br /&gt;
&lt;br /&gt;
==== depends_static ====&lt;br /&gt;
: Run-time dependency package(s) for the &#039;&#039;&#039;$pkgname-static&#039;&#039;&#039; subpackage.&lt;br /&gt;
&lt;br /&gt;
==== checkdepends ====&lt;br /&gt;
: Dependencies that are only required during the check phase, they are only installed if the check option is enabled&lt;br /&gt;
&lt;br /&gt;
==== giturl ====&lt;br /&gt;
:Git repository from which &amp;lt;code&amp;gt;abuild checkout&amp;lt;/code&amp;gt; checks out. You can checkout a specific branch in git by adding &amp;lt;code&amp;gt;-b $branch&amp;lt;/code&amp;gt;.&lt;br /&gt;
==== install ====&lt;br /&gt;
: There are 6 different types of install scripts.  Install scripts are named &#039;&#039;&#039;$pkgname.action&#039;&#039;&#039;, where &#039;&#039;&#039;action&#039;&#039;&#039; can be:  &#039;&#039;&#039;pre-install, post-install, pre-upgrade, post-upgrade, pre-deinstall&#039;&#039;&#039;, or &#039;&#039;&#039;post-deinstall&#039;&#039;&#039;.  For example, if &#039;&#039;pkgname&#039;&#039; is set to &#039;&#039;&#039;mypackage&#039;&#039;&#039; and &#039;&#039;install&#039;&#039; is set to &#039;&#039;&#039;$pkgname.post-install&#039;&#039;&#039;, then a script named &#039;&#039;&#039;mypackage.post-install&#039;&#039;&#039; must exist along-side the APKBUILD.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;{{Note|Always use &amp;lt;code&amp;gt;/bin/sh&amp;lt;/code&amp;gt; for the command-line interpreter on the [https://en.wikipedia.org/wiki/Shebang_%28Unix%29 shebang line] of your install scripts.}}&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following are the different types of install scripts in detail:&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.pre-install =====&lt;br /&gt;
: This script is executed &#039;&#039;before installing&#039;&#039; the package.  Typical use is when the package needs a group and a user to be created. For example:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
addgroup -S clamav 2&amp;gt;/dev/null&lt;br /&gt;
adduser -S -D -H -h /var/lib/clamav -s /sbin/nologin -G clamav -g clamav clamav 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
{{Note|If the script exits with a failure (e.g., if the user already exists), the package will not be installed and &amp;lt;code&amp;gt;apk&amp;lt;/code&amp;gt; will exit with failure, hence the &amp;lt;code&amp;gt;exit 0&amp;lt;/code&amp;gt; at the end.}}&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.post-install =====&lt;br /&gt;
: This script is executed &#039;&#039;after installing&#039;&#039; the package.&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.pre-upgrade =====&lt;br /&gt;
: This script is executed &#039;&#039;before upgrading/downgrading/reinstalling&#039;&#039; the package. Note that exiting with failure will not cause apk to exit with failure, but will mark the package as broken.&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.post-upgrade =====&lt;br /&gt;
: This script is executed &#039;&#039;after upgrading/downgrading/reinstalling&#039;&#039; the package.&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.pre-deinstall =====&lt;br /&gt;
: This script is executed &#039;&#039;before uninstalling&#039;&#039; the package.&lt;br /&gt;
: {{Note|If the script exits with failure, &amp;lt;code&amp;gt;apk&amp;lt;/code&amp;gt; will not uninstall the package.}}&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.post-deinstall =====&lt;br /&gt;
: This script is executed &#039;&#039;after uninstalling&#039;&#039; the package.&lt;br /&gt;
&lt;br /&gt;
==== install_if ====&lt;br /&gt;
:install_if can be used when a package needs to be installed when some packages are already installed or are in the dependency tree. It works in reverse to the &#039;&#039;recommends&#039;&#039; feature, that other package managers provide.&lt;br /&gt;
&lt;br /&gt;
: Typically this is used in a subpackage that should provide files which make sense with another package. For example:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
subpackages=&amp;quot;$pkgname-bash-completion:bashcomp:noarch&amp;quot;&lt;br /&gt;
...&lt;br /&gt;
bashcomp() {&lt;br /&gt;
	pkgdesc=&amp;quot;Bash completions for $pkgname&amp;quot;&lt;br /&gt;
	install_if=&amp;quot;$pkgname=$pkgver-r$pkgrel bash-completion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	install -Dm644 &amp;quot;$builddir&amp;quot;/doc/bash_completion/aria2c \&lt;br /&gt;
		&amp;quot;$subpkgdir&amp;quot;/usr/share/bash-completion/completions/_aria2c&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
From the aria2c APKBUILD. Note that the custom bashcomp() function is only necessary, because the files are not in /usr/share/bash-completion.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:In general, install_if should only be used with &#039;&#039;&#039;at least one versioned constraint&#039;&#039;&#039;. Otherwise, a package that was implicitly installed by install_if and then removed from the binary repositories, will not get purged with &amp;lt;code&amp;gt;apk upgrade&amp;lt;/code&amp;gt;. [https://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/10720#note_121298]&lt;br /&gt;
&lt;br /&gt;
==== license ====&lt;br /&gt;
: License(s) for the package, for example &amp;lt;code&amp;gt;GPL-3.0-or-later&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;BSD-2-Clause&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;MIT&amp;lt;/code&amp;gt; [[Creating_an_Alpine_package#license|(details)]].&lt;br /&gt;
&lt;br /&gt;
==== makedepends ====&lt;br /&gt;
: Build-time dependency package(s). For cross compiling support, split it into &amp;lt;code&amp;gt;makedepends_build&amp;lt;/code&amp;gt; (native system) and &amp;lt;code&amp;gt;makedepends_host&amp;lt;/code&amp;gt; (foreign system).&lt;br /&gt;
&lt;br /&gt;
==== sha256sums/sha512sums ====&lt;br /&gt;
: Checksums for the files/URLs listed in &#039;&#039;source&#039;&#039;.  The checksums are normally generated and updated by executing &amp;lt;code&amp;gt;abuild checksum&amp;lt;/code&amp;gt; and should be the last item in the APKBUILD.&lt;br /&gt;
&lt;br /&gt;
New packages should use only sha512sums. Support for md5sums and sha1sums was dropped.&lt;br /&gt;
&lt;br /&gt;
==== options ====&lt;br /&gt;
: Build-time options for the package.&lt;br /&gt;
&lt;br /&gt;
: {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Option&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;!archcheck&amp;lt;/code&amp;gt;&lt;br /&gt;
| Do not try to verify that the architecture of the binary files is the same architecture as abuild should build for. One example where it makes sense to set this are packages with firmware files, that get executed on another CPU (such as WiFi firmware).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;!check&amp;lt;/code&amp;gt;&lt;br /&gt;
| Do not try to run the &amp;lt;code&amp;gt;check()&amp;lt;/code&amp;gt; function. Please always add a short comment after the &amp;lt;code&amp;gt;!check&amp;lt;/code&amp;gt; about why it&#039;s disabled. [https://github.com/alpinelinux/aports/pull/2322#discussion_r142545300] Creating a very simple check function, that calls &amp;lt;code&amp;gt;program --version&amp;lt;/code&amp;gt; is worse than disabling tests completely because it gives the false impression that the package is thoroughly tested with the testsuite from upstream. [https://github.com/alpinelinux/aports/pull/7326#discussion_r278797457]&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;checkroot&amp;lt;/code&amp;gt;&lt;br /&gt;
| Specifies that the package&#039;s test suite will be run in &#039;&#039;fakeroot&#039;&#039;. This is necessary for some test suites which fail when run as non-root.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;net&amp;lt;/code&amp;gt;&lt;br /&gt;
| Allows network access when run in &#039;&#039;rootbld&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;!strip&amp;lt;/code&amp;gt;&lt;br /&gt;
| Avoid stripping symbols from binaries.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;suid&amp;lt;/code&amp;gt;&lt;br /&gt;
| Allow [https://en.wikipedia.org/wiki/Setuid setuid] binaries.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;!tracedeps&amp;lt;/code&amp;gt;&lt;br /&gt;
| Do not automatically find dependencies (e.g. by using &amp;lt;code&amp;gt;ldd&amp;lt;/code&amp;gt; to find dynamic libraries, which the resulting binary links against).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;chmod-clean&amp;lt;/code&amp;gt;&lt;br /&gt;
| Make all files writable in the src/ directory. Useful for packages that make files read-only in the process of building packages (go modules).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;toolchain&amp;lt;/code&amp;gt;&lt;br /&gt;
| Don&#039;t warn when g++ is in makedepends&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;!dbg&amp;lt;/code&amp;gt;&lt;br /&gt;
| Don&#039;t create debugging subpackage&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ldpath-recursive&amp;lt;/code&amp;gt;&lt;br /&gt;
| Scan directories recursively when creating .so providers&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;!spdx&amp;lt;/code&amp;gt;&lt;br /&gt;
| Do not check if the license= field has a SPDX compliant license&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;textrels&amp;lt;/code&amp;gt;&lt;br /&gt;
| Don&#039;t error out when text relocations are found&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;charset.alias&amp;lt;/code&amp;gt;&lt;br /&gt;
| Don&#039;t error out if /usr/lib/charset.alias is found&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;libtool&amp;lt;/code&amp;gt;&lt;br /&gt;
| Don&#039;t delete libtool .la files&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;!fhs&amp;lt;/code&amp;gt;&lt;br /&gt;
| Don&#039;t enforce checks on path that follow the FHS&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== pkgdesc ====&lt;br /&gt;
: A brief, one-line description of what the package does.&lt;br /&gt;
&lt;br /&gt;
: Here&#039;s an example from the OpenSSH client package:&lt;br /&gt;
: &amp;lt;pre&amp;gt;pkgdesc=&amp;quot;Port of OpenBSD&#039;s free SSH release - client&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== pkggroups ====&lt;br /&gt;
: System group(s) to be created during build-time.  System group(s) should also be created in the &#039;&#039;&#039;[[APKBUILD Reference#.24pkgname.pre-install|$pkgname.pre-install]]&#039;&#039;&#039; script, so that the system group(s) are also created prior to package installation for run-time use.&lt;br /&gt;
==== pkgname ====&lt;br /&gt;
: The name of the package.  All letters should be lowercase.&lt;br /&gt;
: {{Note|When creating an APKBUILD of a module or library for another package, we use some common package prefixes, such as: &#039;&#039;lua-&#039;&#039;, &#039;&#039;perl-&#039;&#039;, &#039;&#039;php-&#039;&#039;, and &#039;&#039;py3-&#039;&#039;.  Search aports for other common prefixes.}}&lt;br /&gt;
&lt;br /&gt;
==== pkgrel ====&lt;br /&gt;
: Alpine package release number.  Starts at 0 (zero).  Always increment &#039;&#039;pkgrel&#039;&#039; when making updates to an aport; reset &#039;&#039;pkgrel&#039;&#039; to 0 (zero) when incrementing &#039;&#039;pkgver&#039;&#039;.&lt;br /&gt;
==== pkgusers ====&lt;br /&gt;
: System user(s) to be created during build-time.  System user(s) should also be created in the &#039;&#039;&#039;[[APKBUILD Reference#.24pkgname.pre-install|$pkgname.pre-install]]&#039;&#039;&#039; script, so that the system user(s) are also created prior to package installation for run-time use.&lt;br /&gt;
==== pkgver ====&lt;br /&gt;
: The version of the software being packaged. Format for valid versions: &amp;lt;code&amp;gt;{digit}{.digit}...{letter}{_suf{#}}...{-r#}&amp;lt;/code&amp;gt; [https://git.alpinelinux.org/cgit/apk-tools/tree/src/version.c#n17]&lt;br /&gt;
: A Suffix &amp;lt;code&amp;gt;suf&amp;lt;/code&amp;gt; in the above format can be one of the following to indicate that the release is &#039;&#039;less recent&#039;&#039; than the version without the suffix: &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;beta&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;rc&amp;lt;/code&amp;gt; [https://git.alpinelinux.org/cgit/apk-tools/tree/src/version.c#n75]&lt;br /&gt;
: These are for indicating &#039;&#039;more recent&#039;&#039; releases: &amp;lt;code&amp;gt;cvs&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;svn&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;git&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hg&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; [https://git.alpinelinux.org/cgit/apk-tools/tree/src/version.c#n76]&lt;br /&gt;
: All other suffices are invalid. To package a specific git commit, the date of the commit gets appended to the latest release, e.g. &amp;lt;code&amp;gt;1.0.0_git20180204&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== provides ====&lt;br /&gt;
: List of package names (and optionally version info) this package provides.&lt;br /&gt;
&lt;br /&gt;
: If package with a version is provided (provides=&#039;foo=1.2&#039;) apk will consider it as an alternate name and it will automatically consider the package for installation by the alternate name, and conflict with other packages having the same name, or provides.&lt;br /&gt;
&lt;br /&gt;
: If version is not provided (provides=&#039;foo&#039;), apk will consider it as virtual package name. Several package with same non-versioned provides can be installed simultaneously. However, none of them will be installed by default when requested by the virtual name - instead, error message is given and user is asked to choose which package providing the virtual name should be installed.&lt;br /&gt;
==== provider_priority ====&lt;br /&gt;
: A numeric value which is used by apk-tools to break ties when choosing a virtual package to satisfy a dependency. Higher values have higher priority. The primary use case is to specify the primary package that satisfies a virtual (provider).&lt;br /&gt;
==== replaces ====&lt;br /&gt;
: Allow this package to be installed at the same time as the listed packages, even if they have conflicting files. The files from this package will override (&amp;quot;take over&amp;quot;) the conflicting files.&lt;br /&gt;
&lt;br /&gt;
: This can be used to override config files with &amp;quot;policy packages&amp;quot; [https://gitlab.alpinelinux.org/alpine/apk-tools/-/commit/89d003f8c2e5a92655ee778f7bfa5c0e85ddbed4].&lt;br /&gt;
&lt;br /&gt;
: Another use case is renaming packages (or moving files from one package to another): &amp;quot;replaces&amp;quot; will avoid the file conflict error that apk reports if it happens to install the new package before uninstalling the old package [https://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/10724#note_132872].&lt;br /&gt;
&lt;br /&gt;
: A common misconception is that &amp;quot;replaces&amp;quot; is used to replace packages (like in [https://wiki.archlinux.org/index.php/PKGBUILD#replaces PKGBUILD]). This is not the case, it is only for solving file conflicts. To let apk consider installing one package instead of another one, refer to [[#provides|provides]] (with the version).&lt;br /&gt;
&lt;br /&gt;
==== replaces_priority ====&lt;br /&gt;
: The priority of the replaces. If multiple packages replace files of each other, then the package with the highest &#039;&#039;replaces_priority&#039;&#039; will win.&lt;br /&gt;
&lt;br /&gt;
==== source ====&lt;br /&gt;
: The source variable is not only used to list the remote source files to fetch, it is also used to list the local files that abuild will need in order to build the apk. Examples of such local files include: init.d files, conf.d files, install files (see [[APKBUILD Reference#install|install variable]]), patches, and all other necessary files.&lt;br /&gt;
&lt;br /&gt;
: Here are few things to note:&lt;br /&gt;
&lt;br /&gt;
:* When you are finished adding local and/or remote files to &#039;&#039;source&#039;&#039;, you can execute the following command to add their checksums to the APKBUILD file:&lt;br /&gt;
:: {{Cmd|abuild checksum}}&lt;br /&gt;
:: {{Note|When later updating the content of &#039;&#039;source&#039;&#039;, or updating a file that is listed in &#039;&#039;source&#039;&#039;, you must also update their checksums again with the same command.}}&lt;br /&gt;
&lt;br /&gt;
:* When the remote file is hosted at SourceForge, it&#039;s best to specify the special mirrors link used by SourceForge:&lt;br /&gt;
:: &amp;lt;pre&amp;gt;http://downloads.sourceforge.net/software/software-$pkgver.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
:: (or similar depending on the package).&lt;br /&gt;
&lt;br /&gt;
:* You can set target filename (eg &#039;save as...&#039;) by prefixing the URI with &#039;&#039;filename::&#039;&#039;. This is useful when the remote filename is not specified in the URI (ie, does not end in &#039;/software-1.0.tar.gz&#039;), such as:&lt;br /&gt;
:: &amp;lt;pre&amp;gt;http://oss.example.org/?get=software&amp;amp;ver=1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
:: or when the filename is braindead, like githubs&#039; download tags:&lt;br /&gt;
:: &amp;lt;pre&amp;gt;https://github.com/software/software/archive/v$pkgver.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
:: The above two examples needs a target filename prefix:&lt;br /&gt;
:: &amp;lt;pre&amp;gt;$pkgname-$pkgver.tar.gz::http://oss.example.org/?get=software&amp;amp;ver=$pkgver&amp;lt;/pre&amp;gt;&lt;br /&gt;
:: and:&lt;br /&gt;
:: &amp;lt;pre&amp;gt;$pkgname-$pkgver.tar.gz::https://github.com/software/software/archive/v$pkgver.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:* abuild currently supports the following protocols for remote file retrieval:&lt;br /&gt;
:** http&lt;br /&gt;
:** https&lt;br /&gt;
:** ftp&lt;br /&gt;
&lt;br /&gt;
:* abuild currently supports the following archive types/archive file extensions:&lt;br /&gt;
:** .tar (only in Alpine &amp;gt;= 2.5)&lt;br /&gt;
:** .tar.gz / .tgz&lt;br /&gt;
:** .tar.bz2&lt;br /&gt;
:** .tar.lz (only in Alpine &amp;gt;=3.7)&lt;br /&gt;
:** .tar.lzma&lt;br /&gt;
:** .tar.xz&lt;br /&gt;
:** .zip&lt;br /&gt;
&lt;br /&gt;
:* &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; should only include variables that change often like &amp;lt;code&amp;gt;pkgver&amp;lt;/code&amp;gt; or a commit ID. CI will warn you if you include &amp;lt;code&amp;gt;pkgname&amp;lt;/code&amp;gt; in source. Other variables like for example &amp;lt;code&amp;gt;_pkgname&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;_pyname&amp;lt;/code&amp;gt; do not belong in &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; either.&lt;br /&gt;
&lt;br /&gt;
==== subpackages ====&lt;br /&gt;
: Subpackages built from this APKBUILD.  abuild will parse this variable and try to find a subpackage split function.  The split function must &#039;&#039;move&#039;&#039; files that do not belong in the main package, from &#039;&#039;$pkgdir&#039;&#039; to &#039;&#039;$subpkgdir&#039;&#039;.  Files and directories can also be &#039;&#039;copied&#039;&#039; from &#039;&#039;$startdir&#039;&#039; and &#039;&#039;$srcdir&#039;&#039; to &#039;&#039;$subpkgdir&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
: The split function can be specified in 1 of 3 different methods:&lt;br /&gt;
:# subpkgname:&#039;&#039;&#039;splitfunc&#039;&#039;&#039;&lt;br /&gt;
:# $pkgname-&#039;&#039;&#039;splitfunc&#039;&#039;&#039;&lt;br /&gt;
:# &#039;&#039;&#039;splitfunc&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
: {{Note|Split function names &#039;&#039;&#039;cannot&#039;&#039;&#039; use hyphens; use the first method above if the subpackage name contains a hyphen (-) character, like this: &#039;&#039;subpkg-name:subpkg_name&#039;&#039;, where &amp;lt;code&amp;gt;subpkg-name&amp;lt;/code&amp;gt; is the name of the &#039;&#039;&#039;subpackage&#039;&#039;&#039; and &amp;lt;code&amp;gt;subpkg_name&amp;lt;/code&amp;gt; is the name of the &#039;&#039;&#039;subpackage&#039;s split function&#039;&#039;&#039;.}}&lt;br /&gt;
&lt;br /&gt;
: {{Tip|For more information, see the [[APKBUILD_examples:Subpackages|Subpackages example]].}}&lt;br /&gt;
&lt;br /&gt;
==== triggers ====&lt;br /&gt;
: Apk-tools can &amp;quot;monitor&amp;quot; directories and execute a trigger if any package installed/uninstalled any file in the monitored dir. The triggers are always executed after the apk action (install, uninstall, upgrade).&lt;br /&gt;
&lt;br /&gt;
: The triggers are specified in the format: &#039;&#039;scriptname&#039;&#039;=&#039;&#039;pathlist&#039;&#039; where &#039;&#039;scriptname&#039;&#039; is the (sub)package name + .trigger suffix and pathlist is : separated list of the dirs to monitor.&lt;br /&gt;
&lt;br /&gt;
: The &#039;&#039;&#039;triggers&#039;&#039;&#039; variable must include the triggers for subpackages too if they have any.&lt;br /&gt;
&lt;br /&gt;
: It is possible to use wildcards (*) in the dir list.&lt;br /&gt;
&lt;br /&gt;
==== url ====&lt;br /&gt;
: The homepage for the package.  This is to help users find upstream documentation and other information regarding the package.&lt;br /&gt;
&lt;br /&gt;
==== langdir ====&lt;br /&gt;
: Path to where the language files are located for the &#039;&#039;&#039;-lang&#039;&#039;&#039; subpackage, defaults to &#039;&#039;&#039;/usr/share/locale&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== pcprefix ====&lt;br /&gt;
: Prefix all provides derived from parsing pkg-config Requires: with the value in this variable, example: &#039;&#039;&#039;&#039;pcprefix=&amp;quot;foo:&amp;quot;&#039;&#039;&#039; will produce &#039;&#039;&#039;pc:foo:bar&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== sonameprefix ====&lt;br /&gt;
: Prefix all provides derived from parsing shared objects with the value in this variable, example: &#039;&#039;&#039;sonameprefix=&amp;quot;foo&amp;quot;&#039;&#039;&#039; will produce &#039;&#039;&#039;so:foo:bar.so.X&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Functions =&lt;br /&gt;
{{Note|All functions that are not &#039;&#039;prepare()&#039;&#039;, &#039;&#039;build()&#039;&#039;, &#039;&#039;check()&#039;&#039; and &#039;&#039;package()&#039;&#039; should consider the current working directory as undefined, and should therefore use the [[APKBUILD Reference#abuild-defined_variables|abuild-defined directory variables]] to their advantage.}}&lt;br /&gt;
&lt;br /&gt;
 sanitycheck() -&amp;gt; clean()-&amp;gt; fetch() -&amp;gt; verify() -&amp;gt; unpack() -&amp;gt; prepare() -&amp;gt; mkusers() -&amp;gt; build() -&amp;gt; check() -&amp;gt; package() -&amp;gt; subpackages() -&amp;gt; language packs -&amp;gt; apk -&amp;gt; cleanup()&lt;br /&gt;
&lt;br /&gt;
== abuild-defined functions ==&lt;br /&gt;
The following functions are provided by abuild and can be overridden, but it is strongly discouraged on code review for some functions:&lt;br /&gt;
&lt;br /&gt;
==== fetch() ====&lt;br /&gt;
: Downloads remote sources listed in &#039;&#039;source&#039;&#039; to &#039;&#039;SRCDEST&#039;&#039; (&#039;&#039;SRCDEST&#039;&#039; is configured in &#039;&#039;/etc/abuild.conf&#039;&#039;) and creates symlinks in &#039;&#039;$srcdir&#039;&#039;.&lt;br /&gt;
==== unpack() ====&lt;br /&gt;
: unpack() will call default_unpack().&lt;br /&gt;
&lt;br /&gt;
: [https://github.com/alpinelinux/abuild/blob/v3.1.0/abuild.in#L403 default_unpack()] unpacks .tar, .tgz, .tar.gz, .tar.lz (only available in Alpine &amp;gt;=3.7), .tar.bz2, .tar.lzma, .tar.xz, and .zip archives from a symlink in &#039;&#039;$srcdir&#039;&#039; associated with &#039;&#039;$SRCDEST&#039;&#039; (or distfiles folder) resulting in an unpacked folder in &#039;&#039;$srcdir&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== dev() ====&lt;br /&gt;
: Subpackage function for the &#039;&#039;&#039;$pkgname-dev&#039;&#039;&#039; package is used to collect developer files and folders for use in other packages in the compilation process nothing more.  Without specifying a custom &#039;&#039;dev()&#039;&#039; function, abuild will call its internal &#039;&#039;dev()&#039;&#039; function, which in turn calls default_dev().&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;[https://github.com/alpinelinux/abuild/blob/v3.1.0/abuild.in#L1605 default_dev()]&#039;&#039; will move any &#039;&#039;include&#039;&#039; folder and folders containing &#039;&#039;*.[acho]&#039;&#039; (static archive, c source, c header file, object file), &#039;&#039;*.prl&#039;&#039; file extension patterns in &#039;&#039;&amp;quot;$pkgdir&amp;quot;/{lib,usr}&#039;&#039; to &#039;&#039;&amp;quot;$subpkgdir&amp;quot;/{lib,usr}&#039;&#039; recursively; and &#039;&#039;*.so&#039;&#039; files from &#039;&#039;&amp;quot;$pkgdir&amp;quot;/{lib,usr/lib}&#039;&#039; to &#039;&#039;&amp;quot;$subpkgdir&amp;quot;/{lib,usr/lib}&#039;&#039;.  It will also scan and move &#039;&#039;usr/{include,lib/{pkgconfig,cmake,qt*/mkspecs},share/{aclocal,gettext,vala/vapi,gir-[0-9]*,qt*/mkspecs},bin/*-config}}&#039;&#039; developer only folders in &#039;&#039;$pkgdir&#039;&#039; and transfer them to &#039;&#039;$subpkgdir&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
: In general, default_dev() will support packages that share pkg-config, C programming language API, shared and static libraries, Autotools, gettext, Vala programming language bindings, Python GObject introspection, a provided custom pkg-config like command (*-config), Qt, and CMake.  If you have packages that have C++, other languages, other build system, etc; you need to manually move those developer files only if they are to be used in other packages.&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;&#039;Important&#039;&#039;&#039;: For default_dev() to be called as in no dev(), you need to explicitly add subpackages=&amp;quot;$pkgname-dev&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== doc() ====&lt;br /&gt;
: Subpackage function for the &#039;&#039;&#039;$pkgname-doc&#039;&#039;&#039; package whose job is only to collect documentation folders from $pkgdir nothing more.  Without specifying a custom &#039;&#039;doc()&#039;&#039; function, abuild will call its internal &#039;&#039;doc()&#039;&#039; function, which in turn calls default_doc().&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;[https://github.com/alpinelinux/abuild/blob/v3.1.0/abuild.in#L1519 default_doc()]&#039;&#039; will move &#039;&#039;&amp;quot;$pkgdir&amp;quot;/usr/share/{doc,man,info,html,sgml,licenses,gtk-doc,ri,help}&#039;&#039; to &#039;&#039;$subpkgdir&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
: Overriding this function is strongly discouraged.  Packaging docs should be done in the package() function while letting abuild automatically collect the doc folders.&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;&#039;Important&#039;&#039;&#039;: For default_doc() to be called as in no doc(), you need to explicitly add subpackages=&amp;quot;$pkgname-doc&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== openrc() ====&lt;br /&gt;
: Subpackage function for the &#039;&#039;&#039;$pkgname-openrc&#039;&#039;&#039; package whose job is to collect OpenRC service files that are in /etc/init.d and /etc/conf.d.&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;[https://github.com/alpinelinux/abuild/blob/v3.1.0/abuild.in#L1661 default_openrc()]&#039;&#039; will move &#039;&#039;&amp;quot;$pkgdir&amp;quot;/etc/{conf,init}.d&#039;&#039; to &#039;&#039;$subpkgdir&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
: Overriding this function is strongly discouraged. Packaging OpenRC service definitions should be in the package() function while letting abuild automatically collect the openrc folders.&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;&#039;Important&#039;&#039;&#039;: for default_openrc() to be called as in no openrc(), you need to explicitly add subpackages=&amp;quot;$pkgname-openrc&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== static() ====&lt;br /&gt;
: Subpackage function for the &#039;&#039;&#039;$pkgname-static&#039;&#039;&#039; package whose job is to collect static libraries that are stored in /lib and /usr/lib.&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;[https://github.com/alpinelinux/abuild/blob/v3.4.0_rc4/abuild.in#L1748 default_static()]&#039;&#039; will move all static libraries (files ending with .a) from &#039;&#039;&amp;quot;$pkgdir&amp;quot;/lib&#039;&#039; and &#039;&#039;&amp;quot;$pkgdir&amp;quot;/usr/lib&#039;&#039; to their equivalents in &#039;&#039;$subpkgdir&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
: Overriding this function is strongly discouraged. Packaging static libraries should be done in the package() function while letting abuild automatically collect the static libraries.&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;&#039;Important&#039;&#039;&#039;: for default_static() to be called as in no static(), you need to explicitly add subpackages=&amp;quot;$pkgname-static&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== snapshot() ====&lt;br /&gt;
: &#039;&#039;&#039;Optional&#039;&#039;&#039;.  For live APKBUILDs or those with a _cvs, _svn, _git, _hg in their version number, you should create a snapshot function only if there is no download link to an archive file (.zip, .tar.gz, ...) to the commit/hash/tag.  The purpose of the snapshot function is to create an archive of the source code so that the package source code is deterministic, and it doesn&#039;t waste time to fetch the source code but bypasses the download step after snapshotting.  Those that download the source code from a git repository will follow head or the latest change to the source code.  It is better to archive the source code as a zip / tar.gz / tar.bz2 up to the commit or the tag which you are trying to build a package.  If it is not deterministic or not every part of the code frozen in time for every dependency and the main project, then the patches will fail or the package may fail to compile when you revisit the package months or years to backport a patch.&lt;br /&gt;
&lt;br /&gt;
: The default [https://github.com/alpinelinux/abuild/blob/v3.1.0/abuild.in#L2310 snapshot()] function has variables associated with it:&lt;br /&gt;
:* $disturl - the base-url of the place to autoupload the snapshot&lt;br /&gt;
:* $svnurl - Subversion repository &lt;br /&gt;
:* $giturl - Git repository&lt;br /&gt;
&lt;br /&gt;
: The default snapshot() can only support one repository.  It is better to override it if there are multiple repositories involved in your package.  CVS, Mercurial (hg), and alternative version control systems must override the default snapshot().&lt;br /&gt;
&lt;br /&gt;
: See [[APKBUILD_examples:Git_checkout]] to how to use it with git.  It takes 2-3 general steps.  Clone the repository; check it out at a specific revision/commit or tag; then you use an archiver to dump it in the &#039;&#039;$SRCDEST&#039;&#039; variable which points to the distfiles folder and the base path to the full path to the archive that you want to create.  You do this for every internal dependency that the package pulls.&lt;br /&gt;
&lt;br /&gt;
: After you have created your snapshot function, you use &amp;lt;code&amp;gt;abuild snapshot&amp;lt;/code&amp;gt; to run it.  &lt;br /&gt;
&lt;br /&gt;
: The archives produced by the snapshot will be saved in &#039;&#039;/var/cache/distfiles&#039;&#039; or whatever you set for &#039;&#039;$SRCDEST&#039;&#039;.  You may need to create symlinks to the archive if the archive is not saved to the Alpine server.&lt;br /&gt;
&lt;br /&gt;
: After you snapshot it, you need to produce the checksums with &amp;lt;code&amp;gt;abuild checksum&amp;lt;/code&amp;gt; to use it in the APKBUILD creation process.&lt;br /&gt;
&lt;br /&gt;
: This feature is available since Alpine &amp;gt;=2.6.&lt;br /&gt;
&lt;br /&gt;
==== default_prepare() ====&lt;br /&gt;
&lt;br /&gt;
:  Before build preparation it handles set of patches inside &amp;lt;code&amp;gt;$srcdir&amp;lt;/code&amp;gt; and prints failed ones.&lt;br /&gt;
&lt;br /&gt;
== User-defined functions ==&lt;br /&gt;
The following functions should be defined by the user: &lt;br /&gt;
&lt;br /&gt;
==== prepare() ====&lt;br /&gt;
: {{note|Please adjust old APKBUILDs, which still have a &#039;&#039;prepare()&#039;&#039; function that does the same as the &#039;&#039;default_prepare()&#039;&#039; when you edit them anyway.}}&lt;br /&gt;
: &#039;&#039;&#039;&#039;&#039;Optional&#039;&#039;.&#039;&#039;&#039;  Used for build preparation: patches, etc, should be applied here. When you don&#039;t specify a custom &#039;&#039;prepare()&#039;&#039;, the built-in &#039;&#039;default_prepare()&#039;&#039; from abuild will be used. It applies patches already (always prepare them in the &amp;lt;code&amp;gt;-p1&amp;lt;/code&amp;gt; format), so &#039;&#039;&#039;usually it makes sense to not create a custom &#039;&#039;prepare()&#039;&#039; function at all!&#039;&#039;&#039; If you do create one, call &#039;&#039;default_prepare()&#039;&#039; inside it:&lt;br /&gt;
&lt;br /&gt;
: Before default_prepare gets called, you can define &#039;&#039;patch_args&#039;&#039; to supply the argument to the patch command in global scope then throw away prepare() so it is unnecessary to use the old template code floating around to patch.  patch_args and autopatching is only available in Alpine &amp;gt;=3.4.  See [[Creating_an_Alpine_package#Patches]] to fix the patch that uses a different patch level (-pX).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prepare() {&lt;br /&gt;
    default_prepare&lt;br /&gt;
    # your custom code here&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== build() ====&lt;br /&gt;
: &#039;&#039;&#039;Required.&#039;&#039;&#039;  This is the compilation stage.  This function will be called as the current user (unless the &#039;&#039;package()&#039;&#039; function is missing - for compatibility reasons).  If no compilation is needed, the function should be removed.&lt;br /&gt;
&lt;br /&gt;
: To enable or disable CFLAGS, CXXFLAGS, CMake with option, or configure option per arch, use the CARCH variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
local cmakeoptions=&lt;br /&gt;
case &amp;quot;$CARCH&amp;quot; in&lt;br /&gt;
        aarch64*|arm*|ppc64le|x86|s390x) cmakeoptions=&amp;quot;$cmakeoptions -DWITH_OPENMP=OFF&amp;quot; ;;&lt;br /&gt;
        x86_64)                          cmakeoptions=&amp;quot;$cmakeoptions -DWITH_OPENMP=ON&amp;quot; ;;&lt;br /&gt;
        *)                               msg &amp;quot;Unable to determine architecture from (CARCH=$CARCH)&amp;quot; ; return 1 ;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: The block can be used in other parts of the APKBUILD even in global.&lt;br /&gt;
&lt;br /&gt;
==== check() ====&lt;br /&gt;
: &#039;&#039;&#039;Required if functionality exists.&#039;&#039;&#039; This function is called right after the build stage.  It should check that the packaged thing is actually working, typically by running (integration) tests, if provided by upstream.  If there’s no (easy) way how to test the package, you can declare that it does not want to use &#039;&#039;check()&#039;&#039; by adding &amp;quot;!check&amp;quot; into the &#039;&#039;options&#039;&#039; variable (&amp;lt;code&amp;gt;options=&amp;quot;!check&amp;quot;&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
: default_check() does nothing.  You need to manually explicitly call the unit tests or test suite yourself.  When you run the test, the program should return with an exit code of 0, indicating the tests were a success.  Unit tests or test suites will do feature tests, per function correctness check, fuzz testing, benchmarks.&lt;br /&gt;
&lt;br /&gt;
: A package may also require additional testing frameworks packages that are external dependencies.  You should add those to the &#039;&#039;checkdepends=&#039;&#039; in Alpine &amp;gt;=3.6 or &#039;&#039;makedepends=&#039;&#039; for older for backporters.  If the testing framework is not available, you need to create a package for it.  If it requires a specific version of a testing framework, consider making it an internal dependency or a new package with a package name containing the major and minor version number like the python packages.&lt;br /&gt;
&lt;br /&gt;
: Generally speaking, you should define the check functions for libraries, large programs like web browsers, or compilers and interpreters, cryptographic/security/anonymity stuff, mission critical stuff, PCI compliance/money/accounting software, server software with a lot of stakeholders or consumers.  Soon for the new policy change will have virtually &#039;&#039;&#039;all packages with testing capabilities be required to have a working and defined check() function&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
: There are times when the unit tests do not work, just because the test itself is broken, new unimplemented feature, external factors not taken into consideration, unbundling path differences, breakage caused by ccache, missing test dependency or version mismatch dependency as in python2 vs python3, test scripts only work for particular language implementation like only supporting python2 but not python3 having used the 2to3 conversion script.  If a unit test is known not to work, you may need to patch it to omit that test or fix it; but, certain tests should not be disabled if it is important.  You may need to alter the references to uncompiled internal dependencies to work with the external dependencies instead.  For ccache, you can either disable it or remove it from the PATH environmental variable before running tests.&lt;br /&gt;
&lt;br /&gt;
{{Note|Tests for graphical applications and toolkits might work on a X11 user setup but will fail on the server unless run with xvfb-run.}}&lt;br /&gt;
&lt;br /&gt;
: If you don&#039;t add the &#039;&#039;check()&#039;&#039; and the &#039;&#039;options=&#039;&#039;, this is what you will see:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt;&amp;gt;&amp;gt; WARNING: py-webtest*: APKBUILD does not run any tests!&lt;br /&gt;
    Alpine policy will soon require that packages have any relevant testsuites run during the build process.&lt;br /&gt;
    To fix, either define a check() function, or declare !check in $options to indicate the package does not have a testsuite.&lt;br /&gt;
&lt;br /&gt;
: If you do not do a check or disable it, you must state there is no testsuite in comment form (#) next to options=&amp;quot;!check&amp;quot; for the code reviewers.&lt;br /&gt;
&lt;br /&gt;
: To run test suite with autotools do:&lt;br /&gt;
&lt;br /&gt;
  make check&lt;br /&gt;
&lt;br /&gt;
: To run the test suite with python setuptools:&lt;br /&gt;
&lt;br /&gt;
  python2 setup.py test&lt;br /&gt;
  python3 setup.py test&lt;br /&gt;
&lt;br /&gt;
: For python it should be &#039;&#039;&#039;test&#039;&#039;&#039; not check.  Check for python setuptools will check the packaging metadata fields[https://docs.python.org/3/distutils/examples.html#checking-a-package] only but not run the unit tests.  There should be verbose output also.  The dependencies for the tests are found in test_require in the setup.py.&lt;br /&gt;
&lt;br /&gt;
: If it says &amp;lt;code&amp;gt;Ran 0 tests in 0.000s&amp;lt;/code&amp;gt; that is not acceptable.  check() will say it was good but it is not actually correct.  It needs to run the test suite with an alternative method like &amp;lt;code&amp;gt;tox -e py27,py36&amp;lt;/code&amp;gt; if you see a tox.ini file.&lt;br /&gt;
&lt;br /&gt;
: You want to do it for each implementation to ensure that the API calls are correct per implementation but ncopa said it was just fine with python3.&lt;br /&gt;
&lt;br /&gt;
: If there is a circular dependency for the checkdepends=, you need to disable the check and put the reason next to &amp;lt;code&amp;gt;options=&amp;quot;!check&amp;quot;&amp;lt;/code&amp;gt; that there is a circular dependency.  You should disable it for the package that package that is least important or least security risk.  The other solution is to make the conflicting dependency an internal dependency but making sure that it doesn&#039;t pull it at check time.  This way they can both preform tests properly.&lt;br /&gt;
&lt;br /&gt;
==== package() ====&lt;br /&gt;
: &#039;&#039;&#039;Required.&#039;&#039;&#039;  This is the packaging stage.  Here, the built application and support files should be installed into &#039;&#039;&#039;$pkgdir&#039;&#039;&#039;.  If this is a metapackage, this function can contain a single line: &amp;lt;code&amp;gt;mkdir -p &amp;quot;$pkgdir&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|Building in fakeroot will reduce performance for parallel builds dramatically.  It is for this reason that we split the build and package process into two separate functions.}}&lt;br /&gt;
&lt;br /&gt;
= Special Operators =&lt;br /&gt;
&lt;br /&gt;
== $pkgname~$pkgver ==&lt;br /&gt;
&lt;br /&gt;
Specifies a required &amp;lt;code&amp;gt;$pkgver&amp;lt;/code&amp;gt; for [[apk]] to satisfy the &amp;lt;code&amp;gt;$pkgname&amp;lt;/code&amp;gt; requirement. &amp;lt;code&amp;gt;~&amp;lt;/code&amp;gt; ignores revisions of the package version. For example &amp;lt;code&amp;gt;superd~0.6&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;$depends&amp;lt;/code&amp;gt; will ensure superd with package version 0.6 is installed as a run-time dependency for the package.&lt;br /&gt;
&lt;br /&gt;
== $pkgname&amp;gt;=$pkgver ==&lt;br /&gt;
&lt;br /&gt;
Specifies the installed package version must be greater than or equal to &amp;lt;code&amp;gt;$pkgver&amp;lt;/code&amp;gt; for [[apk]] to satisfy the &amp;lt;code&amp;gt;$pkgname&amp;lt;/code&amp;gt; requirement.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
The [[APKBUILD examples]] page will assist you in understanding how to create an APKBUILD.&lt;br /&gt;
&lt;br /&gt;
= Version =&lt;br /&gt;
&lt;br /&gt;
This document assumes abuild for Alpine Edge.  For older releases of abuild, some of these features may not be available if you are using an older release.  A link to the implementation is linked for researchers and backporters.&lt;br /&gt;
&lt;br /&gt;
For more information see [[APKBUILD_versions]].&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=APKBUILD_Reference&amp;diff=29222</id>
		<title>APKBUILD Reference</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=APKBUILD_Reference&amp;diff=29222"/>
		<updated>2025-03-10T11:23:24Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: /* $pkgname.pre-install */ use -h in adduser example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;APKBUILDs are the scripts that are created in order to build Alpine packages using the [[Abuild and Helpers|abuild]] tool.&lt;br /&gt;
&lt;br /&gt;
See [[aports]] for details on Alpine&#039;s official ports repository.&lt;br /&gt;
&lt;br /&gt;
This page is intended to serve as a reference for creating APKBUILDs; if this is your first time creating a package for Alpine Linux, please see [[Creating an Alpine package]].&lt;br /&gt;
&lt;br /&gt;
= Legend =&lt;br /&gt;
The following notes will assist you in understanding this document.&lt;br /&gt;
&lt;br /&gt;
In description text:&lt;br /&gt;
* If a variable is not prefixed with a &#039;&#039;$&#039;&#039;, it will be represented by italics (i.e., &#039;&#039;srcdir&#039;&#039; ).&lt;br /&gt;
* Functions will also be represented by italics, but will also end with a pair of parentheses (i.e., &#039;&#039;build()&#039;&#039; ).&lt;br /&gt;
* Shell commands will be represented &amp;lt;code&amp;gt;like this&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Variables =&lt;br /&gt;
{{Note|Variables that contain a path (e.g. &#039;&#039;$srcdir&#039;&#039; and &#039;&#039;$pkgdir&#039;&#039;) should always be quoted using double quotes (i.e., &#039;&#039;&amp;quot;$srcdir&amp;quot;&#039;&#039;).  This is done to prevent things from breaking, should the user have the APKBUILD in a directory path that contains spaces.}}&lt;br /&gt;
{{Note|All arbitrary variable and function names should be prefixed with an underscore character ( _ ) to avoid name clashes with the internals of abuild (for example, &#039;&#039;_luaversions&#039;&#039;).}}&lt;br /&gt;
&lt;br /&gt;
These variables are all well documented in &amp;lt;code&amp;gt;man 5 APKBUILD&amp;lt;/code&amp;gt; ([https://gitlab.alpinelinux.org/alpine/abuild/-/blob/master/APKBUILD.5.scd man page source]).&lt;br /&gt;
&lt;br /&gt;
== User-defined variables ==&lt;br /&gt;
The following variables should be defined by the user:&lt;br /&gt;
==== maintainer ====&lt;br /&gt;
: Name and email address of the maintainer of the package.&lt;br /&gt;
: A well-formatted example is &amp;lt;code&amp;gt;maintainer=&amp;quot;John Snow &amp;lt;john_snow@thewall.net&amp;gt;&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== arch ====&lt;br /&gt;
: Package architecture(s) to build for.  Can be one or several seperated by whitespace of: &#039;&#039;&#039;[[x86]], [[x86_64]], [[armv7]], [[armhf]], [[aarch64]], [[ppc64le]], [[s390x]], [[riscv64]], all&#039;&#039;&#039;, or &#039;&#039;&#039;noarch&#039;&#039;&#039;, where &#039;&#039;&#039;all&#039;&#039;&#039; means all architectures, and &#039;&#039;&#039;noarch&#039;&#039;&#039; means it&#039;s architecture-independent (e.g., a pure-python package). Architectures can be negated using the ! character to exclude them from the list of supported architectures. E.g. &#039;&#039;&#039;arch=&amp;quot;all !ppc64le&amp;quot;&#039;&#039;&#039; means that the package is allowed to be built on all architectures but the ppc64le architecture.&lt;br /&gt;
: {{Tip|To determine if your APKBUILD can use &#039;&#039;&#039;noarch&#039;&#039;&#039;: First specify &#039;&#039;&#039;all&#039;&#039;&#039; and then build the package by executing &amp;lt;code&amp;gt;abuild -r&amp;lt;/code&amp;gt;.  Watch the output towards the end for warnings saying that &#039;&#039;&#039;noarch&#039;&#039;&#039; can be used.  If the main package and all subpackages, if you have any subpackages, give a warning saying that &#039;&#039;&#039;noarch&#039;&#039;&#039; can be used, then you can use &#039;&#039;&#039;noarch&#039;&#039;&#039;.}}&lt;br /&gt;
&lt;br /&gt;
==== depends ====&lt;br /&gt;
: Run-time dependency package(s) that are not shared-object dependencies.  Shared objects dependencies are auto-detected and should not be specified here. To specify a conflicting package, add the package name prefixed with a &#039;!&#039;.&lt;br /&gt;
&lt;br /&gt;
==== depends_dev ====&lt;br /&gt;
: Run-time dependency package(s) for the &#039;&#039;&#039;$pkgname-dev&#039;&#039;&#039; subpackage.&lt;br /&gt;
&lt;br /&gt;
: {{Note|From ncopa on IRC: To find out if you need to add a package to depends_dev have a look at *requires* in usr/lib/pkgconfig/*.pc. With libtool it gets more complicated, but we should delete the .la files. Also check if there are any  /usr/bin/*-configure #!/bin/bash #!/usr/bin/perl or Python. Sometimes scripts or similar are generated at build time (i.e autoconf automake) then you normally don&#039;t need add those to depends_dev. You can also just add all -dev makedepends to depends_dev but it will slow the build process a little bit (more build dependencies).}}&lt;br /&gt;
&lt;br /&gt;
==== depends_doc ====&lt;br /&gt;
: Run-time dependency package(s) for the &#039;&#039;&#039;$pkgname-doc&#039;&#039;&#039; subpackage.&lt;br /&gt;
&lt;br /&gt;
==== depends_openrc ====&lt;br /&gt;
: Run-time dependency package(s) for the &#039;&#039;&#039;$pkgname-openrc&#039;&#039;&#039; subpackage.&lt;br /&gt;
&lt;br /&gt;
==== depends_libs ====&lt;br /&gt;
: Run-time dependency package(s) for the &#039;&#039;&#039;$pkgname-libs&#039;&#039;&#039; subpackage.&lt;br /&gt;
&lt;br /&gt;
==== depends_static ====&lt;br /&gt;
: Run-time dependency package(s) for the &#039;&#039;&#039;$pkgname-static&#039;&#039;&#039; subpackage.&lt;br /&gt;
&lt;br /&gt;
==== checkdepends ====&lt;br /&gt;
: Dependencies that are only required during the check phase, they are only installed if the check option is enabled&lt;br /&gt;
&lt;br /&gt;
==== giturl ====&lt;br /&gt;
:Git repository from which &amp;lt;code&amp;gt;abuild checkout&amp;lt;/code&amp;gt; checks out. You can checkout a specific branch in git by adding &amp;lt;code&amp;gt;-b $branch&amp;lt;/code&amp;gt;.&lt;br /&gt;
==== install ====&lt;br /&gt;
: There are 6 different types of install scripts.  Install scripts are named &#039;&#039;&#039;$pkgname.action&#039;&#039;&#039;, where &#039;&#039;&#039;action&#039;&#039;&#039; can be:  &#039;&#039;&#039;pre-install, post-install, pre-upgrade, post-upgrade, pre-deinstall&#039;&#039;&#039;, or &#039;&#039;&#039;post-deinstall&#039;&#039;&#039;.  For example, if &#039;&#039;pkgname&#039;&#039; is set to &#039;&#039;&#039;mypackage&#039;&#039;&#039; and &#039;&#039;install&#039;&#039; is set to &#039;&#039;&#039;$pkgname.post-install&#039;&#039;&#039;, then a script named &#039;&#039;&#039;mypackage.post-install&#039;&#039;&#039; must exist along-side the APKBUILD.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;{{Note|Always use &amp;lt;code&amp;gt;/bin/sh&amp;lt;/code&amp;gt; for the command-line interpreter on the [https://en.wikipedia.org/wiki/Shebang_%28Unix%29 shebang line] of your install scripts.}}&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following are the different types of install scripts in detail:&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.pre-install =====&lt;br /&gt;
: This script is executed &#039;&#039;before installing&#039;&#039; the package.  Typical use is when the package needs a group and a user to be created. For example:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
addgroup -S clamav 2&amp;gt;/dev/null&lt;br /&gt;
adduser -S -D -H -h /var/lib/clamav -s /sbin/nologin -G clamav -g clamav clamav 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
{{Note|If the script exits with a failure (e.g., if the user already exists), the package will not be installed and &amp;lt;code&amp;gt;apk&amp;lt;/code&amp;gt; will exit with failure, hence the &amp;lt;code&amp;gt;exit 0&amp;lt;/code&amp;gt; at the end.}}&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.post-install =====&lt;br /&gt;
: This script is executed &#039;&#039;after installing&#039;&#039; the package.&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.pre-upgrade =====&lt;br /&gt;
: This script is executed &#039;&#039;before upgrading/downgrading/reinstalling&#039;&#039; the package. Note that exiting with failure will not cause apk to exit with failure, but will mark the package as broken.&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.post-upgrade =====&lt;br /&gt;
: This script is executed &#039;&#039;after upgrading/downgrading/reinstalling&#039;&#039; the package.&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.pre-deinstall =====&lt;br /&gt;
: This script is executed &#039;&#039;before uninstalling&#039;&#039; the package.&lt;br /&gt;
: {{Note|If the script exits with failure, &amp;lt;code&amp;gt;apk&amp;lt;/code&amp;gt; will not uninstall the package.}}&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.post-deinstall =====&lt;br /&gt;
: This script is executed &#039;&#039;after uninstalling&#039;&#039; the package.&lt;br /&gt;
&lt;br /&gt;
==== install_if ====&lt;br /&gt;
:install_if can be used when a package needs to be installed when some packages are already installed or are in the dependency tree. It works in reverse to the &#039;&#039;recommends&#039;&#039; feature, that other package managers provide.&lt;br /&gt;
&lt;br /&gt;
: Typically this is used in a subpackage that should provide files which make sense with another package. For example:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
subpackages=&amp;quot;$pkgname-bash-completion:bashcomp:noarch&amp;quot;&lt;br /&gt;
...&lt;br /&gt;
bashcomp() {&lt;br /&gt;
	pkgdesc=&amp;quot;Bash completions for $pkgname&amp;quot;&lt;br /&gt;
	install_if=&amp;quot;$pkgname=$pkgver-r$pkgrel bash-completion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	install -Dm644 &amp;quot;$builddir&amp;quot;/doc/bash_completion/aria2c \&lt;br /&gt;
		&amp;quot;$subpkgdir&amp;quot;/usr/share/bash-completion/completions/_aria2c&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
From the aria2c APKBUILD. Note that the custom bashcomp() function is only necessary, because the files are not in /usr/share/bash-completion.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:In general, install_if should only be used with &#039;&#039;&#039;at least one versioned constraint&#039;&#039;&#039;. Otherwise, a package that was implicitly installed by install_if and then removed from the binary repositories, will not get purged with &amp;lt;code&amp;gt;apk upgrade&amp;lt;/code&amp;gt;. [https://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/10720#note_121298]&lt;br /&gt;
&lt;br /&gt;
==== license ====&lt;br /&gt;
: License(s) for the package, for example &amp;lt;code&amp;gt;GPL-3.0-or-later&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;BSD-2-Clause&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;MIT&amp;lt;/code&amp;gt; [[Creating_an_Alpine_package#license|(details)]].&lt;br /&gt;
&lt;br /&gt;
==== makedepends ====&lt;br /&gt;
: Build-time dependency package(s). For cross compiling support, split it into &amp;lt;code&amp;gt;makedepends_build&amp;lt;/code&amp;gt; (native system) and &amp;lt;code&amp;gt;makedepends_host&amp;lt;/code&amp;gt; (foreign system).&lt;br /&gt;
&lt;br /&gt;
==== md5sums/sha256sums/sha512sums ====&lt;br /&gt;
: Checksums for the files/URLs listed in &#039;&#039;source&#039;&#039;.  The checksums are normally generated and updated by executing &amp;lt;code&amp;gt;abuild checksum&amp;lt;/code&amp;gt; and should be the last item in the APKBUILD.&lt;br /&gt;
&lt;br /&gt;
New packages should use only sha512sums.&lt;br /&gt;
&lt;br /&gt;
==== options ====&lt;br /&gt;
: Build-time options for the package.&lt;br /&gt;
&lt;br /&gt;
: {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Option&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;!archcheck&amp;lt;/code&amp;gt;&lt;br /&gt;
| Do not try to verify that the architecture of the binary files is the same architecture as abuild should build for. One example where it makes sense to set this are packages with firmware files, that get executed on another CPU (such as WiFi firmware).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;!check&amp;lt;/code&amp;gt;&lt;br /&gt;
| Do not try to run the &amp;lt;code&amp;gt;check()&amp;lt;/code&amp;gt; function. Please always add a short comment after the &amp;lt;code&amp;gt;!check&amp;lt;/code&amp;gt; about why it&#039;s disabled. [https://github.com/alpinelinux/aports/pull/2322#discussion_r142545300] Creating a very simple check function, that calls &amp;lt;code&amp;gt;program --version&amp;lt;/code&amp;gt; is worse than disabling tests completely because it gives the false impression that the package is thoroughly tested with the testsuite from upstream. [https://github.com/alpinelinux/aports/pull/7326#discussion_r278797457]&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;checkroot&amp;lt;/code&amp;gt;&lt;br /&gt;
| Specifies that the package&#039;s test suite will be run in &#039;&#039;fakeroot&#039;&#039;. This is necessary for some test suites which fail when run as non-root.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;net&amp;lt;/code&amp;gt;&lt;br /&gt;
| Allows network access when run in &#039;&#039;rootbld&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;!strip&amp;lt;/code&amp;gt;&lt;br /&gt;
| Avoid stripping symbols from binaries.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;suid&amp;lt;/code&amp;gt;&lt;br /&gt;
| Allow [https://en.wikipedia.org/wiki/Setuid setuid] binaries.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;!tracedeps&amp;lt;/code&amp;gt;&lt;br /&gt;
| Do not automatically find dependencies (e.g. by using &amp;lt;code&amp;gt;ldd&amp;lt;/code&amp;gt; to find dynamic libraries, which the resulting binary links against).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;chmod-clean&amp;lt;/code&amp;gt;&lt;br /&gt;
| Make all files writable in the src/ directory. Useful for packages that make files read-only in the process of building packages (go modules).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;toolchain&amp;lt;/code&amp;gt;&lt;br /&gt;
| Don&#039;t warn when g++ is in makedepends&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;!dbg&amp;lt;/code&amp;gt;&lt;br /&gt;
| Don&#039;t create debugging subpackage&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ldpath-recursive&amp;lt;/code&amp;gt;&lt;br /&gt;
| Scan directories recursively when creating .so providers&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;!spdx&amp;lt;/code&amp;gt;&lt;br /&gt;
| Do not check if the license= field has a SPDX compliant license&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;textrels&amp;lt;/code&amp;gt;&lt;br /&gt;
| Don&#039;t error out when text relocations are found&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;charset.alias&amp;lt;/code&amp;gt;&lt;br /&gt;
| Don&#039;t error out if /usr/lib/charset.alias is found&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;libtool&amp;lt;/code&amp;gt;&lt;br /&gt;
| Don&#039;t delete libtool .la files&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;!fhs&amp;lt;/code&amp;gt;&lt;br /&gt;
| Don&#039;t enforce checks on path that follow the FHS&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== pkgdesc ====&lt;br /&gt;
: A brief, one-line description of what the package does.&lt;br /&gt;
&lt;br /&gt;
: Here&#039;s an example from the OpenSSH client package:&lt;br /&gt;
: &amp;lt;pre&amp;gt;pkgdesc=&amp;quot;Port of OpenBSD&#039;s free SSH release - client&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== pkggroups ====&lt;br /&gt;
: System group(s) to be created during build-time.  System group(s) should also be created in the &#039;&#039;&#039;[[APKBUILD Reference#.24pkgname.pre-install|$pkgname.pre-install]]&#039;&#039;&#039; script, so that the system group(s) are also created prior to package installation for run-time use.&lt;br /&gt;
==== pkgname ====&lt;br /&gt;
: The name of the package.  All letters should be lowercase.&lt;br /&gt;
: {{Note|When creating an APKBUILD of a module or library for another package, we use some common package prefixes, such as: &#039;&#039;lua-&#039;&#039;, &#039;&#039;perl-&#039;&#039;, &#039;&#039;php-&#039;&#039;, and &#039;&#039;py3-&#039;&#039;.  Search aports for other common prefixes.}}&lt;br /&gt;
&lt;br /&gt;
==== pkgrel ====&lt;br /&gt;
: Alpine package release number.  Starts at 0 (zero).  Always increment &#039;&#039;pkgrel&#039;&#039; when making updates to an aport; reset &#039;&#039;pkgrel&#039;&#039; to 0 (zero) when incrementing &#039;&#039;pkgver&#039;&#039;.&lt;br /&gt;
==== pkgusers ====&lt;br /&gt;
: System user(s) to be created during build-time.  System user(s) should also be created in the &#039;&#039;&#039;[[APKBUILD Reference#.24pkgname.pre-install|$pkgname.pre-install]]&#039;&#039;&#039; script, so that the system user(s) are also created prior to package installation for run-time use.&lt;br /&gt;
==== pkgver ====&lt;br /&gt;
: The version of the software being packaged. Format for valid versions: &amp;lt;code&amp;gt;{digit}{.digit}...{letter}{_suf{#}}...{-r#}&amp;lt;/code&amp;gt; [https://git.alpinelinux.org/cgit/apk-tools/tree/src/version.c#n17]&lt;br /&gt;
: A Suffix &amp;lt;code&amp;gt;suf&amp;lt;/code&amp;gt; in the above format can be one of the following to indicate that the release is &#039;&#039;less recent&#039;&#039; than the version without the suffix: &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;beta&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;rc&amp;lt;/code&amp;gt; [https://git.alpinelinux.org/cgit/apk-tools/tree/src/version.c#n75]&lt;br /&gt;
: These are for indicating &#039;&#039;more recent&#039;&#039; releases: &amp;lt;code&amp;gt;cvs&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;svn&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;git&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hg&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; [https://git.alpinelinux.org/cgit/apk-tools/tree/src/version.c#n76]&lt;br /&gt;
: All other suffices are invalid. To package a specific git commit, the date of the commit gets appended to the latest release, e.g. &amp;lt;code&amp;gt;1.0.0_git20180204&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== provides ====&lt;br /&gt;
: List of package names (and optionally version info) this package provides.&lt;br /&gt;
&lt;br /&gt;
: If package with a version is provided (provides=&#039;foo=1.2&#039;) apk will consider it as an alternate name and it will automatically consider the package for installation by the alternate name, and conflict with other packages having the same name, or provides.&lt;br /&gt;
&lt;br /&gt;
: If version is not provided (provides=&#039;foo&#039;), apk will consider it as virtual package name. Several package with same non-versioned provides can be installed simultaneously. However, none of them will be installed by default when requested by the virtual name - instead, error message is given and user is asked to choose which package providing the virtual name should be installed.&lt;br /&gt;
==== provider_priority ====&lt;br /&gt;
: A numeric value which is used by apk-tools to break ties when choosing a virtual package to satisfy a dependency. Higher values have higher priority. The primary use case is to specify the primary package that satisfies a virtual (provider).&lt;br /&gt;
==== replaces ====&lt;br /&gt;
: Allow this package to be installed at the same time as the listed packages, even if they have conflicting files. The files from this package will override (&amp;quot;take over&amp;quot;) the conflicting files.&lt;br /&gt;
&lt;br /&gt;
: This can be used to override config files with &amp;quot;policy packages&amp;quot; [https://gitlab.alpinelinux.org/alpine/apk-tools/-/commit/89d003f8c2e5a92655ee778f7bfa5c0e85ddbed4].&lt;br /&gt;
&lt;br /&gt;
: Another use case is renaming packages (or moving files from one package to another): &amp;quot;replaces&amp;quot; will avoid the file conflict error that apk reports if it happens to install the new package before uninstalling the old package [https://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/10724#note_132872].&lt;br /&gt;
&lt;br /&gt;
: A common misconception is that &amp;quot;replaces&amp;quot; is used to replace packages (like in [https://wiki.archlinux.org/index.php/PKGBUILD#replaces PKGBUILD]). This is not the case, it is only for solving file conflicts. To let apk consider installing one package instead of another one, refer to [[#provides|provides]] (with the version).&lt;br /&gt;
&lt;br /&gt;
==== replaces_priority ====&lt;br /&gt;
: The priority of the replaces. If multiple packages replace files of each other, then the package with the highest &#039;&#039;replaces_priority&#039;&#039; will win.&lt;br /&gt;
&lt;br /&gt;
==== source ====&lt;br /&gt;
: The source variable is not only used to list the remote source files to fetch, it is also used to list the local files that abuild will need in order to build the apk. Examples of such local files include: init.d files, conf.d files, install files (see [[APKBUILD Reference#install|install variable]]), patches, and all other necessary files.&lt;br /&gt;
&lt;br /&gt;
: Here are few things to note:&lt;br /&gt;
&lt;br /&gt;
:* When you are finished adding local and/or remote files to &#039;&#039;source&#039;&#039;, you can execute the following command to add their checksums to the APKBUILD file:&lt;br /&gt;
:: {{Cmd|abuild checksum}}&lt;br /&gt;
:: {{Note|When later updating the content of &#039;&#039;source&#039;&#039;, or updating a file that is listed in &#039;&#039;source&#039;&#039;, you must also update their checksums again with the same command.}}&lt;br /&gt;
&lt;br /&gt;
:* When the remote file is hosted at SourceForge, it&#039;s best to specify the special mirrors link used by SourceForge:&lt;br /&gt;
:: &amp;lt;pre&amp;gt;http://downloads.sourceforge.net/software/software-$pkgver.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
:: (or similar depending on the package).&lt;br /&gt;
&lt;br /&gt;
:* You can set target filename (eg &#039;save as...&#039;) by prefixing the URI with &#039;&#039;filename::&#039;&#039;. This is useful when the remote filename is not specified in the URI (ie, does not end in &#039;/software-1.0.tar.gz&#039;), such as:&lt;br /&gt;
:: &amp;lt;pre&amp;gt;http://oss.example.org/?get=software&amp;amp;ver=1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
:: or when the filename is braindead, like githubs&#039; download tags:&lt;br /&gt;
:: &amp;lt;pre&amp;gt;https://github.com/software/software/archive/v$pkgver.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
:: The above two examples needs a target filename prefix:&lt;br /&gt;
:: &amp;lt;pre&amp;gt;$pkgname-$pkgver.tar.gz::http://oss.example.org/?get=software&amp;amp;ver=$pkgver&amp;lt;/pre&amp;gt;&lt;br /&gt;
:: and:&lt;br /&gt;
:: &amp;lt;pre&amp;gt;$pkgname-$pkgver.tar.gz::https://github.com/software/software/archive/v$pkgver.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:* abuild currently supports the following protocols for remote file retrieval:&lt;br /&gt;
:** http&lt;br /&gt;
:** https&lt;br /&gt;
:** ftp&lt;br /&gt;
&lt;br /&gt;
:* abuild currently supports the following archive types/archive file extensions:&lt;br /&gt;
:** .tar (only in Alpine &amp;gt;= 2.5)&lt;br /&gt;
:** .tar.gz / .tgz&lt;br /&gt;
:** .tar.bz2&lt;br /&gt;
:** .tar.lz (only in Alpine &amp;gt;=3.7)&lt;br /&gt;
:** .tar.lzma&lt;br /&gt;
:** .tar.xz&lt;br /&gt;
:** .zip&lt;br /&gt;
&lt;br /&gt;
:* &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; should only include variables that change often like &amp;lt;code&amp;gt;pkgver&amp;lt;/code&amp;gt; or a commit ID. CI will warn you if you include &amp;lt;code&amp;gt;pkgname&amp;lt;/code&amp;gt; in source. Other variables like for example &amp;lt;code&amp;gt;_pkgname&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;_pyname&amp;lt;/code&amp;gt; do not belong in &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; either.&lt;br /&gt;
&lt;br /&gt;
==== subpackages ====&lt;br /&gt;
: Subpackages built from this APKBUILD.  abuild will parse this variable and try to find a subpackage split function.  The split function must &#039;&#039;move&#039;&#039; files that do not belong in the main package, from &#039;&#039;$pkgdir&#039;&#039; to &#039;&#039;$subpkgdir&#039;&#039;.  Files and directories can also be &#039;&#039;copied&#039;&#039; from &#039;&#039;$startdir&#039;&#039; and &#039;&#039;$srcdir&#039;&#039; to &#039;&#039;$subpkgdir&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
: The split function can be specified in 1 of 3 different methods:&lt;br /&gt;
:# subpkgname:&#039;&#039;&#039;splitfunc&#039;&#039;&#039;&lt;br /&gt;
:# $pkgname-&#039;&#039;&#039;splitfunc&#039;&#039;&#039;&lt;br /&gt;
:# &#039;&#039;&#039;splitfunc&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
: {{Note|Split function names &#039;&#039;&#039;cannot&#039;&#039;&#039; use hyphens; use the first method above if the subpackage name contains a hyphen (-) character, like this: &#039;&#039;subpkg-name:subpkg_name&#039;&#039;, where &amp;lt;code&amp;gt;subpkg-name&amp;lt;/code&amp;gt; is the name of the &#039;&#039;&#039;subpackage&#039;&#039;&#039; and &amp;lt;code&amp;gt;subpkg_name&amp;lt;/code&amp;gt; is the name of the &#039;&#039;&#039;subpackage&#039;s split function&#039;&#039;&#039;.}}&lt;br /&gt;
&lt;br /&gt;
: {{Tip|For more information, see the [[APKBUILD_examples:Subpackages|Subpackages example]].}}&lt;br /&gt;
&lt;br /&gt;
==== triggers ====&lt;br /&gt;
: Apk-tools can &amp;quot;monitor&amp;quot; directories and execute a trigger if any package installed/uninstalled any file in the monitored dir. The triggers are always executed after the apk action (install, uninstall, upgrade).&lt;br /&gt;
&lt;br /&gt;
: The triggers are specified in the format: &#039;&#039;scriptname&#039;&#039;=&#039;&#039;pathlist&#039;&#039; where &#039;&#039;scriptname&#039;&#039; is the (sub)package name + .trigger suffix and pathlist is : separated list of the dirs to monitor.&lt;br /&gt;
&lt;br /&gt;
: The &#039;&#039;&#039;triggers&#039;&#039;&#039; variable must include the triggers for subpackages too if they have any.&lt;br /&gt;
&lt;br /&gt;
: It is possible to use wildcards (*) in the dir list.&lt;br /&gt;
&lt;br /&gt;
==== url ====&lt;br /&gt;
: The homepage for the package.  This is to help users find upstream documentation and other information regarding the package.&lt;br /&gt;
&lt;br /&gt;
==== langdir ====&lt;br /&gt;
: Path to where the language files are located for the &#039;&#039;&#039;-lang&#039;&#039;&#039; subpackage, defaults to &#039;&#039;&#039;/usr/share/locale&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== pcprefix ====&lt;br /&gt;
: Prefix all provides derived from parsing pkg-config Requires: with the value in this variable, example: &#039;&#039;&#039;&#039;pcprefix=&amp;quot;foo:&amp;quot;&#039;&#039;&#039; will produce &#039;&#039;&#039;pc:foo:bar&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== sonameprefix ====&lt;br /&gt;
: Prefix all provides derived from parsing shared objects with the value in this variable, example: &#039;&#039;&#039;sonameprefix=&amp;quot;foo&amp;quot;&#039;&#039;&#039; will produce &#039;&#039;&#039;so:foo:bar.so.X&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Functions =&lt;br /&gt;
{{Note|All functions that are not &#039;&#039;prepare()&#039;&#039;, &#039;&#039;build()&#039;&#039;, &#039;&#039;check()&#039;&#039; and &#039;&#039;package()&#039;&#039; should consider the current working directory as undefined, and should therefore use the [[APKBUILD Reference#abuild-defined_variables|abuild-defined directory variables]] to their advantage.}}&lt;br /&gt;
&lt;br /&gt;
 sanitycheck() -&amp;gt; clean()-&amp;gt; fetch() -&amp;gt; verify() -&amp;gt; unpack() -&amp;gt; prepare() -&amp;gt; mkusers() -&amp;gt; build() -&amp;gt; check() -&amp;gt; package() -&amp;gt; subpackages() -&amp;gt; language packs -&amp;gt; apk -&amp;gt; cleanup()&lt;br /&gt;
&lt;br /&gt;
== abuild-defined functions ==&lt;br /&gt;
The following functions are provided by abuild and can be overridden, but it is strongly discouraged on code review for some functions:&lt;br /&gt;
&lt;br /&gt;
==== fetch() ====&lt;br /&gt;
: Downloads remote sources listed in &#039;&#039;source&#039;&#039; to &#039;&#039;SRCDEST&#039;&#039; (&#039;&#039;SRCDEST&#039;&#039; is configured in &#039;&#039;/etc/abuild.conf&#039;&#039;) and creates symlinks in &#039;&#039;$srcdir&#039;&#039;.&lt;br /&gt;
==== unpack() ====&lt;br /&gt;
: unpack() will call default_unpack().&lt;br /&gt;
&lt;br /&gt;
: [https://github.com/alpinelinux/abuild/blob/v3.1.0/abuild.in#L403 default_unpack()] unpacks .tar, .tgz, .tar.gz, .tar.lz (only available in Alpine &amp;gt;=3.7), .tar.bz2, .tar.lzma, .tar.xz, and .zip archives from a symlink in &#039;&#039;$srcdir&#039;&#039; associated with &#039;&#039;$SRCDEST&#039;&#039; (or distfiles folder) resulting in an unpacked folder in &#039;&#039;$srcdir&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== dev() ====&lt;br /&gt;
: Subpackage function for the &#039;&#039;&#039;$pkgname-dev&#039;&#039;&#039; package is used to collect developer files and folders for use in other packages in the compilation process nothing more.  Without specifying a custom &#039;&#039;dev()&#039;&#039; function, abuild will call its internal &#039;&#039;dev()&#039;&#039; function, which in turn calls default_dev().&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;[https://github.com/alpinelinux/abuild/blob/v3.1.0/abuild.in#L1605 default_dev()]&#039;&#039; will move any &#039;&#039;include&#039;&#039; folder and folders containing &#039;&#039;*.[acho]&#039;&#039; (static archive, c source, c header file, object file), &#039;&#039;*.prl&#039;&#039; file extension patterns in &#039;&#039;&amp;quot;$pkgdir&amp;quot;/{lib,usr}&#039;&#039; to &#039;&#039;&amp;quot;$subpkgdir&amp;quot;/{lib,usr}&#039;&#039; recursively; and &#039;&#039;*.so&#039;&#039; files from &#039;&#039;&amp;quot;$pkgdir&amp;quot;/{lib,usr/lib}&#039;&#039; to &#039;&#039;&amp;quot;$subpkgdir&amp;quot;/{lib,usr/lib}&#039;&#039;.  It will also scan and move &#039;&#039;usr/{include,lib/{pkgconfig,cmake,qt*/mkspecs},share/{aclocal,gettext,vala/vapi,gir-[0-9]*,qt*/mkspecs},bin/*-config}}&#039;&#039; developer only folders in &#039;&#039;$pkgdir&#039;&#039; and transfer them to &#039;&#039;$subpkgdir&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
: In general, default_dev() will support packages that share pkg-config, C programming language API, shared and static libraries, Autotools, gettext, Vala programming language bindings, Python GObject introspection, a provided custom pkg-config like command (*-config), Qt, and CMake.  If you have packages that have C++, other languages, other build system, etc; you need to manually move those developer files only if they are to be used in other packages.&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;&#039;Important&#039;&#039;&#039;: For default_dev() to be called as in no dev(), you need to explicitly add subpackages=&amp;quot;$pkgname-dev&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== doc() ====&lt;br /&gt;
: Subpackage function for the &#039;&#039;&#039;$pkgname-doc&#039;&#039;&#039; package whose job is only to collect documentation folders from $pkgdir nothing more.  Without specifying a custom &#039;&#039;doc()&#039;&#039; function, abuild will call its internal &#039;&#039;doc()&#039;&#039; function, which in turn calls default_doc().&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;[https://github.com/alpinelinux/abuild/blob/v3.1.0/abuild.in#L1519 default_doc()]&#039;&#039; will move &#039;&#039;&amp;quot;$pkgdir&amp;quot;/usr/share/{doc,man,info,html,sgml,licenses,gtk-doc,ri,help}&#039;&#039; to &#039;&#039;$subpkgdir&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
: Overriding this function is strongly discouraged.  Packaging docs should be done in the package() function while letting abuild automatically collect the doc folders.&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;&#039;Important&#039;&#039;&#039;: For default_doc() to be called as in no doc(), you need to explicitly add subpackages=&amp;quot;$pkgname-doc&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== openrc() ====&lt;br /&gt;
: Subpackage function for the &#039;&#039;&#039;$pkgname-openrc&#039;&#039;&#039; package whose job is to collect OpenRC service files that are in /etc/init.d and /etc/conf.d.&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;[https://github.com/alpinelinux/abuild/blob/v3.1.0/abuild.in#L1661 default_openrc()]&#039;&#039; will move &#039;&#039;&amp;quot;$pkgdir&amp;quot;/etc/{conf,init}.d&#039;&#039; to &#039;&#039;$subpkgdir&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
: Overriding this function is strongly discouraged. Packaging OpenRC service definitions should be in the package() function while letting abuild automatically collect the openrc folders.&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;&#039;Important&#039;&#039;&#039;: for default_openrc() to be called as in no openrc(), you need to explicitly add subpackages=&amp;quot;$pkgname-openrc&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== static() ====&lt;br /&gt;
: Subpackage function for the &#039;&#039;&#039;$pkgname-static&#039;&#039;&#039; package whose job is to collect static libraries that are stored in /lib and /usr/lib.&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;[https://github.com/alpinelinux/abuild/blob/v3.4.0_rc4/abuild.in#L1748 default_static()]&#039;&#039; will move all static libraries (files ending with .a) from &#039;&#039;&amp;quot;$pkgdir&amp;quot;/lib&#039;&#039; and &#039;&#039;&amp;quot;$pkgdir&amp;quot;/usr/lib&#039;&#039; to their equivalents in &#039;&#039;$subpkgdir&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
: Overriding this function is strongly discouraged. Packaging static libraries should be done in the package() function while letting abuild automatically collect the static libraries.&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;&#039;Important&#039;&#039;&#039;: for default_static() to be called as in no static(), you need to explicitly add subpackages=&amp;quot;$pkgname-static&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== snapshot() ====&lt;br /&gt;
: &#039;&#039;&#039;Optional&#039;&#039;&#039;.  For live APKBUILDs or those with a _cvs, _svn, _git, _hg in their version number, you should create a snapshot function only if there is no download link to an archive file (.zip, .tar.gz, ...) to the commit/hash/tag.  The purpose of the snapshot function is to create an archive of the source code so that the package source code is deterministic, and it doesn&#039;t waste time to fetch the source code but bypasses the download step after snapshotting.  Those that download the source code from a git repository will follow head or the latest change to the source code.  It is better to archive the source code as a zip / tar.gz / tar.bz2 up to the commit or the tag which you are trying to build a package.  If it is not deterministic or not every part of the code frozen in time for every dependency and the main project, then the patches will fail or the package may fail to compile when you revisit the package months or years to backport a patch.&lt;br /&gt;
&lt;br /&gt;
: The default [https://github.com/alpinelinux/abuild/blob/v3.1.0/abuild.in#L2310 snapshot()] function has variables associated with it:&lt;br /&gt;
:* $disturl - the base-url of the place to autoupload the snapshot&lt;br /&gt;
:* $svnurl - Subversion repository &lt;br /&gt;
:* $giturl - Git repository&lt;br /&gt;
&lt;br /&gt;
: The default snapshot() can only support one repository.  It is better to override it if there are multiple repositories involved in your package.  CVS, Mercurial (hg), and alternative version control systems must override the default snapshot().&lt;br /&gt;
&lt;br /&gt;
: See [[APKBUILD_examples:Git_checkout]] to how to use it with git.  It takes 2-3 general steps.  Clone the repository; check it out at a specific revision/commit or tag; then you use an archiver to dump it in the &#039;&#039;$SRCDEST&#039;&#039; variable which points to the distfiles folder and the base path to the full path to the archive that you want to create.  You do this for every internal dependency that the package pulls.&lt;br /&gt;
&lt;br /&gt;
: After you have created your snapshot function, you use &amp;lt;code&amp;gt;abuild snapshot&amp;lt;/code&amp;gt; to run it.  &lt;br /&gt;
&lt;br /&gt;
: The archives produced by the snapshot will be saved in &#039;&#039;/var/cache/distfiles&#039;&#039; or whatever you set for &#039;&#039;$SRCDEST&#039;&#039;.  You may need to create symlinks to the archive if the archive is not saved to the Alpine server.&lt;br /&gt;
&lt;br /&gt;
: After you snapshot it, you need to produce the checksums with &amp;lt;code&amp;gt;abuild checksum&amp;lt;/code&amp;gt; to use it in the APKBUILD creation process.&lt;br /&gt;
&lt;br /&gt;
: This feature is available since Alpine &amp;gt;=2.6.&lt;br /&gt;
&lt;br /&gt;
==== default_prepare() ====&lt;br /&gt;
&lt;br /&gt;
:  Before build preparation it handles set of patches inside &amp;lt;code&amp;gt;$srcdir&amp;lt;/code&amp;gt; and prints failed ones.&lt;br /&gt;
&lt;br /&gt;
== User-defined functions ==&lt;br /&gt;
The following functions should be defined by the user: &lt;br /&gt;
&lt;br /&gt;
==== prepare() ====&lt;br /&gt;
: {{note|Please adjust old APKBUILDs, which still have a &#039;&#039;prepare()&#039;&#039; function that does the same as the &#039;&#039;default_prepare()&#039;&#039; when you edit them anyway.}}&lt;br /&gt;
: &#039;&#039;&#039;&#039;&#039;Optional&#039;&#039;.&#039;&#039;&#039;  Used for build preparation: patches, etc, should be applied here. When you don&#039;t specify a custom &#039;&#039;prepare()&#039;&#039;, the built-in &#039;&#039;default_prepare()&#039;&#039; from abuild will be used. It applies patches already (always prepare them in the &amp;lt;code&amp;gt;-p1&amp;lt;/code&amp;gt; format), so &#039;&#039;&#039;usually it makes sense to not create a custom &#039;&#039;prepare()&#039;&#039; function at all!&#039;&#039;&#039; If you do create one, call &#039;&#039;default_prepare()&#039;&#039; inside it:&lt;br /&gt;
&lt;br /&gt;
: Before default_prepare gets called, you can define &#039;&#039;patch_args&#039;&#039; to supply the argument to the patch command in global scope then throw away prepare() so it is unnecessary to use the old template code floating around to patch.  patch_args and autopatching is only available in Alpine &amp;gt;=3.4.  See [[Creating_an_Alpine_package#Patches]] to fix the patch that uses a different patch level (-pX).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prepare() {&lt;br /&gt;
    default_prepare&lt;br /&gt;
    # your custom code here&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== build() ====&lt;br /&gt;
: &#039;&#039;&#039;Required.&#039;&#039;&#039;  This is the compilation stage.  This function will be called as the current user (unless the &#039;&#039;package()&#039;&#039; function is missing - for compatibility reasons).  If no compilation is needed, the function should be removed.&lt;br /&gt;
&lt;br /&gt;
: To enable or disable CFLAGS, CXXFLAGS, CMake with option, or configure option per arch, use the CARCH variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
local cmakeoptions=&lt;br /&gt;
case &amp;quot;$CARCH&amp;quot; in&lt;br /&gt;
        aarch64*|arm*|ppc64le|x86|s390x) cmakeoptions=&amp;quot;$cmakeoptions -DWITH_OPENMP=OFF&amp;quot; ;;&lt;br /&gt;
        x86_64)                          cmakeoptions=&amp;quot;$cmakeoptions -DWITH_OPENMP=ON&amp;quot; ;;&lt;br /&gt;
        *)                               msg &amp;quot;Unable to determine architecture from (CARCH=$CARCH)&amp;quot; ; return 1 ;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: The block can be used in other parts of the APKBUILD even in global.&lt;br /&gt;
&lt;br /&gt;
==== check() ====&lt;br /&gt;
: &#039;&#039;&#039;Required if functionality exists.&#039;&#039;&#039; This function is called right after the build stage.  It should check that the packaged thing is actually working, typically by running (integration) tests, if provided by upstream.  If there’s no (easy) way how to test the package, you can declare that it does not want to use &#039;&#039;check()&#039;&#039; by adding &amp;quot;!check&amp;quot; into the &#039;&#039;options&#039;&#039; variable (&amp;lt;code&amp;gt;options=&amp;quot;!check&amp;quot;&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
: default_check() does nothing.  You need to manually explicitly call the unit tests or test suite yourself.  When you run the test, the program should return with an exit code of 0, indicating the tests were a success.  Unit tests or test suites will do feature tests, per function correctness check, fuzz testing, benchmarks.&lt;br /&gt;
&lt;br /&gt;
: A package may also require additional testing frameworks packages that are external dependencies.  You should add those to the &#039;&#039;checkdepends=&#039;&#039; in Alpine &amp;gt;=3.6 or &#039;&#039;makedepends=&#039;&#039; for older for backporters.  If the testing framework is not available, you need to create a package for it.  If it requires a specific version of a testing framework, consider making it an internal dependency or a new package with a package name containing the major and minor version number like the python packages.&lt;br /&gt;
&lt;br /&gt;
: Generally speaking, you should define the check functions for libraries, large programs like web browsers, or compilers and interpreters, cryptographic/security/anonymity stuff, mission critical stuff, PCI compliance/money/accounting software, server software with a lot of stakeholders or consumers.  Soon for the new policy change will have virtually &#039;&#039;&#039;all packages with testing capabilities be required to have a working and defined check() function&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
: There are times when the unit tests do not work, just because the test itself is broken, new unimplemented feature, external factors not taken into consideration, unbundling path differences, breakage caused by ccache, missing test dependency or version mismatch dependency as in python2 vs python3, test scripts only work for particular language implementation like only supporting python2 but not python3 having used the 2to3 conversion script.  If a unit test is known not to work, you may need to patch it to omit that test or fix it; but, certain tests should not be disabled if it is important.  You may need to alter the references to uncompiled internal dependencies to work with the external dependencies instead.  For ccache, you can either disable it or remove it from the PATH environmental variable before running tests.&lt;br /&gt;
&lt;br /&gt;
{{Note|Tests for graphical applications and toolkits might work on a X11 user setup but will fail on the server unless run with xvfb-run.}}&lt;br /&gt;
&lt;br /&gt;
: If you don&#039;t add the &#039;&#039;check()&#039;&#039; and the &#039;&#039;options=&#039;&#039;, this is what you will see:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt;&amp;gt;&amp;gt; WARNING: py-webtest*: APKBUILD does not run any tests!&lt;br /&gt;
    Alpine policy will soon require that packages have any relevant testsuites run during the build process.&lt;br /&gt;
    To fix, either define a check() function, or declare !check in $options to indicate the package does not have a testsuite.&lt;br /&gt;
&lt;br /&gt;
: If you do not do a check or disable it, you must state there is no testsuite in comment form (#) next to options=&amp;quot;!check&amp;quot; for the code reviewers.&lt;br /&gt;
&lt;br /&gt;
: To run test suite with autotools do:&lt;br /&gt;
&lt;br /&gt;
  make check&lt;br /&gt;
&lt;br /&gt;
: To run the test suite with python setuptools:&lt;br /&gt;
&lt;br /&gt;
  python2 setup.py test&lt;br /&gt;
  python3 setup.py test&lt;br /&gt;
&lt;br /&gt;
: For python it should be &#039;&#039;&#039;test&#039;&#039;&#039; not check.  Check for python setuptools will check the packaging metadata fields[https://docs.python.org/3/distutils/examples.html#checking-a-package] only but not run the unit tests.  There should be verbose output also.  The dependencies for the tests are found in test_require in the setup.py.&lt;br /&gt;
&lt;br /&gt;
: If it says &amp;lt;code&amp;gt;Ran 0 tests in 0.000s&amp;lt;/code&amp;gt; that is not acceptable.  check() will say it was good but it is not actually correct.  It needs to run the test suite with an alternative method like &amp;lt;code&amp;gt;tox -e py27,py36&amp;lt;/code&amp;gt; if you see a tox.ini file.&lt;br /&gt;
&lt;br /&gt;
: You want to do it for each implementation to ensure that the API calls are correct per implementation but ncopa said it was just fine with python3.&lt;br /&gt;
&lt;br /&gt;
: If there is a circular dependency for the checkdepends=, you need to disable the check and put the reason next to &amp;lt;code&amp;gt;options=&amp;quot;!check&amp;quot;&amp;lt;/code&amp;gt; that there is a circular dependency.  You should disable it for the package that package that is least important or least security risk.  The other solution is to make the conflicting dependency an internal dependency but making sure that it doesn&#039;t pull it at check time.  This way they can both preform tests properly.&lt;br /&gt;
&lt;br /&gt;
==== package() ====&lt;br /&gt;
: &#039;&#039;&#039;Required.&#039;&#039;&#039;  This is the packaging stage.  Here, the built application and support files should be installed into &#039;&#039;&#039;$pkgdir&#039;&#039;&#039;.  If this is a metapackage, this function can contain a single line: &amp;lt;code&amp;gt;mkdir -p &amp;quot;$pkgdir&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|Building in fakeroot will reduce performance for parallel builds dramatically.  It is for this reason that we split the build and package process into two separate functions.}}&lt;br /&gt;
&lt;br /&gt;
= Special Operators =&lt;br /&gt;
&lt;br /&gt;
== $pkgname~$pkgver ==&lt;br /&gt;
&lt;br /&gt;
Specifies a required &amp;lt;code&amp;gt;$pkgver&amp;lt;/code&amp;gt; for [[apk]] to satisfy the &amp;lt;code&amp;gt;$pkgname&amp;lt;/code&amp;gt; requirement. &amp;lt;code&amp;gt;~&amp;lt;/code&amp;gt; ignores revisions of the package version. For example &amp;lt;code&amp;gt;superd~0.6&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;$depends&amp;lt;/code&amp;gt; will ensure superd with package version 0.6 is installed as a run-time dependency for the package.&lt;br /&gt;
&lt;br /&gt;
== $pkgname&amp;gt;=$pkgver ==&lt;br /&gt;
&lt;br /&gt;
Specifies the installed package version must be greater than or equal to &amp;lt;code&amp;gt;$pkgver&amp;lt;/code&amp;gt; for [[apk]] to satisfy the &amp;lt;code&amp;gt;$pkgname&amp;lt;/code&amp;gt; requirement.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
The [[APKBUILD examples]] page will assist you in understanding how to create an APKBUILD.&lt;br /&gt;
&lt;br /&gt;
= Version =&lt;br /&gt;
&lt;br /&gt;
This document assumes abuild for Alpine Edge.  For older releases of abuild, some of these features may not be available if you are using an older release.  A link to the implementation is linked for researchers and backporters.&lt;br /&gt;
&lt;br /&gt;
For more information see [[APKBUILD_versions]].&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=APKBUILD_Reference&amp;diff=29221</id>
		<title>APKBUILD Reference</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=APKBUILD_Reference&amp;diff=29221"/>
		<updated>2025-03-10T10:47:37Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: remove build() function instead of using return 0&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;APKBUILDs are the scripts that are created in order to build Alpine packages using the [[Abuild and Helpers|abuild]] tool.&lt;br /&gt;
&lt;br /&gt;
See [[aports]] for details on Alpine&#039;s official ports repository.&lt;br /&gt;
&lt;br /&gt;
This page is intended to serve as a reference for creating APKBUILDs; if this is your first time creating a package for Alpine Linux, please see [[Creating an Alpine package]].&lt;br /&gt;
&lt;br /&gt;
= Legend =&lt;br /&gt;
The following notes will assist you in understanding this document.&lt;br /&gt;
&lt;br /&gt;
In description text:&lt;br /&gt;
* If a variable is not prefixed with a &#039;&#039;$&#039;&#039;, it will be represented by italics (i.e., &#039;&#039;srcdir&#039;&#039; ).&lt;br /&gt;
* Functions will also be represented by italics, but will also end with a pair of parentheses (i.e., &#039;&#039;build()&#039;&#039; ).&lt;br /&gt;
* Shell commands will be represented &amp;lt;code&amp;gt;like this&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Variables =&lt;br /&gt;
{{Note|Variables that contain a path (e.g. &#039;&#039;$srcdir&#039;&#039; and &#039;&#039;$pkgdir&#039;&#039;) should always be quoted using double quotes (i.e., &#039;&#039;&amp;quot;$srcdir&amp;quot;&#039;&#039;).  This is done to prevent things from breaking, should the user have the APKBUILD in a directory path that contains spaces.}}&lt;br /&gt;
{{Note|All arbitrary variable and function names should be prefixed with an underscore character ( _ ) to avoid name clashes with the internals of abuild (for example, &#039;&#039;_luaversions&#039;&#039;).}}&lt;br /&gt;
&lt;br /&gt;
These variables are all well documented in &amp;lt;code&amp;gt;man 5 APKBUILD&amp;lt;/code&amp;gt; ([https://gitlab.alpinelinux.org/alpine/abuild/-/blob/master/APKBUILD.5.scd man page source]).&lt;br /&gt;
&lt;br /&gt;
== User-defined variables ==&lt;br /&gt;
The following variables should be defined by the user:&lt;br /&gt;
==== maintainer ====&lt;br /&gt;
: Name and email address of the maintainer of the package.&lt;br /&gt;
: A well-formatted example is &amp;lt;code&amp;gt;maintainer=&amp;quot;John Snow &amp;lt;john_snow@thewall.net&amp;gt;&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== arch ====&lt;br /&gt;
: Package architecture(s) to build for.  Can be one or several seperated by whitespace of: &#039;&#039;&#039;[[x86]], [[x86_64]], [[armv7]], [[armhf]], [[aarch64]], [[ppc64le]], [[s390x]], [[riscv64]], all&#039;&#039;&#039;, or &#039;&#039;&#039;noarch&#039;&#039;&#039;, where &#039;&#039;&#039;all&#039;&#039;&#039; means all architectures, and &#039;&#039;&#039;noarch&#039;&#039;&#039; means it&#039;s architecture-independent (e.g., a pure-python package). Architectures can be negated using the ! character to exclude them from the list of supported architectures. E.g. &#039;&#039;&#039;arch=&amp;quot;all !ppc64le&amp;quot;&#039;&#039;&#039; means that the package is allowed to be built on all architectures but the ppc64le architecture.&lt;br /&gt;
: {{Tip|To determine if your APKBUILD can use &#039;&#039;&#039;noarch&#039;&#039;&#039;: First specify &#039;&#039;&#039;all&#039;&#039;&#039; and then build the package by executing &amp;lt;code&amp;gt;abuild -r&amp;lt;/code&amp;gt;.  Watch the output towards the end for warnings saying that &#039;&#039;&#039;noarch&#039;&#039;&#039; can be used.  If the main package and all subpackages, if you have any subpackages, give a warning saying that &#039;&#039;&#039;noarch&#039;&#039;&#039; can be used, then you can use &#039;&#039;&#039;noarch&#039;&#039;&#039;.}}&lt;br /&gt;
&lt;br /&gt;
==== depends ====&lt;br /&gt;
: Run-time dependency package(s) that are not shared-object dependencies.  Shared objects dependencies are auto-detected and should not be specified here. To specify a conflicting package, add the package name prefixed with a &#039;!&#039;.&lt;br /&gt;
&lt;br /&gt;
==== depends_dev ====&lt;br /&gt;
: Run-time dependency package(s) for the &#039;&#039;&#039;$pkgname-dev&#039;&#039;&#039; subpackage.&lt;br /&gt;
&lt;br /&gt;
: {{Note|From ncopa on IRC: To find out if you need to add a package to depends_dev have a look at *requires* in usr/lib/pkgconfig/*.pc. With libtool it gets more complicated, but we should delete the .la files. Also check if there are any  /usr/bin/*-configure #!/bin/bash #!/usr/bin/perl or Python. Sometimes scripts or similar are generated at build time (i.e autoconf automake) then you normally don&#039;t need add those to depends_dev. You can also just add all -dev makedepends to depends_dev but it will slow the build process a little bit (more build dependencies).}}&lt;br /&gt;
&lt;br /&gt;
==== depends_doc ====&lt;br /&gt;
: Run-time dependency package(s) for the &#039;&#039;&#039;$pkgname-doc&#039;&#039;&#039; subpackage.&lt;br /&gt;
&lt;br /&gt;
==== depends_openrc ====&lt;br /&gt;
: Run-time dependency package(s) for the &#039;&#039;&#039;$pkgname-openrc&#039;&#039;&#039; subpackage.&lt;br /&gt;
&lt;br /&gt;
==== depends_libs ====&lt;br /&gt;
: Run-time dependency package(s) for the &#039;&#039;&#039;$pkgname-libs&#039;&#039;&#039; subpackage.&lt;br /&gt;
&lt;br /&gt;
==== depends_static ====&lt;br /&gt;
: Run-time dependency package(s) for the &#039;&#039;&#039;$pkgname-static&#039;&#039;&#039; subpackage.&lt;br /&gt;
&lt;br /&gt;
==== checkdepends ====&lt;br /&gt;
: Dependencies that are only required during the check phase, they are only installed if the check option is enabled&lt;br /&gt;
&lt;br /&gt;
==== giturl ====&lt;br /&gt;
:Git repository from which &amp;lt;code&amp;gt;abuild checkout&amp;lt;/code&amp;gt; checks out. You can checkout a specific branch in git by adding &amp;lt;code&amp;gt;-b $branch&amp;lt;/code&amp;gt;.&lt;br /&gt;
==== install ====&lt;br /&gt;
: There are 6 different types of install scripts.  Install scripts are named &#039;&#039;&#039;$pkgname.action&#039;&#039;&#039;, where &#039;&#039;&#039;action&#039;&#039;&#039; can be:  &#039;&#039;&#039;pre-install, post-install, pre-upgrade, post-upgrade, pre-deinstall&#039;&#039;&#039;, or &#039;&#039;&#039;post-deinstall&#039;&#039;&#039;.  For example, if &#039;&#039;pkgname&#039;&#039; is set to &#039;&#039;&#039;mypackage&#039;&#039;&#039; and &#039;&#039;install&#039;&#039; is set to &#039;&#039;&#039;$pkgname.post-install&#039;&#039;&#039;, then a script named &#039;&#039;&#039;mypackage.post-install&#039;&#039;&#039; must exist along-side the APKBUILD.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;{{Note|Always use &amp;lt;code&amp;gt;/bin/sh&amp;lt;/code&amp;gt; for the command-line interpreter on the [https://en.wikipedia.org/wiki/Shebang_%28Unix%29 shebang line] of your install scripts.}}&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following are the different types of install scripts in detail:&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.pre-install =====&lt;br /&gt;
: This script is executed &#039;&#039;before installing&#039;&#039; the package.  Typical use is when the package needs a group and a user to be created. For example:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
addgroup -S clamav 2&amp;gt;/dev/null&lt;br /&gt;
adduser -S -D -H -s /sbin/nologin -G clamav -g clamav clamav 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
{{Note|If the script exits with a failure (e.g., if the user already exists), the package will not be installed and &amp;lt;code&amp;gt;apk&amp;lt;/code&amp;gt; will exit with failure, hence the &amp;lt;code&amp;gt;exit 0&amp;lt;/code&amp;gt; at the end.}}&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.post-install =====&lt;br /&gt;
: This script is executed &#039;&#039;after installing&#039;&#039; the package.&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.pre-upgrade =====&lt;br /&gt;
: This script is executed &#039;&#039;before upgrading/downgrading/reinstalling&#039;&#039; the package. Note that exiting with failure will not cause apk to exit with failure, but will mark the package as broken.&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.post-upgrade =====&lt;br /&gt;
: This script is executed &#039;&#039;after upgrading/downgrading/reinstalling&#039;&#039; the package.&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.pre-deinstall =====&lt;br /&gt;
: This script is executed &#039;&#039;before uninstalling&#039;&#039; the package.&lt;br /&gt;
: {{Note|If the script exits with failure, &amp;lt;code&amp;gt;apk&amp;lt;/code&amp;gt; will not uninstall the package.}}&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.post-deinstall =====&lt;br /&gt;
: This script is executed &#039;&#039;after uninstalling&#039;&#039; the package.&lt;br /&gt;
&lt;br /&gt;
==== install_if ====&lt;br /&gt;
:install_if can be used when a package needs to be installed when some packages are already installed or are in the dependency tree. It works in reverse to the &#039;&#039;recommends&#039;&#039; feature, that other package managers provide.&lt;br /&gt;
&lt;br /&gt;
: Typically this is used in a subpackage that should provide files which make sense with another package. For example:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
subpackages=&amp;quot;$pkgname-bash-completion:bashcomp:noarch&amp;quot;&lt;br /&gt;
...&lt;br /&gt;
bashcomp() {&lt;br /&gt;
	pkgdesc=&amp;quot;Bash completions for $pkgname&amp;quot;&lt;br /&gt;
	install_if=&amp;quot;$pkgname=$pkgver-r$pkgrel bash-completion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	install -Dm644 &amp;quot;$builddir&amp;quot;/doc/bash_completion/aria2c \&lt;br /&gt;
		&amp;quot;$subpkgdir&amp;quot;/usr/share/bash-completion/completions/_aria2c&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
From the aria2c APKBUILD. Note that the custom bashcomp() function is only necessary, because the files are not in /usr/share/bash-completion.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:In general, install_if should only be used with &#039;&#039;&#039;at least one versioned constraint&#039;&#039;&#039;. Otherwise, a package that was implicitly installed by install_if and then removed from the binary repositories, will not get purged with &amp;lt;code&amp;gt;apk upgrade&amp;lt;/code&amp;gt;. [https://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/10720#note_121298]&lt;br /&gt;
&lt;br /&gt;
==== license ====&lt;br /&gt;
: License(s) for the package, for example &amp;lt;code&amp;gt;GPL-3.0-or-later&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;BSD-2-Clause&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;MIT&amp;lt;/code&amp;gt; [[Creating_an_Alpine_package#license|(details)]].&lt;br /&gt;
&lt;br /&gt;
==== makedepends ====&lt;br /&gt;
: Build-time dependency package(s). For cross compiling support, split it into &amp;lt;code&amp;gt;makedepends_build&amp;lt;/code&amp;gt; (native system) and &amp;lt;code&amp;gt;makedepends_host&amp;lt;/code&amp;gt; (foreign system).&lt;br /&gt;
&lt;br /&gt;
==== md5sums/sha256sums/sha512sums ====&lt;br /&gt;
: Checksums for the files/URLs listed in &#039;&#039;source&#039;&#039;.  The checksums are normally generated and updated by executing &amp;lt;code&amp;gt;abuild checksum&amp;lt;/code&amp;gt; and should be the last item in the APKBUILD.&lt;br /&gt;
&lt;br /&gt;
New packages should use only sha512sums.&lt;br /&gt;
&lt;br /&gt;
==== options ====&lt;br /&gt;
: Build-time options for the package.&lt;br /&gt;
&lt;br /&gt;
: {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Option&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;!archcheck&amp;lt;/code&amp;gt;&lt;br /&gt;
| Do not try to verify that the architecture of the binary files is the same architecture as abuild should build for. One example where it makes sense to set this are packages with firmware files, that get executed on another CPU (such as WiFi firmware).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;!check&amp;lt;/code&amp;gt;&lt;br /&gt;
| Do not try to run the &amp;lt;code&amp;gt;check()&amp;lt;/code&amp;gt; function. Please always add a short comment after the &amp;lt;code&amp;gt;!check&amp;lt;/code&amp;gt; about why it&#039;s disabled. [https://github.com/alpinelinux/aports/pull/2322#discussion_r142545300] Creating a very simple check function, that calls &amp;lt;code&amp;gt;program --version&amp;lt;/code&amp;gt; is worse than disabling tests completely because it gives the false impression that the package is thoroughly tested with the testsuite from upstream. [https://github.com/alpinelinux/aports/pull/7326#discussion_r278797457]&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;checkroot&amp;lt;/code&amp;gt;&lt;br /&gt;
| Specifies that the package&#039;s test suite will be run in &#039;&#039;fakeroot&#039;&#039;. This is necessary for some test suites which fail when run as non-root.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;net&amp;lt;/code&amp;gt;&lt;br /&gt;
| Allows network access when run in &#039;&#039;rootbld&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;!strip&amp;lt;/code&amp;gt;&lt;br /&gt;
| Avoid stripping symbols from binaries.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;suid&amp;lt;/code&amp;gt;&lt;br /&gt;
| Allow [https://en.wikipedia.org/wiki/Setuid setuid] binaries.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;!tracedeps&amp;lt;/code&amp;gt;&lt;br /&gt;
| Do not automatically find dependencies (e.g. by using &amp;lt;code&amp;gt;ldd&amp;lt;/code&amp;gt; to find dynamic libraries, which the resulting binary links against).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;chmod-clean&amp;lt;/code&amp;gt;&lt;br /&gt;
| Make all files writable in the src/ directory. Useful for packages that make files read-only in the process of building packages (go modules).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;toolchain&amp;lt;/code&amp;gt;&lt;br /&gt;
| Don&#039;t warn when g++ is in makedepends&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;!dbg&amp;lt;/code&amp;gt;&lt;br /&gt;
| Don&#039;t create debugging subpackage&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ldpath-recursive&amp;lt;/code&amp;gt;&lt;br /&gt;
| Scan directories recursively when creating .so providers&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;!spdx&amp;lt;/code&amp;gt;&lt;br /&gt;
| Do not check if the license= field has a SPDX compliant license&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;textrels&amp;lt;/code&amp;gt;&lt;br /&gt;
| Don&#039;t error out when text relocations are found&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;charset.alias&amp;lt;/code&amp;gt;&lt;br /&gt;
| Don&#039;t error out if /usr/lib/charset.alias is found&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;libtool&amp;lt;/code&amp;gt;&lt;br /&gt;
| Don&#039;t delete libtool .la files&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;!fhs&amp;lt;/code&amp;gt;&lt;br /&gt;
| Don&#039;t enforce checks on path that follow the FHS&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== pkgdesc ====&lt;br /&gt;
: A brief, one-line description of what the package does.&lt;br /&gt;
&lt;br /&gt;
: Here&#039;s an example from the OpenSSH client package:&lt;br /&gt;
: &amp;lt;pre&amp;gt;pkgdesc=&amp;quot;Port of OpenBSD&#039;s free SSH release - client&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== pkggroups ====&lt;br /&gt;
: System group(s) to be created during build-time.  System group(s) should also be created in the &#039;&#039;&#039;[[APKBUILD Reference#.24pkgname.pre-install|$pkgname.pre-install]]&#039;&#039;&#039; script, so that the system group(s) are also created prior to package installation for run-time use.&lt;br /&gt;
==== pkgname ====&lt;br /&gt;
: The name of the package.  All letters should be lowercase.&lt;br /&gt;
: {{Note|When creating an APKBUILD of a module or library for another package, we use some common package prefixes, such as: &#039;&#039;lua-&#039;&#039;, &#039;&#039;perl-&#039;&#039;, &#039;&#039;php-&#039;&#039;, and &#039;&#039;py3-&#039;&#039;.  Search aports for other common prefixes.}}&lt;br /&gt;
&lt;br /&gt;
==== pkgrel ====&lt;br /&gt;
: Alpine package release number.  Starts at 0 (zero).  Always increment &#039;&#039;pkgrel&#039;&#039; when making updates to an aport; reset &#039;&#039;pkgrel&#039;&#039; to 0 (zero) when incrementing &#039;&#039;pkgver&#039;&#039;.&lt;br /&gt;
==== pkgusers ====&lt;br /&gt;
: System user(s) to be created during build-time.  System user(s) should also be created in the &#039;&#039;&#039;[[APKBUILD Reference#.24pkgname.pre-install|$pkgname.pre-install]]&#039;&#039;&#039; script, so that the system user(s) are also created prior to package installation for run-time use.&lt;br /&gt;
==== pkgver ====&lt;br /&gt;
: The version of the software being packaged. Format for valid versions: &amp;lt;code&amp;gt;{digit}{.digit}...{letter}{_suf{#}}...{-r#}&amp;lt;/code&amp;gt; [https://git.alpinelinux.org/cgit/apk-tools/tree/src/version.c#n17]&lt;br /&gt;
: A Suffix &amp;lt;code&amp;gt;suf&amp;lt;/code&amp;gt; in the above format can be one of the following to indicate that the release is &#039;&#039;less recent&#039;&#039; than the version without the suffix: &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;beta&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;rc&amp;lt;/code&amp;gt; [https://git.alpinelinux.org/cgit/apk-tools/tree/src/version.c#n75]&lt;br /&gt;
: These are for indicating &#039;&#039;more recent&#039;&#039; releases: &amp;lt;code&amp;gt;cvs&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;svn&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;git&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hg&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; [https://git.alpinelinux.org/cgit/apk-tools/tree/src/version.c#n76]&lt;br /&gt;
: All other suffices are invalid. To package a specific git commit, the date of the commit gets appended to the latest release, e.g. &amp;lt;code&amp;gt;1.0.0_git20180204&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== provides ====&lt;br /&gt;
: List of package names (and optionally version info) this package provides.&lt;br /&gt;
&lt;br /&gt;
: If package with a version is provided (provides=&#039;foo=1.2&#039;) apk will consider it as an alternate name and it will automatically consider the package for installation by the alternate name, and conflict with other packages having the same name, or provides.&lt;br /&gt;
&lt;br /&gt;
: If version is not provided (provides=&#039;foo&#039;), apk will consider it as virtual package name. Several package with same non-versioned provides can be installed simultaneously. However, none of them will be installed by default when requested by the virtual name - instead, error message is given and user is asked to choose which package providing the virtual name should be installed.&lt;br /&gt;
==== provider_priority ====&lt;br /&gt;
: A numeric value which is used by apk-tools to break ties when choosing a virtual package to satisfy a dependency. Higher values have higher priority. The primary use case is to specify the primary package that satisfies a virtual (provider).&lt;br /&gt;
==== replaces ====&lt;br /&gt;
: Allow this package to be installed at the same time as the listed packages, even if they have conflicting files. The files from this package will override (&amp;quot;take over&amp;quot;) the conflicting files.&lt;br /&gt;
&lt;br /&gt;
: This can be used to override config files with &amp;quot;policy packages&amp;quot; [https://gitlab.alpinelinux.org/alpine/apk-tools/-/commit/89d003f8c2e5a92655ee778f7bfa5c0e85ddbed4].&lt;br /&gt;
&lt;br /&gt;
: Another use case is renaming packages (or moving files from one package to another): &amp;quot;replaces&amp;quot; will avoid the file conflict error that apk reports if it happens to install the new package before uninstalling the old package [https://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/10724#note_132872].&lt;br /&gt;
&lt;br /&gt;
: A common misconception is that &amp;quot;replaces&amp;quot; is used to replace packages (like in [https://wiki.archlinux.org/index.php/PKGBUILD#replaces PKGBUILD]). This is not the case, it is only for solving file conflicts. To let apk consider installing one package instead of another one, refer to [[#provides|provides]] (with the version).&lt;br /&gt;
&lt;br /&gt;
==== replaces_priority ====&lt;br /&gt;
: The priority of the replaces. If multiple packages replace files of each other, then the package with the highest &#039;&#039;replaces_priority&#039;&#039; will win.&lt;br /&gt;
&lt;br /&gt;
==== source ====&lt;br /&gt;
: The source variable is not only used to list the remote source files to fetch, it is also used to list the local files that abuild will need in order to build the apk. Examples of such local files include: init.d files, conf.d files, install files (see [[APKBUILD Reference#install|install variable]]), patches, and all other necessary files.&lt;br /&gt;
&lt;br /&gt;
: Here are few things to note:&lt;br /&gt;
&lt;br /&gt;
:* When you are finished adding local and/or remote files to &#039;&#039;source&#039;&#039;, you can execute the following command to add their checksums to the APKBUILD file:&lt;br /&gt;
:: {{Cmd|abuild checksum}}&lt;br /&gt;
:: {{Note|When later updating the content of &#039;&#039;source&#039;&#039;, or updating a file that is listed in &#039;&#039;source&#039;&#039;, you must also update their checksums again with the same command.}}&lt;br /&gt;
&lt;br /&gt;
:* When the remote file is hosted at SourceForge, it&#039;s best to specify the special mirrors link used by SourceForge:&lt;br /&gt;
:: &amp;lt;pre&amp;gt;http://downloads.sourceforge.net/software/software-$pkgver.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
:: (or similar depending on the package).&lt;br /&gt;
&lt;br /&gt;
:* You can set target filename (eg &#039;save as...&#039;) by prefixing the URI with &#039;&#039;filename::&#039;&#039;. This is useful when the remote filename is not specified in the URI (ie, does not end in &#039;/software-1.0.tar.gz&#039;), such as:&lt;br /&gt;
:: &amp;lt;pre&amp;gt;http://oss.example.org/?get=software&amp;amp;ver=1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
:: or when the filename is braindead, like githubs&#039; download tags:&lt;br /&gt;
:: &amp;lt;pre&amp;gt;https://github.com/software/software/archive/v$pkgver.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
:: The above two examples needs a target filename prefix:&lt;br /&gt;
:: &amp;lt;pre&amp;gt;$pkgname-$pkgver.tar.gz::http://oss.example.org/?get=software&amp;amp;ver=$pkgver&amp;lt;/pre&amp;gt;&lt;br /&gt;
:: and:&lt;br /&gt;
:: &amp;lt;pre&amp;gt;$pkgname-$pkgver.tar.gz::https://github.com/software/software/archive/v$pkgver.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:* abuild currently supports the following protocols for remote file retrieval:&lt;br /&gt;
:** http&lt;br /&gt;
:** https&lt;br /&gt;
:** ftp&lt;br /&gt;
&lt;br /&gt;
:* abuild currently supports the following archive types/archive file extensions:&lt;br /&gt;
:** .tar (only in Alpine &amp;gt;= 2.5)&lt;br /&gt;
:** .tar.gz / .tgz&lt;br /&gt;
:** .tar.bz2&lt;br /&gt;
:** .tar.lz (only in Alpine &amp;gt;=3.7)&lt;br /&gt;
:** .tar.lzma&lt;br /&gt;
:** .tar.xz&lt;br /&gt;
:** .zip&lt;br /&gt;
&lt;br /&gt;
:* &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; should only include variables that change often like &amp;lt;code&amp;gt;pkgver&amp;lt;/code&amp;gt; or a commit ID. CI will warn you if you include &amp;lt;code&amp;gt;pkgname&amp;lt;/code&amp;gt; in source. Other variables like for example &amp;lt;code&amp;gt;_pkgname&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;_pyname&amp;lt;/code&amp;gt; do not belong in &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; either.&lt;br /&gt;
&lt;br /&gt;
==== subpackages ====&lt;br /&gt;
: Subpackages built from this APKBUILD.  abuild will parse this variable and try to find a subpackage split function.  The split function must &#039;&#039;move&#039;&#039; files that do not belong in the main package, from &#039;&#039;$pkgdir&#039;&#039; to &#039;&#039;$subpkgdir&#039;&#039;.  Files and directories can also be &#039;&#039;copied&#039;&#039; from &#039;&#039;$startdir&#039;&#039; and &#039;&#039;$srcdir&#039;&#039; to &#039;&#039;$subpkgdir&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
: The split function can be specified in 1 of 3 different methods:&lt;br /&gt;
:# subpkgname:&#039;&#039;&#039;splitfunc&#039;&#039;&#039;&lt;br /&gt;
:# $pkgname-&#039;&#039;&#039;splitfunc&#039;&#039;&#039;&lt;br /&gt;
:# &#039;&#039;&#039;splitfunc&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
: {{Note|Split function names &#039;&#039;&#039;cannot&#039;&#039;&#039; use hyphens; use the first method above if the subpackage name contains a hyphen (-) character, like this: &#039;&#039;subpkg-name:subpkg_name&#039;&#039;, where &amp;lt;code&amp;gt;subpkg-name&amp;lt;/code&amp;gt; is the name of the &#039;&#039;&#039;subpackage&#039;&#039;&#039; and &amp;lt;code&amp;gt;subpkg_name&amp;lt;/code&amp;gt; is the name of the &#039;&#039;&#039;subpackage&#039;s split function&#039;&#039;&#039;.}}&lt;br /&gt;
&lt;br /&gt;
: {{Tip|For more information, see the [[APKBUILD_examples:Subpackages|Subpackages example]].}}&lt;br /&gt;
&lt;br /&gt;
==== triggers ====&lt;br /&gt;
: Apk-tools can &amp;quot;monitor&amp;quot; directories and execute a trigger if any package installed/uninstalled any file in the monitored dir. The triggers are always executed after the apk action (install, uninstall, upgrade).&lt;br /&gt;
&lt;br /&gt;
: The triggers are specified in the format: &#039;&#039;scriptname&#039;&#039;=&#039;&#039;pathlist&#039;&#039; where &#039;&#039;scriptname&#039;&#039; is the (sub)package name + .trigger suffix and pathlist is : separated list of the dirs to monitor.&lt;br /&gt;
&lt;br /&gt;
: The &#039;&#039;&#039;triggers&#039;&#039;&#039; variable must include the triggers for subpackages too if they have any.&lt;br /&gt;
&lt;br /&gt;
: It is possible to use wildcards (*) in the dir list.&lt;br /&gt;
&lt;br /&gt;
==== url ====&lt;br /&gt;
: The homepage for the package.  This is to help users find upstream documentation and other information regarding the package.&lt;br /&gt;
&lt;br /&gt;
==== langdir ====&lt;br /&gt;
: Path to where the language files are located for the &#039;&#039;&#039;-lang&#039;&#039;&#039; subpackage, defaults to &#039;&#039;&#039;/usr/share/locale&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== pcprefix ====&lt;br /&gt;
: Prefix all provides derived from parsing pkg-config Requires: with the value in this variable, example: &#039;&#039;&#039;&#039;pcprefix=&amp;quot;foo:&amp;quot;&#039;&#039;&#039; will produce &#039;&#039;&#039;pc:foo:bar&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== sonameprefix ====&lt;br /&gt;
: Prefix all provides derived from parsing shared objects with the value in this variable, example: &#039;&#039;&#039;sonameprefix=&amp;quot;foo&amp;quot;&#039;&#039;&#039; will produce &#039;&#039;&#039;so:foo:bar.so.X&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Functions =&lt;br /&gt;
{{Note|All functions that are not &#039;&#039;prepare()&#039;&#039;, &#039;&#039;build()&#039;&#039;, &#039;&#039;check()&#039;&#039; and &#039;&#039;package()&#039;&#039; should consider the current working directory as undefined, and should therefore use the [[APKBUILD Reference#abuild-defined_variables|abuild-defined directory variables]] to their advantage.}}&lt;br /&gt;
&lt;br /&gt;
 sanitycheck() -&amp;gt; clean()-&amp;gt; fetch() -&amp;gt; verify() -&amp;gt; unpack() -&amp;gt; prepare() -&amp;gt; mkusers() -&amp;gt; build() -&amp;gt; check() -&amp;gt; package() -&amp;gt; subpackages() -&amp;gt; language packs -&amp;gt; apk -&amp;gt; cleanup()&lt;br /&gt;
&lt;br /&gt;
== abuild-defined functions ==&lt;br /&gt;
The following functions are provided by abuild and can be overridden, but it is strongly discouraged on code review for some functions:&lt;br /&gt;
&lt;br /&gt;
==== fetch() ====&lt;br /&gt;
: Downloads remote sources listed in &#039;&#039;source&#039;&#039; to &#039;&#039;SRCDEST&#039;&#039; (&#039;&#039;SRCDEST&#039;&#039; is configured in &#039;&#039;/etc/abuild.conf&#039;&#039;) and creates symlinks in &#039;&#039;$srcdir&#039;&#039;.&lt;br /&gt;
==== unpack() ====&lt;br /&gt;
: unpack() will call default_unpack().&lt;br /&gt;
&lt;br /&gt;
: [https://github.com/alpinelinux/abuild/blob/v3.1.0/abuild.in#L403 default_unpack()] unpacks .tar, .tgz, .tar.gz, .tar.lz (only available in Alpine &amp;gt;=3.7), .tar.bz2, .tar.lzma, .tar.xz, and .zip archives from a symlink in &#039;&#039;$srcdir&#039;&#039; associated with &#039;&#039;$SRCDEST&#039;&#039; (or distfiles folder) resulting in an unpacked folder in &#039;&#039;$srcdir&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== dev() ====&lt;br /&gt;
: Subpackage function for the &#039;&#039;&#039;$pkgname-dev&#039;&#039;&#039; package is used to collect developer files and folders for use in other packages in the compilation process nothing more.  Without specifying a custom &#039;&#039;dev()&#039;&#039; function, abuild will call its internal &#039;&#039;dev()&#039;&#039; function, which in turn calls default_dev().&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;[https://github.com/alpinelinux/abuild/blob/v3.1.0/abuild.in#L1605 default_dev()]&#039;&#039; will move any &#039;&#039;include&#039;&#039; folder and folders containing &#039;&#039;*.[acho]&#039;&#039; (static archive, c source, c header file, object file), &#039;&#039;*.prl&#039;&#039; file extension patterns in &#039;&#039;&amp;quot;$pkgdir&amp;quot;/{lib,usr}&#039;&#039; to &#039;&#039;&amp;quot;$subpkgdir&amp;quot;/{lib,usr}&#039;&#039; recursively; and &#039;&#039;*.so&#039;&#039; files from &#039;&#039;&amp;quot;$pkgdir&amp;quot;/{lib,usr/lib}&#039;&#039; to &#039;&#039;&amp;quot;$subpkgdir&amp;quot;/{lib,usr/lib}&#039;&#039;.  It will also scan and move &#039;&#039;usr/{include,lib/{pkgconfig,cmake,qt*/mkspecs},share/{aclocal,gettext,vala/vapi,gir-[0-9]*,qt*/mkspecs},bin/*-config}}&#039;&#039; developer only folders in &#039;&#039;$pkgdir&#039;&#039; and transfer them to &#039;&#039;$subpkgdir&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
: In general, default_dev() will support packages that share pkg-config, C programming language API, shared and static libraries, Autotools, gettext, Vala programming language bindings, Python GObject introspection, a provided custom pkg-config like command (*-config), Qt, and CMake.  If you have packages that have C++, other languages, other build system, etc; you need to manually move those developer files only if they are to be used in other packages.&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;&#039;Important&#039;&#039;&#039;: For default_dev() to be called as in no dev(), you need to explicitly add subpackages=&amp;quot;$pkgname-dev&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== doc() ====&lt;br /&gt;
: Subpackage function for the &#039;&#039;&#039;$pkgname-doc&#039;&#039;&#039; package whose job is only to collect documentation folders from $pkgdir nothing more.  Without specifying a custom &#039;&#039;doc()&#039;&#039; function, abuild will call its internal &#039;&#039;doc()&#039;&#039; function, which in turn calls default_doc().&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;[https://github.com/alpinelinux/abuild/blob/v3.1.0/abuild.in#L1519 default_doc()]&#039;&#039; will move &#039;&#039;&amp;quot;$pkgdir&amp;quot;/usr/share/{doc,man,info,html,sgml,licenses,gtk-doc,ri,help}&#039;&#039; to &#039;&#039;$subpkgdir&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
: Overriding this function is strongly discouraged.  Packaging docs should be done in the package() function while letting abuild automatically collect the doc folders.&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;&#039;Important&#039;&#039;&#039;: For default_doc() to be called as in no doc(), you need to explicitly add subpackages=&amp;quot;$pkgname-doc&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== openrc() ====&lt;br /&gt;
: Subpackage function for the &#039;&#039;&#039;$pkgname-openrc&#039;&#039;&#039; package whose job is to collect OpenRC service files that are in /etc/init.d and /etc/conf.d.&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;[https://github.com/alpinelinux/abuild/blob/v3.1.0/abuild.in#L1661 default_openrc()]&#039;&#039; will move &#039;&#039;&amp;quot;$pkgdir&amp;quot;/etc/{conf,init}.d&#039;&#039; to &#039;&#039;$subpkgdir&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
: Overriding this function is strongly discouraged. Packaging OpenRC service definitions should be in the package() function while letting abuild automatically collect the openrc folders.&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;&#039;Important&#039;&#039;&#039;: for default_openrc() to be called as in no openrc(), you need to explicitly add subpackages=&amp;quot;$pkgname-openrc&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== static() ====&lt;br /&gt;
: Subpackage function for the &#039;&#039;&#039;$pkgname-static&#039;&#039;&#039; package whose job is to collect static libraries that are stored in /lib and /usr/lib.&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;[https://github.com/alpinelinux/abuild/blob/v3.4.0_rc4/abuild.in#L1748 default_static()]&#039;&#039; will move all static libraries (files ending with .a) from &#039;&#039;&amp;quot;$pkgdir&amp;quot;/lib&#039;&#039; and &#039;&#039;&amp;quot;$pkgdir&amp;quot;/usr/lib&#039;&#039; to their equivalents in &#039;&#039;$subpkgdir&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
: Overriding this function is strongly discouraged. Packaging static libraries should be done in the package() function while letting abuild automatically collect the static libraries.&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;&#039;Important&#039;&#039;&#039;: for default_static() to be called as in no static(), you need to explicitly add subpackages=&amp;quot;$pkgname-static&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== snapshot() ====&lt;br /&gt;
: &#039;&#039;&#039;Optional&#039;&#039;&#039;.  For live APKBUILDs or those with a _cvs, _svn, _git, _hg in their version number, you should create a snapshot function only if there is no download link to an archive file (.zip, .tar.gz, ...) to the commit/hash/tag.  The purpose of the snapshot function is to create an archive of the source code so that the package source code is deterministic, and it doesn&#039;t waste time to fetch the source code but bypasses the download step after snapshotting.  Those that download the source code from a git repository will follow head or the latest change to the source code.  It is better to archive the source code as a zip / tar.gz / tar.bz2 up to the commit or the tag which you are trying to build a package.  If it is not deterministic or not every part of the code frozen in time for every dependency and the main project, then the patches will fail or the package may fail to compile when you revisit the package months or years to backport a patch.&lt;br /&gt;
&lt;br /&gt;
: The default [https://github.com/alpinelinux/abuild/blob/v3.1.0/abuild.in#L2310 snapshot()] function has variables associated with it:&lt;br /&gt;
:* $disturl - the base-url of the place to autoupload the snapshot&lt;br /&gt;
:* $svnurl - Subversion repository &lt;br /&gt;
:* $giturl - Git repository&lt;br /&gt;
&lt;br /&gt;
: The default snapshot() can only support one repository.  It is better to override it if there are multiple repositories involved in your package.  CVS, Mercurial (hg), and alternative version control systems must override the default snapshot().&lt;br /&gt;
&lt;br /&gt;
: See [[APKBUILD_examples:Git_checkout]] to how to use it with git.  It takes 2-3 general steps.  Clone the repository; check it out at a specific revision/commit or tag; then you use an archiver to dump it in the &#039;&#039;$SRCDEST&#039;&#039; variable which points to the distfiles folder and the base path to the full path to the archive that you want to create.  You do this for every internal dependency that the package pulls.&lt;br /&gt;
&lt;br /&gt;
: After you have created your snapshot function, you use &amp;lt;code&amp;gt;abuild snapshot&amp;lt;/code&amp;gt; to run it.  &lt;br /&gt;
&lt;br /&gt;
: The archives produced by the snapshot will be saved in &#039;&#039;/var/cache/distfiles&#039;&#039; or whatever you set for &#039;&#039;$SRCDEST&#039;&#039;.  You may need to create symlinks to the archive if the archive is not saved to the Alpine server.&lt;br /&gt;
&lt;br /&gt;
: After you snapshot it, you need to produce the checksums with &amp;lt;code&amp;gt;abuild checksum&amp;lt;/code&amp;gt; to use it in the APKBUILD creation process.&lt;br /&gt;
&lt;br /&gt;
: This feature is available since Alpine &amp;gt;=2.6.&lt;br /&gt;
&lt;br /&gt;
==== default_prepare() ====&lt;br /&gt;
&lt;br /&gt;
:  Before build preparation it handles set of patches inside &amp;lt;code&amp;gt;$srcdir&amp;lt;/code&amp;gt; and prints failed ones.&lt;br /&gt;
&lt;br /&gt;
== User-defined functions ==&lt;br /&gt;
The following functions should be defined by the user: &lt;br /&gt;
&lt;br /&gt;
==== prepare() ====&lt;br /&gt;
: {{note|Please adjust old APKBUILDs, which still have a &#039;&#039;prepare()&#039;&#039; function that does the same as the &#039;&#039;default_prepare()&#039;&#039; when you edit them anyway.}}&lt;br /&gt;
: &#039;&#039;&#039;&#039;&#039;Optional&#039;&#039;.&#039;&#039;&#039;  Used for build preparation: patches, etc, should be applied here. When you don&#039;t specify a custom &#039;&#039;prepare()&#039;&#039;, the built-in &#039;&#039;default_prepare()&#039;&#039; from abuild will be used. It applies patches already (always prepare them in the &amp;lt;code&amp;gt;-p1&amp;lt;/code&amp;gt; format), so &#039;&#039;&#039;usually it makes sense to not create a custom &#039;&#039;prepare()&#039;&#039; function at all!&#039;&#039;&#039; If you do create one, call &#039;&#039;default_prepare()&#039;&#039; inside it:&lt;br /&gt;
&lt;br /&gt;
: Before default_prepare gets called, you can define &#039;&#039;patch_args&#039;&#039; to supply the argument to the patch command in global scope then throw away prepare() so it is unnecessary to use the old template code floating around to patch.  patch_args and autopatching is only available in Alpine &amp;gt;=3.4.  See [[Creating_an_Alpine_package#Patches]] to fix the patch that uses a different patch level (-pX).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prepare() {&lt;br /&gt;
    default_prepare&lt;br /&gt;
    # your custom code here&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== build() ====&lt;br /&gt;
: &#039;&#039;&#039;Required.&#039;&#039;&#039;  This is the compilation stage.  This function will be called as the current user (unless the &#039;&#039;package()&#039;&#039; function is missing - for compatibility reasons).  If no compilation is needed, the function should be removed.&lt;br /&gt;
&lt;br /&gt;
: To enable or disable CFLAGS, CXXFLAGS, CMake with option, or configure option per arch, use the CARCH variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
local cmakeoptions=&lt;br /&gt;
case &amp;quot;$CARCH&amp;quot; in&lt;br /&gt;
        aarch64*|arm*|ppc64le|x86|s390x) cmakeoptions=&amp;quot;$cmakeoptions -DWITH_OPENMP=OFF&amp;quot; ;;&lt;br /&gt;
        x86_64)                          cmakeoptions=&amp;quot;$cmakeoptions -DWITH_OPENMP=ON&amp;quot; ;;&lt;br /&gt;
        *)                               msg &amp;quot;Unable to determine architecture from (CARCH=$CARCH)&amp;quot; ; return 1 ;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: The block can be used in other parts of the APKBUILD even in global.&lt;br /&gt;
&lt;br /&gt;
==== check() ====&lt;br /&gt;
: &#039;&#039;&#039;Required if functionality exists.&#039;&#039;&#039; This function is called right after the build stage.  It should check that the packaged thing is actually working, typically by running (integration) tests, if provided by upstream.  If there’s no (easy) way how to test the package, you can declare that it does not want to use &#039;&#039;check()&#039;&#039; by adding &amp;quot;!check&amp;quot; into the &#039;&#039;options&#039;&#039; variable (&amp;lt;code&amp;gt;options=&amp;quot;!check&amp;quot;&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
: default_check() does nothing.  You need to manually explicitly call the unit tests or test suite yourself.  When you run the test, the program should return with an exit code of 0, indicating the tests were a success.  Unit tests or test suites will do feature tests, per function correctness check, fuzz testing, benchmarks.&lt;br /&gt;
&lt;br /&gt;
: A package may also require additional testing frameworks packages that are external dependencies.  You should add those to the &#039;&#039;checkdepends=&#039;&#039; in Alpine &amp;gt;=3.6 or &#039;&#039;makedepends=&#039;&#039; for older for backporters.  If the testing framework is not available, you need to create a package for it.  If it requires a specific version of a testing framework, consider making it an internal dependency or a new package with a package name containing the major and minor version number like the python packages.&lt;br /&gt;
&lt;br /&gt;
: Generally speaking, you should define the check functions for libraries, large programs like web browsers, or compilers and interpreters, cryptographic/security/anonymity stuff, mission critical stuff, PCI compliance/money/accounting software, server software with a lot of stakeholders or consumers.  Soon for the new policy change will have virtually &#039;&#039;&#039;all packages with testing capabilities be required to have a working and defined check() function&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
: There are times when the unit tests do not work, just because the test itself is broken, new unimplemented feature, external factors not taken into consideration, unbundling path differences, breakage caused by ccache, missing test dependency or version mismatch dependency as in python2 vs python3, test scripts only work for particular language implementation like only supporting python2 but not python3 having used the 2to3 conversion script.  If a unit test is known not to work, you may need to patch it to omit that test or fix it; but, certain tests should not be disabled if it is important.  You may need to alter the references to uncompiled internal dependencies to work with the external dependencies instead.  For ccache, you can either disable it or remove it from the PATH environmental variable before running tests.&lt;br /&gt;
&lt;br /&gt;
{{Note|Tests for graphical applications and toolkits might work on a X11 user setup but will fail on the server unless run with xvfb-run.}}&lt;br /&gt;
&lt;br /&gt;
: If you don&#039;t add the &#039;&#039;check()&#039;&#039; and the &#039;&#039;options=&#039;&#039;, this is what you will see:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt;&amp;gt;&amp;gt; WARNING: py-webtest*: APKBUILD does not run any tests!&lt;br /&gt;
    Alpine policy will soon require that packages have any relevant testsuites run during the build process.&lt;br /&gt;
    To fix, either define a check() function, or declare !check in $options to indicate the package does not have a testsuite.&lt;br /&gt;
&lt;br /&gt;
: If you do not do a check or disable it, you must state there is no testsuite in comment form (#) next to options=&amp;quot;!check&amp;quot; for the code reviewers.&lt;br /&gt;
&lt;br /&gt;
: To run test suite with autotools do:&lt;br /&gt;
&lt;br /&gt;
  make check&lt;br /&gt;
&lt;br /&gt;
: To run the test suite with python setuptools:&lt;br /&gt;
&lt;br /&gt;
  python2 setup.py test&lt;br /&gt;
  python3 setup.py test&lt;br /&gt;
&lt;br /&gt;
: For python it should be &#039;&#039;&#039;test&#039;&#039;&#039; not check.  Check for python setuptools will check the packaging metadata fields[https://docs.python.org/3/distutils/examples.html#checking-a-package] only but not run the unit tests.  There should be verbose output also.  The dependencies for the tests are found in test_require in the setup.py.&lt;br /&gt;
&lt;br /&gt;
: If it says &amp;lt;code&amp;gt;Ran 0 tests in 0.000s&amp;lt;/code&amp;gt; that is not acceptable.  check() will say it was good but it is not actually correct.  It needs to run the test suite with an alternative method like &amp;lt;code&amp;gt;tox -e py27,py36&amp;lt;/code&amp;gt; if you see a tox.ini file.&lt;br /&gt;
&lt;br /&gt;
: You want to do it for each implementation to ensure that the API calls are correct per implementation but ncopa said it was just fine with python3.&lt;br /&gt;
&lt;br /&gt;
: If there is a circular dependency for the checkdepends=, you need to disable the check and put the reason next to &amp;lt;code&amp;gt;options=&amp;quot;!check&amp;quot;&amp;lt;/code&amp;gt; that there is a circular dependency.  You should disable it for the package that package that is least important or least security risk.  The other solution is to make the conflicting dependency an internal dependency but making sure that it doesn&#039;t pull it at check time.  This way they can both preform tests properly.&lt;br /&gt;
&lt;br /&gt;
==== package() ====&lt;br /&gt;
: &#039;&#039;&#039;Required.&#039;&#039;&#039;  This is the packaging stage.  Here, the built application and support files should be installed into &#039;&#039;&#039;$pkgdir&#039;&#039;&#039;.  If this is a metapackage, this function can contain a single line: &amp;lt;code&amp;gt;mkdir -p &amp;quot;$pkgdir&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|Building in fakeroot will reduce performance for parallel builds dramatically.  It is for this reason that we split the build and package process into two separate functions.}}&lt;br /&gt;
&lt;br /&gt;
= Special Operators =&lt;br /&gt;
&lt;br /&gt;
== $pkgname~$pkgver ==&lt;br /&gt;
&lt;br /&gt;
Specifies a required &amp;lt;code&amp;gt;$pkgver&amp;lt;/code&amp;gt; for [[apk]] to satisfy the &amp;lt;code&amp;gt;$pkgname&amp;lt;/code&amp;gt; requirement. &amp;lt;code&amp;gt;~&amp;lt;/code&amp;gt; ignores revisions of the package version. For example &amp;lt;code&amp;gt;superd~0.6&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;$depends&amp;lt;/code&amp;gt; will ensure superd with package version 0.6 is installed as a run-time dependency for the package.&lt;br /&gt;
&lt;br /&gt;
== $pkgname&amp;gt;=$pkgver ==&lt;br /&gt;
&lt;br /&gt;
Specifies the installed package version must be greater than or equal to &amp;lt;code&amp;gt;$pkgver&amp;lt;/code&amp;gt; for [[apk]] to satisfy the &amp;lt;code&amp;gt;$pkgname&amp;lt;/code&amp;gt; requirement.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
The [[APKBUILD examples]] page will assist you in understanding how to create an APKBUILD.&lt;br /&gt;
&lt;br /&gt;
= Version =&lt;br /&gt;
&lt;br /&gt;
This document assumes abuild for Alpine Edge.  For older releases of abuild, some of these features may not be available if you are using an older release.  A link to the implementation is linked for researchers and backporters.&lt;br /&gt;
&lt;br /&gt;
For more information see [[APKBUILD_versions]].&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Alpine_Linux:Listings&amp;diff=27638</id>
		<title>Alpine Linux:Listings</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Alpine_Linux:Listings&amp;diff=27638"/>
		<updated>2024-10-26T18:21:34Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: Update link to Alpine Suck&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC right}}&lt;br /&gt;
&lt;br /&gt;
{{Draft}}&lt;br /&gt;
&lt;br /&gt;
== Alpine Linux Dedicated Pages ==&lt;br /&gt;
&lt;br /&gt;
These are official and unofficial &#039;&#039;&#039;Alpine Linux&#039;&#039;&#039; pages around the web.&lt;br /&gt;
&lt;br /&gt;
===Social Media Pages===&lt;br /&gt;
&lt;br /&gt;
* [https://twitter.com/alpinelinux Twitter]&lt;br /&gt;
* [https://fosstodon.org/@alpinelinux Mastodon (on fosstodon.org)]&lt;br /&gt;
* [https://br.linkedin.com/groups/Alpine-Linux-6648617 LinkedIn Group]&lt;br /&gt;
* [https://old.reddit.com/r/alpinelinux /r/alpinelinux on Reddit]&lt;br /&gt;
&lt;br /&gt;
===Other Pages===&lt;br /&gt;
&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Alpine_Linux Wikipedia article]&lt;br /&gt;
* [https://distrowatch.com/table.php?distribution=alpine Distrowatch entry]&lt;br /&gt;
* [https://openhub.net/p/aports Black Duck Open Hub] (aports statistics)&lt;br /&gt;
* [http://iso.linuxquestions.org/alpine-linux/ Linux Questions ISO links]&lt;br /&gt;
* [https://web.archive.org/web/20171125113042/https://blog.xenproject.org/2013/03/04/alpine-linux-and-xen/ Xen.org article] about Xen and Alpine Linux.&lt;br /&gt;
* [https://github.com/alpinelinux/ GitHub organization]&lt;br /&gt;
* [https://stackoverflow.com/questions/tagged/alpine Alpine Linux tag on StackOverflow]&lt;br /&gt;
&lt;br /&gt;
== Reviews and other Articles ==&lt;br /&gt;
&lt;br /&gt;
* [https://distrowatch.com/weekly.php?issue=20230403#alpine Alpine Linux 3.17.2 Review] by Jesse Smith for DistroWatch (published 2023-04-03 [https://web.archive.org/web/20230809174002/https://distrowatch.com/weekly.php?issue=20230403#alpine:~:text=Feature%20Story%20(by%20Jesse%20Smith) archive])&lt;br /&gt;
* [https://whynothugo.nl/journal/2023/02/18/in-praise-of-alpine-and-apk/ In praise of Alpine and apk] by Hugo Barrera (published 2023-02-18)&lt;br /&gt;
** See also [https://sr.ht/~bt/alpine-suck/ Alpine Suck] Desktop installer for Alpine Linux based on the suckless philosophy&lt;br /&gt;
* [https://drewdevault.com/2021/05/06/Praise-for-Alpine-Linux.html In praise of Alpine Linux] by Drew DeVault (published 2021-05-06)&lt;br /&gt;
* [https://archive.is/F4ZSa Alpine Linux 2 Review] by LinuxBSDos (published 2010-08-23)&lt;br /&gt;
* [https://linuxlandit.blogspot.com/2010/08/alpine-linux-is-community-developed.html Alpine Linux is a community developed operating system &amp;amp;#91;...&amp;amp;#93;] by Linuxlandit &amp;amp; The Conqueror Penguin (published 2010-08-22)&lt;br /&gt;
&lt;br /&gt;
== YouTube Videos ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.youtube.com/watch?v=YNYtJ3jyMRs Installing Alpine Linux as a Desktop OS by Trafotin]&lt;br /&gt;
&lt;br /&gt;
== Lists that include Alpine ==&lt;br /&gt;
&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Lightweight_Linux_distribution Lightweight Linux Distributions]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/List_of_Linux_distributions_that_run_from_RAM Distributions that run from RAM]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/List_of_router_or_firewall_distributions Router or Firewall Distributions]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Security-focused_operating_system#Alpine_Linux Security-focused Distributions]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/PaX#Distributions_that_use_PaX Distributions that use PaX]&lt;br /&gt;
&lt;br /&gt;
== Hosting Providers ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.gigatux.com/distro/alpine_linux_vps GigaTux]&lt;br /&gt;
* [https://linode.com Linode]&lt;br /&gt;
* [https://vpsfree.cz/ vpsFree.cz]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Sertonix/Freedom_of_choice&amp;diff=27473</id>
		<title>User:Sertonix/Freedom of choice</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Sertonix/Freedom_of_choice&amp;diff=27473"/>
		<updated>2024-10-08T22:42:03Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: update status of openrc-init&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is an overview over the different available programms, etc. that can be selected from when using alpine. It is also intended as a reference what should be documented and what could be supported.&lt;br /&gt;
&lt;br /&gt;
== Bootloaders ==&lt;br /&gt;
* See: [[Bootloaders]]&lt;br /&gt;
* Not supported: &amp;lt;code&amp;gt;systemd-boot&amp;lt;/code&amp;gt; ([https://pkgs.postmarketos.org/packages?name=systemd-boot PostmarketOS does])&lt;br /&gt;
&lt;br /&gt;
== Kernel ==&lt;br /&gt;
* See: [[Kernels]]&lt;br /&gt;
&lt;br /&gt;
== Libc ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|musl}} || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| [https://www.gnu.org/software/libc/ glibc] || style=&amp;quot;background:red&amp;quot; | None || [[Running glibc programs]]&lt;br /&gt;
|-&lt;br /&gt;
| without aka static || style=&amp;quot;background:orange&amp;quot; | depends on package || Note that this only means no libc at runtime&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://gitlab.alpinelinux.org/alpine/tsc/-/issues/17 alpine-glibc]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Libc Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
== Initramfs ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|mkinitfs}} || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dracut}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|booster}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| [https://github.com/illiliti/tinyramfs tinyramfs] || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:red&amp;quot; | None || may require [[custom Kernel]], [https://kisslinux.org/install#021 kisslinux without initramfs]&lt;br /&gt;
|}&lt;br /&gt;
* See also: [[Initramfs init]]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Initramfs Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
== PID 1 ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| busybox init || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dinit}} || style=&amp;quot;background:orange&amp;quot; | In testing || Shutdown commands are prefixed with {{ic|dinit-}}. eg {{ic|dinit-reboot}}&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|s6-linux-init}} || style=&amp;quot;background:orange&amp;quot; | Works || Requires manually running {{ic|s6-linux-init-maker}}&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|openrc-init}} || style=&amp;quot;background:orange&amp;quot; | Manual setup ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dumb-init}} || style=&amp;quot;background:silver&amp;quot; | Needs testing || For containers&lt;br /&gt;
|-&lt;br /&gt;
| runit-init || style=&amp;quot;background:silver&amp;quot; | Needs testing || [https://dev.alpinelinux.org/~clandmeter/other/forum.alpinelinux.org/comment/383.html#comment-383 runit-init starting OpenRC]&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|epoch}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| [https://core.suckless.org/sinit/ sinit] || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| custom || style=&amp;quot;background:lime&amp;quot; | Full || For example in docker containers&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Init_system Gentoo Wiki]&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Init Archwiki]&lt;br /&gt;
&lt;br /&gt;
== Service Manager ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[OpenRC]] || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dinit}} || style=&amp;quot;background:orange&amp;quot; | In testing || {{Pkg|dinit-alpine}} includes service files&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|s6-rc}} || style=&amp;quot;background:orange&amp;quot; | Works || Not integrated. For containers there is {{Pkg|s6-overlay}}&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|runit}} || style=&amp;quot;background:orange&amp;quot; | As OpenRC service ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|daemontools}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|daemontools-encore}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|supervisor}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| busybox runit || style=&amp;quot;background:red&amp;quot; | None || Not enabled in a busybox package&lt;br /&gt;
|-&lt;br /&gt;
| [https://core.suckless.org/svc/ svc] || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full || Requires to replace {{Pkg|alpine-base}} with custom set of packages (See {{Issue|71686}})&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Init_system Gentoo Wiki]&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Init Archwiki]&lt;br /&gt;
&lt;br /&gt;
== System Logs ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[Syslog#busybox_syslog|busybox syslog]] || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|rsyslog}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|syslog-ng}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{pkg|socklog}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| [https://skarnet.org/software/s6/s6-socklog.html s6-socklog] from {{pkg|s6}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd-journald || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|}&lt;br /&gt;
* See also: [[Syslog]]&lt;br /&gt;
&lt;br /&gt;
== [[Device Manager]] ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[mdev]] || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| [[mdevd]] || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| [[eudev]] || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| [https://core.suckless.org/smdev/ smdev] || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| vdev || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd-udev || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Power Managment ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[busybox acpid]] || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|acpid}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|elogind}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd-logind || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Power_management Archwiki]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Power_management Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
== DHCP Client ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[Udhcpc|busybox udhcpc]] || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dhcpcd}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dhclient}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| [https://core.suckless.org/sdhcp/ sdhcp] || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| without aka static || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|}&lt;br /&gt;
* See also: [[Configure Networking]]&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Network_configuration#DHCP Archwiki]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Resolv.conf Gentoo Wiki - resolv.conf]&lt;br /&gt;
&lt;br /&gt;
== Wi-Fi ==&lt;br /&gt;
* See: [[Wi-Fi]]&lt;br /&gt;
* Also supported: {{pkg|eiwd}}&lt;br /&gt;
&lt;br /&gt;
== Seat/Session Managnent ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[elogind]] || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|seatd}} || style=&amp;quot;background:lime&amp;quot; | Full || seats only&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|turnstile}} || style=&amp;quot;background:silver&amp;quot; | needs testing || session only&lt;br /&gt;
|-&lt;br /&gt;
| systemd-logind || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full || Not recommended with graphical enviroment&lt;br /&gt;
|}&lt;br /&gt;
* [https://wiki.gentoo.org/wiki/Seatd Gentoo Wiki - seatd]&lt;br /&gt;
* [https://wiki.gentoo.org/wiki/Elogind Gentoo Wiki - elogind]&lt;br /&gt;
* [https://wiki.archlinux.org/title/Init#logind ArchWiki - systemd-logind]&lt;br /&gt;
* [https://chimera-linux.org/docs/configuration/seat Chimera Linux docs]&lt;br /&gt;
&lt;br /&gt;
== Login ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Supports [[PAM]] !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| busybox login || style=&amp;quot;background:lime&amp;quot; | Full || style=&amp;quot;background:red&amp;quot; | No || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|greetd}} || style=&amp;quot;background:lime&amp;quot; | Full || style=&amp;quot;background:lime&amp;quot; | Yes || requires greeter&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|shadow-login}} || style=&amp;quot;background:lime&amp;quot; | Full || style=&amp;quot;background:lime&amp;quot; | Yes ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|util-linux-login}} || style=&amp;quot;background:lime&amp;quot; | Full || style=&amp;quot;background:lime&amp;quot; | Yes ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd-logind || style=&amp;quot;background:red&amp;quot; | None || style=&amp;quot;background:lime&amp;quot; | Yes || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full || style=&amp;quot;background:red&amp;quot; | No ||&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Login Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
== Shell Utils ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|busybox}} || style=&amp;quot;background:lime&amp;quot; | Full || Dependency of {{pkg|alpine-base}}&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|busybox-extras}} || style=&amp;quot;background:lime&amp;quot; | Full || Some commands that are missing in the main {{Pkg|busybox}} package&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|util-linux}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| [[GNU_core_utilities|coreutils]] || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|s6-portable-utils}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|s6-linux-utils}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|toybox}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|sbase}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|ubase}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:red&amp;quot; | None || A lot of implicit dependency&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Core_utilities Archwiki]&lt;br /&gt;
&lt;br /&gt;
== Shell ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| busybox ash || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|bash}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dash}} || style=&amp;quot;background:lime&amp;quot; | Full || When used as /bin/sh this may cause breakage.&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|yash}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| busybox hush || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:red&amp;quot; | None || sometimes implicit dependency&lt;br /&gt;
|}&lt;br /&gt;
* See also: [[Change default shell]]&lt;br /&gt;
* See proposal: [https://gitlab.alpinelinux.org/alpine/tsc/-/issues/39 replace busybox ash with another /bin/sh]&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Command-line_shell Archwiki]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Shell Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
== SU ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| {{ic|su}} from {{Pkg|busybox-suid}} || style=&amp;quot;background:lime&amp;quot; | Full || default, can&#039;t be removed by default ({{issue|11730}})&lt;br /&gt;
|-&lt;br /&gt;
| {{ic|su}} from {{Pkg|shadow-login}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{ic|su}} from {{Pkg|util-linux-login}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|sudo}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|doas}} || style=&amp;quot;background:lime&amp;quot; | Full || sudo shim using doas: {{Pkg|doas-sudo-shim}}&lt;br /&gt;
|-&lt;br /&gt;
| [https://skarnet.org/software/s6/s6-sudo.html s6-sudo] || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SSL/TLS ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|openssl}} || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|libressl}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|bearssl}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://gitlab.alpinelinux.org/alpine/tsc/-/issues/28 consider LibreSSL as default OpenSSL provider again]&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Transport_Layer_Security Archwiki]&lt;br /&gt;
* See also: [https://github.com/haproxy/wiki/wiki/SSL-Libraries-Support-Status haproxy SSL Libraries Support Status]&lt;br /&gt;
&lt;br /&gt;
== Cron ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|cronie}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dcron}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|fcron}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| vixie-cron || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| scron || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd.timer || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full || {{Pkg|alpine-baselayout}} includes cron specific directories though&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Cron Archwiki]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Cron Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
== SSH ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[Setting_up_a_SSH_server#OpenSSH|openssh]] || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| [[Setting_up_a_SSH_server#Dropbear|dropbear]] || style=&amp;quot;background:lime&amp;quot; | Full || provide {{ic|ssh}} command {{pkg|dropbear-ssh}}&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Secure_Shell Archwiki]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/SSH Gentoo Wiki - OpenSSH]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Dropbear Gentoo Wiki - Dropbear]&lt;br /&gt;
&lt;br /&gt;
== Desktop ==&lt;br /&gt;
* See: [[Desktop environments and Window managers]]&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Architecture|Alpine Architecture]]&lt;br /&gt;
* [https://gitlab.alpinelinux.org/alpine/tsc/-/issues/55 Future of busybox]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Sertonix/Freedom_of_choice&amp;diff=27421</id>
		<title>User:Sertonix/Freedom of choice</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Sertonix/Freedom_of_choice&amp;diff=27421"/>
		<updated>2024-09-28T22:12:21Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: a few updates&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is an overview over the different available programms, etc. that can be selected from when using alpine. It is also intended as a reference what should be documented and what could be supported.&lt;br /&gt;
&lt;br /&gt;
== Bootloaders ==&lt;br /&gt;
* See: [[Bootloaders]]&lt;br /&gt;
* Not supported: &amp;lt;code&amp;gt;systemd-boot&amp;lt;/code&amp;gt; ([https://pkgs.postmarketos.org/packages?name=systemd-boot PostmarketOS does])&lt;br /&gt;
&lt;br /&gt;
== Kernel ==&lt;br /&gt;
* See: [[Kernels]]&lt;br /&gt;
&lt;br /&gt;
== Libc ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|musl}} || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| [https://www.gnu.org/software/libc/ glibc] || style=&amp;quot;background:red&amp;quot; | None || [[Running glibc programs]]&lt;br /&gt;
|-&lt;br /&gt;
| without aka static || style=&amp;quot;background:orange&amp;quot; | depends on package || Note that this only means no libc at runtime&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://gitlab.alpinelinux.org/alpine/tsc/-/issues/17 alpine-glibc]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Libc Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
== Initramfs ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|mkinitfs}} || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dracut}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|booster}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| [https://github.com/illiliti/tinyramfs tinyramfs] || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:red&amp;quot; | None || may require [[custom Kernel]], [https://kisslinux.org/install#021 kisslinux without initramfs]&lt;br /&gt;
|}&lt;br /&gt;
* See also: [[Initramfs init]]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Initramfs Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
== PID 1 ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| busybox init || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dinit}} || style=&amp;quot;background:orange&amp;quot; | In testing || Shutdown commands are prefixed with {{ic|dinit-}}. eg {{ic|dinit-reboot}}&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|s6-linux-init}} || style=&amp;quot;background:orange&amp;quot; | Works || Requires manually running {{ic|s6-linux-init-maker}}&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dumb-init}} || style=&amp;quot;background:silver&amp;quot; | Needs testing || For containers&lt;br /&gt;
|-&lt;br /&gt;
| runit-init || style=&amp;quot;background:silver&amp;quot; | Needs testing || [https://dev.alpinelinux.org/~clandmeter/other/forum.alpinelinux.org/comment/383.html#comment-383 runit-init starting OpenRC]&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|epoch}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| openrc-init || style=&amp;quot;background:red&amp;quot; | None || Is excluded from the {{pkg|openrc}} package&lt;br /&gt;
|-&lt;br /&gt;
| [https://core.suckless.org/sinit/ sinit] || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| custom || style=&amp;quot;background:lime&amp;quot; | Full || For example in docker containers&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Init_system Gentoo Wiki]&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Init Archwiki]&lt;br /&gt;
&lt;br /&gt;
== Service Manager ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[OpenRC]] || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dinit}} || style=&amp;quot;background:orange&amp;quot; | In testing || {{Pkg|dinit-alpine}} includes service files&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|s6-rc}} || style=&amp;quot;background:orange&amp;quot; | Works || Not integrated. For containers there is {{Pkg|s6-overlay}}&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|runit}} || style=&amp;quot;background:orange&amp;quot; | As OpenRC service ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|daemontools}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|daemontools-encore}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|supervisor}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| busybox runit || style=&amp;quot;background:red&amp;quot; | None || Not enabled in a busybox package&lt;br /&gt;
|-&lt;br /&gt;
| [https://core.suckless.org/svc/ svc] || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full || Requires to replace {{Pkg|alpine-base}} with custom set of packages (See {{Issue|71686}})&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Init_system Gentoo Wiki]&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Init Archwiki]&lt;br /&gt;
&lt;br /&gt;
== System Logs ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[Syslog#busybox_syslog|busybox syslog]] || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|rsyslog}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|syslog-ng}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{pkg|socklog}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| [https://skarnet.org/software/s6/s6-socklog.html s6-socklog] from {{pkg|s6}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd-journald || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|}&lt;br /&gt;
* See also: [[Syslog]]&lt;br /&gt;
&lt;br /&gt;
== [[Device Manager]] ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[mdev]] || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| [[mdevd]] || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| [[eudev]] || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| [https://core.suckless.org/smdev/ smdev] || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| vdev || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd-udev || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Power Managment ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[busybox acpid]] || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|acpid}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|elogind}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd-logind || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Power_management Archwiki]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Power_management Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
== DHCP Client ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[Udhcpc|busybox udhcpc]] || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dhcpcd}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dhclient}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| [https://core.suckless.org/sdhcp/ sdhcp] || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| without aka static || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|}&lt;br /&gt;
* See also: [[Configure Networking]]&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Network_configuration#DHCP Archwiki]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Resolv.conf Gentoo Wiki - resolv.conf]&lt;br /&gt;
&lt;br /&gt;
== Wi-Fi ==&lt;br /&gt;
* See: [[Wi-Fi]]&lt;br /&gt;
* Also supported: {{pkg|eiwd}}&lt;br /&gt;
&lt;br /&gt;
== Seat/Session Managnent ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[elogind]] || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|seatd}} || style=&amp;quot;background:lime&amp;quot; | Full || seats only&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|turnstile}} || style=&amp;quot;background:silver&amp;quot; | needs testing || session only&lt;br /&gt;
|-&lt;br /&gt;
| systemd-logind || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full || Not recommended with graphical enviroment&lt;br /&gt;
|}&lt;br /&gt;
* [https://wiki.gentoo.org/wiki/Seatd Gentoo Wiki - seatd]&lt;br /&gt;
* [https://wiki.gentoo.org/wiki/Elogind Gentoo Wiki - elogind]&lt;br /&gt;
* [https://wiki.archlinux.org/title/Init#logind ArchWiki - systemd-logind]&lt;br /&gt;
* [https://chimera-linux.org/docs/configuration/seat Chimera Linux docs]&lt;br /&gt;
&lt;br /&gt;
== Login ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Supports [[PAM]] !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| busybox login || style=&amp;quot;background:lime&amp;quot; | Full || style=&amp;quot;background:red&amp;quot; | No || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|greetd}} || style=&amp;quot;background:lime&amp;quot; | Full || style=&amp;quot;background:lime&amp;quot; | Yes || requires greeter&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|shadow-login}} || style=&amp;quot;background:lime&amp;quot; | Full || style=&amp;quot;background:lime&amp;quot; | Yes ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|util-linux-login}} || style=&amp;quot;background:lime&amp;quot; | Full || style=&amp;quot;background:lime&amp;quot; | Yes ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd-logind || style=&amp;quot;background:red&amp;quot; | None || style=&amp;quot;background:lime&amp;quot; | Yes || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full || style=&amp;quot;background:red&amp;quot; | No ||&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Login Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
== Shell Utils ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|busybox}} || style=&amp;quot;background:lime&amp;quot; | Full || Dependency of {{pkg|alpine-base}}&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|busybox-extras}} || style=&amp;quot;background:lime&amp;quot; | Full || Some commands that are missing in the main {{Pkg|busybox}} package&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|util-linux}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| [[GNU_core_utilities|coreutils]] || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|s6-portable-utils}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|s6-linux-utils}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|toybox}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|sbase}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|ubase}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:red&amp;quot; | None || A lot of implicit dependency&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Core_utilities Archwiki]&lt;br /&gt;
&lt;br /&gt;
== Shell ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| busybox ash || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|bash}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dash}} || style=&amp;quot;background:lime&amp;quot; | Full || When used as /bin/sh this may cause breakage.&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|yash}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| busybox hush || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:red&amp;quot; | None || sometimes implicit dependency&lt;br /&gt;
|}&lt;br /&gt;
* See also: [[Change default shell]]&lt;br /&gt;
* See proposal: [https://gitlab.alpinelinux.org/alpine/tsc/-/issues/39 replace busybox ash with another /bin/sh]&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Command-line_shell Archwiki]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Shell Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
== SU ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| {{ic|su}} from {{Pkg|busybox-suid}} || style=&amp;quot;background:lime&amp;quot; | Full || default, can&#039;t be removed by default ({{issue|11730}})&lt;br /&gt;
|-&lt;br /&gt;
| {{ic|su}} from {{Pkg|shadow-login}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{ic|su}} from {{Pkg|util-linux-login}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|sudo}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|doas}} || style=&amp;quot;background:lime&amp;quot; | Full || sudo shim using doas: {{Pkg|doas-sudo-shim}}&lt;br /&gt;
|-&lt;br /&gt;
| [https://skarnet.org/software/s6/s6-sudo.html s6-sudo] || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SSL/TLS ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|openssl}} || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|libressl}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|bearssl}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://gitlab.alpinelinux.org/alpine/tsc/-/issues/28 consider LibreSSL as default OpenSSL provider again]&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Transport_Layer_Security Archwiki]&lt;br /&gt;
* See also: [https://github.com/haproxy/wiki/wiki/SSL-Libraries-Support-Status haproxy SSL Libraries Support Status]&lt;br /&gt;
&lt;br /&gt;
== Cron ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|cronie}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dcron}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|fcron}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| vixie-cron || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| scron || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd.timer || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full || {{Pkg|alpine-baselayout}} includes cron specific directories though&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Cron Archwiki]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Cron Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
== SSH ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[Setting_up_a_SSH_server#OpenSSH|openssh]] || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| [[Setting_up_a_SSH_server#Dropbear|dropbear]] || style=&amp;quot;background:lime&amp;quot; | Full || provide {{ic|ssh}} command {{pkg|dropbear-ssh}}&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Secure_Shell Archwiki]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/SSH Gentoo Wiki - OpenSSH]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Dropbear Gentoo Wiki - Dropbear]&lt;br /&gt;
&lt;br /&gt;
== Desktop ==&lt;br /&gt;
* See: [[Desktop environments and Window managers]]&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Architecture|Alpine Architecture]]&lt;br /&gt;
* [https://gitlab.alpinelinux.org/alpine/tsc/-/issues/55 Future of busybox]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=GCC&amp;diff=26856</id>
		<title>GCC</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=GCC&amp;diff=26856"/>
		<updated>2024-06-22T17:11:31Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: Remove deprecated libc-dev&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://gcc.gnu.org/ GCC], which stands for GNU Compiler Collection, is a free, open-source compiler system produced by the [https://gnu.org/ GNU Project].&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
The quickest way to get started with GCC on Alpine Linux is by issuing the following command:&lt;br /&gt;
{{cmd|# apk add {{pkg|build-base}}}}&lt;br /&gt;
&lt;br /&gt;
{{pkg|build-base}} is a meta-package that will install the {{pkg|gcc}}, {{pkg|musl-dev}} and {{pkg|binutils}} packages (amongst others).&lt;br /&gt;
&lt;br /&gt;
For a smaller install you may install just {{pkg|gcc}} but will also need at least {{pkg|musl-dev}}.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Sertonix/Freedom_of_choice&amp;diff=26826</id>
		<title>User:Sertonix/Freedom of choice</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Sertonix/Freedom_of_choice&amp;diff=26826"/>
		<updated>2024-06-04T12:27:03Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: add note about dinit shutdown commands&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is an overview over the different available programms, etc. that can be selected from when using alpine. It is also intended as a reference what should be documented and what could be supported.&lt;br /&gt;
&lt;br /&gt;
== Bootloaders ==&lt;br /&gt;
* See: [[Bootloaders]]&lt;br /&gt;
* Not supported: &amp;lt;code&amp;gt;systemd-boot&amp;lt;/code&amp;gt; ([https://gitlab.com/postmarketOS/pmaports/-/tree/master/main/systemd-boot PostmarketOS does])&lt;br /&gt;
&lt;br /&gt;
== Kernel ==&lt;br /&gt;
* See: [[Kernels]]&lt;br /&gt;
&lt;br /&gt;
== Libc ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|musl}} || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| [https://www.gnu.org/software/libc/ glibc] || style=&amp;quot;background:red&amp;quot; | None || [[Running glibc programs]]&lt;br /&gt;
|-&lt;br /&gt;
| without aka static || style=&amp;quot;background:orange&amp;quot; | depends on package || Note that this only means no libc at runtime&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://gitlab.alpinelinux.org/alpine/tsc/-/issues/17 alpine-glibc]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Libc Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
== Initramfs ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|mkinitfs}} || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dracut}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|booster}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| [https://github.com/illiliti/tinyramfs tinyramfs] || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:red&amp;quot; | None || may require [[custom Kernel]], [https://kisslinux.org/install#021 kisslinux without initramfs]&lt;br /&gt;
|}&lt;br /&gt;
* See also: [[Initramfs init]]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Initramfs Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
== PID 1 ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| busybox init || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dinit}} || style=&amp;quot;background:orange&amp;quot; | In testing || Shutdown commands are prefixed with {{ic|dinit-}}. eg {{ic|dinit-reboot}}&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|s6-linux-init}} || style=&amp;quot;background:orange&amp;quot; | Works || Not integrated&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dumb-init}} || style=&amp;quot;background:silver&amp;quot; | Needs testing || For containers&lt;br /&gt;
|-&lt;br /&gt;
| runit-init || style=&amp;quot;background:silver&amp;quot; | Needs testing || [https://dev.alpinelinux.org/~clandmeter/other/forum.alpinelinux.org/comment/383.html#comment-383 runit-init starting OpenRC]&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|epoch}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| openrc-init || style=&amp;quot;background:red&amp;quot; | None || Is excluded from the {{pkg|openrc}} package&lt;br /&gt;
|-&lt;br /&gt;
| [https://core.suckless.org/sinit/ sinit] || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| [https://ewontfix.com/14/ Felker init] || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Init_system Gentoo Wiki]&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Init Archwiki]&lt;br /&gt;
&lt;br /&gt;
== Service Manager ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[OpenRC]] || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dinit}} || style=&amp;quot;background:orange&amp;quot; | In testing || {{Pkg|dinit-alpine}} includes service files&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|s6-rc}} || style=&amp;quot;background:orange&amp;quot; | Works || Not integrated&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|runit}} || style=&amp;quot;background:orange&amp;quot; | As OpenRC service ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|daemontools}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|daemontools-encore}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|supervisor}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| busybox runit || style=&amp;quot;background:red&amp;quot; | None || Not enabled in a busybox package&lt;br /&gt;
|-&lt;br /&gt;
| [https://core.suckless.org/svc/ svc] || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Init_system Gentoo Wiki]&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Init Archwiki]&lt;br /&gt;
&lt;br /&gt;
== System Logs ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[Syslog#busybox_syslog|busybox syslog]] || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|rsyslog}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|syslog-ng}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{pkg|socklog}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| [https://skarnet.org/software/s6/s6-socklog.html s6-socklog] from {{pkg|s6}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd-journald || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|}&lt;br /&gt;
* See also: [[Syslog]]&lt;br /&gt;
&lt;br /&gt;
== [[Device Manager]] ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[mdev]] || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| [[mdevd]] || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| [[eudev]] || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| [https://core.suckless.org/smdev/ smdev] || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| vdev || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd-udev || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Power Managment ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[busybox acpid]] || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|acpid}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|elogind}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd-logind || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Power_management Archwiki]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Power_management Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
== DHCP Client ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[Udhcpc|busybox udhcpc]] || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dhcpcd}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dhclient}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| [https://core.suckless.org/sdhcp/ sdhcp] || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| without aka static || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|}&lt;br /&gt;
* See also: [[Configure Networking]]&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Network_configuration#DHCP Archwiki]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Resolv.conf Gentoo Wiki - resolv.conf]&lt;br /&gt;
&lt;br /&gt;
== Wi-Fi ==&lt;br /&gt;
* See: [[Wi-Fi]]&lt;br /&gt;
* Also supported: {{pkg|eiwd}}&lt;br /&gt;
&lt;br /&gt;
== Seat/Session Managnent ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[elogind]] || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|seatd}} || style=&amp;quot;background:lime&amp;quot; | Full || seats only&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|turnstile}} || style=&amp;quot;background:silver&amp;quot; | needs testing || session only&lt;br /&gt;
|-&lt;br /&gt;
| systemd-logind || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full || Not recommended with graphical enviroment&lt;br /&gt;
|}&lt;br /&gt;
* [https://wiki.gentoo.org/wiki/Seatd Gentoo Wiki - seatd]&lt;br /&gt;
* [https://wiki.gentoo.org/wiki/Elogind Gentoo Wiki - elogind]&lt;br /&gt;
* [https://wiki.archlinux.org/title/Init#logind ArchWiki - systemd-logind]&lt;br /&gt;
* [https://chimera-linux.org/docs/configuration/seat Chimera Linux docs]&lt;br /&gt;
&lt;br /&gt;
== Login ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Supports [[PAM]] !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| busybox login || style=&amp;quot;background:lime&amp;quot; | Full || style=&amp;quot;background:red&amp;quot; | No || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|greetd}} || style=&amp;quot;background:lime&amp;quot; | Full || style=&amp;quot;background:lime&amp;quot; | Yes || requires greeter&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|shadow-login}} || style=&amp;quot;background:lime&amp;quot; | Full || style=&amp;quot;background:lime&amp;quot; | Yes ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|util-linux-login}} || style=&amp;quot;background:lime&amp;quot; | Full || style=&amp;quot;background:lime&amp;quot; | Yes ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd-logind || style=&amp;quot;background:red&amp;quot; | None || style=&amp;quot;background:lime&amp;quot; | Yes || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full || style=&amp;quot;background:red&amp;quot; | No ||&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Login Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
== Shell Utils ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|busybox}} || style=&amp;quot;background:lime&amp;quot; | Full || Dependency of {{pkg|alpine-base}}&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|busybox-extras}} || style=&amp;quot;background:lime&amp;quot; | Full || Some commands that are missing in the busybox package&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|util-linux}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| [[GNU_core_utilities|coreutils]] || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|s6-portable-utils}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|s6-linux-utils}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|toybox}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|sbase}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|ubase}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:red&amp;quot; | None || A lot of implicit dependency&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Core_utilities Archwiki]&lt;br /&gt;
&lt;br /&gt;
== Shell ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| busybox ash || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|bash}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dash}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|yash}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| busybox hush || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:red&amp;quot; | None || sometimes implicit dependency&lt;br /&gt;
|}&lt;br /&gt;
* See also: [[Change default shell]]&lt;br /&gt;
* See proposal: [https://gitlab.alpinelinux.org/alpine/tsc/-/issues/39 replace busybox ash with another /bin/sh]&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Command-line_shell Archwiki]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Shell Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
== SU ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| su from {{Pkg|busybox-suid}} || style=&amp;quot;background:lime&amp;quot; | Full || default, can&#039;t be removed by default ({{issue|11730}})&lt;br /&gt;
|-&lt;br /&gt;
| su from {{Pkg|shadow-login}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| su from {{Pkg|util-linux-login}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|sudo}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|doas}} || style=&amp;quot;background:lime&amp;quot; | Full || sudo shim using doas: {{Pkg|doas-sudo-shim}}&lt;br /&gt;
|-&lt;br /&gt;
| [https://skarnet.org/software/s6/s6-sudo.html s6-sudo] || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SSL/TLS ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|openssl}} || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|libressl}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|bearssl}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://gitlab.alpinelinux.org/alpine/tsc/-/issues/28 consider LibreSSL as default OpenSSL provider again]&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Transport_Layer_Security Archwiki]&lt;br /&gt;
* See also: [https://github.com/haproxy/wiki/wiki/SSL-Libraries-Support-Status haproxy SSL Libraries Support Status]&lt;br /&gt;
&lt;br /&gt;
== Cron ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|cronie}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dcron}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|fcron}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| vixie-cron || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| scron || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd.timer || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full || alpine-baselayout includes cron specific directories though&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Cron Archwiki]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Cron Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
== SSH ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[Setting_up_a_SSH_server#OpenSSH|openssh]] || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| [[Setting_up_a_SSH_server#Dropbear|dropbear]] || style=&amp;quot;background:lime&amp;quot; | Full || provide ssh command {{pkg|dropbear-ssh}}&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Secure_Shell Archwiki]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/SSH Gentoo Wiki - OpenSSH]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Dropbear Gentoo Wiki - Dropbear]&lt;br /&gt;
&lt;br /&gt;
== Desktop ==&lt;br /&gt;
* See: [[Desktop environments and Window managers]]&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Architecture|Alpine Architecture]]&lt;br /&gt;
* [https://gitlab.alpinelinux.org/alpine/tsc/-/issues/55 Future of busybox]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Sertonix/Freedom_of_choice&amp;diff=26825</id>
		<title>User:Sertonix/Freedom of choice</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Sertonix/Freedom_of_choice&amp;diff=26825"/>
		<updated>2024-06-04T12:20:30Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: Add notes that postmarketOS supports systemd&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is an overview over the different available programms, etc. that can be selected from when using alpine. It is also intended as a reference what should be documented and what could be supported.&lt;br /&gt;
&lt;br /&gt;
== Bootloaders ==&lt;br /&gt;
* See: [[Bootloaders]]&lt;br /&gt;
* Not supported: &amp;lt;code&amp;gt;systemd-boot&amp;lt;/code&amp;gt; ([https://gitlab.com/postmarketOS/pmaports/-/tree/master/main/systemd-boot PostmarketOS does])&lt;br /&gt;
&lt;br /&gt;
== Kernel ==&lt;br /&gt;
* See: [[Kernels]]&lt;br /&gt;
&lt;br /&gt;
== Libc ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|musl}} || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| [https://www.gnu.org/software/libc/ glibc] || style=&amp;quot;background:red&amp;quot; | None || [[Running glibc programs]]&lt;br /&gt;
|-&lt;br /&gt;
| without aka static || style=&amp;quot;background:orange&amp;quot; | depends on package || Note that this only means no libc at runtime&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://gitlab.alpinelinux.org/alpine/tsc/-/issues/17 alpine-glibc]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Libc Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
== Initramfs ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|mkinitfs}} || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dracut}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|booster}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| [https://github.com/illiliti/tinyramfs tinyramfs] || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:red&amp;quot; | None || may require [[custom Kernel]], [https://kisslinux.org/install#021 kisslinux without initramfs]&lt;br /&gt;
|}&lt;br /&gt;
* See also: [[Initramfs init]]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Initramfs Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
== PID 1 ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| busybox init || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dinit}} || style=&amp;quot;background:orange&amp;quot; | In testing ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|s6-linux-init}} || style=&amp;quot;background:orange&amp;quot; | Works || Not integrated&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dumb-init}} || style=&amp;quot;background:silver&amp;quot; | Needs testing || For containers&lt;br /&gt;
|-&lt;br /&gt;
| runit-init || style=&amp;quot;background:silver&amp;quot; | Needs testing || [https://dev.alpinelinux.org/~clandmeter/other/forum.alpinelinux.org/comment/383.html#comment-383 runit-init starting OpenRC]&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|epoch}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| openrc-init || style=&amp;quot;background:red&amp;quot; | None || Is excluded from the {{pkg|openrc}} package&lt;br /&gt;
|-&lt;br /&gt;
| [https://core.suckless.org/sinit/ sinit] || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| [https://ewontfix.com/14/ Felker init] || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Init_system Gentoo Wiki]&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Init Archwiki]&lt;br /&gt;
&lt;br /&gt;
== Service Manager ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[OpenRC]] || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dinit}} || style=&amp;quot;background:orange&amp;quot; | In testing || {{Pkg|dinit-alpine}} includes service files&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|s6-rc}} || style=&amp;quot;background:orange&amp;quot; | Works || Not integrated&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|runit}} || style=&amp;quot;background:orange&amp;quot; | As OpenRC service ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|daemontools}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|daemontools-encore}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|supervisor}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| busybox runit || style=&amp;quot;background:red&amp;quot; | None || Not enabled in a busybox package&lt;br /&gt;
|-&lt;br /&gt;
| [https://core.suckless.org/svc/ svc] || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Init_system Gentoo Wiki]&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Init Archwiki]&lt;br /&gt;
&lt;br /&gt;
== System Logs ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[Syslog#busybox_syslog|busybox syslog]] || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|rsyslog}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|syslog-ng}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{pkg|socklog}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| [https://skarnet.org/software/s6/s6-socklog.html s6-socklog] from {{pkg|s6}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd-journald || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|}&lt;br /&gt;
* See also: [[Syslog]]&lt;br /&gt;
&lt;br /&gt;
== [[Device Manager]] ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[mdev]] || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| [[mdevd]] || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| [[eudev]] || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| [https://core.suckless.org/smdev/ smdev] || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| vdev || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd-udev || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Power Managment ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[busybox acpid]] || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|acpid}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|elogind}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd-logind || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Power_management Archwiki]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Power_management Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
== DHCP Client ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[Udhcpc|busybox udhcpc]] || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dhcpcd}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dhclient}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| [https://core.suckless.org/sdhcp/ sdhcp] || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| without aka static || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|}&lt;br /&gt;
* See also: [[Configure Networking]]&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Network_configuration#DHCP Archwiki]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Resolv.conf Gentoo Wiki - resolv.conf]&lt;br /&gt;
&lt;br /&gt;
== Wi-Fi ==&lt;br /&gt;
* See: [[Wi-Fi]]&lt;br /&gt;
* Also supported: {{pkg|eiwd}}&lt;br /&gt;
&lt;br /&gt;
== Seat/Session Managnent ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[elogind]] || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|seatd}} || style=&amp;quot;background:lime&amp;quot; | Full || seats only&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|turnstile}} || style=&amp;quot;background:silver&amp;quot; | needs testing || session only&lt;br /&gt;
|-&lt;br /&gt;
| systemd-logind || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full || Not recommended with graphical enviroment&lt;br /&gt;
|}&lt;br /&gt;
* [https://wiki.gentoo.org/wiki/Seatd Gentoo Wiki - seatd]&lt;br /&gt;
* [https://wiki.gentoo.org/wiki/Elogind Gentoo Wiki - elogind]&lt;br /&gt;
* [https://wiki.archlinux.org/title/Init#logind ArchWiki - systemd-logind]&lt;br /&gt;
* [https://chimera-linux.org/docs/configuration/seat Chimera Linux docs]&lt;br /&gt;
&lt;br /&gt;
== Login ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Supports [[PAM]] !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| busybox login || style=&amp;quot;background:lime&amp;quot; | Full || style=&amp;quot;background:red&amp;quot; | No || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|greetd}} || style=&amp;quot;background:lime&amp;quot; | Full || style=&amp;quot;background:lime&amp;quot; | Yes || requires greeter&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|shadow-login}} || style=&amp;quot;background:lime&amp;quot; | Full || style=&amp;quot;background:lime&amp;quot; | Yes ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|util-linux-login}} || style=&amp;quot;background:lime&amp;quot; | Full || style=&amp;quot;background:lime&amp;quot; | Yes ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd-logind || style=&amp;quot;background:red&amp;quot; | None || style=&amp;quot;background:lime&amp;quot; | Yes || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full || style=&amp;quot;background:red&amp;quot; | No ||&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Login Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
== Shell Utils ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|busybox}} || style=&amp;quot;background:lime&amp;quot; | Full || Dependency of {{pkg|alpine-base}}&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|busybox-extras}} || style=&amp;quot;background:lime&amp;quot; | Full || Some commands that are missing in the busybox package&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|util-linux}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| [[GNU_core_utilities|coreutils]] || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|s6-portable-utils}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|s6-linux-utils}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|toybox}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|sbase}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|ubase}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:red&amp;quot; | None || A lot of implicit dependency&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Core_utilities Archwiki]&lt;br /&gt;
&lt;br /&gt;
== Shell ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| busybox ash || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|bash}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dash}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|yash}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| busybox hush || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:red&amp;quot; | None || sometimes implicit dependency&lt;br /&gt;
|}&lt;br /&gt;
* See also: [[Change default shell]]&lt;br /&gt;
* See proposal: [https://gitlab.alpinelinux.org/alpine/tsc/-/issues/39 replace busybox ash with another /bin/sh]&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Command-line_shell Archwiki]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Shell Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
== SU ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| su from {{Pkg|busybox-suid}} || style=&amp;quot;background:lime&amp;quot; | Full || default, can&#039;t be removed by default ({{issue|11730}})&lt;br /&gt;
|-&lt;br /&gt;
| su from {{Pkg|shadow-login}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| su from {{Pkg|util-linux-login}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|sudo}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|doas}} || style=&amp;quot;background:lime&amp;quot; | Full || sudo shim using doas: {{Pkg|doas-sudo-shim}}&lt;br /&gt;
|-&lt;br /&gt;
| [https://skarnet.org/software/s6/s6-sudo.html s6-sudo] || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SSL/TLS ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|openssl}} || style=&amp;quot;background:lime&amp;quot; | Full || Default&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|libressl}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|bearssl}} || style=&amp;quot;background:silver&amp;quot; | Needs testing ||&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://gitlab.alpinelinux.org/alpine/tsc/-/issues/28 consider LibreSSL as default OpenSSL provider again]&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Transport_Layer_Security Archwiki]&lt;br /&gt;
* See also: [https://github.com/haproxy/wiki/wiki/SSL-Libraries-Support-Status haproxy SSL Libraries Support Status]&lt;br /&gt;
&lt;br /&gt;
== Cron ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|cronie}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|dcron}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| {{Pkg|fcron}} || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| vixie-cron || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| scron || style=&amp;quot;background:red&amp;quot; | None ||&lt;br /&gt;
|-&lt;br /&gt;
| systemd.timer || style=&amp;quot;background:red&amp;quot; | None || Supported by postmarketOS&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full || alpine-baselayout includes cron specific directories though&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Cron Archwiki]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Cron Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
== SSH ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Support !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[Setting_up_a_SSH_server#OpenSSH|openssh]] || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|-&lt;br /&gt;
| [[Setting_up_a_SSH_server#Dropbear|dropbear]] || style=&amp;quot;background:lime&amp;quot; | Full || provide ssh command {{pkg|dropbear-ssh}}&lt;br /&gt;
|-&lt;br /&gt;
| without || style=&amp;quot;background:lime&amp;quot; | Full ||&lt;br /&gt;
|}&lt;br /&gt;
* See also: [https://wiki.archlinux.org/title/Secure_Shell Archwiki]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/SSH Gentoo Wiki - OpenSSH]&lt;br /&gt;
* See also: [https://wiki.gentoo.org/wiki/Dropbear Gentoo Wiki - Dropbear]&lt;br /&gt;
&lt;br /&gt;
== Desktop ==&lt;br /&gt;
* See: [[Desktop environments and Window managers]]&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Architecture|Alpine Architecture]]&lt;br /&gt;
* [https://gitlab.alpinelinux.org/alpine/tsc/-/issues/55 Future of busybox]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Sway&amp;diff=26592</id>
		<title>Sway</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Sway&amp;diff=26592"/>
		<updated>2024-03-06T21:43:26Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: /* Install greetd (optional) */ link to greetd pahe&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://swaywm.org Sway] is a tiling [[Wayland]] compositor and a drop-in replacement for the i3 window manager for X11. It works with your existing i3 configuration and supports most of i3&#039;s features, plus a few extras.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
=== Add a normal user ===&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;setup-user&amp;lt;/code&amp;gt; to add a non-system normal user for running Sway.&lt;br /&gt;
&lt;br /&gt;
=== Set up eudev ===&lt;br /&gt;
&lt;br /&gt;
[[eudev]] is recommended and required for. Without it, sway cannot connect to input devices.&lt;br /&gt;
&lt;br /&gt;
 setup-devd udev&lt;br /&gt;
&lt;br /&gt;
=== Install Graphics Drivers ===&lt;br /&gt;
&lt;br /&gt;
Graphics drivers:&lt;br /&gt;
&lt;br /&gt;
* [[Intel Video]]&lt;br /&gt;
* [[Radeon Video]]&lt;br /&gt;
* [[Nvidia Video]]&lt;br /&gt;
&lt;br /&gt;
=== Setting up a seat manager ===&lt;br /&gt;
&lt;br /&gt;
Wayland compositors need raw access to input and output devices. This is mediated by a [[seat manager]]. Using either [[seatd]] or [[elogind]] is supported. Using both may lead to conflicts.&lt;br /&gt;
&lt;br /&gt;
==== Install seatd ====&lt;br /&gt;
&lt;br /&gt;
See [[Seatd]].&lt;br /&gt;
&lt;br /&gt;
==== Install elogind ====&lt;br /&gt;
&lt;br /&gt;
See [[Elogind]].&lt;br /&gt;
&lt;br /&gt;
===== Elogind and swayidle =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;swayidle&amp;lt;/code&amp;gt; has integration with &amp;lt;code&amp;gt;elogind&amp;lt;/code&amp;gt; and can handle &amp;lt;code&amp;gt;before-sleep&amp;lt;/code&amp;gt; events.&lt;br /&gt;
&lt;br /&gt;
If using &amp;lt;code&amp;gt;swayidle before-sleep&amp;lt;/code&amp;gt;, there will be a race condition, so that when you resume the computer from suspend, the screen shows the contents of the unlocked screen for a second before showing the actual lock screen.  This can be a privacy concern.&lt;br /&gt;
&lt;br /&gt;
To solve this issue, do the following:&lt;br /&gt;
&lt;br /&gt;
Create this file &amp;lt;code&amp;gt;/etc/elogind/system-sleep/10-swaylock.sh&amp;lt;/code&amp;gt;, then add the following script to this file:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 if [ &amp;quot;${1}&amp;quot; == &amp;quot;pre&amp;quot; ]; then&lt;br /&gt;
   touch /tmp/swaylock-sleep&lt;br /&gt;
   sleep 1&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
Then set it to executable.&lt;br /&gt;
&lt;br /&gt;
Later, once sway is installed, add the following line to sway config:&lt;br /&gt;
&lt;br /&gt;
 # in ~/.config/sway/config&lt;br /&gt;
 exec touch /tmp/swaylock-sleep &amp;amp;&amp;amp; inotifyd swaylock /tmp/swaylock-sleep&lt;br /&gt;
&lt;br /&gt;
With this line, the screen will be promptly locked before suspend-to-RAM starts.&lt;br /&gt;
&lt;br /&gt;
=== Install greetd (optional) ===&lt;br /&gt;
&lt;br /&gt;
{{Box YELLOW|Note:|This content is tangential, and should be moved into the &#039;[[greetd]]&#039; page}} &lt;br /&gt;
&lt;br /&gt;
 apk add greetd greetd-gtkgreet cage&lt;br /&gt;
 rc-update add greetd&lt;br /&gt;
 adduser greetd seat&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;code&amp;gt;/etc/greetd/config.toml&amp;lt;/code&amp;gt;, set&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[default_session]&lt;br /&gt;
&lt;br /&gt;
command = &amp;quot;cage -s -- gtkgreet&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To use a graphical greeter with seatd add &amp;lt;code&amp;gt;rc_need=seatd&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/etc/conf.d/greetd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;code&amp;gt;/etc/greetd/environments&amp;lt;/code&amp;gt;, set&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Launch Sway with a D-Bus server available, use:&lt;br /&gt;
dbus-run-session -- sway&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
D-Bus is required for PipeWire and screensharing in Firefox and Chromium. Running with &amp;lt;code&amp;gt;dbus-run-session&amp;lt;/code&amp;gt; is a convenience wrapper that will explicitly export the path of the session bus.&lt;br /&gt;
&lt;br /&gt;
=== Install fonts ===&lt;br /&gt;
&lt;br /&gt;
Install DejaVu fonts, which has good Unicode coverage:&lt;br /&gt;
&lt;br /&gt;
 apk add font-dejavu&lt;br /&gt;
&lt;br /&gt;
=== Install Sway ===&lt;br /&gt;
&lt;br /&gt;
 apk add sway \&lt;br /&gt;
    xwayland             \ # if you need xserver&lt;br /&gt;
    foot                 \ # default terminal emulator. Modify $term in config for a different one.&lt;br /&gt;
    wmenu                \ # default wayland native menu for choosing program and screensharing monitor&lt;br /&gt;
    swaylock swaylockd   \ # lockscreen tool&lt;br /&gt;
    grim                 \ # screenshot tool&lt;br /&gt;
    wl-clipboard         \ # clipboard management&lt;br /&gt;
    i3status             \ # simple status bar&lt;br /&gt;
    swayidle               # idle management (DPMS) daemon&lt;br /&gt;
&lt;br /&gt;
For complimentary software alternatives, see [https://github.com/swaywm/sway/wiki/Useful-add-ons-for-sway the relevant page from sway&#039;s wiki] or [https://wiki.gentoo.org/wiki/List_of_software_for_Wayland this list at Gentoo Wiki.]&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
Copy default sway configuration to &amp;lt;code&amp;gt;~/.config&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 # as normal user&lt;br /&gt;
 mkdir -p ~/.config/sway&lt;br /&gt;
 cp /etc/sway/config ~/.config/sway/&lt;br /&gt;
&lt;br /&gt;
Read through it to learn the default keybindings.&lt;br /&gt;
Sway configuration is mostly backwards-compatible with that of [[I3wm|i3]] and if you are looking for a solution for a specific issue, you may also try checking if it hasn&#039;t been provided for i3WM.&lt;br /&gt;
&lt;br /&gt;
For additional information, start at &amp;lt;code&amp;gt;man 5 sway&amp;lt;/code&amp;gt; and read the [https://github.com/swaywm/sway/wiki upstream wiki].&lt;br /&gt;
&lt;br /&gt;
== PipeWire and enable screensharing ==&lt;br /&gt;
&lt;br /&gt;
For audio playback, either PipeWire or PulseAudio work fine. The compositor has no involvement in audio playback.&lt;br /&gt;
&lt;br /&gt;
For screen sharing, applications are split into two categories:&lt;br /&gt;
&lt;br /&gt;
* Those which use the native wayland protocol, &amp;lt;/code&amp;gt;wlr-screencopy&amp;lt;/code&amp;gt;&lt;br /&gt;
* Those which use the API from Flatpak&#039;s &amp;lt;code&amp;gt;xdg-desktop-portal&amp;lt;/code&amp;gt; (this portal is also used by native non-Flatpak applications).&lt;br /&gt;
&lt;br /&gt;
Applications in the first group require not additional setup. Applications in the second group (which includes Firefox and Chromium) require setting up pipewire, wireplumber and xdg portals:&lt;br /&gt;
&lt;br /&gt;
{{Todo|Move this content into [[PipeWire]].}} &lt;br /&gt;
&lt;br /&gt;
 apk add pipewire pipewire-pulse pipewire-tools&lt;br /&gt;
 apk add wireplumber&lt;br /&gt;
 apk add xdg-desktop-portal xdg-desktop-portal-wlr&lt;br /&gt;
&lt;br /&gt;
Launch PipeWire with Sway. Use your service manager of choice, or add the following to sway config:&lt;br /&gt;
&lt;br /&gt;
 exec /usr/libexec/pipewire-launcher&lt;br /&gt;
&lt;br /&gt;
If your are using automatic D-Bus activation, you also need to set DBus variables for the portal and screensharing features to work:&lt;br /&gt;
&lt;br /&gt;
 exec dbus-update-activation-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway&lt;br /&gt;
&lt;br /&gt;
{{Box YELLOW|Unclear:|The following paragraph is unclear and needs further work}} &lt;br /&gt;
&lt;br /&gt;
Replace dmenu (depends on X server) with bemenu (Wayland native) for launching programs and selecting which screen to share in Firefox/Chromium:&lt;br /&gt;
&lt;br /&gt;
 set $menu bemenu-run | xargs swaymsg exec&lt;br /&gt;
&lt;br /&gt;
== Screen lock and suspend-to-RAM ==&lt;br /&gt;
&lt;br /&gt;
=== Without elogind ===&lt;br /&gt;
&lt;br /&gt;
Consider using {{Pkg|powerctl}}.&lt;br /&gt;
&lt;br /&gt;
=== With elogind ===&lt;br /&gt;
&lt;br /&gt;
Putting the system to sleep with elogind requires elevated privileges or additional configuration.&lt;br /&gt;
&lt;br /&gt;
For details on configuring &amp;lt;code&amp;gt;doas&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;elogind&amp;lt;/code&amp;gt;, see [[Elogind#Doas]]&lt;br /&gt;
&lt;br /&gt;
To put the system to sleep after 600 seconds, use:&lt;br /&gt;
&lt;br /&gt;
 exec swayidle -w timeout 600 &#039;doas /bin/loginctl suspend&#039;&lt;br /&gt;
&lt;br /&gt;
loginctl suspend command will trigger the screenlock, as mentioned in the section [[#Install elogind (optional)|Install elogind (optional)]] above.&lt;br /&gt;
&lt;br /&gt;
Do not lock the screen if program is running in full screen:&lt;br /&gt;
&lt;br /&gt;
 for_window [app_id=&amp;quot;^.*&amp;quot;] inhibit_idle fullscreen&lt;br /&gt;
&lt;br /&gt;
== Brightness control ==&lt;br /&gt;
&lt;br /&gt;
Controlling display backlight requires either the proper udev rules, or using some form of privilege escalation.&lt;br /&gt;
&lt;br /&gt;
{{Pkg|brightnessctl}} is a reliable alternative, although its default udev rules require too wide permissions (see {{Issue|15409}}). You may need your own rules, or configure doas to allow running it as an unprivileged user.&lt;br /&gt;
&lt;br /&gt;
Optionally enable brightnessctl service to restore brightness settings on reboot:&lt;br /&gt;
&lt;br /&gt;
 rc-update add brightnessctl&lt;br /&gt;
&lt;br /&gt;
== Output scaling for high resolution displays ==&lt;br /&gt;
&lt;br /&gt;
Without further configuration, program interfaces might be too small to use on high resolution displays.&lt;br /&gt;
&lt;br /&gt;
Sway supports the per-display configuration of&lt;br /&gt;
&lt;br /&gt;
* fractional (e.g., 1.5x), and&lt;br /&gt;
* integer scaling (e.g., 2x) &lt;br /&gt;
&lt;br /&gt;
However, fractional scaling is discouraged due to both the performance impact and the blurry output it produces. In this case, where 1x scaling is too small and 2x scaling is too large, program-specific GTK/QT based scaling is recommended.  See below.&lt;br /&gt;
&lt;br /&gt;
To enable Sway scaling, the user can first preview different scaling factors with &amp;lt;code&amp;gt;wdisplays&amp;lt;/code&amp;gt; package.  Note the output name (eDP-1, LVDS-1) and try apply scaling factors such as 1 and 2.  To make changes permanent, add&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
output &amp;lt;name&amp;gt; scale &amp;lt;factor&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to ~/.config/sway/config.&lt;br /&gt;
&lt;br /&gt;
To use toolkit scaling, use&lt;br /&gt;
{{Cmd|# for GTK-based programs such as firefox and emacs:&lt;br /&gt;
export GDK_DPI_SCALE{{=}}2&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; for QT-based programs&lt;br /&gt;
export QT_WAYLAND_FORCE_DPI{{=}}&amp;quot;physical&amp;quot;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; or if still too small, use a custom DPI&lt;br /&gt;
export QT_WAYLAND_FORCE_DPI{{=}}192 # 2x scaling&lt;br /&gt;
export QT_QPA_PLATFORM{{=}}&amp;quot;wayland-egl&amp;quot;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Screenshots ==&lt;br /&gt;
A simple tool that works well under Wayland is Grimshot. Example keybindings:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bindsym Print exec grimshot copy area&lt;br /&gt;
bindsym Shift+Print exec grimshot copy screen&lt;br /&gt;
bindsym Control+Print exec grimshot save area ~/Pictures/$(date +%d-%m-%Y-%H-%M-%S).png&lt;br /&gt;
bindsym Control+Shift+Print exec grimshot save screen ~/Pictures/$(date +%d-%m-%Y-%H-%M-%S).png&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/swaywm/sway/wiki/Useful-add-ons-for-sway the sway wiki&#039;s article] for a list of screenshot tools.&lt;br /&gt;
&lt;br /&gt;
== Tweaks ==&lt;br /&gt;
&lt;br /&gt;
=== Make clipboard content persistent ===&lt;br /&gt;
By default the clipboard content does not persist after terminating the program: you copy some text from Firefox and then exit Firefox, the copied text is also lost.&lt;br /&gt;
&lt;br /&gt;
Install clipman from testing repo and add the following to sway config:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
exec wl-paste --type text/plain --watch clipman store --histpath=&amp;quot;~/.local/state/clipman-primary.json&amp;quot;&lt;br /&gt;
bindsym $mod+h exec clipman pick --tool wofi --histpath=&amp;quot;~/.local/state/clipman-primary.json&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Firefox picture-in-picture mode/floating windows ===&lt;br /&gt;
Add this to your sway config file (modify the numeric values to suit your needs and your display):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for_window [app_id=&amp;quot;firefox&amp;quot; title=&amp;quot;^Picture-in-Picture$&amp;quot;] floating enable, move position 877 450, sticky enable, border none&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Start with NumLock enabled ===&lt;br /&gt;
Add this to your sway config file:&lt;br /&gt;
&amp;lt;code&amp;gt;input type:keyboard xkb_numlock enabled&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Change mouse cursor theme and size ===&lt;br /&gt;
Add to your sway config:&lt;br /&gt;
&lt;br /&gt;
 seat seat0 xcursor_theme my_cursor_theme my_cursor_size&lt;br /&gt;
&lt;br /&gt;
For example, set a mouse cursor, using GNOME Adwaita theme:&lt;br /&gt;
&lt;br /&gt;
 seat seat0 xcursor_theme Adwaita 16&lt;br /&gt;
&lt;br /&gt;
You can inspect their values with &amp;lt;code&amp;gt;echo $XCURSOR_SIZE&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;echo $XCURSOR_THEME&amp;lt;/code&amp;gt;. If reloading your config does not result in change, try logging out and in.&lt;br /&gt;
&lt;br /&gt;
{{Note|Wayland allows for client-side cursors. It is possible that applications do not evaluate the values of &amp;lt;code&amp;gt;$XCURSOR_SIZE&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;$XCURSOR_THEME&amp;lt;/code&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
=== Custom keyboard layout ===&lt;br /&gt;
&lt;br /&gt;
To use custom keyboard layout, just use&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
input type:keyboard {&lt;br /&gt;
  xkb_file /path/to/my/custom/layout&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Changing default application fonts ===&lt;br /&gt;
&lt;br /&gt;
See [[Fontconfig]]&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
If you encounter any issues, try running &amp;lt;code&amp;gt;sway -Vc /etc/sway/config&amp;lt;/code&amp;gt;. It will run sway with the default config file and set the output to be more verbose. It is generally a good idea to track your config files with git (when and if at all you use a remote repository for them, keep it private for security reasons). &lt;br /&gt;
&lt;br /&gt;
=== Flatpaks ===&lt;br /&gt;
{{main|Flatpak}}&lt;br /&gt;
Due to their sandboxing, flatpaks require the use of a portal frontend (xdg-desktop-portal) and backends (such as xdg-desktop-portal-wlr, xdg-desktop-portal-gtk, xdg-desktop-portal-gnome) that implement the methods. When in doubt, install multiple backends. For more information on backends, see [https://github.com/flatpak/xdg-desktop-portal/#using-portals flatpak&#039;s page on the subject]. In addition to the steps under the &amp;quot;Firefox Screensharing&amp;quot; section, it may also be necessary to launch additional backends in your Sway config file. Otherwise, you may run into GDBus errors as your flatpak fails to interface with the portal. This can cause issues such as with opening your file directories from a flatpak application.&lt;br /&gt;
&lt;br /&gt;
After installing different backends, you might need to add the relevant backends to your sway config file similarly to in the &amp;quot;Firefox Screensharing&amp;quot; section above. For example, an autostart section of your sway config file may include:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
exec /usr/libexec/xdg-desktop-portal-gtk&lt;br /&gt;
exec /usr/libexec/xdg-desktop-portal-wlr&lt;br /&gt;
exec /usr/libexec/xdg-desktop-portal-gnome&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is only needed if they are not started automatically via other means.&lt;br /&gt;
&lt;br /&gt;
=== Firefox (Flatpak) and/or GTK apps ===&lt;br /&gt;
==== Disappearing cursor ====&lt;br /&gt;
You may need to get an icon pack and possibly a theme from [https://www.pling.com/browse?cat=107&amp;amp;ord=latest Pling store] and set &amp;lt;code&amp;gt;GTK_THEME&amp;lt;/code&amp;gt; environmental variable. Alternatively you can install a theme      for all users (search [https://pkgs.alpinelinux.org/ Alpine Linux Packages] for &#039;&#039;*-icon-theme&#039;&#039;) using &amp;lt;code&amp;gt;apk add&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Missing file picker/cannot download ====&lt;br /&gt;
&lt;br /&gt;
Go to &#039;&#039;about:config&#039;&#039; and set &amp;lt;code&amp;gt;widget.use-xdg-desktop-portal.file-picker&amp;lt;/code&amp;gt; to 0.&lt;br /&gt;
&lt;br /&gt;
=== Failing to start under certain graphics cards/multiple wlroots stacked windows spawning upon start ===&lt;br /&gt;
As of Dec 31 2022, [https://developer.nvidia.com/docs/drive/drive-os/latest/linux/sdk/common/topics/window_system_stub/Gnome-WaylandDesktopShellSupport136.html Nvidia still doesn&#039;t fully support Wayland]. Therefore, the possible solutions are as outlined in the link, or setting your WLR_BACKENDS environmental variables to &amp;lt;code&amp;gt;drm,libinput&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;x11&amp;lt;/code&amp;gt; (add libinput here as well if you cannot use your mouse and keyboard after starting Sway). The latter also works for AMD/ATI cards (&#039;&#039;&#039;make sure to install libinput first&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
=== Sway socket not detected ===&lt;br /&gt;
&lt;br /&gt;
See [[Sway#Installation|Installation]] for instructions on how to set this environmental variable. This issue may occur with terminal multiplexers, such as [[tmux]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [https://wiki.archlinux.org/title/Sway Archwiki]&lt;br /&gt;
* [https://wiki.gentoo.org/wiki/Sway Gentoo Wiki]&lt;br /&gt;
* [https://wiki.postmarketos.org/wiki/Sway PostmarketOS Wiki]&lt;br /&gt;
&lt;br /&gt;
[[Category:Desktop]]&lt;br /&gt;
[[Category:Window Managers]]&lt;br /&gt;
[[Category:Wayland]]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Sway&amp;diff=26591</id>
		<title>Sway</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Sway&amp;diff=26591"/>
		<updated>2024-03-06T21:42:03Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: /* Setting up a seat manager */ link to &amp;#039;seat manager&amp;#039; page and more&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://swaywm.org Sway] is a tiling [[Wayland]] compositor and a drop-in replacement for the i3 window manager for X11. It works with your existing i3 configuration and supports most of i3&#039;s features, plus a few extras.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
=== Add a normal user ===&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;setup-user&amp;lt;/code&amp;gt; to add a non-system normal user for running Sway.&lt;br /&gt;
&lt;br /&gt;
=== Set up eudev ===&lt;br /&gt;
&lt;br /&gt;
[[eudev]] is recommended and required for. Without it, sway cannot connect to input devices.&lt;br /&gt;
&lt;br /&gt;
 setup-devd udev&lt;br /&gt;
&lt;br /&gt;
=== Install Graphics Drivers ===&lt;br /&gt;
&lt;br /&gt;
Graphics drivers:&lt;br /&gt;
&lt;br /&gt;
* [[Intel Video]]&lt;br /&gt;
* [[Radeon Video]]&lt;br /&gt;
* [[Nvidia Video]]&lt;br /&gt;
&lt;br /&gt;
=== Setting up a seat manager ===&lt;br /&gt;
&lt;br /&gt;
Wayland compositors need raw access to input and output devices. This is mediated by a [[seat manager]]. Using either [[seatd]] or [[elogind]] is supported. Using both may lead to conflicts.&lt;br /&gt;
&lt;br /&gt;
==== Install seatd ====&lt;br /&gt;
&lt;br /&gt;
See [[Seatd]].&lt;br /&gt;
&lt;br /&gt;
==== Install elogind ====&lt;br /&gt;
&lt;br /&gt;
See [[Elogind]].&lt;br /&gt;
&lt;br /&gt;
===== Elogind and swayidle =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;swayidle&amp;lt;/code&amp;gt; has integration with &amp;lt;code&amp;gt;elogind&amp;lt;/code&amp;gt; and can handle &amp;lt;code&amp;gt;before-sleep&amp;lt;/code&amp;gt; events.&lt;br /&gt;
&lt;br /&gt;
If using &amp;lt;code&amp;gt;swayidle before-sleep&amp;lt;/code&amp;gt;, there will be a race condition, so that when you resume the computer from suspend, the screen shows the contents of the unlocked screen for a second before showing the actual lock screen.  This can be a privacy concern.&lt;br /&gt;
&lt;br /&gt;
To solve this issue, do the following:&lt;br /&gt;
&lt;br /&gt;
Create this file &amp;lt;code&amp;gt;/etc/elogind/system-sleep/10-swaylock.sh&amp;lt;/code&amp;gt;, then add the following script to this file:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 if [ &amp;quot;${1}&amp;quot; == &amp;quot;pre&amp;quot; ]; then&lt;br /&gt;
   touch /tmp/swaylock-sleep&lt;br /&gt;
   sleep 1&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
Then set it to executable.&lt;br /&gt;
&lt;br /&gt;
Later, once sway is installed, add the following line to sway config:&lt;br /&gt;
&lt;br /&gt;
 # in ~/.config/sway/config&lt;br /&gt;
 exec touch /tmp/swaylock-sleep &amp;amp;&amp;amp; inotifyd swaylock /tmp/swaylock-sleep&lt;br /&gt;
&lt;br /&gt;
With this line, the screen will be promptly locked before suspend-to-RAM starts.&lt;br /&gt;
&lt;br /&gt;
=== Install greetd (optional) ===&lt;br /&gt;
&lt;br /&gt;
{{Box YELLOW|Note:|This content is tangential, and should be moved into the &#039;greetd&#039; page}} &lt;br /&gt;
&lt;br /&gt;
 apk add greetd greetd-gtkgreet cage&lt;br /&gt;
 rc-update add greetd&lt;br /&gt;
 adduser greetd seat&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;code&amp;gt;/etc/greetd/config.toml&amp;lt;/code&amp;gt;, set&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[default_session]&lt;br /&gt;
&lt;br /&gt;
command = &amp;quot;cage -s -- gtkgreet&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To use a graphical greeter with seatd add &amp;lt;code&amp;gt;rc_need=seatd&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/etc/conf.d/greetd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;code&amp;gt;/etc/greetd/environments&amp;lt;/code&amp;gt;, set&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Launch Sway with a D-Bus server available, use:&lt;br /&gt;
dbus-run-session -- sway&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
D-Bus is required for PipeWire and screensharing in Firefox and Chromium. Running with &amp;lt;code&amp;gt;dbus-run-session&amp;lt;/code&amp;gt; is a convenience wrapper that will explicitly export the path of the session bus.&lt;br /&gt;
&lt;br /&gt;
=== Install fonts ===&lt;br /&gt;
&lt;br /&gt;
Install DejaVu fonts, which has good Unicode coverage:&lt;br /&gt;
&lt;br /&gt;
 apk add font-dejavu&lt;br /&gt;
&lt;br /&gt;
=== Install Sway ===&lt;br /&gt;
&lt;br /&gt;
 apk add sway \&lt;br /&gt;
    xwayland             \ # if you need xserver&lt;br /&gt;
    foot                 \ # default terminal emulator. Modify $term in config for a different one.&lt;br /&gt;
    wmenu                \ # default wayland native menu for choosing program and screensharing monitor&lt;br /&gt;
    swaylock swaylockd   \ # lockscreen tool&lt;br /&gt;
    grim                 \ # screenshot tool&lt;br /&gt;
    wl-clipboard         \ # clipboard management&lt;br /&gt;
    i3status             \ # simple status bar&lt;br /&gt;
    swayidle               # idle management (DPMS) daemon&lt;br /&gt;
&lt;br /&gt;
For complimentary software alternatives, see [https://github.com/swaywm/sway/wiki/Useful-add-ons-for-sway the relevant page from sway&#039;s wiki] or [https://wiki.gentoo.org/wiki/List_of_software_for_Wayland this list at Gentoo Wiki.]&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
Copy default sway configuration to &amp;lt;code&amp;gt;~/.config&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 # as normal user&lt;br /&gt;
 mkdir -p ~/.config/sway&lt;br /&gt;
 cp /etc/sway/config ~/.config/sway/&lt;br /&gt;
&lt;br /&gt;
Read through it to learn the default keybindings.&lt;br /&gt;
Sway configuration is mostly backwards-compatible with that of [[I3wm|i3]] and if you are looking for a solution for a specific issue, you may also try checking if it hasn&#039;t been provided for i3WM.&lt;br /&gt;
&lt;br /&gt;
For additional information, start at &amp;lt;code&amp;gt;man 5 sway&amp;lt;/code&amp;gt; and read the [https://github.com/swaywm/sway/wiki upstream wiki].&lt;br /&gt;
&lt;br /&gt;
== PipeWire and enable screensharing ==&lt;br /&gt;
&lt;br /&gt;
For audio playback, either PipeWire or PulseAudio work fine. The compositor has no involvement in audio playback.&lt;br /&gt;
&lt;br /&gt;
For screen sharing, applications are split into two categories:&lt;br /&gt;
&lt;br /&gt;
* Those which use the native wayland protocol, &amp;lt;/code&amp;gt;wlr-screencopy&amp;lt;/code&amp;gt;&lt;br /&gt;
* Those which use the API from Flatpak&#039;s &amp;lt;code&amp;gt;xdg-desktop-portal&amp;lt;/code&amp;gt; (this portal is also used by native non-Flatpak applications).&lt;br /&gt;
&lt;br /&gt;
Applications in the first group require not additional setup. Applications in the second group (which includes Firefox and Chromium) require setting up pipewire, wireplumber and xdg portals:&lt;br /&gt;
&lt;br /&gt;
{{Todo|Move this content into [[PipeWire]].}} &lt;br /&gt;
&lt;br /&gt;
 apk add pipewire pipewire-pulse pipewire-tools&lt;br /&gt;
 apk add wireplumber&lt;br /&gt;
 apk add xdg-desktop-portal xdg-desktop-portal-wlr&lt;br /&gt;
&lt;br /&gt;
Launch PipeWire with Sway. Use your service manager of choice, or add the following to sway config:&lt;br /&gt;
&lt;br /&gt;
 exec /usr/libexec/pipewire-launcher&lt;br /&gt;
&lt;br /&gt;
If your are using automatic D-Bus activation, you also need to set DBus variables for the portal and screensharing features to work:&lt;br /&gt;
&lt;br /&gt;
 exec dbus-update-activation-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway&lt;br /&gt;
&lt;br /&gt;
{{Box YELLOW|Unclear:|The following paragraph is unclear and needs further work}} &lt;br /&gt;
&lt;br /&gt;
Replace dmenu (depends on X server) with bemenu (Wayland native) for launching programs and selecting which screen to share in Firefox/Chromium:&lt;br /&gt;
&lt;br /&gt;
 set $menu bemenu-run | xargs swaymsg exec&lt;br /&gt;
&lt;br /&gt;
== Screen lock and suspend-to-RAM ==&lt;br /&gt;
&lt;br /&gt;
=== Without elogind ===&lt;br /&gt;
&lt;br /&gt;
Consider using {{Pkg|powerctl}}.&lt;br /&gt;
&lt;br /&gt;
=== With elogind ===&lt;br /&gt;
&lt;br /&gt;
Putting the system to sleep with elogind requires elevated privileges or additional configuration.&lt;br /&gt;
&lt;br /&gt;
For details on configuring &amp;lt;code&amp;gt;doas&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;elogind&amp;lt;/code&amp;gt;, see [[Elogind#Doas]]&lt;br /&gt;
&lt;br /&gt;
To put the system to sleep after 600 seconds, use:&lt;br /&gt;
&lt;br /&gt;
 exec swayidle -w timeout 600 &#039;doas /bin/loginctl suspend&#039;&lt;br /&gt;
&lt;br /&gt;
loginctl suspend command will trigger the screenlock, as mentioned in the section [[#Install elogind (optional)|Install elogind (optional)]] above.&lt;br /&gt;
&lt;br /&gt;
Do not lock the screen if program is running in full screen:&lt;br /&gt;
&lt;br /&gt;
 for_window [app_id=&amp;quot;^.*&amp;quot;] inhibit_idle fullscreen&lt;br /&gt;
&lt;br /&gt;
== Brightness control ==&lt;br /&gt;
&lt;br /&gt;
Controlling display backlight requires either the proper udev rules, or using some form of privilege escalation.&lt;br /&gt;
&lt;br /&gt;
{{Pkg|brightnessctl}} is a reliable alternative, although its default udev rules require too wide permissions (see {{Issue|15409}}). You may need your own rules, or configure doas to allow running it as an unprivileged user.&lt;br /&gt;
&lt;br /&gt;
Optionally enable brightnessctl service to restore brightness settings on reboot:&lt;br /&gt;
&lt;br /&gt;
 rc-update add brightnessctl&lt;br /&gt;
&lt;br /&gt;
== Output scaling for high resolution displays ==&lt;br /&gt;
&lt;br /&gt;
Without further configuration, program interfaces might be too small to use on high resolution displays.&lt;br /&gt;
&lt;br /&gt;
Sway supports the per-display configuration of&lt;br /&gt;
&lt;br /&gt;
* fractional (e.g., 1.5x), and&lt;br /&gt;
* integer scaling (e.g., 2x) &lt;br /&gt;
&lt;br /&gt;
However, fractional scaling is discouraged due to both the performance impact and the blurry output it produces. In this case, where 1x scaling is too small and 2x scaling is too large, program-specific GTK/QT based scaling is recommended.  See below.&lt;br /&gt;
&lt;br /&gt;
To enable Sway scaling, the user can first preview different scaling factors with &amp;lt;code&amp;gt;wdisplays&amp;lt;/code&amp;gt; package.  Note the output name (eDP-1, LVDS-1) and try apply scaling factors such as 1 and 2.  To make changes permanent, add&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
output &amp;lt;name&amp;gt; scale &amp;lt;factor&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to ~/.config/sway/config.&lt;br /&gt;
&lt;br /&gt;
To use toolkit scaling, use&lt;br /&gt;
{{Cmd|# for GTK-based programs such as firefox and emacs:&lt;br /&gt;
export GDK_DPI_SCALE{{=}}2&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; for QT-based programs&lt;br /&gt;
export QT_WAYLAND_FORCE_DPI{{=}}&amp;quot;physical&amp;quot;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; or if still too small, use a custom DPI&lt;br /&gt;
export QT_WAYLAND_FORCE_DPI{{=}}192 # 2x scaling&lt;br /&gt;
export QT_QPA_PLATFORM{{=}}&amp;quot;wayland-egl&amp;quot;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Screenshots ==&lt;br /&gt;
A simple tool that works well under Wayland is Grimshot. Example keybindings:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bindsym Print exec grimshot copy area&lt;br /&gt;
bindsym Shift+Print exec grimshot copy screen&lt;br /&gt;
bindsym Control+Print exec grimshot save area ~/Pictures/$(date +%d-%m-%Y-%H-%M-%S).png&lt;br /&gt;
bindsym Control+Shift+Print exec grimshot save screen ~/Pictures/$(date +%d-%m-%Y-%H-%M-%S).png&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/swaywm/sway/wiki/Useful-add-ons-for-sway the sway wiki&#039;s article] for a list of screenshot tools.&lt;br /&gt;
&lt;br /&gt;
== Tweaks ==&lt;br /&gt;
&lt;br /&gt;
=== Make clipboard content persistent ===&lt;br /&gt;
By default the clipboard content does not persist after terminating the program: you copy some text from Firefox and then exit Firefox, the copied text is also lost.&lt;br /&gt;
&lt;br /&gt;
Install clipman from testing repo and add the following to sway config:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
exec wl-paste --type text/plain --watch clipman store --histpath=&amp;quot;~/.local/state/clipman-primary.json&amp;quot;&lt;br /&gt;
bindsym $mod+h exec clipman pick --tool wofi --histpath=&amp;quot;~/.local/state/clipman-primary.json&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Firefox picture-in-picture mode/floating windows ===&lt;br /&gt;
Add this to your sway config file (modify the numeric values to suit your needs and your display):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for_window [app_id=&amp;quot;firefox&amp;quot; title=&amp;quot;^Picture-in-Picture$&amp;quot;] floating enable, move position 877 450, sticky enable, border none&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Start with NumLock enabled ===&lt;br /&gt;
Add this to your sway config file:&lt;br /&gt;
&amp;lt;code&amp;gt;input type:keyboard xkb_numlock enabled&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Change mouse cursor theme and size ===&lt;br /&gt;
Add to your sway config:&lt;br /&gt;
&lt;br /&gt;
 seat seat0 xcursor_theme my_cursor_theme my_cursor_size&lt;br /&gt;
&lt;br /&gt;
For example, set a mouse cursor, using GNOME Adwaita theme:&lt;br /&gt;
&lt;br /&gt;
 seat seat0 xcursor_theme Adwaita 16&lt;br /&gt;
&lt;br /&gt;
You can inspect their values with &amp;lt;code&amp;gt;echo $XCURSOR_SIZE&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;echo $XCURSOR_THEME&amp;lt;/code&amp;gt;. If reloading your config does not result in change, try logging out and in.&lt;br /&gt;
&lt;br /&gt;
{{Note|Wayland allows for client-side cursors. It is possible that applications do not evaluate the values of &amp;lt;code&amp;gt;$XCURSOR_SIZE&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;$XCURSOR_THEME&amp;lt;/code&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
=== Custom keyboard layout ===&lt;br /&gt;
&lt;br /&gt;
To use custom keyboard layout, just use&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
input type:keyboard {&lt;br /&gt;
  xkb_file /path/to/my/custom/layout&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Changing default application fonts ===&lt;br /&gt;
&lt;br /&gt;
See [[Fontconfig]]&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
If you encounter any issues, try running &amp;lt;code&amp;gt;sway -Vc /etc/sway/config&amp;lt;/code&amp;gt;. It will run sway with the default config file and set the output to be more verbose. It is generally a good idea to track your config files with git (when and if at all you use a remote repository for them, keep it private for security reasons). &lt;br /&gt;
&lt;br /&gt;
=== Flatpaks ===&lt;br /&gt;
{{main|Flatpak}}&lt;br /&gt;
Due to their sandboxing, flatpaks require the use of a portal frontend (xdg-desktop-portal) and backends (such as xdg-desktop-portal-wlr, xdg-desktop-portal-gtk, xdg-desktop-portal-gnome) that implement the methods. When in doubt, install multiple backends. For more information on backends, see [https://github.com/flatpak/xdg-desktop-portal/#using-portals flatpak&#039;s page on the subject]. In addition to the steps under the &amp;quot;Firefox Screensharing&amp;quot; section, it may also be necessary to launch additional backends in your Sway config file. Otherwise, you may run into GDBus errors as your flatpak fails to interface with the portal. This can cause issues such as with opening your file directories from a flatpak application.&lt;br /&gt;
&lt;br /&gt;
After installing different backends, you might need to add the relevant backends to your sway config file similarly to in the &amp;quot;Firefox Screensharing&amp;quot; section above. For example, an autostart section of your sway config file may include:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
exec /usr/libexec/xdg-desktop-portal-gtk&lt;br /&gt;
exec /usr/libexec/xdg-desktop-portal-wlr&lt;br /&gt;
exec /usr/libexec/xdg-desktop-portal-gnome&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is only needed if they are not started automatically via other means.&lt;br /&gt;
&lt;br /&gt;
=== Firefox (Flatpak) and/or GTK apps ===&lt;br /&gt;
==== Disappearing cursor ====&lt;br /&gt;
You may need to get an icon pack and possibly a theme from [https://www.pling.com/browse?cat=107&amp;amp;ord=latest Pling store] and set &amp;lt;code&amp;gt;GTK_THEME&amp;lt;/code&amp;gt; environmental variable. Alternatively you can install a theme      for all users (search [https://pkgs.alpinelinux.org/ Alpine Linux Packages] for &#039;&#039;*-icon-theme&#039;&#039;) using &amp;lt;code&amp;gt;apk add&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Missing file picker/cannot download ====&lt;br /&gt;
&lt;br /&gt;
Go to &#039;&#039;about:config&#039;&#039; and set &amp;lt;code&amp;gt;widget.use-xdg-desktop-portal.file-picker&amp;lt;/code&amp;gt; to 0.&lt;br /&gt;
&lt;br /&gt;
=== Failing to start under certain graphics cards/multiple wlroots stacked windows spawning upon start ===&lt;br /&gt;
As of Dec 31 2022, [https://developer.nvidia.com/docs/drive/drive-os/latest/linux/sdk/common/topics/window_system_stub/Gnome-WaylandDesktopShellSupport136.html Nvidia still doesn&#039;t fully support Wayland]. Therefore, the possible solutions are as outlined in the link, or setting your WLR_BACKENDS environmental variables to &amp;lt;code&amp;gt;drm,libinput&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;x11&amp;lt;/code&amp;gt; (add libinput here as well if you cannot use your mouse and keyboard after starting Sway). The latter also works for AMD/ATI cards (&#039;&#039;&#039;make sure to install libinput first&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
=== Sway socket not detected ===&lt;br /&gt;
&lt;br /&gt;
See [[Sway#Installation|Installation]] for instructions on how to set this environmental variable. This issue may occur with terminal multiplexers, such as [[tmux]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [https://wiki.archlinux.org/title/Sway Archwiki]&lt;br /&gt;
* [https://wiki.gentoo.org/wiki/Sway Gentoo Wiki]&lt;br /&gt;
* [https://wiki.postmarketos.org/wiki/Sway PostmarketOS Wiki]&lt;br /&gt;
&lt;br /&gt;
[[Category:Desktop]]&lt;br /&gt;
[[Category:Window Managers]]&lt;br /&gt;
[[Category:Wayland]]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Desktop_environments_and_Window_managers&amp;diff=26590</id>
		<title>Desktop environments and Window managers</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Desktop_environments_and_Window_managers&amp;diff=26590"/>
		<updated>2024-03-06T21:31:12Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: fix link to display manager category&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC right}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alpine Linux&#039;&#039;&#039; has no official desktop. Older versions used Xfce, but now all GUI and graphical interfaces are optional. many are available and are attempted to be listed below:&lt;br /&gt;
&lt;br /&gt;
== Desktop Environments ==&lt;br /&gt;
&lt;br /&gt;
See also: [[:Category:Desktop Environments|Desktop Environments Category]]&lt;br /&gt;
&lt;br /&gt;
* [[Xfce]]&lt;br /&gt;
* [[LXQt]]&lt;br /&gt;
* [[KDE|KDE Plasma]]&lt;br /&gt;
* [[GNOME]]&lt;br /&gt;
* [[MATE]]&lt;br /&gt;
&lt;br /&gt;
== Window Managers ==&lt;br /&gt;
&lt;br /&gt;
See also: [[:Category:Window Managers|Window Managers Category]]&lt;br /&gt;
&lt;br /&gt;
===  [https://en.wikipedia.org/wiki/Stacking_window_manager Stacking (floating) window managers] ===&lt;br /&gt;
&lt;br /&gt;
* X11:&lt;br /&gt;
** [[Openbox]]&lt;br /&gt;
&lt;br /&gt;
* Wayland:&lt;br /&gt;
** Weston&lt;br /&gt;
** [[LabWC]]&lt;br /&gt;
** [[Wayfire]]&lt;br /&gt;
&lt;br /&gt;
=== [https://en.wikipedia.org/wiki/Tiling_window_manager Tiling (dynamic) window managers] ===&lt;br /&gt;
&lt;br /&gt;
* X11:&lt;br /&gt;
** bspwm&lt;br /&gt;
** herbstluftwm&lt;br /&gt;
** [[twm]]&lt;br /&gt;
** [[dwm]]&lt;br /&gt;
** [[I3wm|i3]]&lt;br /&gt;
** [[AwesomeWM|Awesome Window Manager]]&lt;br /&gt;
** Ratpoison (Available in Edge branch under the testing repository)&lt;br /&gt;
** spectrwm (Available in Edge Branch under the testing repository)&lt;br /&gt;
** Qtile (Available in Edge Branch under the testing repository)&lt;br /&gt;
&lt;br /&gt;
* Wayland:&lt;br /&gt;
** [[Sway]]&lt;br /&gt;
** [[River]]&lt;br /&gt;
** Cagebreak&lt;br /&gt;
** dwl (Available in Edge Branch under the testing repository)&lt;br /&gt;
** Qtile (Available in Edge Branch under the testing repository)&lt;br /&gt;
&lt;br /&gt;
=== Other Window Managers ===&lt;br /&gt;
&lt;br /&gt;
* Wayland&lt;br /&gt;
** Cage - Wayland Compositor for running single app on fullscreen mode (kiosk)&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Installation]]&lt;br /&gt;
* [[Installation#Post-Installation|Post Installation]]&lt;br /&gt;
* [[Seat_manager#Input_and_video_groups|Input and video groups]]&lt;br /&gt;
* [[Fonts]]&lt;br /&gt;
* [[Wayland]]&lt;br /&gt;
* [[:Category:Display Managers]]&lt;br /&gt;
* [https://wiki.archlinux.org/title/Desktop_environment Desktop environment - Archwiki]&lt;br /&gt;
* [https://wiki.gentoo.org/wiki/Desktop_environment Desktop environment - Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
[[Category:Desktop]]&lt;br /&gt;
[[Category:Newbie]]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Desktop_environments_and_Window_managers&amp;diff=26589</id>
		<title>Desktop environments and Window managers</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Desktop_environments_and_Window_managers&amp;diff=26589"/>
		<updated>2024-03-06T21:30:53Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: fix input/video group suggestion&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC right}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alpine Linux&#039;&#039;&#039; has no official desktop. Older versions used Xfce, but now all GUI and graphical interfaces are optional. many are available and are attempted to be listed below:&lt;br /&gt;
&lt;br /&gt;
== Desktop Environments ==&lt;br /&gt;
&lt;br /&gt;
See also: [[:Category:Desktop Environments|Desktop Environments Category]]&lt;br /&gt;
&lt;br /&gt;
* [[Xfce]]&lt;br /&gt;
* [[LXQt]]&lt;br /&gt;
* [[KDE|KDE Plasma]]&lt;br /&gt;
* [[GNOME]]&lt;br /&gt;
* [[MATE]]&lt;br /&gt;
&lt;br /&gt;
== Window Managers ==&lt;br /&gt;
&lt;br /&gt;
See also: [[:Category:Window Managers|Window Managers Category]]&lt;br /&gt;
&lt;br /&gt;
===  [https://en.wikipedia.org/wiki/Stacking_window_manager Stacking (floating) window managers] ===&lt;br /&gt;
&lt;br /&gt;
* X11:&lt;br /&gt;
** [[Openbox]]&lt;br /&gt;
&lt;br /&gt;
* Wayland:&lt;br /&gt;
** Weston&lt;br /&gt;
** [[LabWC]]&lt;br /&gt;
** [[Wayfire]]&lt;br /&gt;
&lt;br /&gt;
=== [https://en.wikipedia.org/wiki/Tiling_window_manager Tiling (dynamic) window managers] ===&lt;br /&gt;
&lt;br /&gt;
* X11:&lt;br /&gt;
** bspwm&lt;br /&gt;
** herbstluftwm&lt;br /&gt;
** [[twm]]&lt;br /&gt;
** [[dwm]]&lt;br /&gt;
** [[I3wm|i3]]&lt;br /&gt;
** [[AwesomeWM|Awesome Window Manager]]&lt;br /&gt;
** Ratpoison (Available in Edge branch under the testing repository)&lt;br /&gt;
** spectrwm (Available in Edge Branch under the testing repository)&lt;br /&gt;
** Qtile (Available in Edge Branch under the testing repository)&lt;br /&gt;
&lt;br /&gt;
* Wayland:&lt;br /&gt;
** [[Sway]]&lt;br /&gt;
** [[River]]&lt;br /&gt;
** Cagebreak&lt;br /&gt;
** dwl (Available in Edge Branch under the testing repository)&lt;br /&gt;
** Qtile (Available in Edge Branch under the testing repository)&lt;br /&gt;
&lt;br /&gt;
=== Other Window Managers ===&lt;br /&gt;
&lt;br /&gt;
* Wayland&lt;br /&gt;
** Cage - Wayland Compositor for running single app on fullscreen mode (kiosk)&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Installation]]&lt;br /&gt;
* [[Installation#Post-Installation|Post Installation]]&lt;br /&gt;
* [[Seat_manager#Input_and_video_groups|Input and video groups]]&lt;br /&gt;
* [[Fonts]]&lt;br /&gt;
* [[Wayland]]&lt;br /&gt;
* [[Category:Display Managers]]&lt;br /&gt;
* [https://wiki.archlinux.org/title/Desktop_environment Desktop environment - Archwiki]&lt;br /&gt;
* [https://wiki.gentoo.org/wiki/Desktop_environment Desktop environment - Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
[[Category:Desktop]]&lt;br /&gt;
[[Category:Newbie]]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Category:Seat_manager&amp;diff=26588</id>
		<title>Category:Seat manager</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Category:Seat_manager&amp;diff=26588"/>
		<updated>2024-03-06T21:26:25Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: add to desktop category&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Seat_manager]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Desktop]]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Seat_manager&amp;diff=26587</id>
		<title>Seat manager</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Seat_manager&amp;diff=26587"/>
		<updated>2024-03-06T21:25:54Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: add desktop category&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|This article needs verification for X11 based setups}}&lt;br /&gt;
&lt;br /&gt;
A seat manager dictates access to input and output devices like keyboard and monitor.&lt;br /&gt;
&lt;br /&gt;
On alpine linux 2 seat managers are available:&lt;br /&gt;
* [[seatd]]: a minimal seat management daemon&lt;br /&gt;
* [[elogind]]: from systemd extracted login manager&lt;br /&gt;
&lt;br /&gt;
== Input and video groups ==&lt;br /&gt;
Some instructions mention the need for the &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt; groups. This is in most cases not correct and insecure! The seat manager already provides the necessary permissions.&lt;br /&gt;
&lt;br /&gt;
Due to issue {{issue|15409}} there is currently 1 exception: If you aren&#039;t using elogind and need [[PipeWire#Device_access|PipeWire]] to access a webcam you need the &amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt; group.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [https://man.sr.ht/~kennylevinsen/seatd/#what-is-a-seat seatd: what is a seat]&lt;br /&gt;
* [https://docs.voidlinux.org/config/session-management.html void docs: Session and Seat Management]&lt;br /&gt;
&lt;br /&gt;
[[Category:Desktop]]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Seatd&amp;diff=26586</id>
		<title>Seatd</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Seatd&amp;diff=26586"/>
		<updated>2024-03-06T21:24:38Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: link to seat manager article&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Seatd is a [[seat manager]] and provides user sessions (mostly compositors) with access to input and output devices.&lt;br /&gt;
&lt;br /&gt;
See [https://man.sr.ht/~kennylevinsen/seatd/ the seatd documentation] for further details.&lt;br /&gt;
&lt;br /&gt;
When using [[elogind]], seatd is not required and viceversa.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add {{Pkg|seatd}}       # install seatd&lt;br /&gt;
rc-update add seatd # configure it to auto-start&lt;br /&gt;
service seatd start # start it now&lt;br /&gt;
adduser $USER seat  # allow current user to access seatd&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
If you are already logged in as a &amp;lt;code&amp;gt;$USER&amp;lt;/code&amp;gt;, you will need to relogin.&lt;br /&gt;
&lt;br /&gt;
[[Category:Desktop]]&lt;br /&gt;
[[Category:Seat_manager]]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Category:Seat_manager&amp;diff=26585</id>
		<title>Category:Seat manager</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Category:Seat_manager&amp;diff=26585"/>
		<updated>2024-03-06T21:24:05Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: redirect to &amp;quot;Seat manager&amp;quot; page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Seat_manager]]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Seat_manager&amp;diff=26584</id>
		<title>Seat manager</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Seat_manager&amp;diff=26584"/>
		<updated>2024-03-06T21:23:30Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: initial instructions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|This article needs verification for X11 based setups}}&lt;br /&gt;
&lt;br /&gt;
A seat manager dictates access to input and output devices like keyboard and monitor.&lt;br /&gt;
&lt;br /&gt;
On alpine linux 2 seat managers are available:&lt;br /&gt;
* [[seatd]]: a minimal seat management daemon&lt;br /&gt;
* [[elogind]]: from systemd extracted login manager&lt;br /&gt;
&lt;br /&gt;
== Input and video groups ==&lt;br /&gt;
Some instructions mention the need for the &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt; groups. This is in most cases not correct and insecure! The seat manager already provides the necessary permissions.&lt;br /&gt;
&lt;br /&gt;
Due to issue {{issue|15409}} there is currently 1 exception: If you aren&#039;t using elogind and need [[PipeWire#Device_access|PipeWire]] to access a webcam you need the &amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt; group.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [https://man.sr.ht/~kennylevinsen/seatd/#what-is-a-seat seatd: what is a seat]&lt;br /&gt;
* [https://docs.voidlinux.org/config/session-management.html void docs: Session and Seat Management]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Desktop_environments_and_Window_managers&amp;diff=26583</id>
		<title>Desktop environments and Window managers</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Desktop_environments_and_Window_managers&amp;diff=26583"/>
		<updated>2024-03-06T21:00:29Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: link to wayland article&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC right}}&lt;br /&gt;
&lt;br /&gt;
{{Tip|Be sure to add your user to &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt; groups.}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alpine Linux&#039;&#039;&#039; has no official desktop. Older versions used Xfce, but now all GUI and graphical interfaces are optional. many are available and are attempted to be listed below:&lt;br /&gt;
&lt;br /&gt;
== Desktop Environments ==&lt;br /&gt;
&lt;br /&gt;
See also: [[:Category:Desktop Environments|Desktop Environments Category]]&lt;br /&gt;
&lt;br /&gt;
* [[Xfce]]&lt;br /&gt;
* [[LXQt]]&lt;br /&gt;
* [[KDE|KDE Plasma]]&lt;br /&gt;
* [[GNOME]]&lt;br /&gt;
* [[MATE]]&lt;br /&gt;
&lt;br /&gt;
== Window Managers ==&lt;br /&gt;
&lt;br /&gt;
See also: [[:Category:Window Managers|Window Managers Category]]&lt;br /&gt;
&lt;br /&gt;
===  [https://en.wikipedia.org/wiki/Stacking_window_manager Stacking (floating) window managers] ===&lt;br /&gt;
&lt;br /&gt;
* X11:&lt;br /&gt;
** [[Openbox]]&lt;br /&gt;
&lt;br /&gt;
* Wayland:&lt;br /&gt;
** Weston&lt;br /&gt;
** [[LabWC]]&lt;br /&gt;
** [[Wayfire]]&lt;br /&gt;
&lt;br /&gt;
=== [https://en.wikipedia.org/wiki/Tiling_window_manager Tiling (dynamic) window managers] ===&lt;br /&gt;
&lt;br /&gt;
* X11:&lt;br /&gt;
** bspwm&lt;br /&gt;
** herbstluftwm&lt;br /&gt;
** [[twm]]&lt;br /&gt;
** [[dwm]]&lt;br /&gt;
** [[I3wm|i3]]&lt;br /&gt;
** [[AwesomeWM|Awesome Window Manager]]&lt;br /&gt;
** Ratpoison (Available in Edge branch under the testing repository)&lt;br /&gt;
** spectrwm (Available in Edge Branch under the testing repository)&lt;br /&gt;
** Qtile (Available in Edge Branch under the testing repository)&lt;br /&gt;
&lt;br /&gt;
* Wayland:&lt;br /&gt;
** [[Sway]]&lt;br /&gt;
** [[River]]&lt;br /&gt;
** Cagebreak&lt;br /&gt;
** dwl (Available in Edge Branch under the testing repository)&lt;br /&gt;
** Qtile (Available in Edge Branch under the testing repository)&lt;br /&gt;
&lt;br /&gt;
=== Other Window Managers ===&lt;br /&gt;
&lt;br /&gt;
* Wayland&lt;br /&gt;
** Cage - Wayland Compositor for running single app on fullscreen mode (kiosk)&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Installation]]&lt;br /&gt;
* [[Installation#Post-Installation|Post Installation]]&lt;br /&gt;
* [[Fonts]]&lt;br /&gt;
* [[Wayland]]&lt;br /&gt;
* [[Category:Display Managers]]&lt;br /&gt;
* [https://wiki.archlinux.org/title/Desktop_environment Desktop environment - Archwiki]&lt;br /&gt;
* [https://wiki.gentoo.org/wiki/Desktop_environment Desktop environment - Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
[[Category:Desktop]]&lt;br /&gt;
[[Category:Newbie]]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Seatd&amp;diff=26582</id>
		<title>Seatd</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Seatd&amp;diff=26582"/>
		<updated>2024-03-06T20:49:01Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: add seat manager category&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Seatd is a seat manager and provides user sessions (mostly compositors) with access to input and output devices.&lt;br /&gt;
&lt;br /&gt;
See [https://man.sr.ht/~kennylevinsen/seatd/ the seatd documentation] for further details.&lt;br /&gt;
&lt;br /&gt;
When using [[elogind]], seatd is not required and viceversa.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add {{Pkg|seatd}}       # install seatd&lt;br /&gt;
rc-update add seatd # configure it to auto-start&lt;br /&gt;
service seatd start # start it now&lt;br /&gt;
adduser $USER seat  # allow current user to access seatd&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
If you are already logged in as a &amp;lt;code&amp;gt;$USER&amp;lt;/code&amp;gt;, you will need to relogin.&lt;br /&gt;
&lt;br /&gt;
[[Category:Desktop]]&lt;br /&gt;
[[Category:Seat_manager]]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Elogind&amp;diff=26581</id>
		<title>Elogind</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Elogind&amp;diff=26581"/>
		<updated>2024-03-06T20:48:59Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: add seat manager category&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://github.com/elogind/elogind &#039;&#039;&#039;elogind&#039;&#039;&#039;] is a login manager and provides support for &lt;br /&gt;
&lt;br /&gt;
* setting up necessary permissions for the desktop environment or window manager&lt;br /&gt;
* handling poweroff, reboot, suspend and hibernate via &#039;&#039;&#039;loginctl&#039;&#039;&#039; command&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
{{Cmd|# apk add {{Pkg|elogind}}&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; rc-update add elogind&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; rc-service elogind start}}&lt;br /&gt;
Polkit is used for authentication. Without it some things may not function. You need to install and configure [[D-Bus#Installation|D-Bus]] to use polkit.&lt;br /&gt;
{{Cmd|# apk add {{Pkg|polkit-elogind}}&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; rc-update add polkit&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; rc-service polkit start}}&lt;br /&gt;
&lt;br /&gt;
Set up a [[PAM]] login.&lt;br /&gt;
&lt;br /&gt;
== Hibernating ==&lt;br /&gt;
&lt;br /&gt;
For {{Cmd|# loginctl hibernate}} to work, you must have a swap partition. Check {{Cmd|# lsblk}} for a partition with the mountpoint [SWAP].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS&lt;br /&gt;
nvme0n1     259:0    0 953.9G  0 disk &lt;br /&gt;
├─nvme0n1p1 259:1    0   200M  0 part /boot&lt;br /&gt;
├─nvme0n1p2 259:2    0   100G  0 part /&lt;br /&gt;
├─nvme0n1p3 259:3    0   805G  0 part /home&lt;br /&gt;
└─nvme0n1p4 259:4    0  48.7G  0 part [SWAP]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remember also to add a kernel parameter to resume, ie in {{Path|/etc/default/grub}} :&lt;br /&gt;
&lt;br /&gt;
{{Cat|/etc/default/grub|&amp;lt;nowiki&amp;gt;...&lt;br /&gt;
GRUB_CMDLINE_LINUX_DEFAULT=&amp;quot;modules=sd-mod,usb-storage,ext4,nvme quiet rootfstype=ext4 resume=/dev/nvme0n1p4&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Note the &amp;quot;resume=&amp;quot; flag with the same partition that was marked as [SWAP].&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
=== logind.conf ===&lt;br /&gt;
&lt;br /&gt;
Edit {{Path|/etc/elogind/logind.conf}} to configure handling of power events, such as suspending the computer when power button is pressed:&lt;br /&gt;
&lt;br /&gt;
{{cat|/etc/elogind/logind.conf|...&lt;br /&gt;
[Login]&lt;br /&gt;
HandlePowerKey{{=}}suspend&lt;br /&gt;
...}}&lt;br /&gt;
&lt;br /&gt;
=== Working with Desktop Environments ===&lt;br /&gt;
&lt;br /&gt;
If using a Window Manager or Desktop Environment, such as [[Sway]], the user must ensure that login session is correctly configured.  When correctly configured, the &amp;lt;code&amp;gt;loginctl&amp;lt;/code&amp;gt; command should output the following:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using [[Sway]] and [[SDDM]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;background-color:#f9f9f9; border:1px dashed #2f6fab; line-height:1.1em; padding:1em; font-family:monospace; font-size:10pt; white-space:pre; overflow:auto;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:green;&amp;quot;&amp;gt;~&amp;lt;/span&amp;gt;&#039;&#039;&#039;$&#039;&#039;&#039; loginctl&lt;br /&gt;
&lt;br /&gt;
SESSION  UID USER SEAT  TTY &lt;br /&gt;
     c1  105 sddm seat0     &lt;br /&gt;
     c2 1000 User seat0 tty8&lt;br /&gt;
&lt;br /&gt;
2 sessions listed.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the output is &amp;lt;code&amp;gt;No session available.&amp;lt;/code&amp;gt;, such as in the case of launching Sway from tty, suspend and many other functionality will not work.  The user then must configure a display manager such as {{Pkg|greetd}}, [[SDDM]] or {{Pkg|lightdm|LightDM}}.&lt;br /&gt;
&lt;br /&gt;
== Doas ==&lt;br /&gt;
&lt;br /&gt;
Doas is used to grant permissions for suspend-to-RAM and brightness control with brightnessctl:&lt;br /&gt;
&lt;br /&gt;
 apk add doas brightnessctl&lt;br /&gt;
 # optionally, allow $USER root access with password&lt;br /&gt;
 adduser $USER wheel&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;code&amp;gt;/etc/doas.conf&amp;lt;/code&amp;gt;, set&lt;br /&gt;
&lt;br /&gt;
 permit :wheel&lt;br /&gt;
 permit nopass $USER as root cmd /bin/loginctl&lt;br /&gt;
 permit nopass $USER as root cmd /usr/bin/brightnessctl&lt;br /&gt;
&lt;br /&gt;
After setting the above, suspend-to-RAM can be triggered by running &lt;br /&gt;
&lt;br /&gt;
 /bin/loginctl suspend&lt;br /&gt;
&lt;br /&gt;
(use full path to executable) and brightness can be adjusted by running&lt;br /&gt;
&lt;br /&gt;
 /usr/bin/brightnessctl set 100&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [https://wiki.gentoo.org/wiki/Elogind elogind - Gentoo Wiki]&lt;br /&gt;
* [https://wiki.gentoo.org/wiki/Polkit polkit - Gentoo Wiki]&lt;br /&gt;
* [https://wiki.archlinux.org/title/Polkit polkit - ArchWiki]&lt;br /&gt;
&lt;br /&gt;
[[Category:Desktop]]&lt;br /&gt;
[[Category:Seat_manager]]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Seatd&amp;diff=26580</id>
		<title>Seatd</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Seatd&amp;diff=26580"/>
		<updated>2024-03-06T20:28:01Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: add to desktop category&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Seatd is a seat manager and provides user sessions (mostly compositors) with access to input and output devices.&lt;br /&gt;
&lt;br /&gt;
See [https://man.sr.ht/~kennylevinsen/seatd/ the seatd documentation] for further details.&lt;br /&gt;
&lt;br /&gt;
When using [[elogind]], seatd is not required and viceversa.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add {{Pkg|seatd}}       # install seatd&lt;br /&gt;
rc-update add seatd # configure it to auto-start&lt;br /&gt;
service seatd start # start it now&lt;br /&gt;
adduser $USER seat  # allow current user to access seatd&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
If you are already logged in as a &amp;lt;code&amp;gt;$USER&amp;lt;/code&amp;gt;, you will need to relogin.&lt;br /&gt;
&lt;br /&gt;
[[Category:Desktop]]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Seatd&amp;diff=26579</id>
		<title>Seatd</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Seatd&amp;diff=26579"/>
		<updated>2024-03-06T20:26:46Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: link to elogind article&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Seatd is a seat manager and provides user sessions (mostly compositors) with access to input and output devices.&lt;br /&gt;
&lt;br /&gt;
See [https://man.sr.ht/~kennylevinsen/seatd/ the seatd documentation] for further details.&lt;br /&gt;
&lt;br /&gt;
When using [[elogind]], seatd is not required and viceversa.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add {{Pkg|seatd}}       # install seatd&lt;br /&gt;
rc-update add seatd # configure it to auto-start&lt;br /&gt;
service seatd start # start it now&lt;br /&gt;
adduser $USER seat  # allow current user to access seatd&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
If you are already logged in as a &amp;lt;code&amp;gt;$USER&amp;lt;/code&amp;gt;, you will need to relogin.&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Sway&amp;diff=26578</id>
		<title>Sway</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Sway&amp;diff=26578"/>
		<updated>2024-03-06T20:25:09Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: add overall install heading&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://swaywm.org Sway] is a tiling [[Wayland]] compositor and a drop-in replacement for the i3 window manager for X11. It works with your existing i3 configuration and supports most of i3&#039;s features, plus a few extras.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
=== Add a normal user ===&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;setup-user&amp;lt;/code&amp;gt; to add a non-system normal user for running Sway.&lt;br /&gt;
&lt;br /&gt;
=== Set up eudev ===&lt;br /&gt;
&lt;br /&gt;
[[eudev]] is recommended and required for. Without it, sway cannot connect to input devices.&lt;br /&gt;
&lt;br /&gt;
 setup-devd udev&lt;br /&gt;
&lt;br /&gt;
=== Install Graphics Drivers ===&lt;br /&gt;
&lt;br /&gt;
Graphics drivers:&lt;br /&gt;
&lt;br /&gt;
* [[Intel Video]]&lt;br /&gt;
* [[Radeon Video]]&lt;br /&gt;
* [[Nvidia Video]]&lt;br /&gt;
&lt;br /&gt;
=== Setting up a seat manager ===&lt;br /&gt;
&lt;br /&gt;
Wayland compositors need raw access to input and output devices. This is mediated by a [https://man.sr.ht/~kennylevinsen/seatd/ seat manager]. Using either seatd or elogind is supported. Using both may lead to conflicts.&lt;br /&gt;
&lt;br /&gt;
==== Install seatd ====&lt;br /&gt;
&lt;br /&gt;
See [[Seatd]].&lt;br /&gt;
&lt;br /&gt;
==== Install elogind ====&lt;br /&gt;
&lt;br /&gt;
See [[Elogind]].&lt;br /&gt;
&lt;br /&gt;
===== Elogind and swayidle =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;swayidle&amp;lt;/code&amp;gt; has integration with &amp;lt;code&amp;gt;elogind&amp;lt;/code&amp;gt; and can handle &amp;lt;code&amp;gt;before-sleep&amp;lt;/code&amp;gt; events.&lt;br /&gt;
&lt;br /&gt;
If using &amp;lt;code&amp;gt;swayidle before-sleep&amp;lt;/code&amp;gt;, there will be a race condition, so that when you resume the computer from suspend, the screen shows the contents of the unlocked screen for a second before showing the actual lock screen.  This can be a privacy concern.&lt;br /&gt;
&lt;br /&gt;
To solve this issue, do the following:&lt;br /&gt;
&lt;br /&gt;
Create this file &amp;lt;code&amp;gt;/etc/elogind/system-sleep/10-swaylock.sh&amp;lt;/code&amp;gt;, then add the following script to this file:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 if [ &amp;quot;${1}&amp;quot; == &amp;quot;pre&amp;quot; ]; then&lt;br /&gt;
   touch /tmp/swaylock-sleep&lt;br /&gt;
   sleep 1&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
Then set it to executable.&lt;br /&gt;
&lt;br /&gt;
Later, once sway is installed, add the following line to sway config:&lt;br /&gt;
&lt;br /&gt;
 # in ~/.config/sway/config&lt;br /&gt;
 exec touch /tmp/swaylock-sleep &amp;amp;&amp;amp; inotifyd swaylock /tmp/swaylock-sleep&lt;br /&gt;
&lt;br /&gt;
With this line, the screen will be promptly locked before suspend-to-RAM starts.&lt;br /&gt;
&lt;br /&gt;
=== Install greetd (optional) ===&lt;br /&gt;
&lt;br /&gt;
{{Box YELLOW|Note:|This content is tangential, and should be moved into the &#039;greetd&#039; page}} &lt;br /&gt;
&lt;br /&gt;
 apk add greetd greetd-gtkgreet cage&lt;br /&gt;
 rc-update add greetd&lt;br /&gt;
 adduser greetd seat&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;code&amp;gt;/etc/greetd/config.toml&amp;lt;/code&amp;gt;, set&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[default_session]&lt;br /&gt;
&lt;br /&gt;
command = &amp;quot;cage -s -- gtkgreet&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To use a graphical greeter with seatd add &amp;lt;code&amp;gt;rc_need=seatd&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/etc/conf.d/greetd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;code&amp;gt;/etc/greetd/environments&amp;lt;/code&amp;gt;, set&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Launch Sway with a D-Bus server available, use:&lt;br /&gt;
dbus-run-session -- sway&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
D-Bus is required for PipeWire and screensharing in Firefox and Chromium. Running with &amp;lt;code&amp;gt;dbus-run-session&amp;lt;/code&amp;gt; is a convenience wrapper that will explicitly export the path of the session bus.&lt;br /&gt;
&lt;br /&gt;
=== Install fonts ===&lt;br /&gt;
&lt;br /&gt;
Install DejaVu fonts, which has good Unicode coverage:&lt;br /&gt;
&lt;br /&gt;
 apk add font-dejavu&lt;br /&gt;
&lt;br /&gt;
=== Install Sway ===&lt;br /&gt;
&lt;br /&gt;
 apk add sway \&lt;br /&gt;
    xwayland             \ # if you need xserver&lt;br /&gt;
    foot                 \ # default terminal emulator. Modify $term in config for a different one.&lt;br /&gt;
    wmenu                \ # default wayland native menu for choosing program and screensharing monitor&lt;br /&gt;
    swaylock swaylockd   \ # lockscreen tool&lt;br /&gt;
    grim                 \ # screenshot tool&lt;br /&gt;
    wl-clipboard         \ # clipboard management&lt;br /&gt;
    i3status             \ # simple status bar&lt;br /&gt;
    swayidle               # idle management (DPMS) daemon&lt;br /&gt;
&lt;br /&gt;
For complimentary software alternatives, see [https://github.com/swaywm/sway/wiki/Useful-add-ons-for-sway the relevant page from sway&#039;s wiki] or [https://wiki.gentoo.org/wiki/List_of_software_for_Wayland this list at Gentoo Wiki.]&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
Copy default sway configuration to &amp;lt;code&amp;gt;~/.config&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 # as normal user&lt;br /&gt;
 mkdir -p ~/.config/sway&lt;br /&gt;
 cp /etc/sway/config ~/.config/sway/&lt;br /&gt;
&lt;br /&gt;
Read through it to learn the default keybindings.&lt;br /&gt;
Sway configuration is mostly backwards-compatible with that of [[I3wm|i3]] and if you are looking for a solution for a specific issue, you may also try checking if it hasn&#039;t been provided for i3WM.&lt;br /&gt;
&lt;br /&gt;
For additional information, start at &amp;lt;code&amp;gt;man 5 sway&amp;lt;/code&amp;gt; and read the [https://github.com/swaywm/sway/wiki upstream wiki].&lt;br /&gt;
&lt;br /&gt;
== PipeWire and enable screensharing ==&lt;br /&gt;
&lt;br /&gt;
For audio playback, either PipeWire or PulseAudio work fine. The compositor has no involvement in audio playback.&lt;br /&gt;
&lt;br /&gt;
For screen sharing, applications are split into two categories:&lt;br /&gt;
&lt;br /&gt;
* Those which use the native wayland protocol, &amp;lt;/code&amp;gt;wlr-screencopy&amp;lt;/code&amp;gt;&lt;br /&gt;
* Those which use the API from Flatpak&#039;s &amp;lt;code&amp;gt;xdg-desktop-portal&amp;lt;/code&amp;gt; (this portal is also used by native non-Flatpak applications).&lt;br /&gt;
&lt;br /&gt;
Applications in the first group require not additional setup. Applications in the second group (which includes Firefox and Chromium) require setting up pipewire, wireplumber and xdg portals:&lt;br /&gt;
&lt;br /&gt;
{{Todo|Move this content into [[PipeWire]].}} &lt;br /&gt;
&lt;br /&gt;
 apk add pipewire pipewire-pulse pipewire-tools&lt;br /&gt;
 apk add wireplumber&lt;br /&gt;
 apk add xdg-desktop-portal xdg-desktop-portal-wlr&lt;br /&gt;
&lt;br /&gt;
Launch PipeWire with Sway. Use your service manager of choice, or add the following to sway config:&lt;br /&gt;
&lt;br /&gt;
 exec /usr/libexec/pipewire-launcher&lt;br /&gt;
&lt;br /&gt;
If your are using automatic D-Bus activation, you also need to set DBus variables for the portal and screensharing features to work:&lt;br /&gt;
&lt;br /&gt;
 exec dbus-update-activation-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway&lt;br /&gt;
&lt;br /&gt;
{{Box YELLOW|Unclear:|The following paragraph is unclear and needs further work}} &lt;br /&gt;
&lt;br /&gt;
Replace dmenu (depends on X server) with bemenu (Wayland native) for launching programs and selecting which screen to share in Firefox/Chromium:&lt;br /&gt;
&lt;br /&gt;
 set $menu bemenu-run | xargs swaymsg exec&lt;br /&gt;
&lt;br /&gt;
== Screen lock and suspend-to-RAM ==&lt;br /&gt;
&lt;br /&gt;
=== Without elogind ===&lt;br /&gt;
&lt;br /&gt;
Consider using {{Pkg|powerctl}}.&lt;br /&gt;
&lt;br /&gt;
=== With elogind ===&lt;br /&gt;
&lt;br /&gt;
Putting the system to sleep with elogind requires elevated privileges or additional configuration.&lt;br /&gt;
&lt;br /&gt;
For details on configuring &amp;lt;code&amp;gt;doas&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;elogind&amp;lt;/code&amp;gt;, see [[Elogind#Doas]]&lt;br /&gt;
&lt;br /&gt;
To put the system to sleep after 600 seconds, use:&lt;br /&gt;
&lt;br /&gt;
 exec swayidle -w timeout 600 &#039;doas /bin/loginctl suspend&#039;&lt;br /&gt;
&lt;br /&gt;
loginctl suspend command will trigger the screenlock, as mentioned in the section [[#Install elogind (optional)|Install elogind (optional)]] above.&lt;br /&gt;
&lt;br /&gt;
Do not lock the screen if program is running in full screen:&lt;br /&gt;
&lt;br /&gt;
 for_window [app_id=&amp;quot;^.*&amp;quot;] inhibit_idle fullscreen&lt;br /&gt;
&lt;br /&gt;
== Brightness control ==&lt;br /&gt;
&lt;br /&gt;
Controlling display backlight requires either the proper udev rules, or using some form of privilege escalation.&lt;br /&gt;
&lt;br /&gt;
{{Pkg|brightnessctl}} is a reliable alternative, although its default udev rules require too wide permissions (see {{Issue|15409}}). You may need your own rules, or configure doas to allow running it as an unprivileged user.&lt;br /&gt;
&lt;br /&gt;
Optionally enable brightnessctl service to restore brightness settings on reboot:&lt;br /&gt;
&lt;br /&gt;
 rc-update add brightnessctl&lt;br /&gt;
&lt;br /&gt;
== Output scaling for high resolution displays ==&lt;br /&gt;
&lt;br /&gt;
Without further configuration, program interfaces might be too small to use on high resolution displays.&lt;br /&gt;
&lt;br /&gt;
Sway supports the per-display configuration of&lt;br /&gt;
&lt;br /&gt;
* fractional (e.g., 1.5x), and&lt;br /&gt;
* integer scaling (e.g., 2x) &lt;br /&gt;
&lt;br /&gt;
However, fractional scaling is discouraged due to both the performance impact and the blurry output it produces. In this case, where 1x scaling is too small and 2x scaling is too large, program-specific GTK/QT based scaling is recommended.  See below.&lt;br /&gt;
&lt;br /&gt;
To enable Sway scaling, the user can first preview different scaling factors with &amp;lt;code&amp;gt;wdisplays&amp;lt;/code&amp;gt; package.  Note the output name (eDP-1, LVDS-1) and try apply scaling factors such as 1 and 2.  To make changes permanent, add&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
output &amp;lt;name&amp;gt; scale &amp;lt;factor&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to ~/.config/sway/config.&lt;br /&gt;
&lt;br /&gt;
To use toolkit scaling, use&lt;br /&gt;
{{Cmd|# for GTK-based programs such as firefox and emacs:&lt;br /&gt;
export GDK_DPI_SCALE{{=}}2&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; for QT-based programs&lt;br /&gt;
export QT_WAYLAND_FORCE_DPI{{=}}&amp;quot;physical&amp;quot;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; or if still too small, use a custom DPI&lt;br /&gt;
export QT_WAYLAND_FORCE_DPI{{=}}192 # 2x scaling&lt;br /&gt;
export QT_QPA_PLATFORM{{=}}&amp;quot;wayland-egl&amp;quot;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Screenshots ==&lt;br /&gt;
A simple tool that works well under Wayland is Grimshot. Example keybindings:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bindsym Print exec grimshot copy area&lt;br /&gt;
bindsym Shift+Print exec grimshot copy screen&lt;br /&gt;
bindsym Control+Print exec grimshot save area ~/Pictures/$(date +%d-%m-%Y-%H-%M-%S).png&lt;br /&gt;
bindsym Control+Shift+Print exec grimshot save screen ~/Pictures/$(date +%d-%m-%Y-%H-%M-%S).png&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/swaywm/sway/wiki/Useful-add-ons-for-sway the sway wiki&#039;s article] for a list of screenshot tools.&lt;br /&gt;
&lt;br /&gt;
== Tweaks ==&lt;br /&gt;
&lt;br /&gt;
=== Make clipboard content persistent ===&lt;br /&gt;
By default the clipboard content does not persist after terminating the program: you copy some text from Firefox and then exit Firefox, the copied text is also lost.&lt;br /&gt;
&lt;br /&gt;
Install clipman from testing repo and add the following to sway config:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
exec wl-paste --type text/plain --watch clipman store --histpath=&amp;quot;~/.local/state/clipman-primary.json&amp;quot;&lt;br /&gt;
bindsym $mod+h exec clipman pick --tool wofi --histpath=&amp;quot;~/.local/state/clipman-primary.json&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Firefox picture-in-picture mode/floating windows ===&lt;br /&gt;
Add this to your sway config file (modify the numeric values to suit your needs and your display):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for_window [app_id=&amp;quot;firefox&amp;quot; title=&amp;quot;^Picture-in-Picture$&amp;quot;] floating enable, move position 877 450, sticky enable, border none&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Start with NumLock enabled ===&lt;br /&gt;
Add this to your sway config file:&lt;br /&gt;
&amp;lt;code&amp;gt;input type:keyboard xkb_numlock enabled&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Change mouse cursor theme and size ===&lt;br /&gt;
Add to your sway config:&lt;br /&gt;
&lt;br /&gt;
 seat seat0 xcursor_theme my_cursor_theme my_cursor_size&lt;br /&gt;
&lt;br /&gt;
For example, set a mouse cursor, using GNOME Adwaita theme:&lt;br /&gt;
&lt;br /&gt;
 seat seat0 xcursor_theme Adwaita 16&lt;br /&gt;
&lt;br /&gt;
You can inspect their values with &amp;lt;code&amp;gt;echo $XCURSOR_SIZE&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;echo $XCURSOR_THEME&amp;lt;/code&amp;gt;. If reloading your config does not result in change, try logging out and in.&lt;br /&gt;
&lt;br /&gt;
{{Note|Wayland allows for client-side cursors. It is possible that applications do not evaluate the values of &amp;lt;code&amp;gt;$XCURSOR_SIZE&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;$XCURSOR_THEME&amp;lt;/code&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
=== Custom keyboard layout ===&lt;br /&gt;
&lt;br /&gt;
To use custom keyboard layout, just use&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
input type:keyboard {&lt;br /&gt;
  xkb_file /path/to/my/custom/layout&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Changing default application fonts ===&lt;br /&gt;
&lt;br /&gt;
See [[Fontconfig]]&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
If you encounter any issues, try running &amp;lt;code&amp;gt;sway -Vc /etc/sway/config&amp;lt;/code&amp;gt;. It will run sway with the default config file and set the output to be more verbose. It is generally a good idea to track your config files with git (when and if at all you use a remote repository for them, keep it private for security reasons). &lt;br /&gt;
&lt;br /&gt;
=== Flatpaks ===&lt;br /&gt;
{{main|Flatpak}}&lt;br /&gt;
Due to their sandboxing, flatpaks require the use of a portal frontend (xdg-desktop-portal) and backends (such as xdg-desktop-portal-wlr, xdg-desktop-portal-gtk, xdg-desktop-portal-gnome) that implement the methods. When in doubt, install multiple backends. For more information on backends, see [https://github.com/flatpak/xdg-desktop-portal/#using-portals flatpak&#039;s page on the subject]. In addition to the steps under the &amp;quot;Firefox Screensharing&amp;quot; section, it may also be necessary to launch additional backends in your Sway config file. Otherwise, you may run into GDBus errors as your flatpak fails to interface with the portal. This can cause issues such as with opening your file directories from a flatpak application.&lt;br /&gt;
&lt;br /&gt;
After installing different backends, you might need to add the relevant backends to your sway config file similarly to in the &amp;quot;Firefox Screensharing&amp;quot; section above. For example, an autostart section of your sway config file may include:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
exec /usr/libexec/xdg-desktop-portal-gtk&lt;br /&gt;
exec /usr/libexec/xdg-desktop-portal-wlr&lt;br /&gt;
exec /usr/libexec/xdg-desktop-portal-gnome&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is only needed if they are not started automatically via other means.&lt;br /&gt;
&lt;br /&gt;
=== Firefox (Flatpak) and/or GTK apps ===&lt;br /&gt;
==== Disappearing cursor ====&lt;br /&gt;
You may need to get an icon pack and possibly a theme from [https://www.pling.com/browse?cat=107&amp;amp;ord=latest Pling store] and set &amp;lt;code&amp;gt;GTK_THEME&amp;lt;/code&amp;gt; environmental variable. Alternatively you can install a theme      for all users (search [https://pkgs.alpinelinux.org/ Alpine Linux Packages] for &#039;&#039;*-icon-theme&#039;&#039;) using &amp;lt;code&amp;gt;apk add&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Missing file picker/cannot download ====&lt;br /&gt;
&lt;br /&gt;
Go to &#039;&#039;about:config&#039;&#039; and set &amp;lt;code&amp;gt;widget.use-xdg-desktop-portal.file-picker&amp;lt;/code&amp;gt; to 0.&lt;br /&gt;
&lt;br /&gt;
=== Failing to start under certain graphics cards/multiple wlroots stacked windows spawning upon start ===&lt;br /&gt;
As of Dec 31 2022, [https://developer.nvidia.com/docs/drive/drive-os/latest/linux/sdk/common/topics/window_system_stub/Gnome-WaylandDesktopShellSupport136.html Nvidia still doesn&#039;t fully support Wayland]. Therefore, the possible solutions are as outlined in the link, or setting your WLR_BACKENDS environmental variables to &amp;lt;code&amp;gt;drm,libinput&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;x11&amp;lt;/code&amp;gt; (add libinput here as well if you cannot use your mouse and keyboard after starting Sway). The latter also works for AMD/ATI cards (&#039;&#039;&#039;make sure to install libinput first&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
=== Sway socket not detected ===&lt;br /&gt;
&lt;br /&gt;
See [[Sway#Installation|Installation]] for instructions on how to set this environmental variable. This issue may occur with terminal multiplexers, such as [[tmux]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [https://wiki.archlinux.org/title/Sway Archwiki]&lt;br /&gt;
* [https://wiki.gentoo.org/wiki/Sway Gentoo Wiki]&lt;br /&gt;
* [https://wiki.postmarketos.org/wiki/Sway PostmarketOS Wiki]&lt;br /&gt;
&lt;br /&gt;
[[Category:Desktop]]&lt;br /&gt;
[[Category:Window Managers]]&lt;br /&gt;
[[Category:Wayland]]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Sway&amp;diff=26577</id>
		<title>Sway</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Sway&amp;diff=26577"/>
		<updated>2024-03-06T20:18:52Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: add links to introduction&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://swaywm.org Sway] is a tiling [[Wayland]] compositor and a drop-in replacement for the i3 window manager for X11. It works with your existing i3 configuration and supports most of i3&#039;s features, plus a few extras.&lt;br /&gt;
&lt;br /&gt;
== Add a normal user ==&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;setup-user&amp;lt;/code&amp;gt; to add a non-system normal user for running Sway.&lt;br /&gt;
&lt;br /&gt;
== Set up eudev ==&lt;br /&gt;
&lt;br /&gt;
[[eudev]] is recommended and required for. Without it, sway cannot connect to input devices.&lt;br /&gt;
&lt;br /&gt;
 setup-devd udev&lt;br /&gt;
&lt;br /&gt;
== Install Graphics Drivers ==&lt;br /&gt;
&lt;br /&gt;
Graphics drivers:&lt;br /&gt;
&lt;br /&gt;
* [[Intel Video]]&lt;br /&gt;
* [[Radeon Video]]&lt;br /&gt;
* [[Nvidia Video]]&lt;br /&gt;
&lt;br /&gt;
== Setting up a seat manager ==&lt;br /&gt;
&lt;br /&gt;
Wayland compositors need raw access to input and output devices. This is mediated by a [https://man.sr.ht/~kennylevinsen/seatd/ seat manager]. Using either seatd or elogind is supported. Using both may lead to conflicts.&lt;br /&gt;
&lt;br /&gt;
=== Install seatd ===&lt;br /&gt;
&lt;br /&gt;
See [[Seatd]].&lt;br /&gt;
&lt;br /&gt;
=== Install elogind ===&lt;br /&gt;
&lt;br /&gt;
See [[Elogind]].&lt;br /&gt;
&lt;br /&gt;
==== Elogind and swayidle ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;swayidle&amp;lt;/code&amp;gt; has integration with &amp;lt;code&amp;gt;elogind&amp;lt;/code&amp;gt; and can handle &amp;lt;code&amp;gt;before-sleep&amp;lt;/code&amp;gt; events.&lt;br /&gt;
&lt;br /&gt;
If using &amp;lt;code&amp;gt;swayidle before-sleep&amp;lt;/code&amp;gt;, there will be a race condition, so that when you resume the computer from suspend, the screen shows the contents of the unlocked screen for a second before showing the actual lock screen.  This can be a privacy concern.&lt;br /&gt;
&lt;br /&gt;
To solve this issue, do the following:&lt;br /&gt;
&lt;br /&gt;
Create this file &amp;lt;code&amp;gt;/etc/elogind/system-sleep/10-swaylock.sh&amp;lt;/code&amp;gt;, then add the following script to this file:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 if [ &amp;quot;${1}&amp;quot; == &amp;quot;pre&amp;quot; ]; then&lt;br /&gt;
   touch /tmp/swaylock-sleep&lt;br /&gt;
   sleep 1&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
Then set it to executable.&lt;br /&gt;
&lt;br /&gt;
Later, once sway is installed, add the following line to sway config:&lt;br /&gt;
&lt;br /&gt;
 # in ~/.config/sway/config&lt;br /&gt;
 exec touch /tmp/swaylock-sleep &amp;amp;&amp;amp; inotifyd swaylock /tmp/swaylock-sleep&lt;br /&gt;
&lt;br /&gt;
With this line, the screen will be promptly locked before suspend-to-RAM starts.&lt;br /&gt;
&lt;br /&gt;
== Install greetd (optional) ==&lt;br /&gt;
&lt;br /&gt;
{{Box YELLOW|Note:|This content is tangential, and should be moved into the &#039;greetd&#039; page}} &lt;br /&gt;
&lt;br /&gt;
 apk add greetd greetd-gtkgreet cage&lt;br /&gt;
 rc-update add greetd&lt;br /&gt;
 adduser greetd seat&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;code&amp;gt;/etc/greetd/config.toml&amp;lt;/code&amp;gt;, set&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[default_session]&lt;br /&gt;
&lt;br /&gt;
command = &amp;quot;cage -s -- gtkgreet&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To use a graphical greeter with seatd add &amp;lt;code&amp;gt;rc_need=seatd&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/etc/conf.d/greetd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;code&amp;gt;/etc/greetd/environments&amp;lt;/code&amp;gt;, set&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Launch Sway with a D-Bus server available, use:&lt;br /&gt;
dbus-run-session -- sway&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
D-Bus is required for PipeWire and screensharing in Firefox and Chromium. Running with &amp;lt;code&amp;gt;dbus-run-session&amp;lt;/code&amp;gt; is a convenience wrapper that will explicitly export the path of the session bus.&lt;br /&gt;
&lt;br /&gt;
== Install fonts ==&lt;br /&gt;
&lt;br /&gt;
Install DejaVu fonts, which has good Unicode coverage:&lt;br /&gt;
&lt;br /&gt;
 apk add font-dejavu&lt;br /&gt;
&lt;br /&gt;
== Install Sway ==&lt;br /&gt;
&lt;br /&gt;
 apk add sway \&lt;br /&gt;
    xwayland             \ # if you need xserver&lt;br /&gt;
    foot                 \ # default terminal emulator. Modify $term in config for a different one.&lt;br /&gt;
    wmenu                \ # default wayland native menu for choosing program and screensharing monitor&lt;br /&gt;
    swaylock swaylockd   \ # lockscreen tool&lt;br /&gt;
    grim                 \ # screenshot tool&lt;br /&gt;
    wl-clipboard         \ # clipboard management&lt;br /&gt;
    i3status             \ # simple status bar&lt;br /&gt;
    swayidle               # idle management (DPMS) daemon&lt;br /&gt;
&lt;br /&gt;
For complimentary software alternatives, see [https://github.com/swaywm/sway/wiki/Useful-add-ons-for-sway the relevant page from sway&#039;s wiki] or [https://wiki.gentoo.org/wiki/List_of_software_for_Wayland this list at Gentoo Wiki.]&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
Copy default sway configuration to &amp;lt;code&amp;gt;~/.config&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 # as normal user&lt;br /&gt;
 mkdir -p ~/.config/sway&lt;br /&gt;
 cp /etc/sway/config ~/.config/sway/&lt;br /&gt;
&lt;br /&gt;
Read through it to learn the default keybindings.&lt;br /&gt;
Sway configuration is mostly backwards-compatible with that of [[I3wm|i3]] and if you are looking for a solution for a specific issue, you may also try checking if it hasn&#039;t been provided for i3WM.&lt;br /&gt;
&lt;br /&gt;
For additional information, start at &amp;lt;code&amp;gt;man 5 sway&amp;lt;/code&amp;gt; and read the [https://github.com/swaywm/sway/wiki upstream wiki].&lt;br /&gt;
&lt;br /&gt;
== PipeWire and enable screensharing ==&lt;br /&gt;
&lt;br /&gt;
For audio playback, either PipeWire or PulseAudio work fine. The compositor has no involvement in audio playback.&lt;br /&gt;
&lt;br /&gt;
For screen sharing, applications are split into two categories:&lt;br /&gt;
&lt;br /&gt;
* Those which use the native wayland protocol, &amp;lt;/code&amp;gt;wlr-screencopy&amp;lt;/code&amp;gt;&lt;br /&gt;
* Those which use the API from Flatpak&#039;s &amp;lt;code&amp;gt;xdg-desktop-portal&amp;lt;/code&amp;gt; (this portal is also used by native non-Flatpak applications).&lt;br /&gt;
&lt;br /&gt;
Applications in the first group require not additional setup. Applications in the second group (which includes Firefox and Chromium) require setting up pipewire, wireplumber and xdg portals:&lt;br /&gt;
&lt;br /&gt;
{{Todo|Move this content into [[PipeWire]].}} &lt;br /&gt;
&lt;br /&gt;
 apk add pipewire pipewire-pulse pipewire-tools&lt;br /&gt;
 apk add wireplumber&lt;br /&gt;
 apk add xdg-desktop-portal xdg-desktop-portal-wlr&lt;br /&gt;
&lt;br /&gt;
Launch PipeWire with Sway. Use your service manager of choice, or add the following to sway config:&lt;br /&gt;
&lt;br /&gt;
 exec /usr/libexec/pipewire-launcher&lt;br /&gt;
&lt;br /&gt;
If your are using automatic D-Bus activation, you also need to set DBus variables for the portal and screensharing features to work:&lt;br /&gt;
&lt;br /&gt;
 exec dbus-update-activation-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway&lt;br /&gt;
&lt;br /&gt;
{{Box YELLOW|Unclear:|The following paragraph is unclear and needs further work}} &lt;br /&gt;
&lt;br /&gt;
Replace dmenu (depends on X server) with bemenu (Wayland native) for launching programs and selecting which screen to share in Firefox/Chromium:&lt;br /&gt;
&lt;br /&gt;
 set $menu bemenu-run | xargs swaymsg exec&lt;br /&gt;
&lt;br /&gt;
== Screen lock and suspend-to-RAM ==&lt;br /&gt;
&lt;br /&gt;
=== Without elogind ===&lt;br /&gt;
&lt;br /&gt;
Consider using {{Pkg|powerctl}}.&lt;br /&gt;
&lt;br /&gt;
=== With elogind ===&lt;br /&gt;
&lt;br /&gt;
Putting the system to sleep with elogind requires elevated privileges or additional configuration.&lt;br /&gt;
&lt;br /&gt;
For details on configuring &amp;lt;code&amp;gt;doas&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;elogind&amp;lt;/code&amp;gt;, see [[Elogind#Doas]]&lt;br /&gt;
&lt;br /&gt;
To put the system to sleep after 600 seconds, use:&lt;br /&gt;
&lt;br /&gt;
 exec swayidle -w timeout 600 &#039;doas /bin/loginctl suspend&#039;&lt;br /&gt;
&lt;br /&gt;
loginctl suspend command will trigger the screenlock, as mentioned in the section [[#Install elogind (optional)|Install elogind (optional)]] above.&lt;br /&gt;
&lt;br /&gt;
Do not lock the screen if program is running in full screen:&lt;br /&gt;
&lt;br /&gt;
 for_window [app_id=&amp;quot;^.*&amp;quot;] inhibit_idle fullscreen&lt;br /&gt;
&lt;br /&gt;
== Brightness control ==&lt;br /&gt;
&lt;br /&gt;
Controlling display backlight requires either the proper udev rules, or using some form of privilege escalation.&lt;br /&gt;
&lt;br /&gt;
{{Pkg|brightnessctl}} is a reliable alternative, although its default udev rules require too wide permissions (see {{Issue|15409}}). You may need your own rules, or configure doas to allow running it as an unprivileged user.&lt;br /&gt;
&lt;br /&gt;
Optionally enable brightnessctl service to restore brightness settings on reboot:&lt;br /&gt;
&lt;br /&gt;
 rc-update add brightnessctl&lt;br /&gt;
&lt;br /&gt;
== Output scaling for high resolution displays ==&lt;br /&gt;
&lt;br /&gt;
Without further configuration, program interfaces might be too small to use on high resolution displays.&lt;br /&gt;
&lt;br /&gt;
Sway supports the per-display configuration of&lt;br /&gt;
&lt;br /&gt;
* fractional (e.g., 1.5x), and&lt;br /&gt;
* integer scaling (e.g., 2x) &lt;br /&gt;
&lt;br /&gt;
However, fractional scaling is discouraged due to both the performance impact and the blurry output it produces. In this case, where 1x scaling is too small and 2x scaling is too large, program-specific GTK/QT based scaling is recommended.  See below.&lt;br /&gt;
&lt;br /&gt;
To enable Sway scaling, the user can first preview different scaling factors with &amp;lt;code&amp;gt;wdisplays&amp;lt;/code&amp;gt; package.  Note the output name (eDP-1, LVDS-1) and try apply scaling factors such as 1 and 2.  To make changes permanent, add&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
output &amp;lt;name&amp;gt; scale &amp;lt;factor&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to ~/.config/sway/config.&lt;br /&gt;
&lt;br /&gt;
To use toolkit scaling, use&lt;br /&gt;
{{Cmd|# for GTK-based programs such as firefox and emacs:&lt;br /&gt;
export GDK_DPI_SCALE{{=}}2&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; for QT-based programs&lt;br /&gt;
export QT_WAYLAND_FORCE_DPI{{=}}&amp;quot;physical&amp;quot;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; or if still too small, use a custom DPI&lt;br /&gt;
export QT_WAYLAND_FORCE_DPI{{=}}192 # 2x scaling&lt;br /&gt;
export QT_QPA_PLATFORM{{=}}&amp;quot;wayland-egl&amp;quot;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Screenshots ==&lt;br /&gt;
A simple tool that works well under Wayland is Grimshot. Example keybindings:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bindsym Print exec grimshot copy area&lt;br /&gt;
bindsym Shift+Print exec grimshot copy screen&lt;br /&gt;
bindsym Control+Print exec grimshot save area ~/Pictures/$(date +%d-%m-%Y-%H-%M-%S).png&lt;br /&gt;
bindsym Control+Shift+Print exec grimshot save screen ~/Pictures/$(date +%d-%m-%Y-%H-%M-%S).png&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/swaywm/sway/wiki/Useful-add-ons-for-sway the sway wiki&#039;s article] for a list of screenshot tools.&lt;br /&gt;
&lt;br /&gt;
== Tweaks ==&lt;br /&gt;
&lt;br /&gt;
=== Make clipboard content persistent ===&lt;br /&gt;
By default the clipboard content does not persist after terminating the program: you copy some text from Firefox and then exit Firefox, the copied text is also lost.&lt;br /&gt;
&lt;br /&gt;
Install clipman from testing repo and add the following to sway config:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
exec wl-paste --type text/plain --watch clipman store --histpath=&amp;quot;~/.local/state/clipman-primary.json&amp;quot;&lt;br /&gt;
bindsym $mod+h exec clipman pick --tool wofi --histpath=&amp;quot;~/.local/state/clipman-primary.json&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Firefox picture-in-picture mode/floating windows ===&lt;br /&gt;
Add this to your sway config file (modify the numeric values to suit your needs and your display):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for_window [app_id=&amp;quot;firefox&amp;quot; title=&amp;quot;^Picture-in-Picture$&amp;quot;] floating enable, move position 877 450, sticky enable, border none&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Start with NumLock enabled ===&lt;br /&gt;
Add this to your sway config file:&lt;br /&gt;
&amp;lt;code&amp;gt;input type:keyboard xkb_numlock enabled&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Change mouse cursor theme and size ===&lt;br /&gt;
Add to your sway config:&lt;br /&gt;
&lt;br /&gt;
 seat seat0 xcursor_theme my_cursor_theme my_cursor_size&lt;br /&gt;
&lt;br /&gt;
For example, set a mouse cursor, using GNOME Adwaita theme:&lt;br /&gt;
&lt;br /&gt;
 seat seat0 xcursor_theme Adwaita 16&lt;br /&gt;
&lt;br /&gt;
You can inspect their values with &amp;lt;code&amp;gt;echo $XCURSOR_SIZE&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;echo $XCURSOR_THEME&amp;lt;/code&amp;gt;. If reloading your config does not result in change, try logging out and in.&lt;br /&gt;
&lt;br /&gt;
{{Note|Wayland allows for client-side cursors. It is possible that applications do not evaluate the values of &amp;lt;code&amp;gt;$XCURSOR_SIZE&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;$XCURSOR_THEME&amp;lt;/code&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
=== Custom keyboard layout ===&lt;br /&gt;
&lt;br /&gt;
To use custom keyboard layout, just use&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
input type:keyboard {&lt;br /&gt;
  xkb_file /path/to/my/custom/layout&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Changing default application fonts ===&lt;br /&gt;
&lt;br /&gt;
See [[Fontconfig]]&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
If you encounter any issues, try running &amp;lt;code&amp;gt;sway -Vc /etc/sway/config&amp;lt;/code&amp;gt;. It will run sway with the default config file and set the output to be more verbose. It is generally a good idea to track your config files with git (when and if at all you use a remote repository for them, keep it private for security reasons). &lt;br /&gt;
&lt;br /&gt;
=== Flatpaks ===&lt;br /&gt;
{{main|Flatpak}}&lt;br /&gt;
Due to their sandboxing, flatpaks require the use of a portal frontend (xdg-desktop-portal) and backends (such as xdg-desktop-portal-wlr, xdg-desktop-portal-gtk, xdg-desktop-portal-gnome) that implement the methods. When in doubt, install multiple backends. For more information on backends, see [https://github.com/flatpak/xdg-desktop-portal/#using-portals flatpak&#039;s page on the subject]. In addition to the steps under the &amp;quot;Firefox Screensharing&amp;quot; section, it may also be necessary to launch additional backends in your Sway config file. Otherwise, you may run into GDBus errors as your flatpak fails to interface with the portal. This can cause issues such as with opening your file directories from a flatpak application.&lt;br /&gt;
&lt;br /&gt;
After installing different backends, you might need to add the relevant backends to your sway config file similarly to in the &amp;quot;Firefox Screensharing&amp;quot; section above. For example, an autostart section of your sway config file may include:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
exec /usr/libexec/xdg-desktop-portal-gtk&lt;br /&gt;
exec /usr/libexec/xdg-desktop-portal-wlr&lt;br /&gt;
exec /usr/libexec/xdg-desktop-portal-gnome&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is only needed if they are not started automatically via other means.&lt;br /&gt;
&lt;br /&gt;
=== Firefox (Flatpak) and/or GTK apps ===&lt;br /&gt;
==== Disappearing cursor ====&lt;br /&gt;
You may need to get an icon pack and possibly a theme from [https://www.pling.com/browse?cat=107&amp;amp;ord=latest Pling store] and set &amp;lt;code&amp;gt;GTK_THEME&amp;lt;/code&amp;gt; environmental variable. Alternatively you can install a theme      for all users (search [https://pkgs.alpinelinux.org/ Alpine Linux Packages] for &#039;&#039;*-icon-theme&#039;&#039;) using &amp;lt;code&amp;gt;apk add&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Missing file picker/cannot download ====&lt;br /&gt;
&lt;br /&gt;
Go to &#039;&#039;about:config&#039;&#039; and set &amp;lt;code&amp;gt;widget.use-xdg-desktop-portal.file-picker&amp;lt;/code&amp;gt; to 0.&lt;br /&gt;
&lt;br /&gt;
=== Failing to start under certain graphics cards/multiple wlroots stacked windows spawning upon start ===&lt;br /&gt;
As of Dec 31 2022, [https://developer.nvidia.com/docs/drive/drive-os/latest/linux/sdk/common/topics/window_system_stub/Gnome-WaylandDesktopShellSupport136.html Nvidia still doesn&#039;t fully support Wayland]. Therefore, the possible solutions are as outlined in the link, or setting your WLR_BACKENDS environmental variables to &amp;lt;code&amp;gt;drm,libinput&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;x11&amp;lt;/code&amp;gt; (add libinput here as well if you cannot use your mouse and keyboard after starting Sway). The latter also works for AMD/ATI cards (&#039;&#039;&#039;make sure to install libinput first&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
=== Sway socket not detected ===&lt;br /&gt;
&lt;br /&gt;
See [[Sway#Installation|Installation]] for instructions on how to set this environmental variable. This issue may occur with terminal multiplexers, such as [[tmux]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [https://wiki.archlinux.org/title/Sway Archwiki]&lt;br /&gt;
* [https://wiki.gentoo.org/wiki/Sway Gentoo Wiki]&lt;br /&gt;
* [https://wiki.postmarketos.org/wiki/Sway PostmarketOS Wiki]&lt;br /&gt;
&lt;br /&gt;
[[Category:Desktop]]&lt;br /&gt;
[[Category:Window Managers]]&lt;br /&gt;
[[Category:Wayland]]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Software_management&amp;diff=26576</id>
		<title>Software management</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Software_management&amp;diff=26576"/>
		<updated>2024-03-06T20:15:38Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: space between # and command&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If you want to run [https://www.gnu.org/software/libc/ glibc] programs in Alpine Linux, there are a few ways of doing so. You can install the [https://git.adelielinux.org/adelie/gcompat gcompat] compatibility layer, you can install glibc alongside [https://musl.libc.org/ musl] (manually, as it isn&#039;t packaged), or you could do it the easy way and use either Flatpak (the easiest), containers or a chroot.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because there are different use cases, this is just a slight overview about what&#039;s possible and what&#039;s sensible.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Your options =&lt;br /&gt;
&lt;br /&gt;
== gcompat ==&lt;br /&gt;
&lt;br /&gt;
gcompat is the go-to compatibility layer for Alpine users.&lt;br /&gt;
&lt;br /&gt;
 {{cmd|apk add {{pkg|gcompat}}}}&lt;br /&gt;
&lt;br /&gt;
After that you run your binaries as normal.&lt;br /&gt;
&lt;br /&gt;
== Flatpak ==&lt;br /&gt;
&lt;br /&gt;
Flatpak is by far the easiest method of running any graphical glibc program on Alpine.&lt;br /&gt;
Firstly install it.&lt;br /&gt;
&lt;br /&gt;
 {{cmd|apk add {{pkg|flatpak}}}}&lt;br /&gt;
&lt;br /&gt;
Then you can run any Flatpak application:&lt;br /&gt;
&lt;br /&gt;
 {{cmd|flatpak run &amp;lt;flatpak name&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
It is recommended to enable [https://flathub.org Flathub] using its instructions [https://flatpak.org/setup/Alpine/ here], as most glibc programs you might need will be packaged there.&lt;br /&gt;
&lt;br /&gt;
You can then install applications from it, for example:&lt;br /&gt;
&lt;br /&gt;
 {{cmd|flatpak install com.valvesoftware.Steam}}&lt;br /&gt;
&lt;br /&gt;
== Chroot ==&lt;br /&gt;
&lt;br /&gt;
An option that&#039;s easier to generalize to other glibc applications is installing a glibc-based distribution into a chroot. You can then either chroot into it, or use a symlink and some configuration to make its glibc (and associated libraries) usable from Alpine.&lt;br /&gt;
&lt;br /&gt;
After setting up a chroot using any of the methods described below, the loader can be set up in Alpine like so (these instructions are for a Debian chroot in /var/chroots/debian, on x86_64, but can be adapted to other systems by using the appropriate paths):&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkdir -p /lib64&lt;br /&gt;
ln -s /var/chroots/debian/lib/x86_64-linux-gnu/ld-2.33.so /lib64&lt;br /&gt;
printf &#039;/var/chroots/debian/lib/x86_64-linux-gnu\n/var/chroots/debian/usr/lib/x86_64-linux-gnu\n&#039; &amp;gt; /etc/ld.so.conf&lt;br /&gt;
/var/chroots/debian/sbin/ldconfig}}&lt;br /&gt;
&lt;br /&gt;
=== Gentoo Linux ===&lt;br /&gt;
&lt;br /&gt;
Select a stage3 from [https://www.gentoo.org/downloads/ here] and portage latest from [https://www.gentoo.org/downloads/mirrors/ here] at gentoo/snapshots/portage-latest.tar.xz.&lt;br /&gt;
&lt;br /&gt;
First,&lt;br /&gt;
&lt;br /&gt;
{{cmd|doas apk add {{pkg|xz}}}}&lt;br /&gt;
&lt;br /&gt;
Enter the chroot:&lt;br /&gt;
{{cmd|mkdir ~/chroot&lt;br /&gt;
cd ~/chroot&lt;br /&gt;
tar -xvf stage3-*.tar.xz&lt;br /&gt;
tar -xvf portage-latest.tar.xz&lt;br /&gt;
mv portage usr&lt;br /&gt;
doas mount --bind /dev dev&lt;br /&gt;
doas mount --bind /sys sys&lt;br /&gt;
doas mount -t proc proc proc&lt;br /&gt;
cp /etc/resolv.conf etc&lt;br /&gt;
doas chroot . /bin/bash}}&lt;br /&gt;
&lt;br /&gt;
And voilà, you have your working Gentoo chroot!&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can now take a look at [https://wiki.gentoo.org/wiki/Handbook:Main_Page Gentoo&#039;s Handbook] to find out how you can configure and install your system, or simply extract/copy the program you need to run in your chroot enviroment and execute it.&lt;br /&gt;
&lt;br /&gt;
Here is a wrapper script that is similar to &amp;lt;code&amp;gt;arch-chroot&amp;lt;/code&amp;gt; when you frequently reuse this chroot:&lt;br /&gt;
&lt;br /&gt;
Also, create an account with the same user name as host current user to the chroot or make changes to the userspec option to chroot line.&lt;br /&gt;
&lt;br /&gt;
{{Cat|gentoo-chroot.sh|&amp;lt;nowiki&amp;gt;!/bin/bash&lt;br /&gt;
CHROOT_PATH=&amp;quot;/home/$USER/chroot&amp;quot;&lt;br /&gt;
cd $CHROOT_PATH&lt;br /&gt;
mount | grep $CHROOT_PATH/dev || doas mount --bind /dev dev&lt;br /&gt;
mount | grep $CHROOT_PATH/sys || doas mount --bind /sys sys&lt;br /&gt;
mount | grep $CHROOT_PATH/proc || doas mount -t proc proc proc&lt;br /&gt;
cp /etc/resolv.conf etc&lt;br /&gt;
doas chroot --userspec=$USER:users . /bin/bash&lt;br /&gt;
echo &amp;quot;You must manually unmount $CHROOT_PATH/dev, $CHROOT_PATH/sys, $CHROOT_PATH/proc.&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Do at &amp;lt;code&amp;gt;chmod +x gentoo-chroot.sh&amp;lt;/code&amp;gt; to get it to work.&lt;br /&gt;
&lt;br /&gt;
=== Arch Linux ===&lt;br /&gt;
&lt;br /&gt;
Either use &#039;&#039;&#039;pacstrap&#039;&#039;&#039; (included with the arch-install-scripts package) or an Arch bootstrap image:&lt;br /&gt;
&lt;br /&gt;
{{cmd|doas apk add {{pkg|arch-install-scripts}}&lt;br /&gt;
mkdir ~/chroot &amp;amp;&amp;amp; cd ~/chroot&lt;br /&gt;
curl -O https://mirrors.edge.kernel.org/archlinux/iso/latest/archlinux-bootstrap-x86_64.tar.gz&lt;br /&gt;
doas tar xzf archlinux-bootstrap-x86_64.tar.gz &amp;amp;&amp;amp; rm archlinux-bootstrap-x86_64.tar.gz&lt;br /&gt;
doas sed -i &#039;/evowise/s/^#//&#039; root.x86_64/etc/pacman.d/mirrorlist&lt;br /&gt;
doas sed -i &#039;/CheckSpace/s/^/#/&#039; root.x86_64/etc/pacman.conf&lt;br /&gt;
doas arch-chroot root.x86_64&lt;br /&gt;
[chroot]# pacman-key --init&lt;br /&gt;
[chroot]# pacman-key --populate archlinux}}&lt;br /&gt;
&lt;br /&gt;
Once that is done, update the system and install the desired package(s) (denoted by &#039;&#039;&amp;quot;foo&amp;quot;&#039;&#039; in this example):&lt;br /&gt;
  &lt;br /&gt;
{{cmd|[chroot]# pacman -Syu &#039;&#039;foo&#039;&#039;}}&lt;br /&gt;
&lt;br /&gt;
=== Debian ===&lt;br /&gt;
{{todo|gresec referencs need to be cleanly removed from this section.}}&lt;br /&gt;
Use the provided debootstrap package to create the Debian chroot. &amp;lt;code&amp;gt;--arch&amp;lt;/code&amp;gt; is optional, depending of your needs.&lt;br /&gt;
&lt;br /&gt;
On the &#039;&#039;&#039;linux-grsec&#039;&#039;&#039; kernel, you will need to relax chroot limitations:&lt;br /&gt;
&lt;br /&gt;
  sudo apk add debootstrap&lt;br /&gt;
  for i in /proc/sys/kernel/grsecurity/chroot_*; do echo 0 | sudo tee $i; done&lt;br /&gt;
  mkdir ~/chroot&lt;br /&gt;
  sudo debootstrap --arch=i386 wheezy ~/chroot https://deb.debian.org/debian/&lt;br /&gt;
  for i in /proc/sys/kernel/grsecurity/chroot_*; do echo 1 | sudo tee $i; done&lt;br /&gt;
  sudo chroot ~/chroot /bin/bash&lt;br /&gt;
&lt;br /&gt;
You can now use &amp;lt;code&amp;gt;apt-get&amp;lt;/code&amp;gt; to install needed packages.&lt;br /&gt;
&lt;br /&gt;
== Containers ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s also possible to use Docker or Podman containers with a helper like Distrobox. This allows using graphical programs easily and doesn&#039;t require root privileges once set up.&lt;br /&gt;
&lt;br /&gt;
{{cmd|# apk add {{pkg|distrobox}}}}&lt;br /&gt;
&lt;br /&gt;
=== Distrobox + Podman ===&lt;br /&gt;
&lt;br /&gt;
{{cmd|# apk add {{pkg|podman}}}}&lt;br /&gt;
&lt;br /&gt;
Then set up rootless Podman, following [[Podman|these steps]].&lt;br /&gt;
You&#039;ll need to mount your root as shared for Distrobox to function.&lt;br /&gt;
&lt;br /&gt;
Fill in {{path|/etc/local.d/mount-rshared.start}} like so:&lt;br /&gt;
&lt;br /&gt;
{{cmd|#!/bin/sh&lt;br /&gt;
mount --make-rshared /}}&lt;br /&gt;
&lt;br /&gt;
Mark it as executable.&lt;br /&gt;
&lt;br /&gt;
{{cmd|# chmod +x /etc/local.d/mount-rshared.start}}&lt;br /&gt;
&lt;br /&gt;
Then autostart its service.&lt;br /&gt;
&lt;br /&gt;
{{cmd|# rc-update add local default&lt;br /&gt;
&amp;amp;#35; rc-service local start}}&lt;br /&gt;
&lt;br /&gt;
Finally you can create a container using your chosen image.&lt;br /&gt;
&lt;br /&gt;
{{cmd|$ distrobox create --image debian --name debian&lt;br /&gt;
$ distrobox enter debian}}&lt;br /&gt;
&lt;br /&gt;
It may also be necessary to allow X authorization for GUI programs to work.&lt;br /&gt;
&lt;br /&gt;
{{cmd|$ xhost +si:localuser:$USER}}&lt;br /&gt;
&lt;br /&gt;
== Chroot + Bubblewrap ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s also possible to use a Debian system chroot with Bubblewrap. This allows running programs without root.&lt;br /&gt;
&lt;br /&gt;
{{cmd|# apk add bubblewrap debootstrap&lt;br /&gt;
&amp;amp;#35; mkdir -p /var/chroots/debian&lt;br /&gt;
&amp;amp;#35; debootstrap --arch amd64 stable /var/chroots/debian/ https://deb.debian.org/debian}}&lt;br /&gt;
&lt;br /&gt;
Finally we can make an alias for bwrap.&lt;br /&gt;
&lt;br /&gt;
{{cmd|$ alias glibc{{=}}&amp;quot;LANG{{=}}en_US.UTF-8 bwrap --bind /var/chroots/debian / --dev-bind /dev /dev --proc /proc --bind /sys /sys --bind /run /run --bind /home /home --ro-bind /etc/resolv.conf /etc/resolv.conf --ro-bind /etc/passwd /etc/passwd --ro-bind /etc/group /etc/group&amp;quot;}}&lt;br /&gt;
&lt;br /&gt;
To run programs that use X11/Xorg you can use: &lt;br /&gt;
{{cmd|$ alias glibcX11{{=}}&amp;quot;LANG{{=}}en_US.UTF-8 bwrap --bind /var/chroots/debian / --dev-bind /dev /dev --proc /proc --bind /sys /sys --bind /run /run --bind /home /home --ro-bind /etc/resolv.conf /etc/resolv.conf --ro-bind /etc/passwd /etc/passwd --ro-bind /etc/group /etc/group --bind /tmp/.X11-unix/X0 /tmp/.X11-unix/X0 --setenv DISPLAY :0&amp;quot;}}&lt;br /&gt;
&lt;br /&gt;
In this case you might need to use xhost to allow local connections, e.g.:&lt;br /&gt;
{{cmd|# xhost + local:}}&lt;br /&gt;
&lt;br /&gt;
Now we can invoke glibc-built binaries like so:&lt;br /&gt;
{{cmd|$ glibc ./binary}} or {{cmd|$ glibcX11 ./binary}} &lt;br /&gt;
&lt;br /&gt;
For updating the Chroot or installing dependencies we can mount it and then login as root:&lt;br /&gt;
{{cmd|# mount --bind /dev /var/chroots/debian/dev&lt;br /&gt;
&amp;amp;#35; mount --bind /proc /var/chroots/debian/proc&lt;br /&gt;
&amp;amp;#35; chroot /var/chroots/debian /bin/bash&lt;br /&gt;
&amp;amp;#35; apt update &amp;amp;&amp;amp; apt upgrade}}&lt;br /&gt;
&lt;br /&gt;
After installing what you might want to umount the binds for dev and proc to avoid issues. &lt;br /&gt;
{{cmd|# umount /var/chroots/debian/dev}}&lt;br /&gt;
{{cmd|# umount /var/chroots/debian/proc}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Installation]]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Steam&amp;diff=26536</id>
		<title>Steam</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Steam&amp;diff=26536"/>
		<updated>2024-03-02T18:26:07Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: Links Sway article&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://store.steampowered.com/about/ Steam] is a popular game distribution platform by Valve.&lt;br /&gt;
&lt;br /&gt;
{{Note|Steam for Linux only supports Ubuntu LTS. Thus, do not turn to Valve for support for issues with Steam on Alpine Linux.}}&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Steam requires glibc to run, and thus doesn&#039;t straight up run on Alpine Linux.&lt;br /&gt;
To work around this problem, we&#039;ll use [https://wiki.alpinelinux.org/wiki/Flatpak Flatpak].&lt;br /&gt;
Make sure you have the Flathub repository installed.&lt;br /&gt;
&lt;br /&gt;
{{Note| commands prefixed with # are run as root, commands prefixed with $ are run as a regular user}}&lt;br /&gt;
&lt;br /&gt;
  # apk add {{pkg|flatpak|arch=x86_64}}&lt;br /&gt;
  $ flatpak --user remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo&lt;br /&gt;
  $ flatpak --user install com.valvesoftware.Steam&lt;br /&gt;
&lt;br /&gt;
After installation Steam can be started using it&#039;s .desktop file or on the command line:&lt;br /&gt;
&lt;br /&gt;
  $ flatpak run com.valvesoftware.Steam&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== My controllers aren&#039;t detected ===&lt;br /&gt;
&lt;br /&gt;
By default Steam doesn&#039;t have permission to read your controllers.&lt;br /&gt;
This can be fixed by installing an [[udev]] rule from the official Steam package, but the udev rules are also available as an Alpine package.&lt;br /&gt;
&lt;br /&gt;
  # apk add {{pkg|steam-devices|arch=x86_64}}&lt;br /&gt;
&lt;br /&gt;
=== SteamVR won&#039;t launch ===&lt;br /&gt;
&lt;br /&gt;
Out of the box SteamVR might not be able to launch and give you various errors. Steam tries to fix this itself by setting the right capabilities on the SteamVR binary, but this doesn&#039;t work in the Flatpak. Instead we&#039;ll have do it manually.&lt;br /&gt;
&lt;br /&gt;
  # setcap CAP_SYS_NICE+ep ~/.var/app/com.valvesoftware.Steam/data/Steam/steamapps/common/SteamVR/bin/linux64/vrcompositor-launcher&lt;br /&gt;
&lt;br /&gt;
Then restart Steam.&lt;br /&gt;
&lt;br /&gt;
There is an issue for this [https://github.com/flathub/com.valvesoftware.Steam/issues/636#issuecomment-779763326 on the Flathub repository].&lt;br /&gt;
&lt;br /&gt;
=== Steam - Error: OpenGL GLX extension not supported by display ===&lt;br /&gt;
&lt;br /&gt;
Add the Mesa gallium driver and reboot your system.&lt;br /&gt;
&lt;br /&gt;
 # apk add {{pkg|mesa-dri-gallium|arch=x86_64}}&lt;br /&gt;
&lt;br /&gt;
=== eventfd: Too many open files ===&lt;br /&gt;
&lt;br /&gt;
Due to a low amount of allowed open file descriptors, Proton games may crash shortly after launching. This can be worked around by disabling esync but many games will perform measurably worse without it. Instead, user limits should be increased. In order to do this, you will need [[PAM]] and a PAM enabled login.&lt;br /&gt;
&lt;br /&gt;
Add the following to &amp;lt;code&amp;gt;/etc/security/limits.conf&amp;lt;/code&amp;gt;:&lt;br /&gt;
 @users hard nofile 524288&lt;br /&gt;
&lt;br /&gt;
{{Note|Although you should already belong to the users group, you can run &amp;lt;code&amp;gt;groups&amp;lt;/code&amp;gt; to check.}}&lt;br /&gt;
&lt;br /&gt;
Reboot and run &amp;lt;code&amp;gt;ulimit -Hn&amp;lt;/code&amp;gt; to verify the new limits are applied.&lt;br /&gt;
&lt;br /&gt;
=== dbus-launch: no such file or directory ===&lt;br /&gt;
&lt;br /&gt;
Set up [[D-Bus|dbus]] for your session.&lt;br /&gt;
&lt;br /&gt;
=== Steam games launched via Proton crash before creating a window ===&lt;br /&gt;
&lt;br /&gt;
Instead of just using the in-Steam menu to install and select a Proton version, try installing the flatpak community build for Proton onto your system. There are several versions, depending on your desired stability, and the experimental version available in Flathub is called &amp;quot;com.valvesoftware.Steam.CompatibilityTool.Proton-Exp&amp;quot;. After you install your chosen version, go into Steam to specify compatibility tool for a game as usual. The installed community build will now be an option. Select that and try launching the game again.&lt;br /&gt;
&lt;br /&gt;
As your last resort, you can try installing [https://github.com/GloriousEggroll/proton-ge-custom proton-ge-custom], but please note that in order for this to be even detected by Steam, you will need to install Steam via Nix due to high level of isolation that Flatpaks utilize. This can however come at the expense of your [https://tosdr.org/en/service/180 privacy].&lt;br /&gt;
&lt;br /&gt;
=== Steam spams dmesg with x86/split lock detection entries ===&lt;br /&gt;
&lt;br /&gt;
Add the below line to {{path|/etc/sysctl.conf}}:&lt;br /&gt;
  kernel.split_lock_mitigate = 0&lt;br /&gt;
&lt;br /&gt;
=== Steam hangs on start with a steamwebhelper popup ===&lt;br /&gt;
&lt;br /&gt;
If this happens and your &amp;lt;pre&amp;gt;cat ~/.var/app/com.valvesoftware.Steam/.local/share/Steam/logs/steamwebhelper.log&amp;lt;/pre&amp;gt; says that you are missing X server or $Display, it means your DISPLAY is not present in the activation environment. For more information please see https://github.com/ValveSoftware/steam-for-linux/issues/10554 &lt;br /&gt;
&lt;br /&gt;
[[Sway]]: go into your sway config file and add DISPLAY to the following line, then restart:&lt;br /&gt;
&amp;lt;pre&amp;gt;exec dbus-activation-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more information about this line, please see the Alpine Wiki&#039;s entry on Sway&lt;br /&gt;
&lt;br /&gt;
Hyprland: add an exec-once to the configuration file at ~/.config/hypr/hyprland to set DISPLAY. Similarly to Sway you may already have a line that sets other variables. If so, add DISPLAY to the line. The line should look similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;exec-once = dbus-update-activation-environment DISPLAY&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Greetd&amp;diff=26533</id>
		<title>Greetd</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Greetd&amp;diff=26533"/>
		<updated>2024-02-29T14:42:11Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: may need to add greetd to the seat group&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:greetd}}&lt;br /&gt;
&lt;br /&gt;
[https://git.sr.ht/~kennylevinsen/greetd greetd] is a minimal and flexible login manager daemon that makes no assumptions about what you want to launch.&lt;br /&gt;
&lt;br /&gt;
This article focuses on alpine specific instructions. It is recommended to read the [https://man.sr.ht/~kennylevinsen/greetd/ greetd wiki] first.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
greetd needs to be combined with a greeter. You can find a list of available greeters here: {{pkg|greetd-*}}. Install the main package and the greeter you selected:&lt;br /&gt;
&lt;br /&gt;
{{cmd|# apk add {{pkg|greetd}} &amp;lt;greeter&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
You need to [[#Configuration|configure]] greetd before you can start it.&lt;br /&gt;
&lt;br /&gt;
Enable and start greetd:&lt;br /&gt;
{{cmd|&amp;lt;nowiki&amp;gt;# rc-update add greetd&lt;br /&gt;
# rc-service greetd start&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
Some graphical greeters (like gtkgreet) require &amp;lt;code&amp;gt;seatd&amp;lt;/code&amp;gt; or [[elogind]]. Add &amp;lt;code&amp;gt;rc_need=seatd&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;rc_need=elogind&amp;lt;/code&amp;gt; to {{path|/etc/conf.d/greetd}}.&lt;br /&gt;
When you use &amp;lt;code&amp;gt;seatd&amp;lt;/code&amp;gt; with a graphical greeter it needs the &amp;lt;code&amp;gt;seatd&amp;lt;/code&amp;gt; group:&lt;br /&gt;
{{cmd|# adduser greetd seat}}&lt;br /&gt;
&lt;br /&gt;
For text based greeters you want to make sure that &amp;lt;code&amp;gt;vt&amp;lt;/code&amp;gt; is set to &amp;lt;code&amp;gt;7&amp;lt;/code&amp;gt; in {{path|/etc/greetd/config.toml}}. (This will be the default in alpine 3.20)&lt;br /&gt;
&lt;br /&gt;
You might want to start a [[D-Bus#D-Bus_session|D-Bus session]] when the greetd session is started. &lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [https://man.sr.ht/~kennylevinsen/greetd/ greetd wiki]&lt;br /&gt;
* [https://wiki.archlinux.org/title/Greetd Arch wiki]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=PAM&amp;diff=26532</id>
		<title>PAM</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=PAM&amp;diff=26532"/>
		<updated>2024-02-29T14:26:27Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: link greetd page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To use PAM, the {{Pkg|linux-pam}} package itself must be installed as well as something for logging into the system that supports PAM. The &amp;lt;code&amp;gt;login&amp;lt;/code&amp;gt; bundled with &amp;lt;code&amp;gt;busybox&amp;lt;/code&amp;gt; does not support PAM. Instead, one of the following may be used:&lt;br /&gt;
&lt;br /&gt;
* [[greetd]] plus any greeter&lt;br /&gt;
* &amp;lt;code&amp;gt;login(1)&amp;lt;/code&amp;gt; provided by {{Pkg|shadow-login}}&lt;br /&gt;
* &amp;lt;code&amp;gt;login(1)&amp;lt;/code&amp;gt; provided by {{Pkg|util-linux-login}}&lt;br /&gt;
&lt;br /&gt;
{{warning|Login without PAM will still be possible. See {{issue|11730}}}}&lt;br /&gt;
&lt;br /&gt;
== ulimit ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ulimit&amp;lt;/code&amp;gt; permissions can be changed via &amp;lt;code&amp;gt;/etc/security/limits.conf&amp;lt;/code&amp;gt;. These will only apply if a PAM-compatible tool is used for logging in (as indicated above).&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [https://wiki.gentoo.org/wiki/PAM PAM on the Gentoo Wiki]&lt;br /&gt;
* [https://wiki.archlinux.org/title/PAM PAM on the ArchLinux Wiki]&lt;br /&gt;
&lt;br /&gt;
[[Category:Kernel]]&lt;br /&gt;
[[Category:Authentication]]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Greetd&amp;diff=26531</id>
		<title>Greetd</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Greetd&amp;diff=26531"/>
		<updated>2024-02-29T14:24:46Z</updated>

		<summary type="html">&lt;p&gt;Sertonix: finish sentence&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:greetd}}&lt;br /&gt;
&lt;br /&gt;
[https://git.sr.ht/~kennylevinsen/greetd greetd] is a minimal and flexible login manager daemon that makes no assumptions about what you want to launch.&lt;br /&gt;
&lt;br /&gt;
This article focuses on alpine specific instructions. It is recommended to read the [https://man.sr.ht/~kennylevinsen/greetd/ greetd wiki] first.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
greetd needs to be combined with a greeter. You can find a list of available greeters here: {{pkg|greetd-*}}. Install the main package and the greeter you selected:&lt;br /&gt;
&lt;br /&gt;
{{cmd|# apk add {{pkg|greetd}} &amp;lt;greeter&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
You need to [[#Configuration|configure]] greetd before you can start it.&lt;br /&gt;
&lt;br /&gt;
Enable and start greetd:&lt;br /&gt;
{{cmd|&amp;lt;nowiki&amp;gt;# rc-update add greetd&lt;br /&gt;
# rc-service greetd start&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
Some graphical greeters (like gtkgreet) require &amp;lt;code&amp;gt;seatd&amp;lt;/code&amp;gt; or [[elogind]]. Add &amp;lt;code&amp;gt;rc_need=seatd&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;rc_need=elogind&amp;lt;/code&amp;gt; to {{path|/etc/conf.d/greetd}}.&lt;br /&gt;
&lt;br /&gt;
For text based greeters you want to make sure that &amp;lt;code&amp;gt;vt&amp;lt;/code&amp;gt; is set to &amp;lt;code&amp;gt;7&amp;lt;/code&amp;gt; in {{path|/etc/greetd/config.toml}}. (This will be the default in alpine 3.20)&lt;br /&gt;
&lt;br /&gt;
You might want to start a [[D-Bus#D-Bus_session|D-Bus session]] when the greetd session is started. &lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [https://man.sr.ht/~kennylevinsen/greetd/ greetd wiki]&lt;br /&gt;
* [https://wiki.archlinux.org/title/Greetd Arch wiki]&lt;/div&gt;</summary>
		<author><name>Sertonix</name></author>
	</entry>
</feed>