<?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=Aduty</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=Aduty"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Aduty"/>
	<updated>2026-04-30T01:44:39Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Alpine_configuration_management_scripts&amp;diff=16237</id>
		<title>Alpine configuration management scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Alpine_configuration_management_scripts&amp;diff=16237"/>
		<updated>2019-08-21T22:16:01Z</updated>

		<summary type="html">&lt;p&gt;Aduty: /* setup-disk */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page summarizes the low-level behavior of the {{Path|/sbin/setup-*}} scripts on the Alpine ISO (and in a normal Alpine install).&lt;br /&gt;
&lt;br /&gt;
== setup-alpine ==&lt;br /&gt;
&lt;br /&gt;
For a higher-level walkthrough (using the &amp;quot;sys&amp;quot; installmode), see [[Install to disk|Basic HDD install]].&lt;br /&gt;
&lt;br /&gt;
This script accepts the following command-line switches (you can run &amp;lt;code&amp;gt;setup-alpine -h&amp;lt;/code&amp;gt; to see a usage message).&lt;br /&gt;
&lt;br /&gt;
{{Define|-a|Create an overlay file: this creates a temporary directory and saves its location in ROOT; however, the script doesn&#039;t export this variable so I think this feature isn&#039;t currently functional.}}&lt;br /&gt;
;-c &amp;lt;var&amp;gt;answerfile&amp;lt;/var&amp;gt;&lt;br /&gt;
:Create a new &amp;quot;answerfile&amp;quot;, with default choices. You can edit the file and then invoke &amp;lt;code&amp;gt;setup-alpine -f &amp;lt;var&amp;gt;answerfile&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
;-f &amp;lt;var&amp;gt;answerfile&amp;lt;/var&amp;gt;&lt;br /&gt;
:Use an existing &amp;quot;answerfile&amp;quot;, which may override some or all of the interactive prompts.&lt;br /&gt;
{{Define|-q|Run in &amp;quot;quick mode.&amp;quot; See below for details.}}&lt;br /&gt;
&lt;br /&gt;
The script&#039;s behavior is to do the following, in order. Bracketed options represent extra configuration choices that can be supplied when running the auxiliary setup scripts manually, or by supplying an &amp;quot;answerfile&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;setup-keymap&amp;lt;/code&amp;gt; [us us]&lt;br /&gt;
# [[#setup-hostname|setup-hostname]] [-n alpine-test]&lt;br /&gt;
# [[#setup-interfaces|setup-interfaces]] [-i &amp;lt; interfaces-file]&lt;br /&gt;
# &amp;lt;code&amp;gt;/etc/init.d/networking --quiet start &amp;amp;&amp;lt;/code&amp;gt;&lt;br /&gt;
# if none of the networking interfaces were configured using dhcp, then: [[#setup-dns|setup-dns]] [-d example.com -n &amp;quot;8.8.8.8 [...]&amp;quot;]&lt;br /&gt;
# set the root password&lt;br /&gt;
# if not in quick mode, then: [[#setup-timezone|setup-timezone]] [-z UTC | -z America/New_York | -p EST+5]&lt;br /&gt;
# enable the new hostname (&amp;lt;code&amp;gt;/etc/init.d/hostname --quiet restart&amp;lt;/code&amp;gt;)&lt;br /&gt;
# add &amp;lt;code&amp;gt;networking&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;urandom&amp;lt;/code&amp;gt; to the &#039;&#039;&#039;boot&#039;&#039;&#039; rc level, and &amp;lt;code&amp;gt;acpid&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;cron&amp;lt;/code&amp;gt; to the &#039;&#039;&#039;default&#039;&#039;&#039; rc level, and start the &#039;&#039;&#039;boot&#039;&#039;&#039; and &#039;&#039;&#039;default&#039;&#039;&#039; rc services&lt;br /&gt;
# extract the fully-qualified domain name and hostname from {{Path|/etc/resolv.conf}} and &amp;lt;code&amp;gt;hostname&amp;lt;/code&amp;gt;, and update {{Path|/etc/hosts}}&lt;br /&gt;
# [[#setup-proxy|setup-proxy]] [-q &amp;lt;nowiki&amp;gt;&amp;quot;http://webproxy:8080&amp;quot;&amp;lt;/nowiki&amp;gt;], and activate proxy if it was configured&lt;br /&gt;
# &amp;lt;code&amp;gt;setup-apkrepos&amp;lt;/code&amp;gt; [-r (to select a mirror randomly)]&lt;br /&gt;
# if not in quick mode, then: [[#setup-sshd|setup-sshd]] [-c openssh | dropbear | none]&lt;br /&gt;
# if not in quick mode, then: &amp;lt;code&amp;gt;setup-ntp&amp;lt;/code&amp;gt; [-c chrony | openntpd | busybox | none]&lt;br /&gt;
# if not in quick mode, then: &amp;lt;code&amp;gt;DEFAULT_DISK=none&amp;lt;/code&amp;gt; [[#setup-disk|setup-disk]] &amp;lt;code&amp;gt;-q&amp;lt;/code&amp;gt; [-m data /dev/sda]&lt;br /&gt;
# if installation mode selected during setup-disk was &amp;quot;data&amp;quot; instead of &amp;quot;sys&amp;quot;, then: &amp;lt;code&amp;gt;setup-lbu&amp;lt;/code&amp;gt; [/media/sdb1]&lt;br /&gt;
# if installation mode selected during setup-disk was &amp;quot;data&amp;quot; instead of &amp;quot;sys&amp;quot;, then: &amp;lt;code&amp;gt;setup-apkcache&amp;lt;/code&amp;gt; [/media/sdb1/cache | none]&lt;br /&gt;
&lt;br /&gt;
== setup-hostname ==&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;setup-hostname&amp;lt;/code&amp;gt; [-h] [-n hostname]&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;-h&#039;&#039;&#039; &amp;lt;var&amp;gt;Show help&amp;lt;/var&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;-n&#039;&#039;&#039; &amp;lt;var&amp;gt;Specify hostname&amp;lt;/var&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This script allows quick and easy setup of the system hostname by writing it to {{Path|/etc/hostname}}.  The script prevents you from writing an invalid hostname (such as one that used invalid characters or starts with a &#039;-&#039; or is too long).&lt;br /&gt;
The script can be invoked manually or is called as part of the &amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
== setup-interfaces ==&lt;br /&gt;
{{Cmd|setup-interfaces [-i &amp;amp;lt; &amp;lt;var&amp;gt;interfaces-file&amp;lt;/var&amp;gt;]}}&lt;br /&gt;
&lt;br /&gt;
Note that the contents of &amp;lt;var&amp;gt;interfaces-file&amp;lt;/var&amp;gt; has to be supplied as stdin, rather than naming the file as an additional argument. The contents should have the format of {{Path|/etc/network/interfaces}}, such as:&lt;br /&gt;
&lt;br /&gt;
 auto lo&lt;br /&gt;
 iface lo inet loopback&lt;br /&gt;
 &lt;br /&gt;
 auto eth0&lt;br /&gt;
 iface eth0 inet dhcp&lt;br /&gt;
     hostname alpine-test&lt;br /&gt;
&lt;br /&gt;
== setup-dns ==&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;setup-dns&amp;lt;/code&amp;gt; [-h] [-d domain name] [-n name server]&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;-h&#039;&#039;&#039; &amp;lt;var&amp;gt;Show help&amp;lt;/var&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;-d&#039;&#039;&#039; &amp;lt;var&amp;gt;specify search domain name&amp;lt;/var&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;-n&#039;&#039;&#039; &amp;lt;var&amp;gt;name server IP&amp;lt;/var&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The setup-dns script is stored in {{Path|/sbin/setup-dns}} and allows quick and simple setup of DNS servers (and a DNS search domain if required).  Simply running &amp;lt;code&amp;gt;setup-dns&amp;lt;/code&amp;gt; will allow interactive use of the script, or the options can be specified.&lt;br /&gt;
&lt;br /&gt;
The information fed to this script is written to {{Path|/etc/resolv.conf}}&lt;br /&gt;
&lt;br /&gt;
Example usage: {{Cmd|setup-dns -d example.org -n 8.8.8.8}}&lt;br /&gt;
&lt;br /&gt;
Example {{Path|/etc/resolv.conf}}:&lt;br /&gt;
&lt;br /&gt;
 search example.org&lt;br /&gt;
 nameserver 8.8.8.8&lt;br /&gt;
&lt;br /&gt;
It can be run manually but is also invoked in the &amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt; script unless interfaces are configured for DHCP.&lt;br /&gt;
&lt;br /&gt;
== setup-timezone ==&lt;br /&gt;
:&amp;lt;code&amp;gt;setup-timezone&amp;lt;/code&amp;gt; [-z UTC | -z America/New_York | -p EST+5]&lt;br /&gt;
&lt;br /&gt;
Can pre-select the timezone using either of these switches:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;-z&#039;&#039;&#039; &amp;lt;var&amp;gt;subfolder of&amp;lt;/var&amp;gt; {{Path|/usr/share/zoneinfo}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;-p&#039;&#039;&#039; &amp;lt;var&amp;gt;POSIX TZ format&amp;lt;/var&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== setup-proxy ==&lt;br /&gt;
:&amp;lt;code&amp;gt;setup-proxy&amp;lt;/code&amp;gt; [-hq] [PROXYURL]&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;-h&#039;&#039;&#039; &amp;lt;var&amp;gt;Show help&amp;lt;/var&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;-q&#039;&#039;&#039; &amp;lt;var&amp;gt;Quiet mode&amp;lt;/var&amp;gt; prevents changes from taking effect until after reboot&lt;br /&gt;
&lt;br /&gt;
This script requests the system proxy to use in the form &amp;lt;code&amp;gt;http://&amp;lt;proxyurl&amp;gt;:&amp;lt;port&amp;gt;&amp;lt;/code&amp;gt; for example:&lt;br /&gt;
&amp;lt;code&amp;gt;http://10.0.0.1:8080&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To set no system proxy use &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;.&lt;br /&gt;
This script exports the following environmental variables: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;http_proxy=$proxyurl&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;https_proxy=$proxyurl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ftp_proxy=$proxyurl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;$proxyurl&amp;lt;/code&amp;gt; is the value input.  &lt;br /&gt;
If &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt; was chosen then the value it is set to a blank value (and so no proxy is used).&lt;br /&gt;
&lt;br /&gt;
== setup-sshd ==&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;setup-sshd&amp;lt;/code&amp;gt; [-h] [-c choice of SSH daemon]&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;-h&#039;&#039;&#039; &amp;lt;var&amp;gt;Show help&amp;lt;/var&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;-c&#039;&#039;&#039; &amp;lt;var&amp;gt;SSH daemon&amp;lt;/var&amp;gt; where SSH daemon can be one of the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;openssh&amp;lt;/code&amp;gt; install the {{Pkg|openSSH}} daemon&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dropbear&amp;lt;/code&amp;gt; install the {{Pkg|dropbear}} daemon&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt; Do not install an SSH daemon&lt;br /&gt;
&lt;br /&gt;
Example usage: {{Cmd|setup-sshd -c dropbear}}&lt;br /&gt;
&lt;br /&gt;
The setup-sshd script is stored in {{Path|/sbin/setup-sshd}} and allows quick and simple setup of either the OpenSSH or Dropbear SSH daemon &amp;amp; client. &lt;br /&gt;
It can be run manually but is also invoked in the &amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
== setup-apkrepos ==&lt;br /&gt;
:&amp;lt;code&amp;gt;setup-apkrepos&amp;lt;/code&amp;gt; [-fhr] [REPO...]&lt;br /&gt;
&lt;br /&gt;
Setup &amp;lt;code&amp;gt;apk&amp;lt;/code&amp;gt; repositories.&lt;br /&gt;
&lt;br /&gt;
options:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;-f&#039;&#039;&#039;  &amp;lt;var&amp;gt;Detect and add fastest mirror&amp;lt;/var&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;-r&#039;&#039;&#039;  &amp;lt;var&amp;gt;Add a random mirror and do not prompt&amp;lt;/var&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;-1&#039;&#039;&#039;  &amp;lt;var&amp;gt;Add first mirror on the list (normally a CDN)&amp;lt;/var&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is run as part of the &amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
== setup-disk ==&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;DEFAULT_DISK=none setup-disk -q&amp;lt;/code&amp;gt; [-m data | sys] [&amp;lt;var&amp;gt;mountpoint directory&amp;lt;/var&amp;gt; | /dev/sda ...]&lt;br /&gt;
&lt;br /&gt;
In &amp;quot;sys&amp;quot; mode, it&#039;s an installer, it permanently installs Alpine on the disk, in &amp;quot;data&amp;quot; mode, it provides a larger and persistent /var volume.&lt;br /&gt;
&lt;br /&gt;
This script accepts the following command-line switches:&lt;br /&gt;
&lt;br /&gt;
;-k &amp;lt;var&amp;gt;kernel flavor&amp;lt;/var&amp;gt;&lt;br /&gt;
;-o &amp;lt;var&amp;gt;apkovl file&amp;lt;/var&amp;gt;&lt;br /&gt;
:Restore system from &amp;lt;var&amp;gt;apkovl file&amp;lt;/var&amp;gt;&lt;br /&gt;
;-m data | sys&lt;br /&gt;
:Don&#039;t prompt for installation mode. With &#039;&#039;&#039;-m data&#039;&#039;&#039;, the supplied devices are formatted to use as a {{Path|/var}} volume.&lt;br /&gt;
{{Define|-r|Use RAID1 with a single disk (degraded mode)}}&lt;br /&gt;
{{Define|-L|Create and use volumes in a LVM group}}&lt;br /&gt;
;-s &amp;lt;var&amp;gt;swap size in MB&amp;lt;/var&amp;gt;&lt;br /&gt;
:Use 0 to disable swap&lt;br /&gt;
{{Define|-q|Exit quietly if no disks are found}}&lt;br /&gt;
{{Define|-v|Verbose mode}}&lt;br /&gt;
&lt;br /&gt;
The script also honors the following environment variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;BOOT_SIZE&amp;lt;/code&amp;gt;&lt;br /&gt;
:Size of the boot partition in MB; defaults to 100. Only used if &#039;&#039;&#039;-m sys&#039;&#039;&#039; is specified or interactively selected.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SWAP_SIZE&amp;lt;/code&amp;gt;&lt;br /&gt;
:Size of the swap volume in MB; set to 0 to disable swap. If not specified, will default to twice RAM, up to 4096, but won&#039;t be more than 1/3 the size of the smallest disk, and if less than 64 will just be 0. Only used if &#039;&#039;&#039;-m sys&#039;&#039;&#039; is specified or interactively selected.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ROOTFS&amp;lt;/code&amp;gt;&lt;br /&gt;
:Filesystem to use for the / volume; defaults to ext4. Only used if &#039;&#039;&#039;-m sys&#039;&#039;&#039; is specified or interactively selected. Supported filesystems are: ext2 ext3 ext4 btrfs xfs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;BOOTFS&amp;lt;/code&amp;gt;&lt;br /&gt;
:Filesystem to use for the /boot volume; defaults to ext4. Only used if &#039;&#039;&#039;-m sys&#039;&#039;&#039; is specified or interactively selected. Supported filesystems are: ext2 ext3 ext4 btrfs xfs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;VARFS&amp;lt;/code&amp;gt;&lt;br /&gt;
:Filesystem to use for the /var volume; defaults to ext4. Only used if &#039;&#039;&#039;-m data&#039;&#039;&#039; is specified or interactively selected. Supported filesystems are: ext2 ext3 ext4 btrfs xfs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SYSROOT&amp;lt;/code&amp;gt;&lt;br /&gt;
:Mountpoint to use when creating volumes and doing traditional disk install (&#039;&#039;&#039;-m sys&#039;&#039;&#039;). Defaults to {{Path|/mnt}}.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;MBR&amp;lt;/code&amp;gt;&lt;br /&gt;
:Path of MBR binary code, defaults to {{Path|/usr/share/syslinux/mbr.bin}}.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;BOOTLOADER&amp;lt;/code&amp;gt;&lt;br /&gt;
:Bootloader to use, defaults to syslinux. Supported bootloaders are: grub syslinux zipl.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DISKLABEL&amp;lt;/code&amp;gt;&lt;br /&gt;
:Disklabel to use, defaults to dos. Supported disklabels are: dos gpt eckd.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Writes to /tmp/ovlfiles, /tmp/alpine-install-diskmode.out, and /tmp/sfdisk.out but that never seems to be used elsewhere. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Partitioning ===&lt;br /&gt;
&lt;br /&gt;
If you have complex partitioning needs, you can partition, format, and mount your volumes manually, then just supply the root mountpoint to &amp;lt;code&amp;gt;setup-disk&amp;lt;/code&amp;gt;. Doing so implicitly behaves as though &#039;&#039;&#039;-m sys&#039;&#039;&#039; had also been specified.&lt;br /&gt;
&lt;br /&gt;
See [[Setting up disks manually]] for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== RAID ====&lt;br /&gt;
&amp;lt;code&amp;gt;setup-disk&amp;lt;/code&amp;gt; will automatically build a RAID array if you supply the &#039;&#039;&#039;-r&#039;&#039;&#039; switch, or if you specify more than one device. The array will always be [https://en.m.wikipedia.org/wiki/Standard_RAID_levels#RAID_1 RAID1] (and [https://raid.wiki.kernel.org/index.php/RAID_superblock_formats#The_version-0.90_Superblock_Format --metadata=0.90]) for the /boot volumes, but will be [https://en.m.wikipedia.org/wiki/Standard_RAID_levels#RAID_5 RAID5] (and [https://raid.wiki.kernel.org/index.php/RAID_superblock_formats#The_version-1_Superblock_Format --metadata=1.2] for non-boot volumes when 3 or more devices are supplied.&lt;br /&gt;
&lt;br /&gt;
If you instead want to build your RAID array manually, see [[Setting up a software RAID array]]. Then format and mount the disks, and supply the root mountpoint to &amp;lt;code&amp;gt;setup-disk&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== LVM ====&lt;br /&gt;
&amp;lt;code&amp;gt;setup-disk&amp;lt;/code&amp;gt; will automatically build and use volumes in a LVM group if you supply the &#039;&#039;&#039;-L&#039;&#039;&#039; switch. The group and volumes created by the script will have the following names:&lt;br /&gt;
&lt;br /&gt;
* volume group: &#039;&#039;&#039;vg0&#039;&#039;&#039;&lt;br /&gt;
* swap volume: &#039;&#039;&#039;lv_swap&#039;&#039;&#039; (only created when swap size &amp;gt; 0)&lt;br /&gt;
* root volume: &#039;&#039;&#039;lv_root&#039;&#039;&#039; (only created when &#039;&#039;&#039;-m sys&#039;&#039;&#039; is specified or interactively selected)&lt;br /&gt;
* var volume: &#039;&#039;&#039;lv_var&#039;&#039;&#039; (only created when &#039;&#039;&#039;-m data&#039;&#039;&#039; is specified or interactively selected)&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;lv_var&#039;&#039;&#039; or &#039;&#039;&#039;lv_root&#039;&#039;&#039; volumes are created to occupy all remaining space in the volume group.&lt;br /&gt;
&lt;br /&gt;
If you need to change any of these settings, you can use &amp;lt;code&amp;gt;vgrename&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;lvrename&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;lvreduce&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;lvresize&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you instead want to build your LVM system manually, see [[Setting up Logical Volumes with LVM]]. Then format and mount the disks, and supply the root mountpoint to &amp;lt;code&amp;gt;setup-disk&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
=Setup-Disk Usage=&lt;br /&gt;
&lt;br /&gt;
usage: setup-disk [-hqr] [-k kernelflavor] [-m MODE] [-o apkovl] [-s SWAPSIZE]&lt;br /&gt;
		  [MOUNTPOINT | DISKDEV...]&lt;br /&gt;
&lt;br /&gt;
Install alpine on harddisk.&lt;br /&gt;
&lt;br /&gt;
If MOUNTPOINT is specified, then do a traditional disk install with MOUNTPOINT&lt;br /&gt;
as root.&lt;br /&gt;
&lt;br /&gt;
If DISKDEV is specified, then use the specified disk(s) without asking. If&lt;br /&gt;
multiple disks are specified then set them up in a RAID array. If there are&lt;br /&gt;
mode than 2 disks, then use raid level 5 instead of raid level 1.&lt;br /&gt;
&lt;br /&gt;
options:&lt;br /&gt;
 -h  Show this help&lt;br /&gt;
 -m  Use disk for MODE without asking, where MODE is either &#039;data&#039; or &#039;root&#039;&lt;br /&gt;
 -o  Restore system from given apkovl file&lt;br /&gt;
 -k  Use kernelflavor instead of $KERNEL_FLAVOR&lt;br /&gt;
 -L  Use LVM to manage partitions&lt;br /&gt;
 -q  Exit quietly if no disks are found&lt;br /&gt;
 -r  Enable software RAID1 with single disk&lt;br /&gt;
 -s  Use SWAPSIZE MB instead of $SWAP_SIZE MB for swap (Use 0 to disable swap)&lt;br /&gt;
 -v  Be more verbose about what is happening&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Disk Install Styles==&lt;br /&gt;
&lt;br /&gt;
You can select between &#039;sys&#039; or &#039;data&#039;.&lt;br /&gt;
&lt;br /&gt;
sys:&lt;br /&gt;
  This mode is a traditional disk install. The following partitions will be&lt;br /&gt;
  created on the disk: /boot, / (filesystem root) and swap.&lt;br /&gt;
    &lt;br /&gt;
  This mode may be used for development boxes, desktops, virtual servers, etc.&lt;br /&gt;
&lt;br /&gt;
data:&lt;br /&gt;
  This mode uses your disk(s) for data storage, not for the operating system.&lt;br /&gt;
  The system itself will run from tmpfs (RAM).&lt;br /&gt;
&lt;br /&gt;
  Use this mode if you only want to use the disk(s) for a mailspool, databases,&lt;br /&gt;
  logs, etc.&lt;br /&gt;
&lt;br /&gt;
none:&lt;br /&gt;
  Run without installing to disk.&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== setup-bootable ==&lt;br /&gt;
This is a standalone script; it&#039;s not invoked by &amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt; but must be run manually.&lt;br /&gt;
&lt;br /&gt;
Its purpose is to create media that boots into tmpfs by copying the contents of an ISO onto a USB key, CF, or similar media.&lt;br /&gt;
&lt;br /&gt;
For a higher-level walkthrough, see [[Create a Bootable USB#Creating_a_bootable_Alpine_Linux_USB_Stick_from_the_command_line|Creating a bootable Alpine Linux USB Stick from the command line]].&lt;br /&gt;
&lt;br /&gt;
This script accepts the following arguments and command-line switches (you can run &amp;lt;code&amp;gt;setup-bootable -h&amp;lt;/code&amp;gt; to see a usage message).&lt;br /&gt;
&lt;br /&gt;
{{Cmd|setup-bootable &amp;lt;var&amp;gt;source&amp;lt;/var&amp;gt; [&amp;lt;var&amp;gt;dest&amp;lt;/var&amp;gt;]}}&lt;br /&gt;
&lt;br /&gt;
The argument &amp;lt;var&amp;gt;source&amp;lt;/var&amp;gt; can be a directory or an ISO (will be mounted to &amp;lt;code&amp;gt;MNT&amp;lt;/code&amp;gt; or {{Path|/mnt}}) or a URL (will be downloaded with &amp;lt;code&amp;gt;WGET&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;wget&amp;lt;/code&amp;gt;). The argument &amp;lt;var&amp;gt;dest&amp;lt;/var&amp;gt; can be a directory mountpoint, or will default to {{Path|/media/usb}} if not supplied.&lt;br /&gt;
&lt;br /&gt;
{{Define|-k|Keep alpine_dev in {{Path|syslinux.cfg}}; otherwise, replace with UUID.}}&lt;br /&gt;
{{Define|-u|Upgrade mode: keep existing {{Path|syslinux.cfg}} and don&#039;t run &amp;lt;code&amp;gt;syslinux&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Define|-f|Overwrite {{Path|syslinux.cfg}} even if &#039;&#039;&#039;-u&#039;&#039;&#039; was specified.}}&lt;br /&gt;
{{Define|-s|Force the running of &amp;lt;code&amp;gt;syslinux&amp;lt;/code&amp;gt; even if &#039;&#039;&#039;-u&#039;&#039;&#039; was specified.}}&lt;br /&gt;
{{Define|-v|Verbose mode}}&lt;br /&gt;
&lt;br /&gt;
The script will ensure that &amp;lt;var&amp;gt;source&amp;lt;/var&amp;gt; and &amp;lt;var&amp;gt;dest&amp;lt;/var&amp;gt; are available; will copy the contents of &amp;lt;var&amp;gt;source&amp;lt;/var&amp;gt; to &amp;lt;var&amp;gt;dest&amp;lt;/var&amp;gt;, ensuring first that there&#039;s enough space; and unless &#039;&#039;&#039;-u&#039;&#039;&#039; was specified, will make &amp;lt;var&amp;gt;dest&amp;lt;/var&amp;gt; bootable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
== setup-cryptswap ==&lt;br /&gt;
This is a standalone script; it&#039;s not invoked by &amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt; but must be run manually.&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;setup-cryptswap&amp;lt;/code&amp;gt; [&amp;lt;var&amp;gt;partition&amp;lt;/var&amp;gt; | none]&lt;br /&gt;
&lt;br /&gt;
{{Todo|Does this script still work? At what stage can it be run: only after setup-alpine?}}&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== setup-xorg-base ==&lt;br /&gt;
This is a standalone script; it&#039;s not invoked by &amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt; but must be run manually.&lt;br /&gt;
&lt;br /&gt;
Installs the following packages: &amp;lt;code&amp;gt;xorg-server xf86-video-vesa xf86-input-evdev xf86-input-mouse xf86-input-keyboard udev&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Additional packages can be supplied as arguments to &amp;lt;code&amp;gt;setup-xorg-base&amp;lt;/code&amp;gt;. You might need, for example, some of: &amp;lt;code&amp;gt;xf86-input-synaptics xf86-video-&amp;lt;var&amp;gt;something&amp;lt;/var&amp;gt; xinit&amp;lt;/code&amp;gt;. For Qemu, see [[Qemu#Using_Xorg_inside_Qemu|Qemu]]. For Intel GPUs, see [[Intel Video]].&lt;br /&gt;
&lt;br /&gt;
== Documentation needed ==&lt;br /&gt;
&lt;br /&gt;
=== setup-xen-dom0 ===&lt;br /&gt;
&lt;br /&gt;
=== setup-gparted-desktop ===&lt;br /&gt;
Uses openbox.&lt;br /&gt;
&lt;br /&gt;
This is a standalone script; it&#039;s not invoked by &amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt; but must be run manually.&lt;br /&gt;
&lt;br /&gt;
=== setup-mta ===&lt;br /&gt;
Uses ssmtp.&lt;br /&gt;
&lt;br /&gt;
This is a standalone script; it&#039;s not invoked by &amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt; but must be run manually.&lt;br /&gt;
&lt;br /&gt;
=== setup-acf ===&lt;br /&gt;
This is a standalone script; it&#039;s not invoked by &amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt; but must be run manually.&lt;br /&gt;
&lt;br /&gt;
This script was named &amp;lt;code&amp;gt;setup-webconf&amp;lt;/code&amp;gt; before Alpine 1.9 beta 4.&lt;br /&gt;
&lt;br /&gt;
See [[:Category:ACF|ACF pages]] for more information.&lt;br /&gt;
&lt;br /&gt;
=== setup-ntp ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;/div&gt;</summary>
		<author><name>Aduty</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Managing_ACF&amp;diff=15957</id>
		<title>Managing ACF</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Managing_ACF&amp;diff=15957"/>
		<updated>2019-05-21T21:19:03Z</updated>

		<summary type="html">&lt;p&gt;Aduty: /* User Management */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Managing Your ACF Installation  =&lt;br /&gt;
&lt;br /&gt;
ACF is a powerful web application for configuring your Alpine Linux device. While all efforts are made to make ACF a secure application, it is, by its very nature, dangerous. The purpose of ACF is to give users the ability to administer the services running on the system. It is up to the system administrator to ensure that users do not receive more priviliges on ACF than they should have. Access control is provided by the following means: &lt;br /&gt;
&lt;br /&gt;
*System Configuration &lt;br /&gt;
*User Management &lt;br /&gt;
*Roles Management &lt;br /&gt;
*Package-specific Management&lt;br /&gt;
&lt;br /&gt;
== System Configuration  ==&lt;br /&gt;
&lt;br /&gt;
System administrators can do much to limit inappropriate access to ACF by properly managing the firewall and http services on the Alpine Linux device. Lock down access to ACF as much as possible. The following steps are highly recommended: &lt;br /&gt;
&lt;br /&gt;
*Limit ACF to encrypted (HTTPS) access &lt;br /&gt;
*Do not make ACF available on Internet connections (if possible) &lt;br /&gt;
*Limit ACF access to specified IP or MAC addresses&lt;br /&gt;
&lt;br /&gt;
{{tip|By default, ACF use &#039;&#039;&#039;mini_httpd&#039;&#039;&#039; and use port &#039;&#039;&#039;443&#039;&#039;&#039;. If you would like to change this port you simply have to specify the port in &#039;&#039;&#039;/etc/mini_httpd/mini_httpd.conf&#039;&#039;&#039; and restart: &#039;&#039;&#039;/etc/init.d/mini_httpd restart&#039;&#039;&#039;}}&lt;br /&gt;
&lt;br /&gt;
== User Management  ==&lt;br /&gt;
&lt;br /&gt;
ACF includes user management under the &#039;&#039;&#039;System&#039;&#039;&#039; | &#039;&#039;&#039;User Management&#039;&#039;&#039; menu. Select the &#039;&#039;&#039;New User&#039;&#039;&#039; button to create a new user. Separate user accounts should be created for&amp;amp;nbsp;each ACF user.&amp;amp;nbsp;Each user account may belong to any number of ACF roles. &lt;br /&gt;
&lt;br /&gt;
In Alpine Linux 1.8, the system includes two default users: &#039;&#039;alpine&#039;&#039; and &#039;&#039;foo&#039;&#039;. The default password for both users is &#039;&#039;test123&#039;&#039;. &#039;&#039;&#039;Replace the default users as soon as possible.&#039;&#039;&#039; In Alpine Linux 1.9 and later, you will be prompted to create an initial user the first time you try to log in. If you install ACF using the &#039;&#039;&#039;setup-acf&#039;&#039;&#039; script, you will be prompted for a password, and a &#039;&#039;root&#039;&#039; user will be created.&lt;br /&gt;
&lt;br /&gt;
{{Warning|If you installed ACF before defining the root password, you must execute &#039;&#039;&#039;acfpasswd -s root&#039;&#039;&#039;}}&lt;br /&gt;
&lt;br /&gt;
== Roles Management  ==&lt;br /&gt;
&lt;br /&gt;
ACF includes robust roles management under the &#039;&#039;&#039;System&#039;&#039;&#039; | &#039;&#039;&#039;Roles Management&#039;&#039;&#039; menu. Roles define the permissions that each user has in ACF. Specifically, they define which ACF actions a member of a role may invoke. The system provides built-in roles and the ability to create custom roles. &lt;br /&gt;
&lt;br /&gt;
=== Built-in Roles  ===&lt;br /&gt;
&lt;br /&gt;
Each ACF package comes with built-in roles that define some typical usage scenarios. The five basic built-in roles are: &lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| GUEST &lt;br /&gt;
| All users and guests (unauthenticated users) have access to basic status and login.&lt;br /&gt;
|-&lt;br /&gt;
| USER &lt;br /&gt;
| Typical end-users can view the status of services and restart them if necessary.&lt;br /&gt;
|-&lt;br /&gt;
| EDITOR &lt;br /&gt;
| Editors have the ability to change some settings using forms.&lt;br /&gt;
|-&lt;br /&gt;
| EXPERT &lt;br /&gt;
| Expert users can directly edit service configuration files.&lt;br /&gt;
|-&lt;br /&gt;
| ADMIN &lt;br /&gt;
| Administrators have access to all ACF actions.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These built-in roles can be selected on a controller-by-controller basis (ie. /alpine-baselayout/alpine-baselayout/ADMIN) or globally (ie. ADMIN). The global built-in roles consist of all of the permissions of all of the corresponding controller-by-controller roles (ie. ADMIN contains /x/y/ADMIN for every x and y installed).&lt;br /&gt;
&lt;br /&gt;
ACF packages may also include built-in roles that define specific usage scenarios for that package. For instance, acf-openssl is a fully functional certificate authority that separates the roles of submitting and approving certificate requests: &lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| CERT_REQUESTER &lt;br /&gt;
| Users may submit requests for certificates and download those certificates when approved.&lt;br /&gt;
|-&lt;br /&gt;
| CERT_APPROVER &lt;br /&gt;
| Users may approve certificate requests.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A system administrator may edit the built-in roles to add permissions, but may not delete the built-in roles or their default permissions. This feature may allow the system administrator to add some permission to one of the lower roles to meet his needs. This is the only way to modify the permissions of guests (unauthenticated users). More typically, a system administrator would assign each user to custom roles or to a combination of built-in and custom roles. &lt;br /&gt;
&lt;br /&gt;
=== Custom Roles  ===&lt;br /&gt;
&lt;br /&gt;
Custom roles give the system administrator the ability to define roles that match the custom needs of his system. Custom roles may include as many or as few permissions as desired. So, a system administrator may fully define the permissions of each distinct user type in a separate role, or he may use combinations of more specific roles for each user. &lt;br /&gt;
&lt;br /&gt;
Custom roles are created using the &#039;&#039;&#039;New Role&#039;&#039;&#039; button. The &#039;&#039;&#039;Create New Role&#039;&#039;&#039; and &#039;&#039;&#039;Edit Role&#039;&#039;&#039; forms list every ACF action currently installed on the system (depending on which ACF packages are installed). This list can be extensive if several ACF packages are installed. In general, each ACF package stands on its own, so permissions for one package do not depend on having permissions for any other packages. The built-in roles should be used as guides to show which permissions are typically grouped together. &lt;br /&gt;
&lt;br /&gt;
== Package-specific Management  ==&lt;br /&gt;
&lt;br /&gt;
ACF packages may include their own package-specific management. &lt;br /&gt;
&lt;br /&gt;
acf-tinydns manages a tinydns DNS server and includes permissions management on a domain by domain basis. This is available under the &#039;&#039;&#039;Networking&#039;&#039;&#039; | &#039;&#039;&#039;DNS&#039;&#039;&#039; | &#039;&#039;&#039;Permissions&#039;&#039;&#039; tab. The tinydns ACF&amp;amp;nbsp;package&amp;amp;nbsp;is designed to keep configuration for each domain in a separate file (see the &#039;&#039;&#039;List Domains&#039;&#039;&#039; tab). Permissions can then be set as to which domains may be viewed / edited by a specific user or members of a particular role.&lt;br /&gt;
&lt;br /&gt;
= More Information =&lt;br /&gt;
For more information, please see [[Alpine Configuration Framework Design]].&lt;br /&gt;
&lt;br /&gt;
[[Category:ACF]]&lt;br /&gt;
[[Category:Security]]&lt;/div&gt;</summary>
		<author><name>Aduty</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Managing_ACF&amp;diff=15956</id>
		<title>Managing ACF</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Managing_ACF&amp;diff=15956"/>
		<updated>2019-05-21T21:16:56Z</updated>

		<summary type="html">&lt;p&gt;Aduty: /* System Configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Managing Your ACF Installation  =&lt;br /&gt;
&lt;br /&gt;
ACF is a powerful web application for configuring your Alpine Linux device. While all efforts are made to make ACF a secure application, it is, by its very nature, dangerous. The purpose of ACF is to give users the ability to administer the services running on the system. It is up to the system administrator to ensure that users do not receive more priviliges on ACF than they should have. Access control is provided by the following means: &lt;br /&gt;
&lt;br /&gt;
*System Configuration &lt;br /&gt;
*User Management &lt;br /&gt;
*Roles Management &lt;br /&gt;
*Package-specific Management&lt;br /&gt;
&lt;br /&gt;
== System Configuration  ==&lt;br /&gt;
&lt;br /&gt;
System administrators can do much to limit inappropriate access to ACF by properly managing the firewall and http services on the Alpine Linux device. Lock down access to ACF as much as possible. The following steps are highly recommended: &lt;br /&gt;
&lt;br /&gt;
*Limit ACF to encrypted (HTTPS) access &lt;br /&gt;
*Do not make ACF available on Internet connections (if possible) &lt;br /&gt;
*Limit ACF access to specified IP or MAC addresses&lt;br /&gt;
&lt;br /&gt;
{{tip|By default, ACF use &#039;&#039;&#039;mini_httpd&#039;&#039;&#039; and use port &#039;&#039;&#039;443&#039;&#039;&#039;. If you would like to change this port you simply have to specify the port in &#039;&#039;&#039;/etc/mini_httpd/mini_httpd.conf&#039;&#039;&#039; and restart: &#039;&#039;&#039;/etc/init.d/mini_httpd restart&#039;&#039;&#039;}}&lt;br /&gt;
&lt;br /&gt;
== User Management  ==&lt;br /&gt;
&lt;br /&gt;
ACF includes user management under the &#039;&#039;&#039;System&#039;&#039;&#039; | &#039;&#039;&#039;User Management&#039;&#039;&#039; menu. Select the &#039;&#039;&#039;New User&#039;&#039;&#039; button to create a new user. Separate user accounts should be created for&amp;amp;nbsp;each ACF user.&amp;amp;nbsp;Each user account may belong to any number of ACF roles. &lt;br /&gt;
&lt;br /&gt;
In Alpine Linux 1.8, the system includes two default users: &#039;&#039;alpine&#039;&#039; and &#039;&#039;foo&#039;&#039;. The default password for both users is &#039;&#039;test123&#039;&#039;. &#039;&#039;&#039;Replace the default users as soon as possible.&#039;&#039;&#039; In Alpine Linux 1.9 and later, you will be prompted to create an initial user the first time you try to log in. If you install ACF using the &#039;&#039;&#039;setup-acf&#039;&#039;&#039; script, you will be prompted for a password, and a &#039;&#039;root&#039;&#039; user will be created.&lt;br /&gt;
&lt;br /&gt;
{{Warning|If you did install ACF before define the root password, you must execute &#039;&#039;&#039;acfpasswd -s root&#039;&#039;&#039;}}&lt;br /&gt;
&lt;br /&gt;
== Roles Management  ==&lt;br /&gt;
&lt;br /&gt;
ACF includes robust roles management under the &#039;&#039;&#039;System&#039;&#039;&#039; | &#039;&#039;&#039;Roles Management&#039;&#039;&#039; menu. Roles define the permissions that each user has in ACF. Specifically, they define which ACF actions a member of a role may invoke. The system provides built-in roles and the ability to create custom roles. &lt;br /&gt;
&lt;br /&gt;
=== Built-in Roles  ===&lt;br /&gt;
&lt;br /&gt;
Each ACF package comes with built-in roles that define some typical usage scenarios. The five basic built-in roles are: &lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| GUEST &lt;br /&gt;
| All users and guests (unauthenticated users) have access to basic status and login.&lt;br /&gt;
|-&lt;br /&gt;
| USER &lt;br /&gt;
| Typical end-users can view the status of services and restart them if necessary.&lt;br /&gt;
|-&lt;br /&gt;
| EDITOR &lt;br /&gt;
| Editors have the ability to change some settings using forms.&lt;br /&gt;
|-&lt;br /&gt;
| EXPERT &lt;br /&gt;
| Expert users can directly edit service configuration files.&lt;br /&gt;
|-&lt;br /&gt;
| ADMIN &lt;br /&gt;
| Administrators have access to all ACF actions.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These built-in roles can be selected on a controller-by-controller basis (ie. /alpine-baselayout/alpine-baselayout/ADMIN) or globally (ie. ADMIN). The global built-in roles consist of all of the permissions of all of the corresponding controller-by-controller roles (ie. ADMIN contains /x/y/ADMIN for every x and y installed).&lt;br /&gt;
&lt;br /&gt;
ACF packages may also include built-in roles that define specific usage scenarios for that package. For instance, acf-openssl is a fully functional certificate authority that separates the roles of submitting and approving certificate requests: &lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| CERT_REQUESTER &lt;br /&gt;
| Users may submit requests for certificates and download those certificates when approved.&lt;br /&gt;
|-&lt;br /&gt;
| CERT_APPROVER &lt;br /&gt;
| Users may approve certificate requests.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A system administrator may edit the built-in roles to add permissions, but may not delete the built-in roles or their default permissions. This feature may allow the system administrator to add some permission to one of the lower roles to meet his needs. This is the only way to modify the permissions of guests (unauthenticated users). More typically, a system administrator would assign each user to custom roles or to a combination of built-in and custom roles. &lt;br /&gt;
&lt;br /&gt;
=== Custom Roles  ===&lt;br /&gt;
&lt;br /&gt;
Custom roles give the system administrator the ability to define roles that match the custom needs of his system. Custom roles may include as many or as few permissions as desired. So, a system administrator may fully define the permissions of each distinct user type in a separate role, or he may use combinations of more specific roles for each user. &lt;br /&gt;
&lt;br /&gt;
Custom roles are created using the &#039;&#039;&#039;New Role&#039;&#039;&#039; button. The &#039;&#039;&#039;Create New Role&#039;&#039;&#039; and &#039;&#039;&#039;Edit Role&#039;&#039;&#039; forms list every ACF action currently installed on the system (depending on which ACF packages are installed). This list can be extensive if several ACF packages are installed. In general, each ACF package stands on its own, so permissions for one package do not depend on having permissions for any other packages. The built-in roles should be used as guides to show which permissions are typically grouped together. &lt;br /&gt;
&lt;br /&gt;
== Package-specific Management  ==&lt;br /&gt;
&lt;br /&gt;
ACF packages may include their own package-specific management. &lt;br /&gt;
&lt;br /&gt;
acf-tinydns manages a tinydns DNS server and includes permissions management on a domain by domain basis. This is available under the &#039;&#039;&#039;Networking&#039;&#039;&#039; | &#039;&#039;&#039;DNS&#039;&#039;&#039; | &#039;&#039;&#039;Permissions&#039;&#039;&#039; tab. The tinydns ACF&amp;amp;nbsp;package&amp;amp;nbsp;is designed to keep configuration for each domain in a separate file (see the &#039;&#039;&#039;List Domains&#039;&#039;&#039; tab). Permissions can then be set as to which domains may be viewed / edited by a specific user or members of a particular role.&lt;br /&gt;
&lt;br /&gt;
= More Information =&lt;br /&gt;
For more information, please see [[Alpine Configuration Framework Design]].&lt;br /&gt;
&lt;br /&gt;
[[Category:ACF]]&lt;br /&gt;
[[Category:Security]]&lt;/div&gt;</summary>
		<author><name>Aduty</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Alpine_Configuration_Framework_Design&amp;diff=15955</id>
		<title>Alpine Configuration Framework Design</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Alpine_Configuration_Framework_Design&amp;diff=15955"/>
		<updated>2019-05-21T21:14:34Z</updated>

		<summary type="html">&lt;p&gt;Aduty: /* Howto contribute */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Alpine Configuration Framework  =&lt;br /&gt;
&lt;br /&gt;
The Alpine Configuration Framework (ACF) is a mvc-style application for configuring an Alpine Linux device. The primary focus is for a web interface - ACF&#039;s main goal is to be a light-weight MVC &amp;quot;webmin&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
== Why Haserl + Lua  ==&lt;br /&gt;
&lt;br /&gt;
Other competitors in the arena were Webmin, Ruby on Rails, PHP with templates. &lt;br /&gt;
&lt;br /&gt;
A full webmin (Perl), RoR or PHP implementation each require several MB of installed code, and can have very slow startup times, especially when used in &amp;quot;cgi&amp;quot; mode. After evaluating many options, we found that [http://www.lua.org Lua] has the following advantages: &lt;br /&gt;
&lt;br /&gt;
*It is small (typically ~200KB of compiled code) &lt;br /&gt;
*It compiles and runs much faster than [http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&amp;amp;lang=lua&amp;amp;lang2=php PHP], [http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&amp;amp;lang=lua&amp;amp;lang2=perl Perl] or [http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&amp;amp;lang=lua&amp;amp;lang2=ruby Ruby] &lt;br /&gt;
*It provides a &amp;quot;normal&amp;quot; scripting language with [http://en.wikipedia.org/wiki/Lua_(programming_language)#Features features] similar to PHP, perl, java, [[awk]], etc.&lt;br /&gt;
&lt;br /&gt;
Haserl + Lua provides a &#039;good enough&#039; toolset to build a full-featured web application.&lt;br /&gt;
&lt;br /&gt;
== Why ACF is MVC  ==&lt;br /&gt;
&lt;br /&gt;
The MVC design pattern is used to separate presentation information from control logic. By MVC we mean: &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Model&#039;&#039;&#039; - code that reads / writes a config file, starts / stops daemons, or does other work modifying the router. &lt;br /&gt;
*&#039;&#039;&#039;View&#039;&#039;&#039; - code that formats data for output &lt;br /&gt;
*&#039;&#039;&#039;Controller&#039;&#039;&#039; - code that glues the two together&lt;br /&gt;
&lt;br /&gt;
Note the lack of words like: HTML, XML, OO, AJAX, etc. The purpose of ACF&#039;s MVC is simply to separate the configuration logic from the presentation of the output. &lt;br /&gt;
&lt;br /&gt;
The flow of a single transaction is: &lt;br /&gt;
&lt;br /&gt;
start -&amp;amp;gt; execute requested function in &#039;&#039;&#039;controller&#039;&#039;&#039;, optionally reading/writing a file using functions in the &#039;&#039;&#039;model&#039;&#039;&#039; -&amp;amp;gt; execute the &#039;&#039;&#039;view&#039;&#039;&#039; to format the output -&amp;amp;gt; end &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Every&#039;&#039; transaction follows this pattern. For ACF developers, the focus should be on getting a model that does a proper job of abstracting the config file into useable entities and then building a controller that presents useable &amp;quot;actions&amp;quot; based on the model. The presentation layer should be last on the priority list. &lt;br /&gt;
&lt;br /&gt;
Of course, as with all MVC designs, the ACF MVC design is not quite &#039;pure&#039; MVC and has evolved over time. Most of the &#039;&#039;&#039;controller&#039;&#039;&#039; functionality is handled by the framework code. The framework code will also automatically generate views for HTML, JSON, and a few other viewtypes if no &#039;&#039;&#039;view&#039;&#039;&#039; is defined. Also, many &#039;&#039;&#039;model&#039;&#039;&#039; functions are implemented in helper libraries. We have attempted to make it as easy as possible to develop new ACF modules.&lt;br /&gt;
&lt;br /&gt;
For good background information on what ACF attempts to do, please see Terence Parr&#039;s paper &amp;quot;Enforcing Strict Model-View Separation in Template Engines&amp;quot; at [http://www.cs.usfca.edu/~parrt/papers/mvc.templates.pdf http://www.cs.usfcs.edu] or the [[Media:Mvc.templates.pdf|local copy]] of the pdf. &lt;br /&gt;
&lt;br /&gt;
= Starting ACF  =&lt;br /&gt;
Installing [[ACF]] is really simple. Just type this in your terminal and follow the instructions to setup [[ACF]]:&lt;br /&gt;
{{cmd|setup-acf}}&lt;br /&gt;
&#039;&#039;(This script will install mini-httpd, create a certificate, starts mini-httpd in HTTPS mode and installs some basic acf-packages.)&#039;&#039;&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To view [[ACF]], simply browse to your machine https://&amp;amp;lt;hostname&amp;amp;gt;/&lt;br /&gt;
&lt;br /&gt;
See also [[Managing ACF|Managing Your ACF Installation]]&lt;br /&gt;
&lt;br /&gt;
{{tip|Alternately, you can manually install ACF and your web server. The two critical ACF packages are acf-core and acf-alpine-baselayout. The ACF packages will install to /usr/share/acf. You can configure your web server to give access to /usr/share/acf/www and run cgi scripts from /usr/share/acf/www/cgi-bin, and you should be able to view ACF.}}&lt;br /&gt;
&lt;br /&gt;
{{Warning| In Alpine Linux 1.8, the system includes two default users: &#039;&#039;alpine&#039;&#039; and &#039;&#039;foo&#039;&#039;. &#039;alpine&#039; is given ADMIN rights and &#039;foo&#039; is given USER rights. The default password for both users is &#039;&#039;test123&#039;&#039;. &#039;&#039;&#039;Replace the default users as soon as possible.&#039;&#039;&#039;&amp;lt;BR&amp;gt;&lt;br /&gt;
As of 1.9 you will get prompted for a password for the &#039;root&#039; account so this is no issue for newer Alpine Linux versions.}}&lt;br /&gt;
&lt;br /&gt;
= ACF Developer&#039;s Guides  =&lt;br /&gt;
&lt;br /&gt;
#[[ACF mvc.lua reference|mvc.lua reference]] - mvc.lua is the core of ACF &lt;br /&gt;
#[[ACF mvc.lua example|mvc.lua example]] - build a simple (command-line) application &lt;br /&gt;
#[[ACF acf www-controller.lua reference|acf www-controller reference]] - ACF www application functions &lt;br /&gt;
#[[ACF acf www example|acf www-controller example]] - webify the above examples &lt;br /&gt;
#[[ACF how to write]] - Step by step howto for writing ACF modules &lt;br /&gt;
#[[ACF core principles]] - Things that are standard across the application &lt;br /&gt;
#[[LPOSIX]] - Documentation for the Lua Posix functions &lt;br /&gt;
#[[ACF Libraries]] - Document the libraries and common functions &lt;br /&gt;
#[[Writing ACF Views]] - Guide for writing a view &lt;br /&gt;
#[[Writing ACF Controllers]] - Guide for writing a controller &lt;br /&gt;
#[[Writing ACF Models]] - Guide for writing a model&lt;br /&gt;
&lt;br /&gt;
== Other useful links  ==&lt;br /&gt;
&lt;br /&gt;
#[http://www.lua.org/manual/5.1/ Lua 5.1 Reference Manual] &lt;br /&gt;
#[http://www.lua.org/pil/ Programming in Lua (first edition)]&lt;br /&gt;
#[[Managing ACF]]&lt;br /&gt;
&lt;br /&gt;
= ACF Layout  =&lt;br /&gt;
&lt;br /&gt;
ACF has support for multiple skins.&amp;lt;br&amp;gt;Only a few skins are available. Feel free to contribute in programming css-stylesheets for ACF. &lt;br /&gt;
&lt;br /&gt;
== How to contribute  ==&lt;br /&gt;
&lt;br /&gt;
First, download ACF using git or installing available ACF modules using &#039;apk add&#039;.&amp;lt;br&amp;gt;Easiest is if you download the latest Alpine Linux ISO, boot a box from the ISO and then run &#039;setup-alpine&#039; and &#039;setup-acf&#039;. That way you get a running environment fast and easy!&amp;lt;br&amp;gt;Some example skins are available: &lt;br /&gt;
&lt;br /&gt;
*/usr/share/acf/www/skins/alps/ &lt;br /&gt;
*/usr/share/acf/www/skins/cloud/ &lt;br /&gt;
*/usr/share/acf/www/skins/ice/ &lt;br /&gt;
*/usr/share/acf/www/skins/snow/&lt;br /&gt;
*/usr/share/acf/www/skins/wik/ &lt;br /&gt;
&lt;br /&gt;
Make a new skin folder. &lt;br /&gt;
&lt;br /&gt;
 mkdir -p /etc/acf/skins/myskin&lt;br /&gt;
&lt;br /&gt;
Create a css file called as the folder. &lt;br /&gt;
&lt;br /&gt;
 touch /etc/acf/skins/myskin/myskin.css&lt;br /&gt;
&lt;br /&gt;
Now you can start editing your myskin.css.&amp;lt;br&amp;gt;If you have ACF running on the computer, you can browse to https://&amp;amp;lt;hostname&amp;amp;gt;/cgi-bin/acf/acf-util/skins/read and switch to your new skin (called myskin) and see the results of your changes. &lt;br /&gt;
&lt;br /&gt;
Pack your myskin folder, containing your css file (and images, if there are any).&amp;lt;br&amp;gt;Send this patch to acf@lists.alpinelinux.org &#039;&#039;(&#039;&#039;&#039;Note:&#039;&#039;&#039; Don&#039;t forget to [http://wiki.alpinelinux.org/w/index.php?title=Mailing_lists subscribe] before sending your patch)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= ACF Packages  =&lt;br /&gt;
&lt;br /&gt;
Look at [http://wiki.alpinelinux.org/w/index.php?title=ACF_packages ACF packages] to see available ACF modules and their status.&lt;br /&gt;
&lt;br /&gt;
[[Category:ACF]] [[Category:Lua]]&lt;/div&gt;</summary>
		<author><name>Aduty</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Raspberry_Pi&amp;diff=15927</id>
		<title>Raspberry Pi</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Raspberry_Pi&amp;diff=15927"/>
		<updated>2019-05-07T20:06:20Z</updated>

		<summary type="html">&lt;p&gt;Aduty: /* Preparation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Installation]]&lt;br /&gt;
This tutorial will help you install Alpine Linux on your Raspberry Pi.&lt;br /&gt;
&lt;br /&gt;
== Preparation ==&lt;br /&gt;
&lt;br /&gt;
This section will help you format and partition your SD card:&lt;br /&gt;
&lt;br /&gt;
# [http://alpinelinux.org/downloads/ Download] Alpine for Raspberry Pi tarball which is named as &amp;lt;code&amp;gt;alpine-rpi-&amp;lt;version&amp;gt;-armhf.tar.gz&amp;lt;/code&amp;gt;.  You will need version 3.2.0 or greater if you have a Raspberry Pi 2.&lt;br /&gt;
# Mount your SD card to your workstation&lt;br /&gt;
# Use [https://en.wikipedia.org/wiki/GNOME_Disks gnome-disks] or [http://linux.die.net/man/8/fdisk fdisk] to create a FAT32 partition.  If you are using fdisk, the FAT32 partition type is called &#039;&#039;W95 FAT32 (LBA)&#039;&#039; and its ID is 0x0C.&lt;br /&gt;
# Mark the newly created partition as bootable and save&lt;br /&gt;
# Mount the previously created partition&lt;br /&gt;
# Extract the tarball contents to your FAT32 partition&lt;br /&gt;
# Unmount the SD Card.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Optionally create a &amp;quot;usercfg.txt&amp;quot; file on your SD card to configure low-level system settings. Specifications can be found [https://www.raspberrypi.org/documentation/configuration/config-txt here]. Some interesting values include:&lt;br /&gt;
* Enable audio: dtparam=audio=on&lt;br /&gt;
* If you see black edges around your screen: disable_overscan=1&lt;br /&gt;
&lt;br /&gt;
Alpine Linux will be installed as [[Installation#Installation_Handbook|diskless mode]], hence you need to use [[Alpine local backup|Alpine Local Backup (lbu)]] to save your modifications between reboots.  Follow these steps to install Alpine Linux:&lt;br /&gt;
&lt;br /&gt;
# Insert the SD Card into the Raspberry Pi and turn it on&lt;br /&gt;
# Login into the Alpine system as root.  Leave the password empty.&lt;br /&gt;
# Type &amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt;&lt;br /&gt;
# Once the installation is complete, commit the changes by typing &amp;lt;code&amp;gt;lbu commit -d&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Type &amp;lt;code&amp;gt;reboot&amp;lt;/code&amp;gt; to verify that the installation was indeed successful.&lt;br /&gt;
&lt;br /&gt;
== Post Installation ==&lt;br /&gt;
&lt;br /&gt;
=== Update the System ===&lt;br /&gt;
&lt;br /&gt;
Upon installation, make sure that your system is up-to-date:&lt;br /&gt;
&lt;br /&gt;
{{cmd|apk update&lt;br /&gt;
apk upgrade}}&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget to save the changes:&lt;br /&gt;
&lt;br /&gt;
{{cmd|lbu commit -d}}&lt;br /&gt;
&lt;br /&gt;
=== Clock-related error messages ===&lt;br /&gt;
&lt;br /&gt;
During the booting time, you might notice errors related to the hardware clock.  The Raspberry Pi does not have&lt;br /&gt;
a hardware clock and therefore you need to disable the hwclock daemon and enable swclock:&lt;br /&gt;
&lt;br /&gt;
{{cmd|rc-update add swclock boot    # enable the software clock&lt;br /&gt;
rc-update del hwclock boot    # disable the hardware clock}}&lt;br /&gt;
&lt;br /&gt;
Since Raspberry Pi does not have a clock, the Alpine Linux needs to know what the time is by using a&lt;br /&gt;
[https://en.wikipedia.org/wiki/Network_Time_Protocol Network Time Protocol (NTP)] daemon.  Make sure that you a&lt;br /&gt;
NTP daemon installed and running.  If you are not sure, then you can install NTP client by running the following&lt;br /&gt;
command:&lt;br /&gt;
&lt;br /&gt;
{{cmd|setup-ntp}}&lt;br /&gt;
&lt;br /&gt;
Busybox NTP client might be the most lightweight solution.  Save the changes and reboot, once the NTP software is&lt;br /&gt;
installed and running:&lt;br /&gt;
&lt;br /&gt;
{{cmd|lbu commit -d&lt;br /&gt;
reboot}}&lt;br /&gt;
&lt;br /&gt;
After reboot, make sure that the &amp;lt;code&amp;gt;date&amp;lt;/code&amp;gt; command outputs the correct date and time.&lt;br /&gt;
&lt;br /&gt;
=== X11 Setup ===&lt;br /&gt;
Here are what you need if you want to try and run a single X11 application like a browser kiosk or maybe even a desktop: ​{{cmd|setup-xorg-base &lt;br /&gt;
​apk add xf86-video-fbdev xf86-video-vesa xf86-input-mouse xf86-input-keyboard dbus ​set​xkbmap kbd  &lt;br /&gt;
rc-update ​​add dbus}}&lt;br /&gt;
&lt;br /&gt;
Install XFCE:&lt;br /&gt;
{{cmd|apk add xfce4}}&lt;br /&gt;
&lt;br /&gt;
Commit your changes:&lt;br /&gt;
{{cmd|lbu_commit -d}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{cmd|startx}}&lt;br /&gt;
&lt;br /&gt;
=== Enable OpenGL (RPi 3) ===&lt;br /&gt;
&lt;br /&gt;
Remount the boot partition writeable (ie. /media/mmcblk0p1):&lt;br /&gt;
&lt;br /&gt;
{{cmd|mount -o remount,rw /media/mmcblk0p1}}&lt;br /&gt;
&lt;br /&gt;
Add the following lines to /media/mmcblk0p1/config.txt &lt;br /&gt;
&lt;br /&gt;
 dtoverlay=vc4-kms-v3d&lt;br /&gt;
 gpu_mem=128&lt;br /&gt;
&lt;br /&gt;
256MB gpu_mem is also possible&lt;br /&gt;
&lt;br /&gt;
Install mesa-dri-vc4:&lt;br /&gt;
{{cmd|apk add mesa-dri-vc4}}&lt;br /&gt;
&lt;br /&gt;
Reboot:&lt;br /&gt;
&lt;br /&gt;
{{cmd|lbu_commit -d; reboot}}&lt;br /&gt;
&lt;br /&gt;
== Persistent storage ==&lt;br /&gt;
&lt;br /&gt;
=== Loopback image with overlayfs ===&lt;br /&gt;
&lt;br /&gt;
The install is in disk-less mode and forces everything into memory, if you want additional storage we need to create loop-back storage onto the SD mounted with overlayfs.&lt;br /&gt;
&lt;br /&gt;
First make the sd-card writable again and change fstab to always do so:&lt;br /&gt;
{{cmd|mount /media/mmcblk0p1 -o rw,remount&lt;br /&gt;
sed -i &#039;s/vfat\ ro,/vfat\ rw,&#039; /etc/fstab}}&lt;br /&gt;
&lt;br /&gt;
Create the loop-back file, this example is 1 GB:&lt;br /&gt;
&lt;br /&gt;
{{cmd|dd if&amp;amp;#61;/dev/zero of&amp;amp;#61;/media/mmcblk0p1/persist.img bs&amp;amp;#61;1024 count&amp;amp;#61;0 seek&amp;amp;#61;1048576}}&lt;br /&gt;
&lt;br /&gt;
Install the ext utilities:&lt;br /&gt;
&lt;br /&gt;
{{cmd|apk add e2fsprogs}}&lt;br /&gt;
&lt;br /&gt;
Format the loop-back file:&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkfs.ext4 /media/mmcblk0p1/persist.img}}&lt;br /&gt;
&lt;br /&gt;
Mount the storage: &lt;br /&gt;
&lt;br /&gt;
{{cmd|echo &amp;quot;/media/mmcblk0p1/persist.img /media/persist ext4 rw,relatime,errors&amp;amp;#61;remount-ro 0 0&amp;quot; &amp;gt;&amp;gt; /etc/fstab&lt;br /&gt;
mkdir /media/persist &lt;br /&gt;
mount -a}}&lt;br /&gt;
&lt;br /&gt;
Make the overlay folders, we are doing /usr here, but you can do /home or anything else:&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkdir /media/persist/usr &lt;br /&gt;
mkdir /media/persist/.work &lt;br /&gt;
echo &amp;quot;overlay /usr overlay lowerdir&amp;amp;#61;/usr,upperdir&amp;amp;#61;/media/persist/usr,workdir&amp;amp;#61;/media/persist/.work 0 0&amp;quot; &amp;gt;&amp;gt; /etc/fstab &lt;br /&gt;
mount -a}}&lt;br /&gt;
&lt;br /&gt;
Your /etc/fstab should look something like this:&lt;br /&gt;
{{Cmd|/dev/cdrom      /media/cdrom    iso9660 noauto,ro 0 0&lt;br /&gt;
/dev/usbdisk    /media/usb      vfat    noauto,ro 0 0&lt;br /&gt;
/dev/mmcblk0p1 /media/mmcblk0p1 vfat rw,relatime,fmask&amp;amp;#61;0022,dmask&amp;amp;#61;0022,errors&amp;amp;#61;remount-ro 0 0&lt;br /&gt;
/media/mmcblk0p1/persist.img /media/persist ext4 rw,relatime,errors&amp;amp;#61;remount-ro 0 0&lt;br /&gt;
overlay /usr overlay lowerdir&amp;amp;#61;/usr,upperdir&amp;amp;#61;/media/persist/usr,workdir&amp;amp;#61;/media/persist/.work 0 0}}&lt;br /&gt;
&lt;br /&gt;
Now commit the changes: (optionally remove the e2fsprogs, but it does contain repair tools)&lt;br /&gt;
{{cmd|lbu_commit -d}}&lt;br /&gt;
&lt;br /&gt;
Remember with this setup, if you install things and you have done this overlay for /usr, you must not commit the &#039;apk add&#039;, otherwise while it boots it will try and install it to memory and not to the persist storage.&lt;br /&gt;
&lt;br /&gt;
If you do want to install something small at boot you can use `apk add` and `lbu commit -d`.&lt;br /&gt;
&lt;br /&gt;
If it is something a bit bigger then you can use `apk add` but then not commit it, it will be persistent (in /user), but do check everything you need is in that directory and not in folders you have not made persistent.&lt;br /&gt;
&lt;br /&gt;
=== Traditional disk-based (sys) installation ===&lt;br /&gt;
&lt;br /&gt;
{{Warning|This isn&#039;t yet supported by the Alpine setup scripts for Raspberry Pi. It requires manual intervention, and might break.}}&lt;br /&gt;
&lt;br /&gt;
It is also possible to switch to a fully disk-based installation: this is not yet formally supported, but can be done somewhat manually. This frees all the memory otherwise needed for the root filesystem, allowing more installed packages.&lt;br /&gt;
&lt;br /&gt;
Split your SD card into two partitions: the FAT32 boot partition described above (in this example it&#039;ll be &amp;lt;code&amp;gt;mmcblk0p1&amp;lt;/code&amp;gt;) , and a second partition to hold the root filesystem (here it&#039;ll be &amp;lt;code&amp;gt;mmcblk0p2&amp;lt;/code&amp;gt;). Boot and configure your diskless system as above, then create a root filesystem:&lt;br /&gt;
&lt;br /&gt;
{{cmd|apk add e2fsprogs&lt;br /&gt;
mkfs.ext4 /dev/mmcblk0p2}}&lt;br /&gt;
&lt;br /&gt;
Now do a disk install via a mountpoint. The &amp;lt;code&amp;gt;setup-disk&amp;lt;/code&amp;gt; script will give some errors about syslinux/extlinux, but you can ignore these: the Raspberry Pi doesn&#039;t need this to boot anyway.&lt;br /&gt;
&lt;br /&gt;
{{cmd|&amp;lt;nowiki&amp;gt;mkdir /stage&lt;br /&gt;
mount /dev/mmcblk0p2 /stage&lt;br /&gt;
setup-disk -o /media/mmcblk0p1/MYHOSTNAME.apkovl.tar.gz /stage&lt;br /&gt;
# (ignore errors about syslinux/extlinux)&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Add a line to &amp;lt;code&amp;gt;/stage/etc/fstab&amp;lt;/code&amp;gt; to mount the Pi&#039;s boot partition again:&lt;br /&gt;
&lt;br /&gt;
{{cmd|/dev/mmcblk0p1 /media/mmcblk0p1 vfat defaults 0 0}}&lt;br /&gt;
&lt;br /&gt;
Now add a &amp;lt;code&amp;gt;root=/dev/mmcblk0p2&amp;lt;/code&amp;gt; parameter to the Pi&#039;s boot command line, either &amp;lt;code&amp;gt;cmdline-rpi2.txt&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;cmdline-rpi.txt&amp;lt;/code&amp;gt; depending on model:&lt;br /&gt;
&lt;br /&gt;
{{cmd|&amp;lt;nowiki&amp;gt;mount -o remount,rw /media/mmcblk0p1&lt;br /&gt;
sed -i &#039;$ s/$/ root=\/dev\/mmcblk0p2/&#039; /media/mmcblk0p1/cmdline-rpi2.txt&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
You might also consider &amp;lt;code&amp;gt;overlaytmpfs=yes&amp;lt;/code&amp;gt; here, which will cause the underlying SD card root filesystem to be mounted read-only, with an overlayed tmpfs for modifications which will be discarded on shutdown.&lt;br /&gt;
&lt;br /&gt;
Beware, though, that &amp;lt;b&amp;gt;the contents of /boot will be ignored when the Pi boots&amp;lt;/b&amp;gt;: it will use the kernel, initramfs, and modloop images from the FAT32 boot partition. To update the kernel, initfs or modules, you will need to manually (generate and) copy these to the boot partition or you could use bind mount so that manually copy the files to boot partition is not needed.&lt;br /&gt;
&lt;br /&gt;
{{cmd|&amp;lt;nowiki&amp;gt;echo /media/mmcblk0p1/boot /boot none defaults,bind 0 0 &amp;gt;&amp;gt; /etc/fstab&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
=== Persistent Installation on RPi3 ===&lt;br /&gt;
&lt;br /&gt;
See this page : https://wiki.alpinelinux.org/wiki/Classic_install_or_sys_mode_on_Raspberry_Pi&lt;br /&gt;
&lt;br /&gt;
See https://web.archive.org/web/20171125115835/https://forum.alpinelinux.org/comment/1084#comment-1084&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Classic install or sys mode on Raspberry Pi]] - a variant.&lt;br /&gt;
* [[Raspberry Pi 3 - Setting Up Bluetooth]]&lt;br /&gt;
* [[Raspberry Pi 3 - Configuring it as wireless access point -AP Mode]]&lt;br /&gt;
* [[Linux Router with VPN on a Raspberry Pi]]&lt;br /&gt;
* [[Create a bootable SDHC from a Mac]]&lt;br /&gt;
* Build custom Raspberry Pi images based on Alpine via [https://github.com/tolstoyevsky/pieman Pieman]&lt;/div&gt;</summary>
		<author><name>Aduty</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Installing_on_GPT_LVM&amp;diff=15850</id>
		<title>Installing on GPT LVM</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Installing_on_GPT_LVM&amp;diff=15850"/>
		<updated>2019-03-26T21:48:30Z</updated>

		<summary type="html">&lt;p&gt;Aduty: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is an updated version of this Howto: [http://wiki.alpinelinux.org/wiki/Setting_up_LVM_on_GPT-labeled_disks Setting up LVM on GPT-labeled disks].&lt;br /&gt;
&lt;br /&gt;
This document describes how to set up a system booting from a logical volume in Alpine Linux using lvm2 and GPT-labeled disks.&lt;br /&gt;
&lt;br /&gt;
Begin by booting from Alpine Linux installation media in the usual way. Log in as `root`, run `setup-alpine`, and answer `none` when asked to choose a disk. &lt;br /&gt;
&lt;br /&gt;
=== Info ===&lt;br /&gt;
Alpine Linux ISO used in this installation: alpine-vanilla-3.7.0-x86_64.iso&lt;br /&gt;
&lt;br /&gt;
This PC has BIOS, not UEFI (UEFI installation may differ)&lt;br /&gt;
&lt;br /&gt;
Tested on APU4C with 30GB Kingston mSata SSD (SMS200S3/30G).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Partitioning ===&lt;br /&gt;
We need to install some tools, as &#039;gptfdisk&#039; and &#039;sgdisk&#039; are part of main.&lt;br /&gt;
&lt;br /&gt;
Install gptfdisk.&lt;br /&gt;
{{Cmd|apk add -U gptfdisk sgdisk}}&lt;br /&gt;
&lt;br /&gt;
Create some partitions. In my case the SSD disk is found as sda, so I will use &#039;sda&#039; throughout the process.&lt;br /&gt;
{{Cmd|gdisk /dev/sda}}&lt;br /&gt;
 # create a new empty GUID partition table (GPT) with &#039;o&#039;&lt;br /&gt;
 o # then &#039;y&#039; to confirm&lt;br /&gt;
 # create some partitions: BIOS (needed only for GRUB2), Boot (needed by SYSLINUX), and LVM&lt;br /&gt;
 n&lt;br /&gt;
 1&lt;br /&gt;
 &amp;lt;enter&amp;gt;&lt;br /&gt;
 +2M&lt;br /&gt;
 ef02&lt;br /&gt;
 n&lt;br /&gt;
 2&lt;br /&gt;
 &amp;lt;enter&amp;gt;&lt;br /&gt;
 +100M&lt;br /&gt;
 8300&lt;br /&gt;
 n&lt;br /&gt;
 3&lt;br /&gt;
 &amp;lt;enter&amp;gt;&lt;br /&gt;
 &amp;lt;enter&amp;gt;&lt;br /&gt;
 8e00&lt;br /&gt;
 # print the partition table with &#039;p&#039;&lt;br /&gt;
&lt;br /&gt;
You should get something like this:&lt;br /&gt;
 Number  Start (sector)    End (sector)  Size       Code  Name&lt;br /&gt;
   1            2048            6143   2.0 MiB     EF02  BIOS boot partition&lt;br /&gt;
   2            6144          210943   100.0 MiB   8300  Linux filesystem&lt;br /&gt;
   3          210944        15662270   7.4 GiB     8E00  Linux LVM&lt;br /&gt;
&lt;br /&gt;
We need to set the &#039;legacy BIOS bootable&#039; flag on our boot partition, which can be done in gdisk by first entering expert mode with &#039;x&#039; then editing attributes with &#039;a&#039;. It&#039;s used by SYSLINUX&#039;s GPT support to identify a partition that holds second-stage boot code.&lt;br /&gt;
 x&lt;br /&gt;
 a&lt;br /&gt;
 2&lt;br /&gt;
 2&lt;br /&gt;
&lt;br /&gt;
It looks like this:&lt;br /&gt;
 Command (? for help): x&lt;br /&gt;
&lt;br /&gt;
 Expert command (? for help): a&lt;br /&gt;
 Partition number (1-3): 2&lt;br /&gt;
 Known attributes are:&lt;br /&gt;
 0: system partition&lt;br /&gt;
 1: hide from EFI&lt;br /&gt;
 2: legacy BIOS bootable&lt;br /&gt;
 60: read-only&lt;br /&gt;
 62: hidden&lt;br /&gt;
 63: do not automount&lt;br /&gt;
&lt;br /&gt;
 Attribute value is 0000000000000000. Set fields are:&lt;br /&gt;
  No fields set&lt;br /&gt;
&lt;br /&gt;
 Toggle which attribute field (0-63, 64 or &amp;lt;Enter&amp;gt; to exit): 2&lt;br /&gt;
 Have enabled the &#039;legacy BIOS bootable&#039; attribute.&lt;br /&gt;
 Attribute value is 0000000000000004. Set fields are:&lt;br /&gt;
 2 (legacy BIOS bootable)&lt;br /&gt;
&lt;br /&gt;
Press &#039;Enter&#039; to exit the expert mode and then write table to disk and exit gdisk with &#039;w&#039;.&lt;br /&gt;
&lt;br /&gt;
You can verify the legacy_boot flag with sgdisk (also part of the gptfdisk).&lt;br /&gt;
&lt;br /&gt;
{{Cmd|1=sgdisk /dev/sda --attributes=1:show}}&lt;br /&gt;
{{Cmd|1=sgdisk /dev/sda --attributes=2:show}}&lt;br /&gt;
 2:2:1 (legacy BIOS bootable)&lt;br /&gt;
{{Cmd|1=sgdisk /dev/sda --attributes=3:show}}&lt;br /&gt;
&lt;br /&gt;
Remove gptfdisk (if not needed anymore).&lt;br /&gt;
{{Cmd|apk del gptfdisk sgdisk}}&lt;br /&gt;
&lt;br /&gt;
=== LVM Setup ===&lt;br /&gt;
Now we can setup LVM on the third partition created in the process above.&lt;br /&gt;
 {{Cmd|apk add lvm2 e2fsprogs syslinux}}&lt;br /&gt;
&lt;br /&gt;
{{Cmd|pvcreate /dev/sda3}}&lt;br /&gt;
  Physical volume &amp;quot;/dev/sda3&amp;quot; successfully created&lt;br /&gt;
{{Cmd|vgcreate vg00 /dev/sda3}}&lt;br /&gt;
  Volume group &amp;quot;vg00&amp;quot; successfully created&lt;br /&gt;
{{Cmd|lvcreate -n alpine_rootfs -L4G vg00}}&lt;br /&gt;
  Logical volume &amp;quot;alpine_rootfs&amp;quot; created&lt;br /&gt;
{{Cmd|lvcreate -n swap -C y -L 512M vg00}}&lt;br /&gt;
  Logical volume &amp;quot;swap&amp;quot; created&lt;br /&gt;
{{Cmd|rc-update add lvm}}&lt;br /&gt;
 * service lvm added to runlevel default&lt;br /&gt;
{{Cmd|vgchange -ay}}&lt;br /&gt;
  2 logical volume(s) in volume group &amp;quot;vg00&amp;quot; now active&lt;br /&gt;
&lt;br /&gt;
Format new logical volume and activate swap.&lt;br /&gt;
{{Cmd|mkfs.ext3 /dev/sda2}}&lt;br /&gt;
{{Cmd|mkfs.ext4 /dev/vg00/alpine_rootfs}}&lt;br /&gt;
{{Cmd|mkswap /dev/vg0/swap}}&lt;br /&gt;
&lt;br /&gt;
Mount for finishing Alpine Linux installation.&lt;br /&gt;
{{Cmd|mount -t ext4 /dev/vg00/alpine_rootfs /mnt}}&lt;br /&gt;
{{Cmd|mkdir /mnt/boot}}&lt;br /&gt;
{{Cmd|mount -t ext3 /dev/sda2 /mnt/boot}}&lt;br /&gt;
&lt;br /&gt;
=== Finish installation ===&lt;br /&gt;
Run this command to finish installing Alpine Linux to our newly mounted partition on /mnt:&lt;br /&gt;
{{Cmd|setup-disk -m sys /mnt}}&lt;br /&gt;
&lt;br /&gt;
Output of setup-disk should be like this:&lt;br /&gt;
 Installing system on /dev/vg00/alpine_rootfs:&lt;br /&gt;
 /mnt/boot is device /dev/sda2&lt;br /&gt;
 /boot is device /dev/sda2&lt;br /&gt;
 You might need fix the MBR to be able to boot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Syslinux ===&lt;br /&gt;
Install the MBR.&lt;br /&gt;
{{Cmd|1=dd bs=440 conv=notrunc count=1 if=/usr/share/syslinux/gptmbr.bin of=/dev/sda}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reboot and enjoy your new Alpine Linux installation!&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;/div&gt;</summary>
		<author><name>Aduty</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Creating_an_Alpine_package&amp;diff=15746</id>
		<title>Creating an Alpine package</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Creating_an_Alpine_package&amp;diff=15746"/>
		<updated>2019-03-06T06:05:10Z</updated>

		<summary type="html">&lt;p&gt;Aduty: /* install */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Requirements ==&lt;br /&gt;
&lt;br /&gt;
To build a package for Alpine Linux you need an Alpine Linux installation. Check the [[Installation]] page to see all available installation options.&lt;br /&gt;
&lt;br /&gt;
== Setup your system and account  ==&lt;br /&gt;
{{:Include:Setup_your_system_and_account_for_building_packages}}&lt;br /&gt;
&lt;br /&gt;
== Getting some help ==&lt;br /&gt;
&lt;br /&gt;
It might be wise to start by checking what the [[Abuild|abuild]] program can/cannot do.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|abuild -h}}&lt;br /&gt;
&lt;br /&gt;
For real help, you can also go on Freenode&#039;s #alpine-devel on IRC.&lt;br /&gt;
&lt;br /&gt;
== Creating an APKBUILD file  ==&lt;br /&gt;
&lt;br /&gt;
=== Use a template APKBUILD ===&lt;br /&gt;
&lt;br /&gt;
To create the actual APKBUILD file {{Pkg|newapkbuild}} can serve you a template to start with. It will create a directory with the given package name, place an example/template APKBUILD file to the given directory, and fill some variables if those are provided. Please check the [[Package_policies| package policies]] page about naming details.&lt;br /&gt;
&lt;br /&gt;
If you doubt to which repository your package belongs to you can safely use &#039;&#039;&#039;testing&#039;&#039;&#039;. Building package in your aports/testing directory is not mandatory but this way the package is already at the right place.&lt;br /&gt;
&lt;br /&gt;
{{:Include:Newapkbuild}}&lt;br /&gt;
&lt;br /&gt;
{{Note|On older Alpine systems, abuild -c -n &#039;&#039;packagename&#039;&#039; was the way to create APKBUILD files. The &#039;packagename&#039; was a parameter to the -n option so order of -c and -n matters. }}&lt;br /&gt;
&lt;br /&gt;
[[Abuild_and_Helpers#apkbuild-cpan|apkbuild-cpan]] simplifies the creation of perl packages from CPAN and [[Abuild_and_Helpers#apkbuild-pypi|apkbuild-pypi]] ease the generation of APKBUILD files for python packages from PyPi.  &lt;br /&gt;
&lt;br /&gt;
If you are creating a daemon package which needs initd scripts you can add the -c making it: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|newapkbuild -c &#039;&#039;packagename&#039;&#039;}}&lt;br /&gt;
&lt;br /&gt;
This will copy the sample initd and confd files to the build directory.&amp;lt;BR&amp;gt;&lt;br /&gt;
A third file sample.install file will be copied as well (we will discuss this later on).&lt;br /&gt;
&lt;br /&gt;
=== Modify your APKBUILD ===&lt;br /&gt;
Edit APKBUILD and fill in the needed info (especially pkgname, pkgver, pkgdesc, url, license, depends and source). &lt;br /&gt;
&lt;br /&gt;
If you are going to use any of the variables for directories like $pkgdir, always make sure they are double quoted like: &lt;br /&gt;
&lt;br /&gt;
 &amp;quot;$pkgdir&amp;quot;/somedir&lt;br /&gt;
&lt;br /&gt;
This will prevent issues with spaces/special characters in the future. &lt;br /&gt;
&lt;br /&gt;
{{Note|If you like syntax highlighting we suggest you to install vim. We have setup vim to recognize the APKBUILD file as a bash scripts so its easier to read them.}}&lt;br /&gt;
&lt;br /&gt;
=== APKBUILD variables/functions  ===&lt;br /&gt;
&lt;br /&gt;
==== source  ====&lt;br /&gt;
&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 [[Creating an Alpine package#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/$pkgname/$pkgname-$pkgver.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
: (or similar depending on the package).&lt;br /&gt;
&lt;br /&gt;
* 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;
: You must prepend &#039;${pkgname}-${pkgver}.tar.gz::&#039; to the protocol, like so:&lt;br /&gt;
: &amp;lt;pre&amp;gt;source=&amp;quot;${pkgname}-${pkgver}.tar.gz::http://oss.example.org/?get=software&amp;amp;ver=1.0&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
: This causes the file to be saved as &#039;&#039;software-1.0.tar.gz&#039;&#039; where abuild can use it, instead of &#039;&#039;?get=software&amp;amp;ver=1.0&#039;&#039;, where abuild cannot use it.&lt;br /&gt;
&lt;br /&gt;
* Some projects didn&#039;t provide a release tarball. Beware that some git services (gitweg, cgit, …?) doesn’t provide &#039;&#039;stable&#039;&#039; tarballs, so when you point source to an tarball like &amp;lt;tt&amp;gt;http://repo.or.cz/w/gitstats.git/snapshot/ad7efbb9399e60cee6cb217c6b47e604174a8093.tar.gz&amp;lt;/tt&amp;gt;, then you will run into issues because the checksum changes when downloading on the build system. This is not a problem on GitHub, GitLab and other decent services provides, they provide &#039;&#039;stable&#039;&#039; tarballs.&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;
&amp;lt;!--: {{Note|If the you want to download from https, you need GNU wget installed on your system.}}--&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
* abuild currently supports the following archive types/archive file extensions:&lt;br /&gt;
** .tar&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;
==== depends &amp;amp;amp; makedepends  ====&lt;br /&gt;
&lt;br /&gt;
Depends are the actual running dependencies that a package would need when it is running. Makedepends are only needed when you are building a package. If you set a package in depends, you do not need to add it to makedepends as well. The best way to find out what the depends and makedepends of a package are is to [http://en.wikipedia.org/wiki/Rtfm RTFM]. &lt;br /&gt;
&lt;br /&gt;
No kidding, lots of important information can be found in the package INSTALL and README files (or the likes). Another good way is the run &amp;lt;code&amp;gt;./configure --help&amp;lt;/code&amp;gt; from the source directory to see which options are needed for configure to finish without errors. If you do not yet have a source directory you can create one with the command: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|abuild unpack}}&lt;br /&gt;
&lt;br /&gt;
Running &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt; will also show you how you can disable a specific option for this package. For instance, a good example is &amp;quot;--disable-nls&amp;quot; which will disable native language support and thus does not depend on gettext (libiconv, glib, ...). &lt;br /&gt;
&lt;br /&gt;
Alpine likes to keep things small, so we try to disable as much as possible without losing too many features. The exact disable/enable options are decided by the package builder but please try to follow Alpine&#039;s design concept as much as possible.&lt;br /&gt;
&lt;br /&gt;
An easy way of quickly finding out the build info for a package is to check Arch Linux (Alpine package management and build scripts are similar) or Gentoo Linux ebuilds (previous versions of Alpine were based on Gentoo).&lt;br /&gt;
&lt;br /&gt;
* [https://gitweb.gentoo.org/repo/gentoo.git/tree/ Gentoo Ebuilds] &lt;br /&gt;
* [http://www.archlinux.org/packages/search/ Arch Linux packages] [https://aur.archlinux.org/ Arch Linux User Repository]&lt;br /&gt;
&lt;br /&gt;
After the package is successfully compiled and created we should make sure it didn&#039;t link to any package that is not present in the &amp;lt;code&amp;gt;$depends&amp;lt;/code&amp;gt; variable. We do this by using &amp;lt;code&amp;gt;scanelf&amp;lt;/code&amp;gt;. If scanelf is not yet installed on your system you can do that by installing {{Pkg|pax-utils}}.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|scanelf -nR pkg}}&lt;br /&gt;
&lt;br /&gt;
An example output of {{Pkg|libcurl}} would be: &lt;br /&gt;
&lt;br /&gt;
 ET_DYN libssl.so.0.9.8,libcrypto.so.0.9.8,libz.so.1,libc.so.0,ld-uClibc.so.0 pkg/usr/lib/libcurl.so.4.1.1&lt;br /&gt;
&lt;br /&gt;
You can see the needed files and should be able to find out which file belongs to which package.&lt;br /&gt;
&lt;br /&gt;
==== license  ====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;license&#039;&#039;&#039; tag must reflect the license of the source code. Please check the source tarball for COPYING, LICENSE, or other files with names that indicates that it contains licensing information. Beside the license file most developer include headers in the source code files with licensing details.&lt;br /&gt;
&lt;br /&gt;
If the license is on the [https://spdx.org/licenses/ SPDX License List] or [https://spdx.org/licenses/exceptions-index.html SPDX License Exceptions], use the identifier specified by SPDX.&lt;br /&gt;
&lt;br /&gt;
If a package has a special/custom license or is not listed as [https://opensource.org/licenses/alphabetical OSI approved] we need to provide it with the release. Because we want to save space and don&#039;t like to have licenses all over our system we have decided to include the license in the doc subpackage. Please follow the following guidelines to add a proper license. Locate the license file inside the source package. Add the doc subpackage to the $subpackages variable as follows: &lt;br /&gt;
&lt;br /&gt;
 subpackages=&amp;quot;$pkgname-doc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Add a similar line to the following to your package() function, depending on the license description file: &lt;br /&gt;
&lt;br /&gt;
 install -Dm644 COPYING &amp;quot;$pkgdir&amp;quot;/usr/share/licenses/$pkgname/COPYING&lt;br /&gt;
&lt;br /&gt;
If you follow these steps then abuild will automatically add the license to the package-doc apk for you.&lt;br /&gt;
&lt;br /&gt;
{{Warning|It is not acceptable to package software with &amp;quot;unknown&amp;quot; license! If you can&#039;t find the license of the source code, please contact the author and ask them to specify the license. }}&lt;br /&gt;
&lt;br /&gt;
==== arch ====&lt;br /&gt;
&lt;br /&gt;
The package architecture(s) to build for.  This can be one of: &#039;&#039;x86, x86_64, all,&#039;&#039; or &#039;&#039;noarch&#039;&#039;, where &#039;&#039;all&#039;&#039; means all architectures, and &#039;&#039;noarch&#039;&#039; means it&#039;s architecture-independent (ie, a pure-python package).&lt;br /&gt;
{{Tip|To determine if your APKBUILD can use &#039;&#039;noarch&#039;&#039;, build the package for your architecture and then run &amp;quot;scanelf -R pkg&amp;quot; from the directory that the APKBUILD resides in, in order to scan for ELF files in the &#039;&#039;./pkg&#039;&#039; directory.  If you do NOT get output from this, then &#039;&#039;noarch&#039;&#039; can be used.}}&lt;br /&gt;
&lt;br /&gt;
==== url  ====&lt;br /&gt;
&lt;br /&gt;
Website address for the program. This is useful later on when either finding documentation or other information about the package.&lt;br /&gt;
&lt;br /&gt;
==== pkgdesc  ====&lt;br /&gt;
&lt;br /&gt;
A brief, one line, description of what the package does. Useful for the package management system. It should start with a capital letter and does &#039;&#039;&#039;not&#039;&#039;&#039; end with a period.&lt;br /&gt;
&lt;br /&gt;
Here is an example from apk_info for the OpenSSH client package:&lt;br /&gt;
&lt;br /&gt;
 pkgdesc=&amp;quot;Port of OpenBSD&#039;s free SSH release - client&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== pkgver  ====&lt;br /&gt;
&lt;br /&gt;
Provide the release number of the package you are building.&lt;br /&gt;
&lt;br /&gt;
==== pkgrel  ====&lt;br /&gt;
&lt;br /&gt;
The $pkgrel versioning is made so that if you change something in your APKBUILD file without changing the actual $pkgver, you can increment pkgrel so apk tools will detect it as an update. For instance, if you forget to add a dependency, you can add it afterward and you can +1 pkgver so apk finds this update and adds the missing dependency. When there&#039;s an upstream version change, we reset the pkgrel to 0.&lt;br /&gt;
&lt;br /&gt;
==== pkgname  ====&lt;br /&gt;
&lt;br /&gt;
The base name of the package you are creating.  For Freeswitch 1.0.6, you would use &amp;quot;freeswitch&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== install  ====&lt;br /&gt;
&lt;br /&gt;
There are 6 different kinds of install scripts. Each script is called with the $pkgname.&#039;&#039;&amp;lt;action&amp;gt;&#039;&#039; where &#039;&#039;&amp;lt;action&amp;gt;&#039;&#039; is one of the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dl&amp;gt;&lt;br /&gt;
&amp;lt;dt&amp;gt;$pkgname.pre-install&lt;br /&gt;
&amp;lt;dd&amp;gt;This script is executed before package is installed. Typical use is when package needs a group and a user to be created. For example:&lt;br /&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 /bin/false -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 the &#039;&#039;exit 0&#039;&#039; at the end. If the script exits with failure (if the user already exist), the package will not be installed and &amp;lt;code&amp;gt;apk add&amp;lt;/code&amp;gt; will exit with failure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;$pkgname.post-install&lt;br /&gt;
&amp;lt;dd&amp;gt;This script is executed after the package is installed. Can be used to generate font cache and similar.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;$pkgname.pre-upgrade&lt;br /&gt;
&amp;lt;dd&amp;gt;Same as pre-install but is executed before upgrading/downgrading/reinstalling an already installed 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;
&amp;lt;dt&amp;gt;$pkgname.post-upgrade&lt;br /&gt;
&amp;lt;dd&amp;gt;Same as post-install but is executed after upgrading/downgrading/reinstalling an already installed package. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;$pkgname.pre-deinstall&lt;br /&gt;
&amp;lt;dd&amp;gt;This script is executed before uninstalling a package. If script exits with failure apk will not uninstall the package.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;$pkgname.post-deinstall&lt;br /&gt;
&amp;lt;dd&amp;gt;This script is executed after a package have been uninstalled. Can be used to update font caches and restore busybox links. For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
busybox --install -s&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/dl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the package has a pre-install and post-install script the APKBUILD should have the &#039;&#039;install&#039;&#039; variable defined:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
install=&amp;quot;$pkgname.pre-install $pkgname.post-install&amp;quot;&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== subpackages  ====&lt;br /&gt;
&lt;br /&gt;
$subpackages are made to split up the normal &amp;quot;make install&amp;quot; into separate packages. The most common subpackages we use are doc and dev. Because we like to keep our target system small we move documentation and development files (only needed when building packages) into separate packages. To use the specific program a user only need to install the base apk without package-doc or package-dev, but if he wants to read the manual he will need to install package-doc. &lt;br /&gt;
&lt;br /&gt;
The easiest way to find out if you need to use -dev and -doc is to first build the package without these options set and wait until the build finishes. When its finished you should have a pkg directory which is the fake root directory. Inside this directory you will see the structure as how it would be installed in / on the target system. &lt;br /&gt;
&lt;br /&gt;
To see if you need the -dev package you can run the following cmd: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|find pkg/usr/ -name &#039;*.[acho]&#039; -o -name &#039;*.la&#039;}}&lt;br /&gt;
&lt;br /&gt;
If this returns any files you need to include the -dev package. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; To see if you need the -doc package you can run the following cmd: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|find pkg/usr/share -name doc -o -name man -o -name info -o -name html -o -name sgml -o -name licenses}}&lt;br /&gt;
&lt;br /&gt;
If this returns any directories you need to include the -doc package. &lt;br /&gt;
&lt;br /&gt;
===== Custom subpackages  =====&lt;br /&gt;
&lt;br /&gt;
Some software additionally has non-essential files that do not qualify as either documentation or development content. These files should be placed in their own, specialized subpackage(s). Some packages include large test suites which are only needed in specific circumstances or binaries which have depends which we prefer not to install. To handle those we create our own package/function. In the APKBUILD below the build() function we create another function: &lt;br /&gt;
&lt;br /&gt;
 test() {&lt;br /&gt;
        mkdir -p &amp;quot;$subpkgdir&amp;quot;/usr&lt;br /&gt;
        mv &amp;quot;$pkgdir&amp;quot;/usr/package-test &amp;quot;$subpkgdir&amp;quot;/usr/&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
We also need to add the package info to $subpackages variable: &lt;br /&gt;
&lt;br /&gt;
 subpackages=&amp;quot;$pkgname-doc $pkgname-dev $pkgname-test&amp;quot;&lt;br /&gt;
&lt;br /&gt;
After we finish building the package you should see another apk called packagename-test.apk which includes the files which we moved to the $subpkgdir dir. &lt;br /&gt;
&lt;br /&gt;
The above mentioned variables can also be used in our custom function. If we want for instance to build the test() function with perl support we would add: &lt;br /&gt;
&lt;br /&gt;
 depends=&amp;quot;perl&amp;quot;&lt;br /&gt;
 makedepends=&amp;quot;perl-dev&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If we would install the base package it would not install perl, but if we install the package-test package it would.&lt;br /&gt;
&lt;br /&gt;
==== Patches  ====&lt;br /&gt;
&lt;br /&gt;
Please make sure you always submit human readable patches. Ways to create them are: &lt;br /&gt;
&lt;br /&gt;
directory compare: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|diff -urp original_directory new_directory &amp;amp;gt; filename.patch}}&lt;br /&gt;
&lt;br /&gt;
file compare: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|diff -up original.file new.file &amp;amp;gt; filename.patch}}&lt;br /&gt;
&lt;br /&gt;
If a patch contains a completely new file but not *.rej or *.orig file, you need to add -N option to diff, but you may need to add exclusions with &amp;lt;code&amp;gt;--exclude PATTERN&amp;lt;/code&amp;gt; so that you do not inadvertently add files.  You may need to manually delete unwanted files inside the patch file.&lt;br /&gt;
&lt;br /&gt;
Because multiple patches can patch the same file, they can change the offsets required by subsequent patches. To make sure we always patch in a specific way, we should number the patches as follows: &lt;br /&gt;
&lt;br /&gt;
 10-patch1.patch 20-patch2.patch 30-patch3.patch&lt;br /&gt;
&lt;br /&gt;
This way we are always sure that patch 1 is applied first, and if we want to add additional patches between them we can use appropriate indexes (e.g. 11, 12, 21, 22).&lt;br /&gt;
&lt;br /&gt;
Add the names of the patch files to the &#039;&#039;source&#039;&#039; variable. If you haven&#039;t declared a custom &#039;&#039;prepare&#039;&#039; function, no further action is necessary. Otherwise, be sure to call &#039;&#039;default_prepare&#039;&#039; in your &#039;&#039;prepare&#039;&#039; function. For example:&lt;br /&gt;
&lt;br /&gt;
 prepare() {&lt;br /&gt;
 	default_prepare&lt;br /&gt;
 &lt;br /&gt;
 	# do your stuff&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Note: Some older packages contain a &#039;&#039;for&#039;&#039; loop in the &#039;&#039;prepare&#039;&#039; function to apply patches. This is not needed anymore, as patches are handled by &#039;&#039;default_prepare&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
In Alpine &amp;gt;=3.4 you can define patch_args to supply the patch level.  This only works if all the patches have the same patch level.  If there are a lot of patches from different sources, there is a good chance that you may need to edit them, as discussed below.&lt;br /&gt;
&lt;br /&gt;
To automatically patch the package (available only in Alpine &amp;gt;=3.4) if it uses a patch level (-pX) other than the default (-p1), you need to carefully modify the patch.  First, you&#039;ll need a text editor that does not automatically convert  between Windows and Unix new lines (or, disable this feature) so that it preserves the old code.  The next thing you&#039;ll need to do is modify the paths on &amp;quot;+++&amp;quot; and &amp;quot;---&amp;quot; lines in the .patch file.  You can begin the path with a/ and b/ like shown below.  Next, you need to adjust the paths so that the relative base path is from inside $builddir.  Anything to the left of $builddir, including $builddir itself, needs to be removed from the path.  So, if $builddir is /home/USER/aports/community/chromium/src/chromium-65, you need to erase it on the &amp;quot;+++&amp;quot; and &amp;quot;---&amp;quot; lines.  Inside the chromium-65 folder you can see a src folder that has 3rdparty as a descendant.  If a patch originally has a deeper patch level, you may need to fill in the missing portion of the path.  For example, use the &amp;lt;code&amp;gt;find . -name &amp;quot;Assertions.cpp&amp;quot;&amp;lt;/code&amp;gt; command to find the full path to the file relative to the base.&lt;br /&gt;
&lt;br /&gt;
{{Cat|example.patch|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Author: John Doe &amp;lt;johndoe@mail.com&amp;gt;&lt;br /&gt;
URL: http://.....&lt;br /&gt;
Summary: Fixes musl compatibility&lt;br /&gt;
----&lt;br /&gt;
--- a/src/3rdparty/chromium/third_party/WebKit/Source/wtf/Assertions.cpp.orig&lt;br /&gt;
+++ b/src/3rdparty/chromium/third_party/WebKit/Source/wtf/Assertions.cpp&lt;br /&gt;
@@ -142,7 +142,7 @@&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 FrameToNameScope::FrameToNameScope(void* addr) : m_name(0), m_cxaDemangled(0) {&lt;br /&gt;
-#if OS(MACOSX) || (OS(LINUX) &amp;amp;&amp;amp; !defined(__UCLIBC__))&lt;br /&gt;
+#if OS(MACOSX) || (OS(LINUX) &amp;amp;&amp;amp; defined(__GLIBC__))&lt;br /&gt;
   Dl_info info;&lt;br /&gt;
   if (!dladdr(addr, &amp;amp;info) || !info.dli_sname)&lt;br /&gt;
return;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Portions of the patch may be outdated, removed completely as in the source code file completely removed, or moved or renamed files.  You need to delete that section of the patch or find where that section of code changed and re-diff it.&lt;br /&gt;
&lt;br /&gt;
It is good etiquette to give credit at the top and the location of where you originally found them with notes.&lt;br /&gt;
&lt;br /&gt;
Excluding patches with global variable resembling patch_opts is not available on Alpine.  To exclude patches you need to create your own custom prepare().&lt;br /&gt;
&lt;br /&gt;
If you have a monolithic patch where there are a bunch of patches in one big patch, you could use filterdiff which is available in the patchutils package.&lt;br /&gt;
&lt;br /&gt;
Just do something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
makedepends=&amp;quot;patchutils&amp;quot;&lt;br /&gt;
&lt;br /&gt;
prepare() {&lt;br /&gt;
  ...&lt;br /&gt;
  cd &amp;quot;$builddir&amp;quot;&lt;br /&gt;
  filterdiff -x &#039;*drivers/video/logo*&#039; &amp;quot;$srcdir&amp;quot;/original.patch &amp;gt; &amp;quot;$builddir&amp;quot;/modified.patch&lt;br /&gt;
  patch -p1 -i &amp;quot;$builddir&amp;quot;/modified.patch&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You need to put the wildcard pattern in single quotes for it to work.&lt;br /&gt;
&lt;br /&gt;
==== Configure options  ====&lt;br /&gt;
&lt;br /&gt;
Alpine has some default configure options we set by default. We use /usr for prefix to make sure everything is installed with /usr in front of it. If you notice that anything is installed in the wrong directory please run {{Cmd|./configure --help}} and see if you can set the correct location. &lt;br /&gt;
&lt;br /&gt;
We are not covering the depend switches here we have discussed this already in the depend section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Make options  ====&lt;br /&gt;
&lt;br /&gt;
If you notice weird problems when compiling or installing the package with make/make install you could try to disable [http://www.gnu.org/software/make/manual/make.html#Parallel parallel] building/installing. A normal make line would be: &lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
To disable parallel we use: &lt;br /&gt;
&lt;br /&gt;
 make -j1&lt;br /&gt;
&lt;br /&gt;
We can use the same for make install. &lt;br /&gt;
&lt;br /&gt;
Because we do not want to install the package in our build environment but we want to install it in a fake root directory we need to tell &#039;make install&#039; to use another destination directory instead of &#039;/&#039;. We do this by setting a variable when we execute make install as followed: &lt;br /&gt;
&lt;br /&gt;
 make DESTDIR=&amp;quot;$pkgdir&amp;quot; install&lt;br /&gt;
&lt;br /&gt;
Please note that some Makefiles do not support this variable and will always install software in &#039;/&#039;. To make sure you do not mess up your build system NEVER run your build system as root but always use a custom user and sudo when needed. If by accident the Makefile does not support DESTDIR variable it will fail to install in our build system system directories.&lt;br /&gt;
&lt;br /&gt;
==== builddir ====&lt;br /&gt;
If you used &amp;lt;tt&amp;gt;newapkbuild&amp;lt;/tt&amp;gt; to create your APKBUILD file, you must specify the path to your unpacked sources. Inside the sections during the prepare/build/install process &#039;&#039;builddir&#039;&#039; is used. Most of the time a combination of &#039;&#039;$srcdir&#039;&#039; and &#039;&#039;$pkgname-$pkgver&#039;&#039; will work. When not, check the /src directory or the source tarball for the right string. Especially when you are working with automatically generated tarballs (like from github and gitorious), this needs to be adjusted.&lt;br /&gt;
&lt;br /&gt;
builddir=&amp;quot;$srcdir&amp;quot;/$pkgname-$pkgver&lt;br /&gt;
&lt;br /&gt;
==== Additional files  ====&lt;br /&gt;
&lt;br /&gt;
If you want/need to install additional files not mentioned above you can use the following cmd (this is an example of a conf file): &lt;br /&gt;
&lt;br /&gt;
 install -Dm644 doc/$pkgname.conf &amp;quot;$pkgdir&amp;quot;/etc/$pkgname.conf&lt;br /&gt;
&lt;br /&gt;
== Build the package  ==&lt;br /&gt;
&lt;br /&gt;
If you did not already create the checksums as mentioned above you can do so now: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|cd $pkgname&lt;br /&gt;
abuild checksum}}&lt;br /&gt;
&lt;br /&gt;
It&#039;s about time we build our package. Because a build system should never have all the package installed to prevent linking to packages we don&#039;t want it to link we use a abuild recursively with the &#039;&#039;&#039;-r&#039;&#039;&#039; switch. It will install all dependency&#039;s from your repository and builds it, afterwards it will uninstall all those depending packages again. You could also use the &#039;&#039;&#039;-R&#039;&#039;&#039; switch which would build your package including the dependency packages. &lt;br /&gt;
&lt;br /&gt;
{{Cmd|abuild -r}}&lt;br /&gt;
&lt;br /&gt;
== Testing the package locally ==&lt;br /&gt;
&lt;br /&gt;
When it completes, your package will be found in a subfolder of &#039;&#039;~/packages&#039;&#039;.  You may want to test it on your machine but only if the package is not a critical system package like musl or apk-tools package.  To avoid borking your system (as in making it impossible to use &amp;lt;code&amp;gt;apk add&amp;lt;/code&amp;gt; or to restore back the system and the compiler toolchain) for a critical system package, you should test on a chroot first before using it live.&lt;br /&gt;
&lt;br /&gt;
To install the package, you could:&lt;br /&gt;
{{Cmd|sudo apk add /home/&amp;lt;USER&amp;gt;/packages/testing/x86_64/$pkgname-$pkgver.apk}}&lt;br /&gt;
&lt;br /&gt;
Or, modify your /etc/apk/repositories so that it points to your local ARCH/APKINDEX.tar.gz.  Change USER to your login name.&lt;br /&gt;
&lt;br /&gt;
{{Cat|/etc/apk/repositories|&lt;br /&gt;
/home/USER/packages/testing/&lt;br /&gt;
/home/USER/packages/community/&lt;br /&gt;
/home/USER/packages/main/&lt;br /&gt;
/media/sdc/apks&lt;br /&gt;
#http://dl-2.alpinelinux.org/alpine/v3.7/main&lt;br /&gt;
#http://dl-2.alpinelinux.org/alpine/v3.7/community&lt;br /&gt;
http://dl-2.alpinelinux.org/alpine/edge/main&lt;br /&gt;
http://dl-2.alpinelinux.org/alpine/edge/community&lt;br /&gt;
http://dl-2.alpinelinux.org/alpine/edge/testing&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Code review ==&lt;br /&gt;
&lt;br /&gt;
To successfully have your package pass through code reviewers (as of Feb 18, 2018 are nmeum and jirutka on GitHub) and possible increased acceptance, the following conventions need to be followed:&lt;br /&gt;
&lt;br /&gt;
# Custom global variables should be prefixed with underscore (_).&lt;br /&gt;
# Compact code as in merged commands, removed unused variables, removal of functions that do the same thing that are automatically handled by abuild.&lt;br /&gt;
# Versioning is done properly.  For details see [[APKBUILD_Reference#pkgver]].&lt;br /&gt;
# Licensing is done properly. Remove unnecessary copying of licensing that is already OSI approved.&lt;br /&gt;
# Naming conventions rules for unofficial variables as in _gitrev is preferred over commit.&lt;br /&gt;
# Indent with tabs not spaces.&lt;br /&gt;
# Removal of explicit return 1.  (They are still found the old APKBUILD files if you are learning but are now strongly discouraged.)&lt;br /&gt;
# Disabling check() requires either (1) a comment (#) stating next to options=&amp;quot;!check&amp;quot; that there is no test suite/unit tests or (2) functioning working check() function.&lt;br /&gt;
# Explicit call to subpackages=&amp;quot;$pkgname-doc&amp;quot; must be used instead of explicit gzip man page compression.&lt;br /&gt;
# Ideally, lines should be no more than 80 columns wide&lt;br /&gt;
&lt;br /&gt;
For more information see [[Development using git:Quality assurance]] and [[Package_policies]].&lt;br /&gt;
&lt;br /&gt;
== Commit your work  ==&lt;br /&gt;
&lt;br /&gt;
After you successfully build your package and properly followed the conventions and requirements in the code review section, you can submit your APKBUILD to Alpine&#039;s git repository. &lt;br /&gt;
&lt;br /&gt;
Update your git repo, before adding new files: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|cd $aportsdir&lt;br /&gt;
git pull}}&lt;br /&gt;
&lt;br /&gt;
This should pull all the changes made by others into your local git repo.&lt;br /&gt;
&lt;br /&gt;
When you think you are ready you can add your files to git: &lt;br /&gt;
&lt;br /&gt;
NOTE: when using our github repo, you can create PR&#039;s for each package. Please squash all commits into a single one per PR.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|cd $aportsdir&lt;br /&gt;
git add testing/$pkgdir (include any other files needed for the build; $pkgname.install...)&lt;br /&gt;
git commit}}&lt;br /&gt;
&lt;br /&gt;
Use the following commit message template for new aports (without the comments):&lt;br /&gt;
&lt;br /&gt;
{{Cat|template|testing/$pkgname: new aport   # this will be the subject line&lt;br /&gt;
                              # a blank line&lt;br /&gt;
$url                          # project homepage&lt;br /&gt;
$pkgdesc                      # one line description}}&lt;br /&gt;
&lt;br /&gt;
Or you could add the following and &amp;lt;code&amp;gt;chmod +x ports/.git/hooks/prepare-commit-msg&amp;lt;/code&amp;gt; to automatically generate commit message which the default aports/.githooks/ does not:&lt;br /&gt;
&lt;br /&gt;
{{Cat|aports/.git/hooks/prepare-commit-msg|&amp;lt;nowiki&amp;gt;#!/bin/sh&lt;br /&gt;
case &amp;quot;$2,$3&amp;quot; in&lt;br /&gt;
  ,|template,)&lt;br /&gt;
    if git diff-index --diff-filter=A --name-only --cached HEAD \&lt;br /&gt;
        | grep -q &#039;/APKBUILD$&#039;; then&lt;br /&gt;
      meta() { git diff --staged | grep &amp;quot;^+$1&amp;quot; | sed &#039;s/.*=&amp;quot;\?//;s/&amp;quot;$//&#039;;}&lt;br /&gt;
      printf &#039;testing/%s: new aport\n\n%s\n%s\n&#039; &amp;quot;$(meta pkgname)&amp;quot; \&lt;br /&gt;
        &amp;quot;$(meta url)&amp;quot; &amp;quot;$(meta pkgdesc)&amp;quot; &amp;quot;$(cat $1)&amp;quot; &amp;gt; &amp;quot;$1&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      printf &#039;%s\n\n%s&#039; `git diff-index --name-only --cached HEAD \&lt;br /&gt;
        | sed -n &#039;s/\/APKBUILD$//p;q&#039;` &amp;quot;$(cat $1)&amp;quot; &amp;gt; &amp;quot;$1&amp;quot;&lt;br /&gt;
    fi;;&lt;br /&gt;
esac&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Now your changes are only available locally in your repository.&lt;br /&gt;
&lt;br /&gt;
Because you do not have push rights to the Alpine aports repository you need to create a pull request to [https://github.com/alpinelinux/aports/ Alpine&#039;s mirror on GitHub] (read instructions [https://github.com/alpinelinux/aports/blob/master/.github/CONTRIBUTING.md here]).&lt;br /&gt;
&lt;br /&gt;
Alternatively you can also create a diff (patch) of the changes you made and send this patch to the &lt;br /&gt;
[http://lists.alpinelinux.org/alpine-aports/  alpine-aports mailinglist].&lt;br /&gt;
&lt;br /&gt;
To create a diff patch:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|git format-patch HEAD^}}&lt;br /&gt;
&lt;br /&gt;
or if you have sprunge, you can create a link to your patch for convenience&lt;br /&gt;
&lt;br /&gt;
{{Cmd|git format-patch HEAD^ --stdout &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; sprunge}}&lt;br /&gt;
&lt;br /&gt;
== Travis CI and automated testing ==&lt;br /&gt;
&lt;br /&gt;
Travis CI, as in continuous integration automated testing, isn&#039;t always required, but 99% of the time it is strongly encouraged to pass with a green checkmark.  Passing Travis CI ensures that your package works on another machine and builds the image starting from nothing.  One reason why your package fails to build on the remote server is that you may inadvertently add a package dependency as in creating multiple packages at the same time or forgot to remove a dependency and forgot to mark it as a makedepends.&lt;br /&gt;
&lt;br /&gt;
When you submit your APKBUILD as a pull request, the Travis CI server will construct the build environment from [https://github.com/alpinelinux/aports/blob/master/.travis/install-alpine#L28 main] [https://github.com/alpinelinux/aports/blob/master/.travis/common.sh#L5 Edge] apks.&lt;br /&gt;
&lt;br /&gt;
The environment is just like a boot into command line so it is minimal.  Don&#039;t assume that you boot into X.&lt;br /&gt;
&lt;br /&gt;
The server/configuration cannot do testing/check() testing on hardware accelerated OpenGL apps.&lt;br /&gt;
&lt;br /&gt;
== Send a patch ==&lt;br /&gt;
&lt;br /&gt;
[[Creating_patches#Only_the_last_commit_with_.27git_send-email.27|git send-email]] will do that for you.&lt;br /&gt;
&lt;br /&gt;
== GitHub Tagging ==&lt;br /&gt;
&lt;br /&gt;
If you see your pull requested labeled on GitHub this is what they mean:&lt;br /&gt;
&lt;br /&gt;
*A-add - The pull requester wanted to add this brand new package.&lt;br /&gt;
*A-upgrade - The pull requester wanted to update the package.&lt;br /&gt;
*A-improve - The pull requester wanted to improve an existing package.&lt;br /&gt;
*A-fix - The pull requester wanted to fix a bug with the existing package.&lt;br /&gt;
*S-changes-requested - An admin wants you to add or remove a subpackage or fix something as in messy code.&lt;br /&gt;
*S-needs-review - An admin needs someone to do a code review on your package.&lt;br /&gt;
*S-broken - The package fails to build locally on the code reviewer machine.&lt;br /&gt;
*ci-malfunction - Travis CI doesn&#039;t work with this package as in exceeded time.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[APKBUILD Reference]]&lt;br /&gt;
* [[APKBUILD examples]]&lt;br /&gt;
* [[Development using git]]&lt;br /&gt;
* [[Development using git:Quality assurance]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Aduty</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Creating_an_Alpine_package&amp;diff=15745</id>
		<title>Creating an Alpine package</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Creating_an_Alpine_package&amp;diff=15745"/>
		<updated>2019-03-06T06:01:31Z</updated>

		<summary type="html">&lt;p&gt;Aduty: /* pkgrel */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Requirements ==&lt;br /&gt;
&lt;br /&gt;
To build a package for Alpine Linux you need an Alpine Linux installation. Check the [[Installation]] page to see all available installation options.&lt;br /&gt;
&lt;br /&gt;
== Setup your system and account  ==&lt;br /&gt;
{{:Include:Setup_your_system_and_account_for_building_packages}}&lt;br /&gt;
&lt;br /&gt;
== Getting some help ==&lt;br /&gt;
&lt;br /&gt;
It might be wise to start by checking what the [[Abuild|abuild]] program can/cannot do.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|abuild -h}}&lt;br /&gt;
&lt;br /&gt;
For real help, you can also go on Freenode&#039;s #alpine-devel on IRC.&lt;br /&gt;
&lt;br /&gt;
== Creating an APKBUILD file  ==&lt;br /&gt;
&lt;br /&gt;
=== Use a template APKBUILD ===&lt;br /&gt;
&lt;br /&gt;
To create the actual APKBUILD file {{Pkg|newapkbuild}} can serve you a template to start with. It will create a directory with the given package name, place an example/template APKBUILD file to the given directory, and fill some variables if those are provided. Please check the [[Package_policies| package policies]] page about naming details.&lt;br /&gt;
&lt;br /&gt;
If you doubt to which repository your package belongs to you can safely use &#039;&#039;&#039;testing&#039;&#039;&#039;. Building package in your aports/testing directory is not mandatory but this way the package is already at the right place.&lt;br /&gt;
&lt;br /&gt;
{{:Include:Newapkbuild}}&lt;br /&gt;
&lt;br /&gt;
{{Note|On older Alpine systems, abuild -c -n &#039;&#039;packagename&#039;&#039; was the way to create APKBUILD files. The &#039;packagename&#039; was a parameter to the -n option so order of -c and -n matters. }}&lt;br /&gt;
&lt;br /&gt;
[[Abuild_and_Helpers#apkbuild-cpan|apkbuild-cpan]] simplifies the creation of perl packages from CPAN and [[Abuild_and_Helpers#apkbuild-pypi|apkbuild-pypi]] ease the generation of APKBUILD files for python packages from PyPi.  &lt;br /&gt;
&lt;br /&gt;
If you are creating a daemon package which needs initd scripts you can add the -c making it: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|newapkbuild -c &#039;&#039;packagename&#039;&#039;}}&lt;br /&gt;
&lt;br /&gt;
This will copy the sample initd and confd files to the build directory.&amp;lt;BR&amp;gt;&lt;br /&gt;
A third file sample.install file will be copied as well (we will discuss this later on).&lt;br /&gt;
&lt;br /&gt;
=== Modify your APKBUILD ===&lt;br /&gt;
Edit APKBUILD and fill in the needed info (especially pkgname, pkgver, pkgdesc, url, license, depends and source). &lt;br /&gt;
&lt;br /&gt;
If you are going to use any of the variables for directories like $pkgdir, always make sure they are double quoted like: &lt;br /&gt;
&lt;br /&gt;
 &amp;quot;$pkgdir&amp;quot;/somedir&lt;br /&gt;
&lt;br /&gt;
This will prevent issues with spaces/special characters in the future. &lt;br /&gt;
&lt;br /&gt;
{{Note|If you like syntax highlighting we suggest you to install vim. We have setup vim to recognize the APKBUILD file as a bash scripts so its easier to read them.}}&lt;br /&gt;
&lt;br /&gt;
=== APKBUILD variables/functions  ===&lt;br /&gt;
&lt;br /&gt;
==== source  ====&lt;br /&gt;
&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 [[Creating an Alpine package#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/$pkgname/$pkgname-$pkgver.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
: (or similar depending on the package).&lt;br /&gt;
&lt;br /&gt;
* 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;
: You must prepend &#039;${pkgname}-${pkgver}.tar.gz::&#039; to the protocol, like so:&lt;br /&gt;
: &amp;lt;pre&amp;gt;source=&amp;quot;${pkgname}-${pkgver}.tar.gz::http://oss.example.org/?get=software&amp;amp;ver=1.0&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
: This causes the file to be saved as &#039;&#039;software-1.0.tar.gz&#039;&#039; where abuild can use it, instead of &#039;&#039;?get=software&amp;amp;ver=1.0&#039;&#039;, where abuild cannot use it.&lt;br /&gt;
&lt;br /&gt;
* Some projects didn&#039;t provide a release tarball. Beware that some git services (gitweg, cgit, …?) doesn’t provide &#039;&#039;stable&#039;&#039; tarballs, so when you point source to an tarball like &amp;lt;tt&amp;gt;http://repo.or.cz/w/gitstats.git/snapshot/ad7efbb9399e60cee6cb217c6b47e604174a8093.tar.gz&amp;lt;/tt&amp;gt;, then you will run into issues because the checksum changes when downloading on the build system. This is not a problem on GitHub, GitLab and other decent services provides, they provide &#039;&#039;stable&#039;&#039; tarballs.&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;
&amp;lt;!--: {{Note|If the you want to download from https, you need GNU wget installed on your system.}}--&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
* abuild currently supports the following archive types/archive file extensions:&lt;br /&gt;
** .tar&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;
==== depends &amp;amp;amp; makedepends  ====&lt;br /&gt;
&lt;br /&gt;
Depends are the actual running dependencies that a package would need when it is running. Makedepends are only needed when you are building a package. If you set a package in depends, you do not need to add it to makedepends as well. The best way to find out what the depends and makedepends of a package are is to [http://en.wikipedia.org/wiki/Rtfm RTFM]. &lt;br /&gt;
&lt;br /&gt;
No kidding, lots of important information can be found in the package INSTALL and README files (or the likes). Another good way is the run &amp;lt;code&amp;gt;./configure --help&amp;lt;/code&amp;gt; from the source directory to see which options are needed for configure to finish without errors. If you do not yet have a source directory you can create one with the command: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|abuild unpack}}&lt;br /&gt;
&lt;br /&gt;
Running &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt; will also show you how you can disable a specific option for this package. For instance, a good example is &amp;quot;--disable-nls&amp;quot; which will disable native language support and thus does not depend on gettext (libiconv, glib, ...). &lt;br /&gt;
&lt;br /&gt;
Alpine likes to keep things small, so we try to disable as much as possible without losing too many features. The exact disable/enable options are decided by the package builder but please try to follow Alpine&#039;s design concept as much as possible.&lt;br /&gt;
&lt;br /&gt;
An easy way of quickly finding out the build info for a package is to check Arch Linux (Alpine package management and build scripts are similar) or Gentoo Linux ebuilds (previous versions of Alpine were based on Gentoo).&lt;br /&gt;
&lt;br /&gt;
* [https://gitweb.gentoo.org/repo/gentoo.git/tree/ Gentoo Ebuilds] &lt;br /&gt;
* [http://www.archlinux.org/packages/search/ Arch Linux packages] [https://aur.archlinux.org/ Arch Linux User Repository]&lt;br /&gt;
&lt;br /&gt;
After the package is successfully compiled and created we should make sure it didn&#039;t link to any package that is not present in the &amp;lt;code&amp;gt;$depends&amp;lt;/code&amp;gt; variable. We do this by using &amp;lt;code&amp;gt;scanelf&amp;lt;/code&amp;gt;. If scanelf is not yet installed on your system you can do that by installing {{Pkg|pax-utils}}.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|scanelf -nR pkg}}&lt;br /&gt;
&lt;br /&gt;
An example output of {{Pkg|libcurl}} would be: &lt;br /&gt;
&lt;br /&gt;
 ET_DYN libssl.so.0.9.8,libcrypto.so.0.9.8,libz.so.1,libc.so.0,ld-uClibc.so.0 pkg/usr/lib/libcurl.so.4.1.1&lt;br /&gt;
&lt;br /&gt;
You can see the needed files and should be able to find out which file belongs to which package.&lt;br /&gt;
&lt;br /&gt;
==== license  ====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;license&#039;&#039;&#039; tag must reflect the license of the source code. Please check the source tarball for COPYING, LICENSE, or other files with names that indicates that it contains licensing information. Beside the license file most developer include headers in the source code files with licensing details.&lt;br /&gt;
&lt;br /&gt;
If the license is on the [https://spdx.org/licenses/ SPDX License List] or [https://spdx.org/licenses/exceptions-index.html SPDX License Exceptions], use the identifier specified by SPDX.&lt;br /&gt;
&lt;br /&gt;
If a package has a special/custom license or is not listed as [https://opensource.org/licenses/alphabetical OSI approved] we need to provide it with the release. Because we want to save space and don&#039;t like to have licenses all over our system we have decided to include the license in the doc subpackage. Please follow the following guidelines to add a proper license. Locate the license file inside the source package. Add the doc subpackage to the $subpackages variable as follows: &lt;br /&gt;
&lt;br /&gt;
 subpackages=&amp;quot;$pkgname-doc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Add a similar line to the following to your package() function, depending on the license description file: &lt;br /&gt;
&lt;br /&gt;
 install -Dm644 COPYING &amp;quot;$pkgdir&amp;quot;/usr/share/licenses/$pkgname/COPYING&lt;br /&gt;
&lt;br /&gt;
If you follow these steps then abuild will automatically add the license to the package-doc apk for you.&lt;br /&gt;
&lt;br /&gt;
{{Warning|It is not acceptable to package software with &amp;quot;unknown&amp;quot; license! If you can&#039;t find the license of the source code, please contact the author and ask them to specify the license. }}&lt;br /&gt;
&lt;br /&gt;
==== arch ====&lt;br /&gt;
&lt;br /&gt;
The package architecture(s) to build for.  This can be one of: &#039;&#039;x86, x86_64, all,&#039;&#039; or &#039;&#039;noarch&#039;&#039;, where &#039;&#039;all&#039;&#039; means all architectures, and &#039;&#039;noarch&#039;&#039; means it&#039;s architecture-independent (ie, a pure-python package).&lt;br /&gt;
{{Tip|To determine if your APKBUILD can use &#039;&#039;noarch&#039;&#039;, build the package for your architecture and then run &amp;quot;scanelf -R pkg&amp;quot; from the directory that the APKBUILD resides in, in order to scan for ELF files in the &#039;&#039;./pkg&#039;&#039; directory.  If you do NOT get output from this, then &#039;&#039;noarch&#039;&#039; can be used.}}&lt;br /&gt;
&lt;br /&gt;
==== url  ====&lt;br /&gt;
&lt;br /&gt;
Website address for the program. This is useful later on when either finding documentation or other information about the package.&lt;br /&gt;
&lt;br /&gt;
==== pkgdesc  ====&lt;br /&gt;
&lt;br /&gt;
A brief, one line, description of what the package does. Useful for the package management system. It should start with a capital letter and does &#039;&#039;&#039;not&#039;&#039;&#039; end with a period.&lt;br /&gt;
&lt;br /&gt;
Here is an example from apk_info for the OpenSSH client package:&lt;br /&gt;
&lt;br /&gt;
 pkgdesc=&amp;quot;Port of OpenBSD&#039;s free SSH release - client&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== pkgver  ====&lt;br /&gt;
&lt;br /&gt;
Provide the release number of the package you are building.&lt;br /&gt;
&lt;br /&gt;
==== pkgrel  ====&lt;br /&gt;
&lt;br /&gt;
The $pkgrel versioning is made so that if you change something in your APKBUILD file without changing the actual $pkgver, you can increment pkgrel so apk tools will detect it as an update. For instance, if you forget to add a dependency, you can add it afterward and you can +1 pkgver so apk finds this update and adds the missing dependency. When there&#039;s an upstream version change, we reset the pkgrel to 0.&lt;br /&gt;
&lt;br /&gt;
==== pkgname  ====&lt;br /&gt;
&lt;br /&gt;
The base name of the package you are creating.  For Freeswitch 1.0.6, you would use &amp;quot;freeswitch&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== install  ====&lt;br /&gt;
&lt;br /&gt;
There are 6 different kinds of install scripts. Each script is called with the $pkgname.&#039;&#039;&amp;lt;action&amp;gt;&#039;&#039; where &#039;&#039;&amp;lt;action&amp;gt;&#039;&#039; is one of the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dl&amp;gt;&lt;br /&gt;
&amp;lt;dt&amp;gt;$pkgname.pre-install&lt;br /&gt;
&amp;lt;dd&amp;gt;This script is executed before package is installed. Typical use is when package needs a group and a user to be created. For example:&lt;br /&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 /bin/false -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 the &#039;&#039;exit 0&#039;&#039; at the end. If the script exits with failure (if the user already exist), the package will not be installed and &amp;lt;code&amp;gt;apk add&amp;lt;/code&amp;gt; will exit with failure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;$pkgname.post-install&lt;br /&gt;
&amp;lt;dd&amp;gt;This script is executed after package is installed. Can be used to generate font cache and similar.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;$pkgname.pre-upgrade&lt;br /&gt;
&amp;lt;dd&amp;gt;Same as pre-install but is executed before upgrading/downgrading/reinstalling an already installed 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;
&amp;lt;dt&amp;gt;$pkgname.post-upgrade&lt;br /&gt;
&amp;lt;dd&amp;gt;Same as post-install but is executed after upgrading/downgrading/reinstalling an already installed package. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;$pkgname.pre-deinstall&lt;br /&gt;
&amp;lt;dd&amp;gt;This script is executed before uninstalling a package. If script exits with failure apk will not uninstall the package.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;$pkgname.post-deinstall&lt;br /&gt;
&amp;lt;dd&amp;gt;This script is executed after a package have been uninstalled. Can be used to update font caches and restore busybox links. For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
busybox --install -s&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/dl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the package have an pre-install and post-install script the APKBUILD should have the &#039;&#039;install&#039;&#039; variable defined:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
install=&amp;quot;$pkgname.pre-install $pkgname.post-install&amp;quot;&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== subpackages  ====&lt;br /&gt;
&lt;br /&gt;
$subpackages are made to split up the normal &amp;quot;make install&amp;quot; into separate packages. The most common subpackages we use are doc and dev. Because we like to keep our target system small we move documentation and development files (only needed when building packages) into separate packages. To use the specific program a user only need to install the base apk without package-doc or package-dev, but if he wants to read the manual he will need to install package-doc. &lt;br /&gt;
&lt;br /&gt;
The easiest way to find out if you need to use -dev and -doc is to first build the package without these options set and wait until the build finishes. When its finished you should have a pkg directory which is the fake root directory. Inside this directory you will see the structure as how it would be installed in / on the target system. &lt;br /&gt;
&lt;br /&gt;
To see if you need the -dev package you can run the following cmd: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|find pkg/usr/ -name &#039;*.[acho]&#039; -o -name &#039;*.la&#039;}}&lt;br /&gt;
&lt;br /&gt;
If this returns any files you need to include the -dev package. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; To see if you need the -doc package you can run the following cmd: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|find pkg/usr/share -name doc -o -name man -o -name info -o -name html -o -name sgml -o -name licenses}}&lt;br /&gt;
&lt;br /&gt;
If this returns any directories you need to include the -doc package. &lt;br /&gt;
&lt;br /&gt;
===== Custom subpackages  =====&lt;br /&gt;
&lt;br /&gt;
Some software additionally has non-essential files that do not qualify as either documentation or development content. These files should be placed in their own, specialized subpackage(s). Some packages include large test suites which are only needed in specific circumstances or binaries which have depends which we prefer not to install. To handle those we create our own package/function. In the APKBUILD below the build() function we create another function: &lt;br /&gt;
&lt;br /&gt;
 test() {&lt;br /&gt;
        mkdir -p &amp;quot;$subpkgdir&amp;quot;/usr&lt;br /&gt;
        mv &amp;quot;$pkgdir&amp;quot;/usr/package-test &amp;quot;$subpkgdir&amp;quot;/usr/&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
We also need to add the package info to $subpackages variable: &lt;br /&gt;
&lt;br /&gt;
 subpackages=&amp;quot;$pkgname-doc $pkgname-dev $pkgname-test&amp;quot;&lt;br /&gt;
&lt;br /&gt;
After we finish building the package you should see another apk called packagename-test.apk which includes the files which we moved to the $subpkgdir dir. &lt;br /&gt;
&lt;br /&gt;
The above mentioned variables can also be used in our custom function. If we want for instance to build the test() function with perl support we would add: &lt;br /&gt;
&lt;br /&gt;
 depends=&amp;quot;perl&amp;quot;&lt;br /&gt;
 makedepends=&amp;quot;perl-dev&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If we would install the base package it would not install perl, but if we install the package-test package it would.&lt;br /&gt;
&lt;br /&gt;
==== Patches  ====&lt;br /&gt;
&lt;br /&gt;
Please make sure you always submit human readable patches. Ways to create them are: &lt;br /&gt;
&lt;br /&gt;
directory compare: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|diff -urp original_directory new_directory &amp;amp;gt; filename.patch}}&lt;br /&gt;
&lt;br /&gt;
file compare: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|diff -up original.file new.file &amp;amp;gt; filename.patch}}&lt;br /&gt;
&lt;br /&gt;
If a patch contains a completely new file but not *.rej or *.orig file, you need to add -N option to diff, but you may need to add exclusions with &amp;lt;code&amp;gt;--exclude PATTERN&amp;lt;/code&amp;gt; so that you do not inadvertently add files.  You may need to manually delete unwanted files inside the patch file.&lt;br /&gt;
&lt;br /&gt;
Because multiple patches can patch the same file, they can change the offsets required by subsequent patches. To make sure we always patch in a specific way, we should number the patches as follows: &lt;br /&gt;
&lt;br /&gt;
 10-patch1.patch 20-patch2.patch 30-patch3.patch&lt;br /&gt;
&lt;br /&gt;
This way we are always sure that patch 1 is applied first, and if we want to add additional patches between them we can use appropriate indexes (e.g. 11, 12, 21, 22).&lt;br /&gt;
&lt;br /&gt;
Add the names of the patch files to the &#039;&#039;source&#039;&#039; variable. If you haven&#039;t declared a custom &#039;&#039;prepare&#039;&#039; function, no further action is necessary. Otherwise, be sure to call &#039;&#039;default_prepare&#039;&#039; in your &#039;&#039;prepare&#039;&#039; function. For example:&lt;br /&gt;
&lt;br /&gt;
 prepare() {&lt;br /&gt;
 	default_prepare&lt;br /&gt;
 &lt;br /&gt;
 	# do your stuff&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Note: Some older packages contain a &#039;&#039;for&#039;&#039; loop in the &#039;&#039;prepare&#039;&#039; function to apply patches. This is not needed anymore, as patches are handled by &#039;&#039;default_prepare&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
In Alpine &amp;gt;=3.4 you can define patch_args to supply the patch level.  This only works if all the patches have the same patch level.  If there are a lot of patches from different sources, there is a good chance that you may need to edit them, as discussed below.&lt;br /&gt;
&lt;br /&gt;
To automatically patch the package (available only in Alpine &amp;gt;=3.4) if it uses a patch level (-pX) other than the default (-p1), you need to carefully modify the patch.  First, you&#039;ll need a text editor that does not automatically convert  between Windows and Unix new lines (or, disable this feature) so that it preserves the old code.  The next thing you&#039;ll need to do is modify the paths on &amp;quot;+++&amp;quot; and &amp;quot;---&amp;quot; lines in the .patch file.  You can begin the path with a/ and b/ like shown below.  Next, you need to adjust the paths so that the relative base path is from inside $builddir.  Anything to the left of $builddir, including $builddir itself, needs to be removed from the path.  So, if $builddir is /home/USER/aports/community/chromium/src/chromium-65, you need to erase it on the &amp;quot;+++&amp;quot; and &amp;quot;---&amp;quot; lines.  Inside the chromium-65 folder you can see a src folder that has 3rdparty as a descendant.  If a patch originally has a deeper patch level, you may need to fill in the missing portion of the path.  For example, use the &amp;lt;code&amp;gt;find . -name &amp;quot;Assertions.cpp&amp;quot;&amp;lt;/code&amp;gt; command to find the full path to the file relative to the base.&lt;br /&gt;
&lt;br /&gt;
{{Cat|example.patch|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Author: John Doe &amp;lt;johndoe@mail.com&amp;gt;&lt;br /&gt;
URL: http://.....&lt;br /&gt;
Summary: Fixes musl compatibility&lt;br /&gt;
----&lt;br /&gt;
--- a/src/3rdparty/chromium/third_party/WebKit/Source/wtf/Assertions.cpp.orig&lt;br /&gt;
+++ b/src/3rdparty/chromium/third_party/WebKit/Source/wtf/Assertions.cpp&lt;br /&gt;
@@ -142,7 +142,7 @@&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 FrameToNameScope::FrameToNameScope(void* addr) : m_name(0), m_cxaDemangled(0) {&lt;br /&gt;
-#if OS(MACOSX) || (OS(LINUX) &amp;amp;&amp;amp; !defined(__UCLIBC__))&lt;br /&gt;
+#if OS(MACOSX) || (OS(LINUX) &amp;amp;&amp;amp; defined(__GLIBC__))&lt;br /&gt;
   Dl_info info;&lt;br /&gt;
   if (!dladdr(addr, &amp;amp;info) || !info.dli_sname)&lt;br /&gt;
return;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Portions of the patch may be outdated, removed completely as in the source code file completely removed, or moved or renamed files.  You need to delete that section of the patch or find where that section of code changed and re-diff it.&lt;br /&gt;
&lt;br /&gt;
It is good etiquette to give credit at the top and the location of where you originally found them with notes.&lt;br /&gt;
&lt;br /&gt;
Excluding patches with global variable resembling patch_opts is not available on Alpine.  To exclude patches you need to create your own custom prepare().&lt;br /&gt;
&lt;br /&gt;
If you have a monolithic patch where there are a bunch of patches in one big patch, you could use filterdiff which is available in the patchutils package.&lt;br /&gt;
&lt;br /&gt;
Just do something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
makedepends=&amp;quot;patchutils&amp;quot;&lt;br /&gt;
&lt;br /&gt;
prepare() {&lt;br /&gt;
  ...&lt;br /&gt;
  cd &amp;quot;$builddir&amp;quot;&lt;br /&gt;
  filterdiff -x &#039;*drivers/video/logo*&#039; &amp;quot;$srcdir&amp;quot;/original.patch &amp;gt; &amp;quot;$builddir&amp;quot;/modified.patch&lt;br /&gt;
  patch -p1 -i &amp;quot;$builddir&amp;quot;/modified.patch&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You need to put the wildcard pattern in single quotes for it to work.&lt;br /&gt;
&lt;br /&gt;
==== Configure options  ====&lt;br /&gt;
&lt;br /&gt;
Alpine has some default configure options we set by default. We use /usr for prefix to make sure everything is installed with /usr in front of it. If you notice that anything is installed in the wrong directory please run {{Cmd|./configure --help}} and see if you can set the correct location. &lt;br /&gt;
&lt;br /&gt;
We are not covering the depend switches here we have discussed this already in the depend section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Make options  ====&lt;br /&gt;
&lt;br /&gt;
If you notice weird problems when compiling or installing the package with make/make install you could try to disable [http://www.gnu.org/software/make/manual/make.html#Parallel parallel] building/installing. A normal make line would be: &lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
To disable parallel we use: &lt;br /&gt;
&lt;br /&gt;
 make -j1&lt;br /&gt;
&lt;br /&gt;
We can use the same for make install. &lt;br /&gt;
&lt;br /&gt;
Because we do not want to install the package in our build environment but we want to install it in a fake root directory we need to tell &#039;make install&#039; to use another destination directory instead of &#039;/&#039;. We do this by setting a variable when we execute make install as followed: &lt;br /&gt;
&lt;br /&gt;
 make DESTDIR=&amp;quot;$pkgdir&amp;quot; install&lt;br /&gt;
&lt;br /&gt;
Please note that some Makefiles do not support this variable and will always install software in &#039;/&#039;. To make sure you do not mess up your build system NEVER run your build system as root but always use a custom user and sudo when needed. If by accident the Makefile does not support DESTDIR variable it will fail to install in our build system system directories.&lt;br /&gt;
&lt;br /&gt;
==== builddir ====&lt;br /&gt;
If you used &amp;lt;tt&amp;gt;newapkbuild&amp;lt;/tt&amp;gt; to create your APKBUILD file, you must specify the path to your unpacked sources. Inside the sections during the prepare/build/install process &#039;&#039;builddir&#039;&#039; is used. Most of the time a combination of &#039;&#039;$srcdir&#039;&#039; and &#039;&#039;$pkgname-$pkgver&#039;&#039; will work. When not, check the /src directory or the source tarball for the right string. Especially when you are working with automatically generated tarballs (like from github and gitorious), this needs to be adjusted.&lt;br /&gt;
&lt;br /&gt;
builddir=&amp;quot;$srcdir&amp;quot;/$pkgname-$pkgver&lt;br /&gt;
&lt;br /&gt;
==== Additional files  ====&lt;br /&gt;
&lt;br /&gt;
If you want/need to install additional files not mentioned above you can use the following cmd (this is an example of a conf file): &lt;br /&gt;
&lt;br /&gt;
 install -Dm644 doc/$pkgname.conf &amp;quot;$pkgdir&amp;quot;/etc/$pkgname.conf&lt;br /&gt;
&lt;br /&gt;
== Build the package  ==&lt;br /&gt;
&lt;br /&gt;
If you did not already create the checksums as mentioned above you can do so now: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|cd $pkgname&lt;br /&gt;
abuild checksum}}&lt;br /&gt;
&lt;br /&gt;
It&#039;s about time we build our package. Because a build system should never have all the package installed to prevent linking to packages we don&#039;t want it to link we use a abuild recursively with the &#039;&#039;&#039;-r&#039;&#039;&#039; switch. It will install all dependency&#039;s from your repository and builds it, afterwards it will uninstall all those depending packages again. You could also use the &#039;&#039;&#039;-R&#039;&#039;&#039; switch which would build your package including the dependency packages. &lt;br /&gt;
&lt;br /&gt;
{{Cmd|abuild -r}}&lt;br /&gt;
&lt;br /&gt;
== Testing the package locally ==&lt;br /&gt;
&lt;br /&gt;
When it completes, your package will be found in a subfolder of &#039;&#039;~/packages&#039;&#039;.  You may want to test it on your machine but only if the package is not a critical system package like musl or apk-tools package.  To avoid borking your system (as in making it impossible to use &amp;lt;code&amp;gt;apk add&amp;lt;/code&amp;gt; or to restore back the system and the compiler toolchain) for a critical system package, you should test on a chroot first before using it live.&lt;br /&gt;
&lt;br /&gt;
To install the package, you could:&lt;br /&gt;
{{Cmd|sudo apk add /home/&amp;lt;USER&amp;gt;/packages/testing/x86_64/$pkgname-$pkgver.apk}}&lt;br /&gt;
&lt;br /&gt;
Or, modify your /etc/apk/repositories so that it points to your local ARCH/APKINDEX.tar.gz.  Change USER to your login name.&lt;br /&gt;
&lt;br /&gt;
{{Cat|/etc/apk/repositories|&lt;br /&gt;
/home/USER/packages/testing/&lt;br /&gt;
/home/USER/packages/community/&lt;br /&gt;
/home/USER/packages/main/&lt;br /&gt;
/media/sdc/apks&lt;br /&gt;
#http://dl-2.alpinelinux.org/alpine/v3.7/main&lt;br /&gt;
#http://dl-2.alpinelinux.org/alpine/v3.7/community&lt;br /&gt;
http://dl-2.alpinelinux.org/alpine/edge/main&lt;br /&gt;
http://dl-2.alpinelinux.org/alpine/edge/community&lt;br /&gt;
http://dl-2.alpinelinux.org/alpine/edge/testing&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Code review ==&lt;br /&gt;
&lt;br /&gt;
To successfully have your package pass through code reviewers (as of Feb 18, 2018 are nmeum and jirutka on GitHub) and possible increased acceptance, the following conventions need to be followed:&lt;br /&gt;
&lt;br /&gt;
# Custom global variables should be prefixed with underscore (_).&lt;br /&gt;
# Compact code as in merged commands, removed unused variables, removal of functions that do the same thing that are automatically handled by abuild.&lt;br /&gt;
# Versioning is done properly.  For details see [[APKBUILD_Reference#pkgver]].&lt;br /&gt;
# Licensing is done properly. Remove unnecessary copying of licensing that is already OSI approved.&lt;br /&gt;
# Naming conventions rules for unofficial variables as in _gitrev is preferred over commit.&lt;br /&gt;
# Indent with tabs not spaces.&lt;br /&gt;
# Removal of explicit return 1.  (They are still found the old APKBUILD files if you are learning but are now strongly discouraged.)&lt;br /&gt;
# Disabling check() requires either (1) a comment (#) stating next to options=&amp;quot;!check&amp;quot; that there is no test suite/unit tests or (2) functioning working check() function.&lt;br /&gt;
# Explicit call to subpackages=&amp;quot;$pkgname-doc&amp;quot; must be used instead of explicit gzip man page compression.&lt;br /&gt;
# Ideally, lines should be no more than 80 columns wide&lt;br /&gt;
&lt;br /&gt;
For more information see [[Development using git:Quality assurance]] and [[Package_policies]].&lt;br /&gt;
&lt;br /&gt;
== Commit your work  ==&lt;br /&gt;
&lt;br /&gt;
After you successfully build your package and properly followed the conventions and requirements in the code review section, you can submit your APKBUILD to Alpine&#039;s git repository. &lt;br /&gt;
&lt;br /&gt;
Update your git repo, before adding new files: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|cd $aportsdir&lt;br /&gt;
git pull}}&lt;br /&gt;
&lt;br /&gt;
This should pull all the changes made by others into your local git repo.&lt;br /&gt;
&lt;br /&gt;
When you think you are ready you can add your files to git: &lt;br /&gt;
&lt;br /&gt;
NOTE: when using our github repo, you can create PR&#039;s for each package. Please squash all commits into a single one per PR.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|cd $aportsdir&lt;br /&gt;
git add testing/$pkgdir (include any other files needed for the build; $pkgname.install...)&lt;br /&gt;
git commit}}&lt;br /&gt;
&lt;br /&gt;
Use the following commit message template for new aports (without the comments):&lt;br /&gt;
&lt;br /&gt;
{{Cat|template|testing/$pkgname: new aport   # this will be the subject line&lt;br /&gt;
                              # a blank line&lt;br /&gt;
$url                          # project homepage&lt;br /&gt;
$pkgdesc                      # one line description}}&lt;br /&gt;
&lt;br /&gt;
Or you could add the following and &amp;lt;code&amp;gt;chmod +x ports/.git/hooks/prepare-commit-msg&amp;lt;/code&amp;gt; to automatically generate commit message which the default aports/.githooks/ does not:&lt;br /&gt;
&lt;br /&gt;
{{Cat|aports/.git/hooks/prepare-commit-msg|&amp;lt;nowiki&amp;gt;#!/bin/sh&lt;br /&gt;
case &amp;quot;$2,$3&amp;quot; in&lt;br /&gt;
  ,|template,)&lt;br /&gt;
    if git diff-index --diff-filter=A --name-only --cached HEAD \&lt;br /&gt;
        | grep -q &#039;/APKBUILD$&#039;; then&lt;br /&gt;
      meta() { git diff --staged | grep &amp;quot;^+$1&amp;quot; | sed &#039;s/.*=&amp;quot;\?//;s/&amp;quot;$//&#039;;}&lt;br /&gt;
      printf &#039;testing/%s: new aport\n\n%s\n%s\n&#039; &amp;quot;$(meta pkgname)&amp;quot; \&lt;br /&gt;
        &amp;quot;$(meta url)&amp;quot; &amp;quot;$(meta pkgdesc)&amp;quot; &amp;quot;$(cat $1)&amp;quot; &amp;gt; &amp;quot;$1&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      printf &#039;%s\n\n%s&#039; `git diff-index --name-only --cached HEAD \&lt;br /&gt;
        | sed -n &#039;s/\/APKBUILD$//p;q&#039;` &amp;quot;$(cat $1)&amp;quot; &amp;gt; &amp;quot;$1&amp;quot;&lt;br /&gt;
    fi;;&lt;br /&gt;
esac&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Now your changes are only available locally in your repository.&lt;br /&gt;
&lt;br /&gt;
Because you do not have push rights to the Alpine aports repository you need to create a pull request to [https://github.com/alpinelinux/aports/ Alpine&#039;s mirror on GitHub] (read instructions [https://github.com/alpinelinux/aports/blob/master/.github/CONTRIBUTING.md here]).&lt;br /&gt;
&lt;br /&gt;
Alternatively you can also create a diff (patch) of the changes you made and send this patch to the &lt;br /&gt;
[http://lists.alpinelinux.org/alpine-aports/  alpine-aports mailinglist].&lt;br /&gt;
&lt;br /&gt;
To create a diff patch:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|git format-patch HEAD^}}&lt;br /&gt;
&lt;br /&gt;
or if you have sprunge, you can create a link to your patch for convenience&lt;br /&gt;
&lt;br /&gt;
{{Cmd|git format-patch HEAD^ --stdout &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; sprunge}}&lt;br /&gt;
&lt;br /&gt;
== Travis CI and automated testing ==&lt;br /&gt;
&lt;br /&gt;
Travis CI, as in continuous integration automated testing, isn&#039;t always required, but 99% of the time it is strongly encouraged to pass with a green checkmark.  Passing Travis CI ensures that your package works on another machine and builds the image starting from nothing.  One reason why your package fails to build on the remote server is that you may inadvertently add a package dependency as in creating multiple packages at the same time or forgot to remove a dependency and forgot to mark it as a makedepends.&lt;br /&gt;
&lt;br /&gt;
When you submit your APKBUILD as a pull request, the Travis CI server will construct the build environment from [https://github.com/alpinelinux/aports/blob/master/.travis/install-alpine#L28 main] [https://github.com/alpinelinux/aports/blob/master/.travis/common.sh#L5 Edge] apks.&lt;br /&gt;
&lt;br /&gt;
The environment is just like a boot into command line so it is minimal.  Don&#039;t assume that you boot into X.&lt;br /&gt;
&lt;br /&gt;
The server/configuration cannot do testing/check() testing on hardware accelerated OpenGL apps.&lt;br /&gt;
&lt;br /&gt;
== Send a patch ==&lt;br /&gt;
&lt;br /&gt;
[[Creating_patches#Only_the_last_commit_with_.27git_send-email.27|git send-email]] will do that for you.&lt;br /&gt;
&lt;br /&gt;
== GitHub Tagging ==&lt;br /&gt;
&lt;br /&gt;
If you see your pull requested labeled on GitHub this is what they mean:&lt;br /&gt;
&lt;br /&gt;
*A-add - The pull requester wanted to add this brand new package.&lt;br /&gt;
*A-upgrade - The pull requester wanted to update the package.&lt;br /&gt;
*A-improve - The pull requester wanted to improve an existing package.&lt;br /&gt;
*A-fix - The pull requester wanted to fix a bug with the existing package.&lt;br /&gt;
*S-changes-requested - An admin wants you to add or remove a subpackage or fix something as in messy code.&lt;br /&gt;
*S-needs-review - An admin needs someone to do a code review on your package.&lt;br /&gt;
*S-broken - The package fails to build locally on the code reviewer machine.&lt;br /&gt;
*ci-malfunction - Travis CI doesn&#039;t work with this package as in exceeded time.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[APKBUILD Reference]]&lt;br /&gt;
* [[APKBUILD examples]]&lt;br /&gt;
* [[Development using git]]&lt;br /&gt;
* [[Development using git:Quality assurance]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Aduty</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Creating_an_Alpine_package&amp;diff=15744</id>
		<title>Creating an Alpine package</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Creating_an_Alpine_package&amp;diff=15744"/>
		<updated>2019-03-06T05:51:43Z</updated>

		<summary type="html">&lt;p&gt;Aduty: /* depends &amp;amp;amp; makedepends */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Requirements ==&lt;br /&gt;
&lt;br /&gt;
To build a package for Alpine Linux you need an Alpine Linux installation. Check the [[Installation]] page to see all available installation options.&lt;br /&gt;
&lt;br /&gt;
== Setup your system and account  ==&lt;br /&gt;
{{:Include:Setup_your_system_and_account_for_building_packages}}&lt;br /&gt;
&lt;br /&gt;
== Getting some help ==&lt;br /&gt;
&lt;br /&gt;
It might be wise to start by checking what the [[Abuild|abuild]] program can/cannot do.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|abuild -h}}&lt;br /&gt;
&lt;br /&gt;
For real help, you can also go on Freenode&#039;s #alpine-devel on IRC.&lt;br /&gt;
&lt;br /&gt;
== Creating an APKBUILD file  ==&lt;br /&gt;
&lt;br /&gt;
=== Use a template APKBUILD ===&lt;br /&gt;
&lt;br /&gt;
To create the actual APKBUILD file {{Pkg|newapkbuild}} can serve you a template to start with. It will create a directory with the given package name, place an example/template APKBUILD file to the given directory, and fill some variables if those are provided. Please check the [[Package_policies| package policies]] page about naming details.&lt;br /&gt;
&lt;br /&gt;
If you doubt to which repository your package belongs to you can safely use &#039;&#039;&#039;testing&#039;&#039;&#039;. Building package in your aports/testing directory is not mandatory but this way the package is already at the right place.&lt;br /&gt;
&lt;br /&gt;
{{:Include:Newapkbuild}}&lt;br /&gt;
&lt;br /&gt;
{{Note|On older Alpine systems, abuild -c -n &#039;&#039;packagename&#039;&#039; was the way to create APKBUILD files. The &#039;packagename&#039; was a parameter to the -n option so order of -c and -n matters. }}&lt;br /&gt;
&lt;br /&gt;
[[Abuild_and_Helpers#apkbuild-cpan|apkbuild-cpan]] simplifies the creation of perl packages from CPAN and [[Abuild_and_Helpers#apkbuild-pypi|apkbuild-pypi]] ease the generation of APKBUILD files for python packages from PyPi.  &lt;br /&gt;
&lt;br /&gt;
If you are creating a daemon package which needs initd scripts you can add the -c making it: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|newapkbuild -c &#039;&#039;packagename&#039;&#039;}}&lt;br /&gt;
&lt;br /&gt;
This will copy the sample initd and confd files to the build directory.&amp;lt;BR&amp;gt;&lt;br /&gt;
A third file sample.install file will be copied as well (we will discuss this later on).&lt;br /&gt;
&lt;br /&gt;
=== Modify your APKBUILD ===&lt;br /&gt;
Edit APKBUILD and fill in the needed info (especially pkgname, pkgver, pkgdesc, url, license, depends and source). &lt;br /&gt;
&lt;br /&gt;
If you are going to use any of the variables for directories like $pkgdir, always make sure they are double quoted like: &lt;br /&gt;
&lt;br /&gt;
 &amp;quot;$pkgdir&amp;quot;/somedir&lt;br /&gt;
&lt;br /&gt;
This will prevent issues with spaces/special characters in the future. &lt;br /&gt;
&lt;br /&gt;
{{Note|If you like syntax highlighting we suggest you to install vim. We have setup vim to recognize the APKBUILD file as a bash scripts so its easier to read them.}}&lt;br /&gt;
&lt;br /&gt;
=== APKBUILD variables/functions  ===&lt;br /&gt;
&lt;br /&gt;
==== source  ====&lt;br /&gt;
&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 [[Creating an Alpine package#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/$pkgname/$pkgname-$pkgver.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
: (or similar depending on the package).&lt;br /&gt;
&lt;br /&gt;
* 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;
: You must prepend &#039;${pkgname}-${pkgver}.tar.gz::&#039; to the protocol, like so:&lt;br /&gt;
: &amp;lt;pre&amp;gt;source=&amp;quot;${pkgname}-${pkgver}.tar.gz::http://oss.example.org/?get=software&amp;amp;ver=1.0&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
: This causes the file to be saved as &#039;&#039;software-1.0.tar.gz&#039;&#039; where abuild can use it, instead of &#039;&#039;?get=software&amp;amp;ver=1.0&#039;&#039;, where abuild cannot use it.&lt;br /&gt;
&lt;br /&gt;
* Some projects didn&#039;t provide a release tarball. Beware that some git services (gitweg, cgit, …?) doesn’t provide &#039;&#039;stable&#039;&#039; tarballs, so when you point source to an tarball like &amp;lt;tt&amp;gt;http://repo.or.cz/w/gitstats.git/snapshot/ad7efbb9399e60cee6cb217c6b47e604174a8093.tar.gz&amp;lt;/tt&amp;gt;, then you will run into issues because the checksum changes when downloading on the build system. This is not a problem on GitHub, GitLab and other decent services provides, they provide &#039;&#039;stable&#039;&#039; tarballs.&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;
&amp;lt;!--: {{Note|If the you want to download from https, you need GNU wget installed on your system.}}--&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
* abuild currently supports the following archive types/archive file extensions:&lt;br /&gt;
** .tar&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;
==== depends &amp;amp;amp; makedepends  ====&lt;br /&gt;
&lt;br /&gt;
Depends are the actual running dependencies that a package would need when it is running. Makedepends are only needed when you are building a package. If you set a package in depends, you do not need to add it to makedepends as well. The best way to find out what the depends and makedepends of a package are is to [http://en.wikipedia.org/wiki/Rtfm RTFM]. &lt;br /&gt;
&lt;br /&gt;
No kidding, lots of important information can be found in the package INSTALL and README files (or the likes). Another good way is the run &amp;lt;code&amp;gt;./configure --help&amp;lt;/code&amp;gt; from the source directory to see which options are needed for configure to finish without errors. If you do not yet have a source directory you can create one with the command: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|abuild unpack}}&lt;br /&gt;
&lt;br /&gt;
Running &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt; will also show you how you can disable a specific option for this package. For instance, a good example is &amp;quot;--disable-nls&amp;quot; which will disable native language support and thus does not depend on gettext (libiconv, glib, ...). &lt;br /&gt;
&lt;br /&gt;
Alpine likes to keep things small, so we try to disable as much as possible without losing too many features. The exact disable/enable options are decided by the package builder but please try to follow Alpine&#039;s design concept as much as possible.&lt;br /&gt;
&lt;br /&gt;
An easy way of quickly finding out the build info for a package is to check Arch Linux (Alpine package management and build scripts are similar) or Gentoo Linux ebuilds (previous versions of Alpine were based on Gentoo).&lt;br /&gt;
&lt;br /&gt;
* [https://gitweb.gentoo.org/repo/gentoo.git/tree/ Gentoo Ebuilds] &lt;br /&gt;
* [http://www.archlinux.org/packages/search/ Arch Linux packages] [https://aur.archlinux.org/ Arch Linux User Repository]&lt;br /&gt;
&lt;br /&gt;
After the package is successfully compiled and created we should make sure it didn&#039;t link to any package that is not present in the &amp;lt;code&amp;gt;$depends&amp;lt;/code&amp;gt; variable. We do this by using &amp;lt;code&amp;gt;scanelf&amp;lt;/code&amp;gt;. If scanelf is not yet installed on your system you can do that by installing {{Pkg|pax-utils}}.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|scanelf -nR pkg}}&lt;br /&gt;
&lt;br /&gt;
An example output of {{Pkg|libcurl}} would be: &lt;br /&gt;
&lt;br /&gt;
 ET_DYN libssl.so.0.9.8,libcrypto.so.0.9.8,libz.so.1,libc.so.0,ld-uClibc.so.0 pkg/usr/lib/libcurl.so.4.1.1&lt;br /&gt;
&lt;br /&gt;
You can see the needed files and should be able to find out which file belongs to which package.&lt;br /&gt;
&lt;br /&gt;
==== license  ====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;license&#039;&#039;&#039; tag must reflect the license of the source code. Please check the source tarball for COPYING, LICENSE, or other files with names that indicates that it contains licensing information. Beside the license file most developer include headers in the source code files with licensing details.&lt;br /&gt;
&lt;br /&gt;
If the license is on the [https://spdx.org/licenses/ SPDX License List] or [https://spdx.org/licenses/exceptions-index.html SPDX License Exceptions], use the identifier specified by SPDX.&lt;br /&gt;
&lt;br /&gt;
If a package has a special/custom license or is not listed as [https://opensource.org/licenses/alphabetical OSI approved] we need to provide it with the release. Because we want to save space and don&#039;t like to have licenses all over our system we have decided to include the license in the doc subpackage. Please follow the following guidelines to add a proper license. Locate the license file inside the source package. Add the doc subpackage to the $subpackages variable as follows: &lt;br /&gt;
&lt;br /&gt;
 subpackages=&amp;quot;$pkgname-doc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Add a similar line to the following to your package() function, depending on the license description file: &lt;br /&gt;
&lt;br /&gt;
 install -Dm644 COPYING &amp;quot;$pkgdir&amp;quot;/usr/share/licenses/$pkgname/COPYING&lt;br /&gt;
&lt;br /&gt;
If you follow these steps then abuild will automatically add the license to the package-doc apk for you.&lt;br /&gt;
&lt;br /&gt;
{{Warning|It is not acceptable to package software with &amp;quot;unknown&amp;quot; license! If you can&#039;t find the license of the source code, please contact the author and ask them to specify the license. }}&lt;br /&gt;
&lt;br /&gt;
==== arch ====&lt;br /&gt;
&lt;br /&gt;
The package architecture(s) to build for.  This can be one of: &#039;&#039;x86, x86_64, all,&#039;&#039; or &#039;&#039;noarch&#039;&#039;, where &#039;&#039;all&#039;&#039; means all architectures, and &#039;&#039;noarch&#039;&#039; means it&#039;s architecture-independent (ie, a pure-python package).&lt;br /&gt;
{{Tip|To determine if your APKBUILD can use &#039;&#039;noarch&#039;&#039;, build the package for your architecture and then run &amp;quot;scanelf -R pkg&amp;quot; from the directory that the APKBUILD resides in, in order to scan for ELF files in the &#039;&#039;./pkg&#039;&#039; directory.  If you do NOT get output from this, then &#039;&#039;noarch&#039;&#039; can be used.}}&lt;br /&gt;
&lt;br /&gt;
==== url  ====&lt;br /&gt;
&lt;br /&gt;
Website address for the program. This is useful later on when either finding documentation or other information about the package.&lt;br /&gt;
&lt;br /&gt;
==== pkgdesc  ====&lt;br /&gt;
&lt;br /&gt;
A brief, one line, description of what the package does. Useful for the package management system. It should start with a capital letter and does &#039;&#039;&#039;not&#039;&#039;&#039; end with a period.&lt;br /&gt;
&lt;br /&gt;
Here is an example from apk_info for the OpenSSH client package:&lt;br /&gt;
&lt;br /&gt;
 pkgdesc=&amp;quot;Port of OpenBSD&#039;s free SSH release - client&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== pkgver  ====&lt;br /&gt;
&lt;br /&gt;
Provide the release number of the package you are building.&lt;br /&gt;
&lt;br /&gt;
==== pkgrel  ====&lt;br /&gt;
&lt;br /&gt;
The $pkgrel versioning is made so if you change something to your APKBUILD file without changing the actual $pkgver you can increment pkgrel so apk tools will detect it as an update. For instance if you forget to add a dependency you can add it afterward and you can +1 pkgver so apk finds this update and add the missing dependency. When there&#039;s an upstream version changes, we reset the pkgrel to 0.&lt;br /&gt;
&lt;br /&gt;
==== pkgname  ====&lt;br /&gt;
&lt;br /&gt;
The base name of the package you are creating.  For Freeswitch 1.0.6, you would use &amp;quot;freeswitch&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== install  ====&lt;br /&gt;
&lt;br /&gt;
There are 6 different kinds of install scripts. Each script is called with the $pkgname.&#039;&#039;&amp;lt;action&amp;gt;&#039;&#039; where &#039;&#039;&amp;lt;action&amp;gt;&#039;&#039; is one of the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dl&amp;gt;&lt;br /&gt;
&amp;lt;dt&amp;gt;$pkgname.pre-install&lt;br /&gt;
&amp;lt;dd&amp;gt;This script is executed before package is installed. Typical use is when package needs a group and a user to be created. For example:&lt;br /&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 /bin/false -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 the &#039;&#039;exit 0&#039;&#039; at the end. If the script exits with failure (if the user already exist), the package will not be installed and &amp;lt;code&amp;gt;apk add&amp;lt;/code&amp;gt; will exit with failure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;$pkgname.post-install&lt;br /&gt;
&amp;lt;dd&amp;gt;This script is executed after package is installed. Can be used to generate font cache and similar.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;$pkgname.pre-upgrade&lt;br /&gt;
&amp;lt;dd&amp;gt;Same as pre-install but is executed before upgrading/downgrading/reinstalling an already installed 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;
&amp;lt;dt&amp;gt;$pkgname.post-upgrade&lt;br /&gt;
&amp;lt;dd&amp;gt;Same as post-install but is executed after upgrading/downgrading/reinstalling an already installed package. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;$pkgname.pre-deinstall&lt;br /&gt;
&amp;lt;dd&amp;gt;This script is executed before uninstalling a package. If script exits with failure apk will not uninstall the package.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;$pkgname.post-deinstall&lt;br /&gt;
&amp;lt;dd&amp;gt;This script is executed after a package have been uninstalled. Can be used to update font caches and restore busybox links. For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
busybox --install -s&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/dl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the package have an pre-install and post-install script the APKBUILD should have the &#039;&#039;install&#039;&#039; variable defined:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
install=&amp;quot;$pkgname.pre-install $pkgname.post-install&amp;quot;&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== subpackages  ====&lt;br /&gt;
&lt;br /&gt;
$subpackages are made to split up the normal &amp;quot;make install&amp;quot; into separate packages. The most common subpackages we use are doc and dev. Because we like to keep our target system small we move documentation and development files (only needed when building packages) into separate packages. To use the specific program a user only need to install the base apk without package-doc or package-dev, but if he wants to read the manual he will need to install package-doc. &lt;br /&gt;
&lt;br /&gt;
The easiest way to find out if you need to use -dev and -doc is to first build the package without these options set and wait until the build finishes. When its finished you should have a pkg directory which is the fake root directory. Inside this directory you will see the structure as how it would be installed in / on the target system. &lt;br /&gt;
&lt;br /&gt;
To see if you need the -dev package you can run the following cmd: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|find pkg/usr/ -name &#039;*.[acho]&#039; -o -name &#039;*.la&#039;}}&lt;br /&gt;
&lt;br /&gt;
If this returns any files you need to include the -dev package. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; To see if you need the -doc package you can run the following cmd: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|find pkg/usr/share -name doc -o -name man -o -name info -o -name html -o -name sgml -o -name licenses}}&lt;br /&gt;
&lt;br /&gt;
If this returns any directories you need to include the -doc package. &lt;br /&gt;
&lt;br /&gt;
===== Custom subpackages  =====&lt;br /&gt;
&lt;br /&gt;
Some software additionally has non-essential files that do not qualify as either documentation or development content. These files should be placed in their own, specialized subpackage(s). Some packages include large test suites which are only needed in specific circumstances or binaries which have depends which we prefer not to install. To handle those we create our own package/function. In the APKBUILD below the build() function we create another function: &lt;br /&gt;
&lt;br /&gt;
 test() {&lt;br /&gt;
        mkdir -p &amp;quot;$subpkgdir&amp;quot;/usr&lt;br /&gt;
        mv &amp;quot;$pkgdir&amp;quot;/usr/package-test &amp;quot;$subpkgdir&amp;quot;/usr/&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
We also need to add the package info to $subpackages variable: &lt;br /&gt;
&lt;br /&gt;
 subpackages=&amp;quot;$pkgname-doc $pkgname-dev $pkgname-test&amp;quot;&lt;br /&gt;
&lt;br /&gt;
After we finish building the package you should see another apk called packagename-test.apk which includes the files which we moved to the $subpkgdir dir. &lt;br /&gt;
&lt;br /&gt;
The above mentioned variables can also be used in our custom function. If we want for instance to build the test() function with perl support we would add: &lt;br /&gt;
&lt;br /&gt;
 depends=&amp;quot;perl&amp;quot;&lt;br /&gt;
 makedepends=&amp;quot;perl-dev&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If we would install the base package it would not install perl, but if we install the package-test package it would.&lt;br /&gt;
&lt;br /&gt;
==== Patches  ====&lt;br /&gt;
&lt;br /&gt;
Please make sure you always submit human readable patches. Ways to create them are: &lt;br /&gt;
&lt;br /&gt;
directory compare: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|diff -urp original_directory new_directory &amp;amp;gt; filename.patch}}&lt;br /&gt;
&lt;br /&gt;
file compare: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|diff -up original.file new.file &amp;amp;gt; filename.patch}}&lt;br /&gt;
&lt;br /&gt;
If a patch contains a completely new file but not *.rej or *.orig file, you need to add -N option to diff, but you may need to add exclusions with &amp;lt;code&amp;gt;--exclude PATTERN&amp;lt;/code&amp;gt; so that you do not inadvertently add files.  You may need to manually delete unwanted files inside the patch file.&lt;br /&gt;
&lt;br /&gt;
Because multiple patches can patch the same file, they can change the offsets required by subsequent patches. To make sure we always patch in a specific way, we should number the patches as follows: &lt;br /&gt;
&lt;br /&gt;
 10-patch1.patch 20-patch2.patch 30-patch3.patch&lt;br /&gt;
&lt;br /&gt;
This way we are always sure that patch 1 is applied first, and if we want to add additional patches between them we can use appropriate indexes (e.g. 11, 12, 21, 22).&lt;br /&gt;
&lt;br /&gt;
Add the names of the patch files to the &#039;&#039;source&#039;&#039; variable. If you haven&#039;t declared a custom &#039;&#039;prepare&#039;&#039; function, no further action is necessary. Otherwise, be sure to call &#039;&#039;default_prepare&#039;&#039; in your &#039;&#039;prepare&#039;&#039; function. For example:&lt;br /&gt;
&lt;br /&gt;
 prepare() {&lt;br /&gt;
 	default_prepare&lt;br /&gt;
 &lt;br /&gt;
 	# do your stuff&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Note: Some older packages contain a &#039;&#039;for&#039;&#039; loop in the &#039;&#039;prepare&#039;&#039; function to apply patches. This is not needed anymore, as patches are handled by &#039;&#039;default_prepare&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
In Alpine &amp;gt;=3.4 you can define patch_args to supply the patch level.  This only works if all the patches have the same patch level.  If there are a lot of patches from different sources, there is a good chance that you may need to edit them, as discussed below.&lt;br /&gt;
&lt;br /&gt;
To automatically patch the package (available only in Alpine &amp;gt;=3.4) if it uses a patch level (-pX) other than the default (-p1), you need to carefully modify the patch.  First, you&#039;ll need a text editor that does not automatically convert  between Windows and Unix new lines (or, disable this feature) so that it preserves the old code.  The next thing you&#039;ll need to do is modify the paths on &amp;quot;+++&amp;quot; and &amp;quot;---&amp;quot; lines in the .patch file.  You can begin the path with a/ and b/ like shown below.  Next, you need to adjust the paths so that the relative base path is from inside $builddir.  Anything to the left of $builddir, including $builddir itself, needs to be removed from the path.  So, if $builddir is /home/USER/aports/community/chromium/src/chromium-65, you need to erase it on the &amp;quot;+++&amp;quot; and &amp;quot;---&amp;quot; lines.  Inside the chromium-65 folder you can see a src folder that has 3rdparty as a descendant.  If a patch originally has a deeper patch level, you may need to fill in the missing portion of the path.  For example, use the &amp;lt;code&amp;gt;find . -name &amp;quot;Assertions.cpp&amp;quot;&amp;lt;/code&amp;gt; command to find the full path to the file relative to the base.&lt;br /&gt;
&lt;br /&gt;
{{Cat|example.patch|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Author: John Doe &amp;lt;johndoe@mail.com&amp;gt;&lt;br /&gt;
URL: http://.....&lt;br /&gt;
Summary: Fixes musl compatibility&lt;br /&gt;
----&lt;br /&gt;
--- a/src/3rdparty/chromium/third_party/WebKit/Source/wtf/Assertions.cpp.orig&lt;br /&gt;
+++ b/src/3rdparty/chromium/third_party/WebKit/Source/wtf/Assertions.cpp&lt;br /&gt;
@@ -142,7 +142,7 @@&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 FrameToNameScope::FrameToNameScope(void* addr) : m_name(0), m_cxaDemangled(0) {&lt;br /&gt;
-#if OS(MACOSX) || (OS(LINUX) &amp;amp;&amp;amp; !defined(__UCLIBC__))&lt;br /&gt;
+#if OS(MACOSX) || (OS(LINUX) &amp;amp;&amp;amp; defined(__GLIBC__))&lt;br /&gt;
   Dl_info info;&lt;br /&gt;
   if (!dladdr(addr, &amp;amp;info) || !info.dli_sname)&lt;br /&gt;
return;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Portions of the patch may be outdated, removed completely as in the source code file completely removed, or moved or renamed files.  You need to delete that section of the patch or find where that section of code changed and re-diff it.&lt;br /&gt;
&lt;br /&gt;
It is good etiquette to give credit at the top and the location of where you originally found them with notes.&lt;br /&gt;
&lt;br /&gt;
Excluding patches with global variable resembling patch_opts is not available on Alpine.  To exclude patches you need to create your own custom prepare().&lt;br /&gt;
&lt;br /&gt;
If you have a monolithic patch where there are a bunch of patches in one big patch, you could use filterdiff which is available in the patchutils package.&lt;br /&gt;
&lt;br /&gt;
Just do something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
makedepends=&amp;quot;patchutils&amp;quot;&lt;br /&gt;
&lt;br /&gt;
prepare() {&lt;br /&gt;
  ...&lt;br /&gt;
  cd &amp;quot;$builddir&amp;quot;&lt;br /&gt;
  filterdiff -x &#039;*drivers/video/logo*&#039; &amp;quot;$srcdir&amp;quot;/original.patch &amp;gt; &amp;quot;$builddir&amp;quot;/modified.patch&lt;br /&gt;
  patch -p1 -i &amp;quot;$builddir&amp;quot;/modified.patch&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You need to put the wildcard pattern in single quotes for it to work.&lt;br /&gt;
&lt;br /&gt;
==== Configure options  ====&lt;br /&gt;
&lt;br /&gt;
Alpine has some default configure options we set by default. We use /usr for prefix to make sure everything is installed with /usr in front of it. If you notice that anything is installed in the wrong directory please run {{Cmd|./configure --help}} and see if you can set the correct location. &lt;br /&gt;
&lt;br /&gt;
We are not covering the depend switches here we have discussed this already in the depend section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Make options  ====&lt;br /&gt;
&lt;br /&gt;
If you notice weird problems when compiling or installing the package with make/make install you could try to disable [http://www.gnu.org/software/make/manual/make.html#Parallel parallel] building/installing. A normal make line would be: &lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
To disable parallel we use: &lt;br /&gt;
&lt;br /&gt;
 make -j1&lt;br /&gt;
&lt;br /&gt;
We can use the same for make install. &lt;br /&gt;
&lt;br /&gt;
Because we do not want to install the package in our build environment but we want to install it in a fake root directory we need to tell &#039;make install&#039; to use another destination directory instead of &#039;/&#039;. We do this by setting a variable when we execute make install as followed: &lt;br /&gt;
&lt;br /&gt;
 make DESTDIR=&amp;quot;$pkgdir&amp;quot; install&lt;br /&gt;
&lt;br /&gt;
Please note that some Makefiles do not support this variable and will always install software in &#039;/&#039;. To make sure you do not mess up your build system NEVER run your build system as root but always use a custom user and sudo when needed. If by accident the Makefile does not support DESTDIR variable it will fail to install in our build system system directories.&lt;br /&gt;
&lt;br /&gt;
==== builddir ====&lt;br /&gt;
If you used &amp;lt;tt&amp;gt;newapkbuild&amp;lt;/tt&amp;gt; to create your APKBUILD file, you must specify the path to your unpacked sources. Inside the sections during the prepare/build/install process &#039;&#039;builddir&#039;&#039; is used. Most of the time a combination of &#039;&#039;$srcdir&#039;&#039; and &#039;&#039;$pkgname-$pkgver&#039;&#039; will work. When not, check the /src directory or the source tarball for the right string. Especially when you are working with automatically generated tarballs (like from github and gitorious), this needs to be adjusted.&lt;br /&gt;
&lt;br /&gt;
builddir=&amp;quot;$srcdir&amp;quot;/$pkgname-$pkgver&lt;br /&gt;
&lt;br /&gt;
==== Additional files  ====&lt;br /&gt;
&lt;br /&gt;
If you want/need to install additional files not mentioned above you can use the following cmd (this is an example of a conf file): &lt;br /&gt;
&lt;br /&gt;
 install -Dm644 doc/$pkgname.conf &amp;quot;$pkgdir&amp;quot;/etc/$pkgname.conf&lt;br /&gt;
&lt;br /&gt;
== Build the package  ==&lt;br /&gt;
&lt;br /&gt;
If you did not already create the checksums as mentioned above you can do so now: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|cd $pkgname&lt;br /&gt;
abuild checksum}}&lt;br /&gt;
&lt;br /&gt;
It&#039;s about time we build our package. Because a build system should never have all the package installed to prevent linking to packages we don&#039;t want it to link we use a abuild recursively with the &#039;&#039;&#039;-r&#039;&#039;&#039; switch. It will install all dependency&#039;s from your repository and builds it, afterwards it will uninstall all those depending packages again. You could also use the &#039;&#039;&#039;-R&#039;&#039;&#039; switch which would build your package including the dependency packages. &lt;br /&gt;
&lt;br /&gt;
{{Cmd|abuild -r}}&lt;br /&gt;
&lt;br /&gt;
== Testing the package locally ==&lt;br /&gt;
&lt;br /&gt;
When it completes, your package will be found in a subfolder of &#039;&#039;~/packages&#039;&#039;.  You may want to test it on your machine but only if the package is not a critical system package like musl or apk-tools package.  To avoid borking your system (as in making it impossible to use &amp;lt;code&amp;gt;apk add&amp;lt;/code&amp;gt; or to restore back the system and the compiler toolchain) for a critical system package, you should test on a chroot first before using it live.&lt;br /&gt;
&lt;br /&gt;
To install the package, you could:&lt;br /&gt;
{{Cmd|sudo apk add /home/&amp;lt;USER&amp;gt;/packages/testing/x86_64/$pkgname-$pkgver.apk}}&lt;br /&gt;
&lt;br /&gt;
Or, modify your /etc/apk/repositories so that it points to your local ARCH/APKINDEX.tar.gz.  Change USER to your login name.&lt;br /&gt;
&lt;br /&gt;
{{Cat|/etc/apk/repositories|&lt;br /&gt;
/home/USER/packages/testing/&lt;br /&gt;
/home/USER/packages/community/&lt;br /&gt;
/home/USER/packages/main/&lt;br /&gt;
/media/sdc/apks&lt;br /&gt;
#http://dl-2.alpinelinux.org/alpine/v3.7/main&lt;br /&gt;
#http://dl-2.alpinelinux.org/alpine/v3.7/community&lt;br /&gt;
http://dl-2.alpinelinux.org/alpine/edge/main&lt;br /&gt;
http://dl-2.alpinelinux.org/alpine/edge/community&lt;br /&gt;
http://dl-2.alpinelinux.org/alpine/edge/testing&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Code review ==&lt;br /&gt;
&lt;br /&gt;
To successfully have your package pass through code reviewers (as of Feb 18, 2018 are nmeum and jirutka on GitHub) and possible increased acceptance, the following conventions need to be followed:&lt;br /&gt;
&lt;br /&gt;
# Custom global variables should be prefixed with underscore (_).&lt;br /&gt;
# Compact code as in merged commands, removed unused variables, removal of functions that do the same thing that are automatically handled by abuild.&lt;br /&gt;
# Versioning is done properly.  For details see [[APKBUILD_Reference#pkgver]].&lt;br /&gt;
# Licensing is done properly. Remove unnecessary copying of licensing that is already OSI approved.&lt;br /&gt;
# Naming conventions rules for unofficial variables as in _gitrev is preferred over commit.&lt;br /&gt;
# Indent with tabs not spaces.&lt;br /&gt;
# Removal of explicit return 1.  (They are still found the old APKBUILD files if you are learning but are now strongly discouraged.)&lt;br /&gt;
# Disabling check() requires either (1) a comment (#) stating next to options=&amp;quot;!check&amp;quot; that there is no test suite/unit tests or (2) functioning working check() function.&lt;br /&gt;
# Explicit call to subpackages=&amp;quot;$pkgname-doc&amp;quot; must be used instead of explicit gzip man page compression.&lt;br /&gt;
# Ideally, lines should be no more than 80 columns wide&lt;br /&gt;
&lt;br /&gt;
For more information see [[Development using git:Quality assurance]] and [[Package_policies]].&lt;br /&gt;
&lt;br /&gt;
== Commit your work  ==&lt;br /&gt;
&lt;br /&gt;
After you successfully build your package and properly followed the conventions and requirements in the code review section, you can submit your APKBUILD to Alpine&#039;s git repository. &lt;br /&gt;
&lt;br /&gt;
Update your git repo, before adding new files: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|cd $aportsdir&lt;br /&gt;
git pull}}&lt;br /&gt;
&lt;br /&gt;
This should pull all the changes made by others into your local git repo.&lt;br /&gt;
&lt;br /&gt;
When you think you are ready you can add your files to git: &lt;br /&gt;
&lt;br /&gt;
NOTE: when using our github repo, you can create PR&#039;s for each package. Please squash all commits into a single one per PR.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|cd $aportsdir&lt;br /&gt;
git add testing/$pkgdir (include any other files needed for the build; $pkgname.install...)&lt;br /&gt;
git commit}}&lt;br /&gt;
&lt;br /&gt;
Use the following commit message template for new aports (without the comments):&lt;br /&gt;
&lt;br /&gt;
{{Cat|template|testing/$pkgname: new aport   # this will be the subject line&lt;br /&gt;
                              # a blank line&lt;br /&gt;
$url                          # project homepage&lt;br /&gt;
$pkgdesc                      # one line description}}&lt;br /&gt;
&lt;br /&gt;
Or you could add the following and &amp;lt;code&amp;gt;chmod +x ports/.git/hooks/prepare-commit-msg&amp;lt;/code&amp;gt; to automatically generate commit message which the default aports/.githooks/ does not:&lt;br /&gt;
&lt;br /&gt;
{{Cat|aports/.git/hooks/prepare-commit-msg|&amp;lt;nowiki&amp;gt;#!/bin/sh&lt;br /&gt;
case &amp;quot;$2,$3&amp;quot; in&lt;br /&gt;
  ,|template,)&lt;br /&gt;
    if git diff-index --diff-filter=A --name-only --cached HEAD \&lt;br /&gt;
        | grep -q &#039;/APKBUILD$&#039;; then&lt;br /&gt;
      meta() { git diff --staged | grep &amp;quot;^+$1&amp;quot; | sed &#039;s/.*=&amp;quot;\?//;s/&amp;quot;$//&#039;;}&lt;br /&gt;
      printf &#039;testing/%s: new aport\n\n%s\n%s\n&#039; &amp;quot;$(meta pkgname)&amp;quot; \&lt;br /&gt;
        &amp;quot;$(meta url)&amp;quot; &amp;quot;$(meta pkgdesc)&amp;quot; &amp;quot;$(cat $1)&amp;quot; &amp;gt; &amp;quot;$1&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      printf &#039;%s\n\n%s&#039; `git diff-index --name-only --cached HEAD \&lt;br /&gt;
        | sed -n &#039;s/\/APKBUILD$//p;q&#039;` &amp;quot;$(cat $1)&amp;quot; &amp;gt; &amp;quot;$1&amp;quot;&lt;br /&gt;
    fi;;&lt;br /&gt;
esac&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Now your changes are only available locally in your repository.&lt;br /&gt;
&lt;br /&gt;
Because you do not have push rights to the Alpine aports repository you need to create a pull request to [https://github.com/alpinelinux/aports/ Alpine&#039;s mirror on GitHub] (read instructions [https://github.com/alpinelinux/aports/blob/master/.github/CONTRIBUTING.md here]).&lt;br /&gt;
&lt;br /&gt;
Alternatively you can also create a diff (patch) of the changes you made and send this patch to the &lt;br /&gt;
[http://lists.alpinelinux.org/alpine-aports/  alpine-aports mailinglist].&lt;br /&gt;
&lt;br /&gt;
To create a diff patch:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|git format-patch HEAD^}}&lt;br /&gt;
&lt;br /&gt;
or if you have sprunge, you can create a link to your patch for convenience&lt;br /&gt;
&lt;br /&gt;
{{Cmd|git format-patch HEAD^ --stdout &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; sprunge}}&lt;br /&gt;
&lt;br /&gt;
== Travis CI and automated testing ==&lt;br /&gt;
&lt;br /&gt;
Travis CI, as in continuous integration automated testing, isn&#039;t always required, but 99% of the time it is strongly encouraged to pass with a green checkmark.  Passing Travis CI ensures that your package works on another machine and builds the image starting from nothing.  One reason why your package fails to build on the remote server is that you may inadvertently add a package dependency as in creating multiple packages at the same time or forgot to remove a dependency and forgot to mark it as a makedepends.&lt;br /&gt;
&lt;br /&gt;
When you submit your APKBUILD as a pull request, the Travis CI server will construct the build environment from [https://github.com/alpinelinux/aports/blob/master/.travis/install-alpine#L28 main] [https://github.com/alpinelinux/aports/blob/master/.travis/common.sh#L5 Edge] apks.&lt;br /&gt;
&lt;br /&gt;
The environment is just like a boot into command line so it is minimal.  Don&#039;t assume that you boot into X.&lt;br /&gt;
&lt;br /&gt;
The server/configuration cannot do testing/check() testing on hardware accelerated OpenGL apps.&lt;br /&gt;
&lt;br /&gt;
== Send a patch ==&lt;br /&gt;
&lt;br /&gt;
[[Creating_patches#Only_the_last_commit_with_.27git_send-email.27|git send-email]] will do that for you.&lt;br /&gt;
&lt;br /&gt;
== GitHub Tagging ==&lt;br /&gt;
&lt;br /&gt;
If you see your pull requested labeled on GitHub this is what they mean:&lt;br /&gt;
&lt;br /&gt;
*A-add - The pull requester wanted to add this brand new package.&lt;br /&gt;
*A-upgrade - The pull requester wanted to update the package.&lt;br /&gt;
*A-improve - The pull requester wanted to improve an existing package.&lt;br /&gt;
*A-fix - The pull requester wanted to fix a bug with the existing package.&lt;br /&gt;
*S-changes-requested - An admin wants you to add or remove a subpackage or fix something as in messy code.&lt;br /&gt;
*S-needs-review - An admin needs someone to do a code review on your package.&lt;br /&gt;
*S-broken - The package fails to build locally on the code reviewer machine.&lt;br /&gt;
*ci-malfunction - Travis CI doesn&#039;t work with this package as in exceeded time.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[APKBUILD Reference]]&lt;br /&gt;
* [[APKBUILD examples]]&lt;br /&gt;
* [[Development using git]]&lt;br /&gt;
* [[Development using git:Quality assurance]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Aduty</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Package_policies&amp;diff=15740</id>
		<title>Package policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Package_policies&amp;diff=15740"/>
		<updated>2019-03-02T19:53:18Z</updated>

		<summary type="html">&lt;p&gt;Aduty: /* Package Names */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Alpine Linux Package Policies describe some of the policies when creating packages.&lt;br /&gt;
&lt;br /&gt;
== Package Names ==&lt;br /&gt;
* All package names should be lowercase.&lt;br /&gt;
* Development files are placed in subpackages with &#039;&#039;-dev&#039;&#039; suffix (e.g. uclibc-dev)&lt;br /&gt;
* Documentation files (incl. man pages) are placed in subpackages with &#039;&#039;-doc&#039;&#039; suffix (e.g. expat-doc)&lt;br /&gt;
* Lua modules (not applications) are prefixed with &#039;&#039;lua-&#039;&#039;. (e.g. lua-posix)&lt;br /&gt;
* Perl modules (not applications) are prefixed with &#039;&#039;perl-&#039;&#039;. (e.g. perl-xml-parser)&lt;br /&gt;
* Python 2 modules (not applications) are prefixed with &#039;&#039;py2-&#039;&#039;. (e.g. py2-libxml2)&lt;br /&gt;
* [[TODO:py3 packages|Python 3]] modules (not applications) are prefixed with &#039;&#039;py3-&#039;&#039;. (e.g. py3-libxml2)&lt;br /&gt;
* Kernels and third party modules should be suffixed with the kernel flavor. (e.g., &#039;&#039;-grsec&#039;&#039;, &#039;&#039;-vserver&#039;&#039;).&lt;br /&gt;
# Don&#039;t use &#039;&#039;-&#039;&#039; sign in kernel flavor name.&lt;br /&gt;
# Specify &#039;&#039;KERNEL_FLAVOR_DEFAULT&#039;&#039; as your kernel flavor if you want boot your kernel by default.&lt;br /&gt;
&lt;br /&gt;
== Package versions ==&lt;br /&gt;
* Package versions are similar to gentoo.&lt;br /&gt;
&lt;br /&gt;
== Licensing ==&lt;br /&gt;
* The license of the program should be based on the licenses approved by the [http://www.gnu.org/philosophy/license-list.html#GPLCompatibleLicenses Free Software Foundation] or [http://www.opensource.org/licenses/ OSI].&lt;br /&gt;
* If you are unsure about the license, please ask in our [[IRC]] channel.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Aduty</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Nextcloud&amp;diff=15734</id>
		<title>Nextcloud</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Nextcloud&amp;diff=15734"/>
		<updated>2019-03-01T00:58:05Z</updated>

		<summary type="html">&lt;p&gt;Aduty: /* Installation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://nextcloud.com/ Nextcloud] is WedDAV-based solution for storing and sharing on-line your data, files, images, video, music, calendars and contacts. [http://karlitschek.de/2016/06/nextcloud/ Nextcloud is a fork of ownCloud with enterprise features included].&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
{{pkg|nextcloud}} is available from Alpine 3.5 and greater.&lt;br /&gt;
&lt;br /&gt;
Before you start installing anything, make sure you have the latest packages available. Make sure you are using an &#039;http&#039; repository in your {{path|/etc/apk/repositories}} file, then:&lt;br /&gt;
{{cmd|apk update}}&lt;br /&gt;
{{tip|Detailed information is found in [[Include:Upgrading_to_latest_release|this]] doc.}}&lt;br /&gt;
&lt;br /&gt;
== Database ==&lt;br /&gt;
First you have to decide which database to use. Use one of the databases listed below.&lt;br /&gt;
&lt;br /&gt;
=== Sqlite ===&lt;br /&gt;
All you need to do is to install the package:&lt;br /&gt;
{{cmd|apk add nextcloud-sqlite}}&lt;br /&gt;
&lt;br /&gt;
=== PostgreSQL ===&lt;br /&gt;
Install the package:&lt;br /&gt;
{{cmd|apk add nextcloud-pgsql}}&lt;br /&gt;
&lt;br /&gt;
Next thing is to configure and start the database:&lt;br /&gt;
{{cmd|/etc/init.d/postgresql setup&lt;br /&gt;
/etc/init.d/postgresql start}}&lt;br /&gt;
&lt;br /&gt;
Next, you need to create a user and temporarily grant the CREATEDB privilege:&lt;br /&gt;
{{cmd|psql -U postgres&lt;br /&gt;
CREATE USER mycloud WITH PASSWORD &#039;test123&#039;;&lt;br /&gt;
ALTER ROLE mycloud CREATEDB;&lt;br /&gt;
\q}}&lt;br /&gt;
{{Note|Replace the above username &#039;mycloud&#039; and password &#039;test123&#039; with something secure. Remember these settings. You will need them later when setting up nextcloud.}}&lt;br /&gt;
&lt;br /&gt;
=== MariaDB ===&lt;br /&gt;
Install the package:&lt;br /&gt;
{{cmd|apk add nextcloud-mysql mariadb mariadb-client}}&lt;br /&gt;
&lt;br /&gt;
Now configure and start {{pkg|mariadb}}:&lt;br /&gt;
{{cmd|/etc/init.d/mariadb setup&lt;br /&gt;
/etc/init.d/mariadb start&lt;br /&gt;
/usr/bin/mysql_secure_installation}}&lt;br /&gt;
Follow the wizard to setup passwords, etc.&lt;br /&gt;
{{Note|Remember the usernames/passwords that you set using the wizard. You will need them later.}}&lt;br /&gt;
&lt;br /&gt;
Next, you need to create a user and database and set permissions:&lt;br /&gt;
{{cmd|mysql -u root -p&lt;br /&gt;
CREATE DATABASE nextcloud;&lt;br /&gt;
GRANT ALL ON nextcloud.* TO &#039;mycloud&#039;@&#039;localhost&#039; IDENTIFIED BY &#039;test123&#039;;&lt;br /&gt;
GRANT ALL ON nextcloud.* TO &#039;mycloud&#039;@&#039;localhost.localdomain&#039; IDENTIFIED BY &#039;test123&#039;;&lt;br /&gt;
FLUSH PRIVILEGES;&lt;br /&gt;
EXIT}}&lt;br /&gt;
{{Note|Replace the above username &#039;mycloud&#039; and password &#039;test123&#039; with something secure. Remember these settings. You will need them later when setting up nextcloud.}}&lt;br /&gt;
&lt;br /&gt;
{{pkg|mariadb-client}} is not needed anymore. Let&#039;s uninstall it:&lt;br /&gt;
{{cmd|apk del mariadb-client}}&lt;br /&gt;
&lt;br /&gt;
== Webserver ==&lt;br /&gt;
Next thing is to choose, install, and configure a webserver. In this example we will install {{pkg|nginx}} or {{pkg|lighttpd}}. &#039;&#039;Nginx&#039;&#039; is preferred over &#039;&#039;Lighttpd&#039;&#039; since the latter will consume a lot of memory when working with large files (see [http://redmine.lighttpd.net/issues/1283 lighty bug #1283]). You are free to install any other webserver of your choice as long as it supports PHP and FastCGI. Generating an SSL certificate for your webserver is outside of the scope of this document.&lt;br /&gt;
&lt;br /&gt;
=== Nginx ===&lt;br /&gt;
Install the needed packages:&lt;br /&gt;
{{cmd|apk add nginx php7-fpm}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Remove/comment&#039;&#039;&#039; any section like this in {{path|/etc/nginx/nginx.conf}}:&lt;br /&gt;
{{cat|/etc/nginx/nginx.conf|&lt;br /&gt;
server {&lt;br /&gt;
        listen ...&lt;br /&gt;
       }&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Include the following directive in {{path|/etc/nginx/nginx.conf}}:&lt;br /&gt;
{{cat|/etc/nginx/nginx.conf|&lt;br /&gt;
http {&lt;br /&gt;
      ...&lt;br /&gt;
      include /etc/nginx/sites-enabled/*;&lt;br /&gt;
      ...&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Create directories for your websites:&lt;br /&gt;
{{cmd|mkdir /etc/nginx/sites-available}}&lt;br /&gt;
{{cmd|mkdir /etc/nginx/sites-enabled}}&lt;br /&gt;
&lt;br /&gt;
Create a configuration file for your site in {{path|/etc/nginx/sites-available/mysite.mydomain.com}}:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
server {&lt;br /&gt;
        #listen       [::]:80; #uncomment for IPv6 support&lt;br /&gt;
        listen       80;&lt;br /&gt;
	return 301 https://$host$request_uri;&lt;br /&gt;
	server_name mysite.mydomain.com;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
server {&lt;br /&gt;
        #listen       [::]:443 ssl; #uncomment for IPv6 support&lt;br /&gt;
        listen       443 ssl;&lt;br /&gt;
        server_name  mysite.mydomain.com;&lt;br /&gt;
&lt;br /&gt;
	root /usr/share/webapps/nextcloud;&lt;br /&gt;
        index  index.php index.html index.htm;&lt;br /&gt;
	disable_symlinks off;&lt;br /&gt;
&lt;br /&gt;
        ssl_certificate      /etc/ssl/cert.pem;&lt;br /&gt;
        ssl_certificate_key  /etc/ssl/key.pem;&lt;br /&gt;
&lt;br /&gt;
        ssl_session_cache    shared:SSL:1m;&lt;br /&gt;
        ssl_session_timeout  5m;&lt;br /&gt;
&lt;br /&gt;
        #Enable Perfect Forward Secrecy and ciphers without known vulnerabilities&lt;br /&gt;
        #Beware! It breaks compatibility with older OS and browsers (e.g. Windows XP, Android 2.x, etc.)&lt;br /&gt;
	#ssl_ciphers ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA;&lt;br /&gt;
        #ssl_prefer_server_ciphers  on;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        location / {&lt;br /&gt;
            try_files $uri $uri/ /index.html;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000&lt;br /&gt;
        location ~ [^/]\.php(/|$) {&lt;br /&gt;
                fastcgi_split_path_info ^(.+?\.php)(/.*)$;&lt;br /&gt;
                if (!-f $document_root$fastcgi_script_name) {&lt;br /&gt;
                        return 404;&lt;br /&gt;
                }&lt;br /&gt;
                fastcgi_pass 127.0.0.1:9000;&lt;br /&gt;
		#fastcgi_pass unix:/run/php-fpm/socket;&lt;br /&gt;
                fastcgi_index index.php;&lt;br /&gt;
                include fastcgi.conf;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are running from RAM and you&#039;re dealing with large files you might need to move the FastCGI temp file from {{path|/tmp}} to {{path|/var/tmp}} or to a directory that is mounted on hdd:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fastcgi_temp_path /var/tmp/nginx/fastcgi 1 2;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Large file uploads take some time to be processed by php-fpm, so you need to bump the Nginx default read timeout:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fastcgi_read_timeout 300s;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set user and group for php-fpm in {{path|/etc/php7/php-fpm.d/www.conf}}:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
user = nginx&lt;br /&gt;
group = www-data&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you are serving serveral users make sure to tune the *&#039;&#039;children&#039;&#039; settings in {{path|/etc/php7/php-fpm.d/www.conf}}}}&lt;br /&gt;
&lt;br /&gt;
Also enable $PATH by uncommenting the following lines in {{path|/etc/php7/php-fpm.d/www.conf}}:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
env[HOSTNAME] = $HOSTNAME&lt;br /&gt;
env[PATH] = /usr/local/bin:/usr/bin:/bin&lt;br /&gt;
env[TMP] = /tmp&lt;br /&gt;
env[TMPDIR] = /tmp&lt;br /&gt;
env[TEMP] = /tmp&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make nginx user a member of the www-data group:&lt;br /&gt;
{{cmd|addgroup nginx www-data}}&lt;br /&gt;
&lt;br /&gt;
Enable your website:&lt;br /&gt;
{{cmd|ln -s ../sites-available/mysite.mydomain.com /etc/nginx/sites-enabled/mysite.mydomain.com}}&lt;br /&gt;
&lt;br /&gt;
The default configuration of nginx shows a 404 page. Therefore, we have to edit {{path|/etc/nginx/nginx.conf}}:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
# Includes virtual hosts configs.&lt;br /&gt;
# include /etc/nginx/conf.d/*.conf;&lt;br /&gt;
include /etc/nginx/sites-enabled/*;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start services:&lt;br /&gt;
{{cmd|rc-service php-fpm7 start&lt;br /&gt;
rc-service nginx start}}&lt;br /&gt;
&lt;br /&gt;
Enable automatic startup of services:&lt;br /&gt;
{{cmd|rc-update add php-fpm7&lt;br /&gt;
rc-update add nginx}}&lt;br /&gt;
&lt;br /&gt;
=== Lighttpd ===&lt;br /&gt;
Install the package:&lt;br /&gt;
{{cmd|apk add lighttpd php5-cgi}}&lt;br /&gt;
&lt;br /&gt;
Make sure you have FastCGI enabled in {{pkg|lighttpd}}:&lt;br /&gt;
{{cat|/etc/lighttpd/lighttpd.conf|...&lt;br /&gt;
include &amp;quot;mod_fastcgi.conf&amp;quot;&lt;br /&gt;
...}}&lt;br /&gt;
&lt;br /&gt;
Start up the webserver:&lt;br /&gt;
{{cmd|/etc/init.d/lighttpd start}}&lt;br /&gt;
&lt;br /&gt;
{{tip|You might want to follow the [http://wiki.alpinelinux.org/wiki/Lighttpd_Https_access Lighttpd_Https_access] doc in order to configure lighttpd to use https &#039;&#039;(securing your connections to your nextcloud server)&#039;&#039;.}}&lt;br /&gt;
&lt;br /&gt;
Link {{pkg|nextcloud}} installation to web server directory:&lt;br /&gt;
{{cmd|ln -s /usr/share/webapps/nextcloud /var/www/localhost/htdocs}}&lt;br /&gt;
&lt;br /&gt;
== Other settings ==&lt;br /&gt;
=== Hardening ===&lt;br /&gt;
Consider updating the variable &amp;lt;code&amp;gt;url.access-deny&amp;lt;/code&amp;gt; in {{path|/etc/lighttpd/lighttpd.conf}} for additional security. Add &amp;lt;code&amp;gt;&amp;quot;config.php&amp;quot;&amp;lt;/code&amp;gt; to the variable &#039;&#039;(that&#039;s where the database is stored)&#039;&#039; so it looks something like this:&lt;br /&gt;
{{cat|/etc/lighttpd/lighttpd.conf|...&lt;br /&gt;
url.access-deny {{=}} (&amp;quot;~&amp;quot;, &amp;quot;.inc&amp;quot;, &amp;quot;config.php&amp;quot;)&lt;br /&gt;
...}}&lt;br /&gt;
Restart {{pkg|lighttpd}} to activate the changes:&lt;br /&gt;
{{cmd|/etc/init.d/lighttpd restart}}&lt;br /&gt;
&lt;br /&gt;
=== Additional packages ===&lt;br /&gt;
Some large apps, such as pdfviewer, texteditor, notifications and videoplayer are in separate packages:&lt;br /&gt;
{{cmd|apk add nextcloud-pdfviewer nextcloud-texteditor nextcloud-notifications nextcloud-videoplayer}}&lt;br /&gt;
&lt;br /&gt;
= Configure and use Nextcloud =&lt;br /&gt;
== Configure ==&lt;br /&gt;
Point your browser at &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;https://mysite.mydomain.com&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; and follow the on-screen instructions to complete the installation, supplying the database user and password created before.&lt;br /&gt;
&lt;br /&gt;
== Hardening PostgreSQL ==&lt;br /&gt;
If you have chosen PGSQL backend, revoke CREATEDB privilege from &#039;mycloud&#039; user:&lt;br /&gt;
{{cmd|psql -U postgres&lt;br /&gt;
ALTER ROLE mycloud NOCREATEDB;&lt;br /&gt;
\q}}&lt;br /&gt;
&lt;br /&gt;
== Increase upload size ==&lt;br /&gt;
Default configuration for php is limited to 2Mb file size. You might want to increase that size by editing the {{path|/etc/php/php.ini}} and change the following values to something that suits you:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
upload_max_filesize = 2M&lt;br /&gt;
post_max_size = 8M&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== enable opcache for nginx/php7 ==&lt;br /&gt;
To increase performace install&lt;br /&gt;
{{cmd|apk add php7-opcache}}&lt;br /&gt;
&lt;br /&gt;
Now uncomment/edit lines in /etc/php7/php.ini:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
opcache.enable=1&lt;br /&gt;
opcache.enable_cli=1&lt;br /&gt;
opcache.interned_strings_buffer=8&lt;br /&gt;
opcache.max_accelerated_files=10000&lt;br /&gt;
opcache.memory_consumption=128&lt;br /&gt;
opcache.save_comments=1&lt;br /&gt;
opcache.revalidate_freq=1&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart php-fpm7&lt;br /&gt;
{{cmd|rc-service php-fpm7 restart}}&lt;br /&gt;
&lt;br /&gt;
== Clients ==&lt;br /&gt;
There are clients available for many platforms, Android included:&lt;br /&gt;
* http://nextcloud.org/sync-clients/ &#039;&#039;(nextcloud Sync clients)&#039;&#039;&lt;br /&gt;
* http://nextcloud.org/support/android/ &#039;&#039;(Android client)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[http://pkgs.alpinelinux.org/packages?name=nextcloud-client&amp;amp;branch=&amp;amp;repo=&amp;amp;arch=&amp;amp;maintainer= nextcloud-client] is currently available in the testing repo.&lt;br /&gt;
&lt;br /&gt;
= Video Communication =&lt;br /&gt;
One of the major features of Nextcloud 11, available on Alpine 3.6 (currently edge) is a [https://nextcloud.com/webrtc/ WebRTC app], which relies on Spreed WebRTC server, which is available in the Alpine testing repository. Everything is still beta, so be aware of it :-). If you want a private video conferencing server install Nextcloud using Nginx and do the following (you can use Apache as well and follow the &#039;&#039;Apache config&#039;&#039; instructions [https://nextcloud.com/webrtc/ nextcloud.com]):&lt;br /&gt;
&lt;br /&gt;
Put the following config in the &#039;&#039;server&#039;&#039; section of Nginx:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Spreed WebRTC&lt;br /&gt;
location ^~ /webrtc {&lt;br /&gt;
  proxy_pass http://127.0.0.1:8080;&lt;br /&gt;
  proxy_http_version 1.1;&lt;br /&gt;
  proxy_set_header Upgrade $http_upgrade;&lt;br /&gt;
  proxy_set_header Connection $connection_upgrade;&lt;br /&gt;
  proxy_set_header X-Forwarded-Proto $scheme;&lt;br /&gt;
  proxy_set_header Host $http_host;&lt;br /&gt;
  proxy_set_header X-Real-IP $remote_addr;&lt;br /&gt;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;&lt;br /&gt;
&lt;br /&gt;
  proxy_buffering             on;&lt;br /&gt;
  proxy_ignore_client_abort   off;&lt;br /&gt;
  proxy_redirect              off;&lt;br /&gt;
  proxy_connect_timeout       90;&lt;br /&gt;
  proxy_send_timeout          90;&lt;br /&gt;
  proxy_read_timeout          90;&lt;br /&gt;
  proxy_buffer_size           4k;&lt;br /&gt;
  proxy_buffers               4 32k;&lt;br /&gt;
  proxy_busy_buffers_size     64k;&lt;br /&gt;
  proxy_temp_file_write_size  64k;&lt;br /&gt;
  proxy_next_upstream         error timeout invalid_header http_502 http_503 http_504;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Put the following section in the &#039;&#039;http&#039;&#039; section of Nginx:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
map $http_upgrade $connection_upgrade {&lt;br /&gt;
  default upgrade;&lt;br /&gt;
  &#039;&#039;      close;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload Nginx:&lt;br /&gt;
{{cmd|rc-service nginx reload}}&lt;br /&gt;
&lt;br /&gt;
Install Spreed WedRTC server (make sure you have the testing [https://wiki.alpinelinux.org/wiki/Alpine_Linux_package_management#Packages_and_Repositories repository] enabled):&lt;br /&gt;
{{cmd|apk add spreed-web-server}}&lt;br /&gt;
&lt;br /&gt;
Using the configuration file in &#039;&#039;/etc/spreed-webrtc/spreed-webrtc-server.conf&#039;&#039; follow the instructions at [https://nextcloud.com/webrtc/ nextcloud.com] to configure Spreed WebRTC server. Then start the server:&lt;br /&gt;
{{cmd|rc-service spreed-web-server start}}&lt;br /&gt;
{{cmd|rc-update add spreed-web-server}}&lt;br /&gt;
&lt;br /&gt;
Install the &#039;&#039;Spreed video calls&#039;&#039; app in Nextcloud and enjoy your private video calls.&lt;br /&gt;
&lt;br /&gt;
[[Category:Server]]&lt;/div&gt;</summary>
		<author><name>Aduty</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Alpine_Linux:FAQ&amp;diff=15728</id>
		<title>Alpine Linux:FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Alpine_Linux:FAQ&amp;diff=15728"/>
		<updated>2019-02-25T23:49:12Z</updated>

		<summary type="html">&lt;p&gt;Aduty: /* How can I contribute? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:filetypes.svg|64px|left|link=]]&lt;br /&gt;
This is a list of &#039;&#039;&#039;frequently asked questions&#039;&#039;&#039; about Alpine Linux.&amp;lt;br&amp;gt;&lt;br /&gt;
If your question is not answered on this page, use the search box above to find work in progress pages not linked here, or in case of no answer, edit this page and write down your question.&lt;br /&gt;
{{Tip| Prepare your question. Think it through. Make it simple and understandable.}} &lt;br /&gt;
&lt;br /&gt;
=General=&lt;br /&gt;
&lt;br /&gt;
To get oriented and learn what makes our distribution distinctive, see the [http://alpinelinux.org/about About page] or [[Alpine Linux:Overview|our more detailed overview]].&lt;br /&gt;
&lt;br /&gt;
== I have found a bug, where can I report it? ==&lt;br /&gt;
You can report it on the [http://bugs.alpinelinux.org/ bugtracker].&lt;br /&gt;
&lt;br /&gt;
== Are there any details about the releases available? ==&lt;br /&gt;
Yes, please check the [[Alpine Linux:Releases|Releases]] page.&lt;br /&gt;
&lt;br /&gt;
== Alpine freezes during boot from Compact Flash, how can I fix? ==&lt;br /&gt;
Most Compact Flash card readers do not support proper DMA.&amp;lt;br&amp;gt;&lt;br /&gt;
You should append &#039;&#039;&#039;nodma&#039;&#039;&#039; to the &#039;&#039;append&#039;&#039; line in {{path|syslinux.cfg}}.&lt;br /&gt;
&lt;br /&gt;
== How can I contribute? ==&lt;br /&gt;
You can contribute by:&lt;br /&gt;
* Using the software and giving feedback.&lt;br /&gt;
* Documenting your [http://www.alpinelinux.org Alpine Linux] experiences on this [[Main_Page|wiki]].&lt;br /&gt;
* In many other ways.&lt;br /&gt;
Please visit [[Contribute|Contribute page]] to read more about this topic.&lt;br /&gt;
&lt;br /&gt;
Your contributions are highly appreciated.&lt;br /&gt;
&lt;br /&gt;
== How do I remove the CDROM? ==&lt;br /&gt;
Since the modloop loopback device is on CDROM you cannot just run &amp;lt;code&amp;gt;eject&amp;lt;/code&amp;gt;. You need to unmount the modloop first.&amp;lt;br&amp;gt;&lt;br /&gt;
Unmounting both the modloop and the CDROM in one step can be done by executing:&lt;br /&gt;
{{Cmd|/etc/init.d/modloop stop}}&lt;br /&gt;
&lt;br /&gt;
Then it&#039;s possible to eject the CDROM:&lt;br /&gt;
{{Cmd|eject}}&lt;br /&gt;
&lt;br /&gt;
== Why don&#039;t I have man pages or where is the &#039;man&#039; command? ==&lt;br /&gt;
The &amp;lt;code&amp;gt;man&amp;lt;/code&amp;gt; command and man pages are not installed by default.&lt;br /&gt;
&lt;br /&gt;
* First, install the {{pkg|man}} package:&lt;br /&gt;
: {{Cmd|apk add man}}&lt;br /&gt;
* Once that&#039;s done, install the documentation for the packages that you require man pages for.&amp;lt;br /&amp;gt;(Keep in mind, however, it&#039;s possible that not all packages will have a corresponding documentation package.)&lt;br /&gt;
: {{Cmd|apk add &#039;&#039;package&#039;&#039;-doc}}&lt;br /&gt;
: For example, say you installed {{Pkg|iptables}} and you now require its man pages:&lt;br /&gt;
: {{Cmd|apk add iptables-doc}}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In our example above, we installed the man pages (and other documentation) for &amp;lt;code&amp;gt;iptables&amp;lt;/code&amp;gt;. We can now read it:&lt;br /&gt;
{{Cmd|man iptables}}&lt;br /&gt;
&lt;br /&gt;
==Booting Alpine on an HP ML350 G6==&lt;br /&gt;
{{Note|This &#039;Booting Alpine on an HP ML350 G6&#039; section, only applies to [http://www.alpinelinux.org/ Alpine Linux] 1.9.3 and earlier.}}&lt;br /&gt;
[http://bugs.alpinelinux.org/issues/228 Ticket 228] on [http://bugs.alpinelinux.org/ bugs.alpinelinux.org] includes a patch that disables the kernel module hpwdt by default.&lt;br /&gt;
&lt;br /&gt;
Details: Kernel module for HP Watchdog Timer causes issues during boot.  Solution is to create an overlay (ie {{path|hpwdt.apkovl.tar.gz}}) containing {{path|/etc/modprobe.d/hpwdt}} (which contains &amp;quot;blacklist hpwdt&amp;quot;), place that on some removable media (ie USB key) and insert that during boot process.  This will insure that the offending module doesn&#039;t load and that the server will boot properly.&lt;br /&gt;
&lt;br /&gt;
==My cron jobs don&#039;t run?==&lt;br /&gt;
&lt;br /&gt;
Start service &#039;&#039;crond&#039;&#039; and add it to runlevel:&lt;br /&gt;
&lt;br /&gt;
: {{cmd|rc-service crond start &amp;amp;&amp;amp; rc-update add crond}}&lt;br /&gt;
&lt;br /&gt;
After that the cron daemon is started automatically on system boot and executes the scripts placed in the folders under {{path|/etc/periodic}} - there&#039;s a {{path|15min}} folder, plus ones for {{path|hourly}}, {{path|daily}}, {{path|weekly}} and {{path|monthly}} scripts.&lt;br /&gt;
&lt;br /&gt;
You can check whether your scripts are likely to run using the command:&lt;br /&gt;
&lt;br /&gt;
: {{cmd|run-parts --test /etc/periodic/[foldername]}} - for example: &#039;&#039;run-parts --test /etc/periodic/15min&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This command will tell you what should run but will not actually execute the scripts.&lt;br /&gt;
&lt;br /&gt;
If the results of the test are not as expected, check the following:&lt;br /&gt;
&lt;br /&gt;
* Make sure the script is executable - if unsure, issue the command : {{cmd|chmod a+x [scriptname]}}&lt;br /&gt;
* Make sure the first line of your script is :&amp;lt;pre&amp;gt;#!/bin/sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Do not put file extensions on your script names - this stops them from working; for example: {{path|myscript}}  will run, but {{path|myscript.sh}} won&#039;t&lt;br /&gt;
&lt;br /&gt;
== What is the difference between edge and stable releases? ==&lt;br /&gt;
Stable releases are just what they sound like: initially a point-in-time snapshot of the package archives, but then maintained with bugfixes only in order to keep a stable environment.&lt;br /&gt;
&lt;br /&gt;
[[Edge]] is more of a rolling-release, with the latest and greatest packages available in the online repositories.&amp;lt;br&amp;gt;&lt;br /&gt;
Occasionally, snapshot ISO images of the then-current state of [[edge]] are made and are available for download.&amp;lt;br&amp;gt;&lt;br /&gt;
Typically these are made when there are major kernel upgrades or package upgrades that require initramfs rebuilds.&lt;br /&gt;
&lt;br /&gt;
== What kind of release of Alpine Linux are available? ==&lt;br /&gt;
Please check the [[Alpine_Linux:Releases|Releases]] page for more information.&lt;br /&gt;
&lt;br /&gt;
=Setup=&lt;br /&gt;
&lt;br /&gt;
== What is the difference between &#039;sys&#039;, &#039;data&#039;, and &#039;diskless&#039; installs when running setup-alpine (or setup-disk)? ==&lt;br /&gt;
&#039;&#039;&#039;sys:&#039;&#039;&#039; This mode is a traditional disk install. The following partitions will be created on the disk: /boot, / (filesystem root) and swap.&amp;lt;br&amp;gt;&lt;br /&gt;
This mode may be used for development boxes, desktops, virtual servers, etc.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;data:&#039;&#039;&#039; This mode uses your disk(s) for data storage, not for the operating system.  Only /var is created on disk.  The system itself will run from tmpfs (RAM).  &lt;br /&gt;
&lt;br /&gt;
Use this mode if you only want to use the disk(s) for a mailspool, databases, logs, etc.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;diskless:&#039;&#039;&#039; No disks are to be used.  [[Alpine local backup]] may still be used in this mode.&lt;br /&gt;
&lt;br /&gt;
These modes are explained further [[Installation#Basics|on the Installation page]].&lt;br /&gt;
&lt;br /&gt;
== How can I install a custom firmware in a diskless system? ==&lt;br /&gt;
&lt;br /&gt;
The modules and firmware are both special images which are mounted as read-only.&amp;lt;br&amp;gt;&lt;br /&gt;
To fix this issue you can copy the firmware directory to your writeable media (cf/usb) and copy your custom firmware to it.&amp;lt;br&amp;gt;&lt;br /&gt;
After reboot Alpine should automatically use the directory on your local storage instead of the loopback device.&lt;br /&gt;
&lt;br /&gt;
=Audio=&lt;br /&gt;
&lt;br /&gt;
== How do I play my .ogg/.mp3 files? ==&lt;br /&gt;
First, the sound card should be recognized (you must have {{path|/dev/snd/*****}} files)&lt;br /&gt;
&lt;br /&gt;
{{pkg|sox}}, {{pkg|mpg123}}, etc all use the oss sound driver, while Alpine uses ALSA drivers.&amp;lt;br&amp;gt;&lt;br /&gt;
So you need to load the snd-pcm-oss compatibility module.&amp;lt;br&amp;gt;&lt;br /&gt;
While you&#039;re at it, you might need {{pkg|aumix}} to turn up the sound volume&lt;br /&gt;
{{cmd|echo snd-pcm-oss &amp;gt;&amp;gt; /etc/modules&lt;br /&gt;
modprobe snd-pcm-oss &lt;br /&gt;
apk_add aumix sox&lt;br /&gt;
aumix (set volume settings)&lt;br /&gt;
play really_cool_song.mp3}}&lt;br /&gt;
&lt;br /&gt;
= Time and timezones =&lt;br /&gt;
&lt;br /&gt;
== How do I set the local timezone? ==&lt;br /&gt;
&lt;br /&gt;
Starting in Alpine 2.2, setting the timezone can be done through the [[Setup-alpine|setup-alpine]] script, and no manual settings should be necessary.&amp;lt;br&amp;gt;&lt;br /&gt;
If you wish to edit the timezone after installation, run the [[Alpine_setup_scripts|setup-timezone]] script.&lt;br /&gt;
&lt;br /&gt;
However, if you are using a previous version, please use the following steps:&lt;br /&gt;
&lt;br /&gt;
 /etc/timezone and the whole zoneinfo directory tree are not supported.&lt;br /&gt;
 To set the timezone, set the TZ environment variable as specified in&lt;br /&gt;
 http://www.opengroup.org/onlinepubs/007904975/basedefs/xbd_chap08.html&lt;br /&gt;
 or you may also create an /etc/TZ file of a single line, ending with a&lt;br /&gt;
 newline, containing the TZ setting.  For example&lt;br /&gt;
 echo CST6CDT &amp;gt; /etc/TZ&lt;br /&gt;
&#039;&#039;Source: http://www.uclibc.org/downloads/Glibc_vs_uClibc_Differences.txt&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For more information, see how other uClibc-based distributions do this:&lt;br /&gt;
* http://leaf.sourceforge.net/doc/buci-tz3.html&lt;br /&gt;
* http://www.sonoracomm.com/index.php?option=com_content&amp;amp;task=view&amp;amp;id=107&amp;amp;Itemid=32&lt;br /&gt;
&lt;br /&gt;
For a more complete list of timezones, please see: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones&lt;br /&gt;
&lt;br /&gt;
== OpenNTPD reports an error with &amp;quot;adjtime&amp;quot; ==&lt;br /&gt;
Your log contains something like:&lt;br /&gt;
 reply from 85.214.86.126: offset 865033148.784255 delay 0.055466, next query 32s&lt;br /&gt;
 reply from 202.150.212.24: offset 865033148.779314 delay 0.400771, next query 3s&lt;br /&gt;
 adjusting local clock by 865033148.779835s                                      &lt;br /&gt;
 adjtime failed: Invalid argument    &lt;br /&gt;
&lt;br /&gt;
{{pkg|openntpd}} is supposed to make small adjustments in the time without causing time jumps.&amp;lt;br&amp;gt;&lt;br /&gt;
If the adjustment is too big then something is clearly wrong and ntpd gives up. (its actually adjtime(3) that has a limit on how big adjustments are allowed)&lt;br /&gt;
&lt;br /&gt;
You can make ntpd set the time at startup by adding &#039;&#039;-s&#039;&#039; option to ntpd. This is done by setting &#039;&#039;&#039;NTPD_OPTS=&amp;quot;-s&amp;quot;&#039;&#039;&#039; in {{path|/etc/conf.d/ntpd}}.&lt;br /&gt;
&lt;br /&gt;
== Using a cron job to keep the time in sync ==&lt;br /&gt;
Add the following to {{path|/etc/periodic/daily}} (or use another folder under the {{path|/etc/periodic}} heirarchy if you want to run the script more/less frequently)&lt;br /&gt;
&lt;br /&gt;
Example: file called {{path|do-ntp}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
ntpd -d -q -n -p uk.pool.ntp.org&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This queries the uk time server pool - you can modify this to suit your localisation, or just use &#039;&#039;pool.ntp.org&#039;&#039;. More info here: [http://www.pool.ntp.org/zone/@ http://www.pool.ntp.org/zone/@]&lt;br /&gt;
&lt;br /&gt;
== Windows clients reports an error when trying to sync ==&lt;br /&gt;
{{pkg|openntpd}} needs to run for a while before it is satisfied it is in sync.&lt;br /&gt;
Until then it will set a flag &amp;quot;clock not synchronized&amp;quot; and Windows will report an error while trying to sync with your {{pkg|openntpd}} server.&lt;br /&gt;
&lt;br /&gt;
Only thing to do is wait, do something else for 15-20mins and then check.&lt;br /&gt;
&lt;br /&gt;
= Packages =&lt;br /&gt;
== Can you build an apk package for ...? ==&lt;br /&gt;
Yes, we probably can.&amp;lt;br&amp;gt;&lt;br /&gt;
Please create an [https://bugs.alpinelinux.org/projects/alpine/issues/new issue] in the [https://bugs.alpinelinux.org bugtracker]. Mark it as &amp;quot;feature&amp;quot; and include a short description (one-line), an url for the home page, and an url for the source package.&lt;br /&gt;
&lt;br /&gt;
== How can I build my own package? ==&lt;br /&gt;
Please see the [[Creating an Alpine package]] page.&lt;br /&gt;
&lt;br /&gt;
== WARNING: Ignoring APKINDEX.xxxx.tar.gz ==&lt;br /&gt;
If you get &amp;lt;code&amp;gt;WARNING: Ignoring APKINDEX.xxxx.tar.gz: No such file or directory&amp;lt;/code&amp;gt; while running package related tools, check your {{path|/etc/apk/repositories}} file if an entry points to {{path|.../v2.4/testing/}}. This directory is gone.&lt;br /&gt;
&lt;br /&gt;
To check the content of the repositories file&lt;br /&gt;
{{Cmd|cat /etc/apk/repositories}}&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
{{Cmd|setup-apkrepos}}&lt;br /&gt;
&lt;br /&gt;
== What does &amp;quot;required by: world[$pkgname]&amp;quot; mean? ==&lt;br /&gt;
&lt;br /&gt;
It means that the package you try to install does not exist in the repositories you have configured in &amp;lt;code&amp;gt;/etc/apk/repositories&amp;lt;/code&amp;gt;. Maybe you forgot to add community, testing or unmaintained to /etc/apk/repositories?&lt;br /&gt;
&lt;br /&gt;
== How can i find out if a certain package exists in alpine? ==&lt;br /&gt;
&lt;br /&gt;
If you want to only search repositories you have configured in /etc/apk/repositories, then &amp;lt;code&amp;gt;apk search $pkgname&amp;lt;/code&amp;gt; should get you sorted. If you want to search all repositories have a look at the [https://pkgs.alpinelinux.org/ online pkg oracle]&lt;br /&gt;
&lt;br /&gt;
= Dynamic DNS =&lt;br /&gt;
== How do I schedule a regular dynamic DNS update? ==&lt;br /&gt;
You&#039;ll want to install the {{pkg|ez-ipupdate}} package:&lt;br /&gt;
{{cmd|apk add ez-ipupdate}}&lt;br /&gt;
&lt;br /&gt;
After that, create a new file at {{path|/etc/ez-ipupdate.conf}} with contents similar to:&lt;br /&gt;
 service-type=dyndns&lt;br /&gt;
 user=myusername:mypassword&lt;br /&gt;
 interface=eth1&lt;br /&gt;
 host=myhostname.dyndns.org&lt;br /&gt;
&lt;br /&gt;
Make the new ip cache directory:&lt;br /&gt;
{{cmd|mkdir /var/cache/ez-ipupdate&lt;br /&gt;
lbu add /var/cache/ez-ipupdate}}&lt;br /&gt;
&lt;br /&gt;
Then schedule a new cron job with this command:&lt;br /&gt;
{{cmd|echo &amp;gt;&amp;gt; /var/log/ez-ipupdate &amp;amp;&amp;amp; \&amp;lt;br&amp;gt;/bin/date &amp;gt;&amp;gt; /var/log/ez-ipupdate &amp;amp;&amp;amp; \&amp;lt;br&amp;gt;ez-ipupdate --config-file /etc/ez-ipupdate.conf -f -F /var/run/ez-ipupdate.pid \&amp;lt;br&amp;gt;  --cache-file /var/cache/ez-ipupdate/ipcache --quiet &amp;gt;&amp;gt; /var/log/ez-ipupdate 2&amp;gt;&amp;amp;1}}&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget to backup your settings!&lt;br /&gt;
{{cmd|lbu ci}}&lt;br /&gt;
&lt;br /&gt;
= Terminal =&lt;br /&gt;
&lt;br /&gt;
== How to enable/fix colors for git? ==&lt;br /&gt;
&lt;br /&gt;
The problem is not in git itself or terminal, but in the &amp;lt;tt&amp;gt;less&amp;lt;/tt&amp;gt; command.&lt;br /&gt;
Busybox’s &amp;lt;tt&amp;gt;less&amp;lt;/tt&amp;gt; doesn’t support &amp;lt;tt&amp;gt;-r&amp;lt;/tt&amp;gt; (&amp;lt;tt&amp;gt;--raw-control-chars&amp;lt;/tt&amp;gt;) and &amp;lt;tt&amp;gt;-R&amp;lt;/tt&amp;gt; (&amp;lt;tt&amp;gt;--RAW-CONTROL-CHARS&amp;lt;/tt&amp;gt;) options.&lt;br /&gt;
&lt;br /&gt;
The simplest (yet not ideal) solution is to install GNU less:&lt;br /&gt;
&lt;br /&gt;
{{cmd|apk add less}}&lt;/div&gt;</summary>
		<author><name>Aduty</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Alpine_Linux:FAQ&amp;diff=15727</id>
		<title>Alpine Linux:FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Alpine_Linux:FAQ&amp;diff=15727"/>
		<updated>2019-02-25T23:46:14Z</updated>

		<summary type="html">&lt;p&gt;Aduty: /* How do I schedule a regular dynamic DNS update? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:filetypes.svg|64px|left|link=]]&lt;br /&gt;
This is a list of &#039;&#039;&#039;frequently asked questions&#039;&#039;&#039; about Alpine Linux.&amp;lt;br&amp;gt;&lt;br /&gt;
If your question is not answered on this page, use the search box above to find work in progress pages not linked here, or in case of no answer, edit this page and write down your question.&lt;br /&gt;
{{Tip| Prepare your question. Think it through. Make it simple and understandable.}} &lt;br /&gt;
&lt;br /&gt;
=General=&lt;br /&gt;
&lt;br /&gt;
To get oriented and learn what makes our distribution distinctive, see the [http://alpinelinux.org/about About page] or [[Alpine Linux:Overview|our more detailed overview]].&lt;br /&gt;
&lt;br /&gt;
== I have found a bug, where can I report it? ==&lt;br /&gt;
You can report it on the [http://bugs.alpinelinux.org/ bugtracker].&lt;br /&gt;
&lt;br /&gt;
== Are there any details about the releases available? ==&lt;br /&gt;
Yes, please check the [[Alpine Linux:Releases|Releases]] page.&lt;br /&gt;
&lt;br /&gt;
== Alpine freezes during boot from Compact Flash, how can I fix? ==&lt;br /&gt;
Most Compact Flash card readers do not support proper DMA.&amp;lt;br&amp;gt;&lt;br /&gt;
You should append &#039;&#039;&#039;nodma&#039;&#039;&#039; to the &#039;&#039;append&#039;&#039; line in {{path|syslinux.cfg}}.&lt;br /&gt;
&lt;br /&gt;
== How can I contribute? ==&lt;br /&gt;
You can contribute by:&lt;br /&gt;
* using the software and giving feedback&lt;br /&gt;
* by documenting your [http://www.alpinelinux.org Alpine Linux] experiences on this [[Main_Page|wiki]]&lt;br /&gt;
* in many other ways&lt;br /&gt;
Please visit [[Contribute|Contribute page]] to read more about this topic.&lt;br /&gt;
&lt;br /&gt;
Your contributions are highly appreciated.&lt;br /&gt;
&lt;br /&gt;
== How do I remove the CDROM? ==&lt;br /&gt;
Since the modloop loopback device is on CDROM you cannot just run &amp;lt;code&amp;gt;eject&amp;lt;/code&amp;gt;. You need to unmount the modloop first.&amp;lt;br&amp;gt;&lt;br /&gt;
Unmounting both the modloop and the CDROM in one step can be done by executing:&lt;br /&gt;
{{Cmd|/etc/init.d/modloop stop}}&lt;br /&gt;
&lt;br /&gt;
Then it&#039;s possible to eject the CDROM:&lt;br /&gt;
{{Cmd|eject}}&lt;br /&gt;
&lt;br /&gt;
== Why don&#039;t I have man pages or where is the &#039;man&#039; command? ==&lt;br /&gt;
The &amp;lt;code&amp;gt;man&amp;lt;/code&amp;gt; command and man pages are not installed by default.&lt;br /&gt;
&lt;br /&gt;
* First, install the {{pkg|man}} package:&lt;br /&gt;
: {{Cmd|apk add man}}&lt;br /&gt;
* Once that&#039;s done, install the documentation for the packages that you require man pages for.&amp;lt;br /&amp;gt;(Keep in mind, however, it&#039;s possible that not all packages will have a corresponding documentation package.)&lt;br /&gt;
: {{Cmd|apk add &#039;&#039;package&#039;&#039;-doc}}&lt;br /&gt;
: For example, say you installed {{Pkg|iptables}} and you now require its man pages:&lt;br /&gt;
: {{Cmd|apk add iptables-doc}}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In our example above, we installed the man pages (and other documentation) for &amp;lt;code&amp;gt;iptables&amp;lt;/code&amp;gt;. We can now read it:&lt;br /&gt;
{{Cmd|man iptables}}&lt;br /&gt;
&lt;br /&gt;
==Booting Alpine on an HP ML350 G6==&lt;br /&gt;
{{Note|This &#039;Booting Alpine on an HP ML350 G6&#039; section, only applies to [http://www.alpinelinux.org/ Alpine Linux] 1.9.3 and earlier.}}&lt;br /&gt;
[http://bugs.alpinelinux.org/issues/228 Ticket 228] on [http://bugs.alpinelinux.org/ bugs.alpinelinux.org] includes a patch that disables the kernel module hpwdt by default.&lt;br /&gt;
&lt;br /&gt;
Details: Kernel module for HP Watchdog Timer causes issues during boot.  Solution is to create an overlay (ie {{path|hpwdt.apkovl.tar.gz}}) containing {{path|/etc/modprobe.d/hpwdt}} (which contains &amp;quot;blacklist hpwdt&amp;quot;), place that on some removable media (ie USB key) and insert that during boot process.  This will insure that the offending module doesn&#039;t load and that the server will boot properly.&lt;br /&gt;
&lt;br /&gt;
==My cron jobs don&#039;t run?==&lt;br /&gt;
&lt;br /&gt;
Start service &#039;&#039;crond&#039;&#039; and add it to runlevel:&lt;br /&gt;
&lt;br /&gt;
: {{cmd|rc-service crond start &amp;amp;&amp;amp; rc-update add crond}}&lt;br /&gt;
&lt;br /&gt;
After that the cron daemon is started automatically on system boot and executes the scripts placed in the folders under {{path|/etc/periodic}} - there&#039;s a {{path|15min}} folder, plus ones for {{path|hourly}}, {{path|daily}}, {{path|weekly}} and {{path|monthly}} scripts.&lt;br /&gt;
&lt;br /&gt;
You can check whether your scripts are likely to run using the command:&lt;br /&gt;
&lt;br /&gt;
: {{cmd|run-parts --test /etc/periodic/[foldername]}} - for example: &#039;&#039;run-parts --test /etc/periodic/15min&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This command will tell you what should run but will not actually execute the scripts.&lt;br /&gt;
&lt;br /&gt;
If the results of the test are not as expected, check the following:&lt;br /&gt;
&lt;br /&gt;
* Make sure the script is executable - if unsure, issue the command : {{cmd|chmod a+x [scriptname]}}&lt;br /&gt;
* Make sure the first line of your script is :&amp;lt;pre&amp;gt;#!/bin/sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Do not put file extensions on your script names - this stops them from working; for example: {{path|myscript}}  will run, but {{path|myscript.sh}} won&#039;t&lt;br /&gt;
&lt;br /&gt;
== What is the difference between edge and stable releases? ==&lt;br /&gt;
Stable releases are just what they sound like: initially a point-in-time snapshot of the package archives, but then maintained with bugfixes only in order to keep a stable environment.&lt;br /&gt;
&lt;br /&gt;
[[Edge]] is more of a rolling-release, with the latest and greatest packages available in the online repositories.&amp;lt;br&amp;gt;&lt;br /&gt;
Occasionally, snapshot ISO images of the then-current state of [[edge]] are made and are available for download.&amp;lt;br&amp;gt;&lt;br /&gt;
Typically these are made when there are major kernel upgrades or package upgrades that require initramfs rebuilds.&lt;br /&gt;
&lt;br /&gt;
== What kind of release of Alpine Linux are available? ==&lt;br /&gt;
Please check the [[Alpine_Linux:Releases|Releases]] page for more information.&lt;br /&gt;
&lt;br /&gt;
=Setup=&lt;br /&gt;
&lt;br /&gt;
== What is the difference between &#039;sys&#039;, &#039;data&#039;, and &#039;diskless&#039; installs when running setup-alpine (or setup-disk)? ==&lt;br /&gt;
&#039;&#039;&#039;sys:&#039;&#039;&#039; This mode is a traditional disk install. The following partitions will be created on the disk: /boot, / (filesystem root) and swap.&amp;lt;br&amp;gt;&lt;br /&gt;
This mode may be used for development boxes, desktops, virtual servers, etc.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;data:&#039;&#039;&#039; This mode uses your disk(s) for data storage, not for the operating system.  Only /var is created on disk.  The system itself will run from tmpfs (RAM).  &lt;br /&gt;
&lt;br /&gt;
Use this mode if you only want to use the disk(s) for a mailspool, databases, logs, etc.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;diskless:&#039;&#039;&#039; No disks are to be used.  [[Alpine local backup]] may still be used in this mode.&lt;br /&gt;
&lt;br /&gt;
These modes are explained further [[Installation#Basics|on the Installation page]].&lt;br /&gt;
&lt;br /&gt;
== How can I install a custom firmware in a diskless system? ==&lt;br /&gt;
&lt;br /&gt;
The modules and firmware are both special images which are mounted as read-only.&amp;lt;br&amp;gt;&lt;br /&gt;
To fix this issue you can copy the firmware directory to your writeable media (cf/usb) and copy your custom firmware to it.&amp;lt;br&amp;gt;&lt;br /&gt;
After reboot Alpine should automatically use the directory on your local storage instead of the loopback device.&lt;br /&gt;
&lt;br /&gt;
=Audio=&lt;br /&gt;
&lt;br /&gt;
== How do I play my .ogg/.mp3 files? ==&lt;br /&gt;
First, the sound card should be recognized (you must have {{path|/dev/snd/*****}} files)&lt;br /&gt;
&lt;br /&gt;
{{pkg|sox}}, {{pkg|mpg123}}, etc all use the oss sound driver, while Alpine uses ALSA drivers.&amp;lt;br&amp;gt;&lt;br /&gt;
So you need to load the snd-pcm-oss compatibility module.&amp;lt;br&amp;gt;&lt;br /&gt;
While you&#039;re at it, you might need {{pkg|aumix}} to turn up the sound volume&lt;br /&gt;
{{cmd|echo snd-pcm-oss &amp;gt;&amp;gt; /etc/modules&lt;br /&gt;
modprobe snd-pcm-oss &lt;br /&gt;
apk_add aumix sox&lt;br /&gt;
aumix (set volume settings)&lt;br /&gt;
play really_cool_song.mp3}}&lt;br /&gt;
&lt;br /&gt;
= Time and timezones =&lt;br /&gt;
&lt;br /&gt;
== How do I set the local timezone? ==&lt;br /&gt;
&lt;br /&gt;
Starting in Alpine 2.2, setting the timezone can be done through the [[Setup-alpine|setup-alpine]] script, and no manual settings should be necessary.&amp;lt;br&amp;gt;&lt;br /&gt;
If you wish to edit the timezone after installation, run the [[Alpine_setup_scripts|setup-timezone]] script.&lt;br /&gt;
&lt;br /&gt;
However, if you are using a previous version, please use the following steps:&lt;br /&gt;
&lt;br /&gt;
 /etc/timezone and the whole zoneinfo directory tree are not supported.&lt;br /&gt;
 To set the timezone, set the TZ environment variable as specified in&lt;br /&gt;
 http://www.opengroup.org/onlinepubs/007904975/basedefs/xbd_chap08.html&lt;br /&gt;
 or you may also create an /etc/TZ file of a single line, ending with a&lt;br /&gt;
 newline, containing the TZ setting.  For example&lt;br /&gt;
 echo CST6CDT &amp;gt; /etc/TZ&lt;br /&gt;
&#039;&#039;Source: http://www.uclibc.org/downloads/Glibc_vs_uClibc_Differences.txt&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For more information, see how other uClibc-based distributions do this:&lt;br /&gt;
* http://leaf.sourceforge.net/doc/buci-tz3.html&lt;br /&gt;
* http://www.sonoracomm.com/index.php?option=com_content&amp;amp;task=view&amp;amp;id=107&amp;amp;Itemid=32&lt;br /&gt;
&lt;br /&gt;
For a more complete list of timezones, please see: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones&lt;br /&gt;
&lt;br /&gt;
== OpenNTPD reports an error with &amp;quot;adjtime&amp;quot; ==&lt;br /&gt;
Your log contains something like:&lt;br /&gt;
 reply from 85.214.86.126: offset 865033148.784255 delay 0.055466, next query 32s&lt;br /&gt;
 reply from 202.150.212.24: offset 865033148.779314 delay 0.400771, next query 3s&lt;br /&gt;
 adjusting local clock by 865033148.779835s                                      &lt;br /&gt;
 adjtime failed: Invalid argument    &lt;br /&gt;
&lt;br /&gt;
{{pkg|openntpd}} is supposed to make small adjustments in the time without causing time jumps.&amp;lt;br&amp;gt;&lt;br /&gt;
If the adjustment is too big then something is clearly wrong and ntpd gives up. (its actually adjtime(3) that has a limit on how big adjustments are allowed)&lt;br /&gt;
&lt;br /&gt;
You can make ntpd set the time at startup by adding &#039;&#039;-s&#039;&#039; option to ntpd. This is done by setting &#039;&#039;&#039;NTPD_OPTS=&amp;quot;-s&amp;quot;&#039;&#039;&#039; in {{path|/etc/conf.d/ntpd}}.&lt;br /&gt;
&lt;br /&gt;
== Using a cron job to keep the time in sync ==&lt;br /&gt;
Add the following to {{path|/etc/periodic/daily}} (or use another folder under the {{path|/etc/periodic}} heirarchy if you want to run the script more/less frequently)&lt;br /&gt;
&lt;br /&gt;
Example: file called {{path|do-ntp}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
ntpd -d -q -n -p uk.pool.ntp.org&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This queries the uk time server pool - you can modify this to suit your localisation, or just use &#039;&#039;pool.ntp.org&#039;&#039;. More info here: [http://www.pool.ntp.org/zone/@ http://www.pool.ntp.org/zone/@]&lt;br /&gt;
&lt;br /&gt;
== Windows clients reports an error when trying to sync ==&lt;br /&gt;
{{pkg|openntpd}} needs to run for a while before it is satisfied it is in sync.&lt;br /&gt;
Until then it will set a flag &amp;quot;clock not synchronized&amp;quot; and Windows will report an error while trying to sync with your {{pkg|openntpd}} server.&lt;br /&gt;
&lt;br /&gt;
Only thing to do is wait, do something else for 15-20mins and then check.&lt;br /&gt;
&lt;br /&gt;
= Packages =&lt;br /&gt;
== Can you build an apk package for ...? ==&lt;br /&gt;
Yes, we probably can.&amp;lt;br&amp;gt;&lt;br /&gt;
Please create an [https://bugs.alpinelinux.org/projects/alpine/issues/new issue] in the [https://bugs.alpinelinux.org bugtracker]. Mark it as &amp;quot;feature&amp;quot; and include a short description (one-line), an url for the home page, and an url for the source package.&lt;br /&gt;
&lt;br /&gt;
== How can I build my own package? ==&lt;br /&gt;
Please see the [[Creating an Alpine package]] page.&lt;br /&gt;
&lt;br /&gt;
== WARNING: Ignoring APKINDEX.xxxx.tar.gz ==&lt;br /&gt;
If you get &amp;lt;code&amp;gt;WARNING: Ignoring APKINDEX.xxxx.tar.gz: No such file or directory&amp;lt;/code&amp;gt; while running package related tools, check your {{path|/etc/apk/repositories}} file if an entry points to {{path|.../v2.4/testing/}}. This directory is gone.&lt;br /&gt;
&lt;br /&gt;
To check the content of the repositories file&lt;br /&gt;
{{Cmd|cat /etc/apk/repositories}}&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
{{Cmd|setup-apkrepos}}&lt;br /&gt;
&lt;br /&gt;
== What does &amp;quot;required by: world[$pkgname]&amp;quot; mean? ==&lt;br /&gt;
&lt;br /&gt;
It means that the package you try to install does not exist in the repositories you have configured in &amp;lt;code&amp;gt;/etc/apk/repositories&amp;lt;/code&amp;gt;. Maybe you forgot to add community, testing or unmaintained to /etc/apk/repositories?&lt;br /&gt;
&lt;br /&gt;
== How can i find out if a certain package exists in alpine? ==&lt;br /&gt;
&lt;br /&gt;
If you want to only search repositories you have configured in /etc/apk/repositories, then &amp;lt;code&amp;gt;apk search $pkgname&amp;lt;/code&amp;gt; should get you sorted. If you want to search all repositories have a look at the [https://pkgs.alpinelinux.org/ online pkg oracle]&lt;br /&gt;
&lt;br /&gt;
= Dynamic DNS =&lt;br /&gt;
== How do I schedule a regular dynamic DNS update? ==&lt;br /&gt;
You&#039;ll want to install the {{pkg|ez-ipupdate}} package:&lt;br /&gt;
{{cmd|apk add ez-ipupdate}}&lt;br /&gt;
&lt;br /&gt;
After that, create a new file at {{path|/etc/ez-ipupdate.conf}} with contents similar to:&lt;br /&gt;
 service-type=dyndns&lt;br /&gt;
 user=myusername:mypassword&lt;br /&gt;
 interface=eth1&lt;br /&gt;
 host=myhostname.dyndns.org&lt;br /&gt;
&lt;br /&gt;
Make the new ip cache directory:&lt;br /&gt;
{{cmd|mkdir /var/cache/ez-ipupdate&lt;br /&gt;
lbu add /var/cache/ez-ipupdate}}&lt;br /&gt;
&lt;br /&gt;
Then schedule a new cron job with this command:&lt;br /&gt;
{{cmd|echo &amp;gt;&amp;gt; /var/log/ez-ipupdate &amp;amp;&amp;amp; \&amp;lt;br&amp;gt;/bin/date &amp;gt;&amp;gt; /var/log/ez-ipupdate &amp;amp;&amp;amp; \&amp;lt;br&amp;gt;ez-ipupdate --config-file /etc/ez-ipupdate.conf -f -F /var/run/ez-ipupdate.pid \&amp;lt;br&amp;gt;  --cache-file /var/cache/ez-ipupdate/ipcache --quiet &amp;gt;&amp;gt; /var/log/ez-ipupdate 2&amp;gt;&amp;amp;1}}&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget to backup your settings!&lt;br /&gt;
{{cmd|lbu ci}}&lt;br /&gt;
&lt;br /&gt;
= Terminal =&lt;br /&gt;
&lt;br /&gt;
== How to enable/fix colors for git? ==&lt;br /&gt;
&lt;br /&gt;
The problem is not in git itself or terminal, but in the &amp;lt;tt&amp;gt;less&amp;lt;/tt&amp;gt; command.&lt;br /&gt;
Busybox’s &amp;lt;tt&amp;gt;less&amp;lt;/tt&amp;gt; doesn’t support &amp;lt;tt&amp;gt;-r&amp;lt;/tt&amp;gt; (&amp;lt;tt&amp;gt;--raw-control-chars&amp;lt;/tt&amp;gt;) and &amp;lt;tt&amp;gt;-R&amp;lt;/tt&amp;gt; (&amp;lt;tt&amp;gt;--RAW-CONTROL-CHARS&amp;lt;/tt&amp;gt;) options.&lt;br /&gt;
&lt;br /&gt;
The simplest (yet not ideal) solution is to install GNU less:&lt;br /&gt;
&lt;br /&gt;
{{cmd|apk add less}}&lt;/div&gt;</summary>
		<author><name>Aduty</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Installation&amp;diff=15726</id>
		<title>Installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Installation&amp;diff=15726"/>
		<updated>2019-02-25T23:43:19Z</updated>

		<summary type="html">&lt;p&gt;Aduty: /* Basics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following information will assist you with the installation of [http://alpinelinux.org/about Alpine Linux].&lt;br /&gt;
[[Image:hdd_mount.png|left|link=]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installation Quick-Start in 3 Easy Steps ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:left; font-size:30px; font-weight:bold;&amp;quot;&amp;gt;&lt;br /&gt;
1st&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:65px; background-color:#EDF2F2; border-style:solid; border-color:#6F7C91; border-width:0px; border-left-width:5px; min-height:55px; padding:5px;&amp;quot;&amp;gt;&lt;br /&gt;
[http://alpinelinux.org/downloads Download] one of the latest stable-release ISOs. Then compare the image&#039;s checksum to the one in the corresponding checksum file (&amp;lt;code&amp;gt;*.sha256&amp;lt;/code&amp;gt;) and verify its GPG signature.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:left; font-size:30px; font-weight:bold;&amp;quot;&amp;gt;&lt;br /&gt;
2nd&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:65px; background-color:#E0E9E9; border-style:solid; border-color:#606A82; border-width:0px; border-left-width:5px; min-height:55px; padding:5px;&amp;quot;&amp;gt;&lt;br /&gt;
If you have a CD drive from which you can boot, then [[Burning ISOs|burn the ISO onto a blank CD]] using your favorite CD burning software. Else [[Create a Bootable USB|create a bootable USB drive]].&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:left; font-size:30px; font-weight:bold;&amp;quot;&amp;gt;&lt;br /&gt;
3rd&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:65px; background-color:#9faecc; border-style:solid; border-color:#324065; border-width:0px; border-left-width:5px; min-height:55px; padding:5px;&amp;quot;&amp;gt;&lt;br /&gt;
Boot from the CD or USB drive, login as root with no password, and voilà! Enjoy Alpine Linux!&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Clear}}&lt;br /&gt;
One of the [[Installation#Post-Install|first commands you might want to use]] is &amp;lt;code&amp;gt;[[setup-alpine]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Installation Handbook ==&lt;br /&gt;
=== Basics ===&lt;br /&gt;
Alpine can be used in any of three modes:&lt;br /&gt;
&amp;lt;dl&amp;gt;&lt;br /&gt;
&amp;lt;dt&amp;gt;diskless mode&lt;br /&gt;
&amp;lt;dd&amp;gt;You&#039;ll boot from a read-only medium such as the installation CD, a [[Create a Bootable USB|USB drive]], or a [[Create a Bootable Compact Flash|Compact Flash card]]. {{Tip| To prepare either a USB or Compact Flash card, you can use the &amp;lt;code&amp;gt;[[setup-bootable]]&amp;lt;/code&amp;gt; script; see the pages linked above for details.}} When you use Alpine in this mode, you need to use [[Alpine local backup|Alpine Local Backup (lbu)]] to save your modifications between reboots. That requires some writable medium, usually removable. If your boot medium is, for example, a USB drive, you can save modifications there; you don&#039;t need a separate partition or drive. See also [[Local APK cache]].&lt;br /&gt;
{{Note| When the &amp;lt;code&amp;gt;[[setup-alpine]]&amp;lt;/code&amp;gt; script asks for a disk, say &amp;quot;none&amp;quot;. It will then prompt whether you&#039;d like to preserve modifications on any writable medium.}}&lt;br /&gt;
&amp;lt;dt&amp;gt;data mode&lt;br /&gt;
&amp;lt;dd&amp;gt;As in diskless mode, your OS is run from a read-only medium. However, here a writable partition (usually on a hard disk) is used to store the data in {{Path|/var}}. That partition is accessed directly, rather than copied into a tmpfs; so this is better-suited to uses where large amounts of data need to be preserved between reboots. {{Note| The &amp;lt;code&amp;gt;[[setup-alpine]]&amp;lt;/code&amp;gt; script handles installing Alpine in this mode, too, when you supply a writable partition instead of &amp;quot;none&amp;quot;, and request mode &amp;quot;data&amp;quot;.}} This mode may be used for mailspools, database and log servers, and so on.&lt;br /&gt;
&amp;lt;dt&amp;gt;sys mode&lt;br /&gt;
&amp;lt;dd&amp;gt;This is a [[Install to disk|traditional hard-disk install]] (see link for details). &amp;lt;!-- includes [[Installing Alpine on HDD overwriting everything]] --&amp;gt; Both the boot system and your modifications are written to the hard disk in a standard Linux hierarchy. {{Note| The &amp;lt;code&amp;gt;[[setup-alpine]]&amp;lt;/code&amp;gt; script handles installing Alpine in this mode, too, when you supply a writable partition instead of &amp;quot;none&amp;quot;, and request mode &amp;quot;sys&amp;quot;. By default, it will create three partions on your disk for {{Path|/boot}}, {{Path|/}}, and {{Path|swap}}; however you can also [[Setting up disks manually|partition your disk manually]].&lt;br /&gt;
}} This mode may be used for [[Desktops|desktops]], development boxes, and virtual servers.&lt;br /&gt;
    &amp;lt;!-- [[Native Harddisk Install 1.6]] Obsolete --&amp;gt;&lt;br /&gt;
&amp;lt;/dl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Advanced ===&lt;br /&gt;
* [[Create UEFI boot USB]]&lt;br /&gt;
* [[Tutorials_and_Howtos#Storage|Setting up storage with RAID, LVM, LUKS encryption, iSCSI, or suchlike]]&lt;br /&gt;
* [[Setting up disks manually]]&lt;br /&gt;
* [[Partitioning and Bootmanagers]]&lt;br /&gt;
* [[Migrating data]]&lt;br /&gt;
* Details about [[Alpine setup scripts]]&lt;br /&gt;
&lt;br /&gt;
* [[Installing Alpine on HDD dualbooting|Install to HDD with dual-boot]]&lt;br /&gt;
* [[Create A VirtualBox Guest with Grub and XFS]]&lt;br /&gt;
* [[Replacing non-Alpine Linux with Alpine remotely]]&lt;br /&gt;
&amp;lt;!-- [[Installing Xubuntu using Alpine boot floppy]] Obsolete --&amp;gt;&lt;br /&gt;
&amp;lt;!-- [[Installing Alpine Linux on USB Automated]] Obsolete --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[Bootstrapping Alpine Linux]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- If you edit the following, please coordinate with Developer_Documentation#Configuring_your_system.  Note that these two sections are not exact duplicates. --&amp;gt;&lt;br /&gt;
* [[Installing Alpine Linux in a chroot]]&lt;br /&gt;
* [[Install Alpine on LXC]]&lt;br /&gt;
* [[Install Alpine on LXD|Install Alpine on Ubuntu with LXD]]&lt;br /&gt;
* Install Alpine on [[Install Alpine on VirtualBox|VirtualBox]], [[Install Alpine on VMware|VMware]], [[Install Alpine on coLinux|coLinux]], [[Qemu]], &amp;lt;!-- includes [[Install Alpine in Qemu]], [[Running Alpine in Qemu Live mode]], [[Running Alpine Linux As a QEMU networked Guest]], --&amp;gt; [[Install Alpine on Amazon EC2|Amazon EC2]], or [[Install Alpine on Rackspace|RackSpace]]&lt;br /&gt;
&lt;br /&gt;
* [[Xen Dom0]] &#039;&#039;(Setting up Alpine as a dom0 for Xen hypervisor)&#039;&#039;&lt;br /&gt;
* [[Xen Dom0 on USB or SD]]&lt;br /&gt;
* [[Create Alpine Linux PV DomU]]&lt;br /&gt;
* [[Xen LiveCD]]&lt;br /&gt;
&lt;br /&gt;
* [[Setting up a basic vserver]]&lt;br /&gt;
* [[Setting up the build environment on HDD]]&lt;br /&gt;
* [[Setting up a compile vserver]] for official or for [[Setting up a compile vserver for third party packages|third party]] packages&lt;br /&gt;
&amp;lt;!-- [[Create an Alpine 1.9 vserver template]] --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Post-Install ===&lt;br /&gt;
&amp;lt;!-- If you edit this, please coordinate with and Tutorials_and_Howtos#Post-Install and Developer_Documentation#Package_management. Note that these three sections are not exact duplicates. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- [[Configure Networking]] --&amp;gt;&lt;br /&gt;
* [[Tutorials_and_Howtos#Networking|Setting up Networking]]&lt;br /&gt;
* [[Alpine Linux package management|Package Management (apk)]] &#039;&#039;(How to add/remove packages on your Alpine)&#039;&#039;&lt;br /&gt;
   &amp;lt;!-- [[Alpine Linux package management#Local_Cache|How to enable APK caching]] --&amp;gt;&lt;br /&gt;
* [[Alpine local backup|Alpine local backup (lbu)]] &#039;&#039;(Permanently store your modifications in case your box needs reboot)&#039;&#039;&lt;br /&gt;
** [[Back Up a Flash Memory Installation|Back Up a Flash Memory (&amp;quot;diskless mode&amp;quot;) Installation]]&lt;br /&gt;
** [[Manually editing a existing apkovl]]&lt;br /&gt;
* [[Alpine Linux Init System|Init System (OpenRC)]] &#039;&#039;(Configure a service to automatically boot at next reboot)&#039;&#039;&lt;br /&gt;
** [[Multiple Instances of Services]]&lt;br /&gt;
   &amp;lt;!-- [[Writing Init Scripts]] --&amp;gt;&lt;br /&gt;
* [[Alpine setup scripts#setup-xorg-base|Setting up Xorg]]&lt;br /&gt;
&lt;br /&gt;
* [[Upgrading Alpine]]&lt;br /&gt;
&amp;lt;!-- Obsolete&lt;br /&gt;
 [[Upgrading Alpine - v1.9.x]]&lt;br /&gt;
 [[Upgrading Alpine - CD v1.8.x]]&lt;br /&gt;
 [[Upgrading Alpine - HD v1.8.x]]&lt;br /&gt;
 [[Upgrade to repository main|Upgrading to signed repositories]]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[Setting up a ssh-server]] &#039;&#039;(Using ssh is a good way to administer your box remotely)&#039;&#039;&lt;br /&gt;
* [[setup-acf]] &#039;&#039;(Configures ACF (webconfiguration) so you can manage your box through https)&#039;&#039;&lt;br /&gt;
* [[Hosting services on Alpine]]&#039;&#039;(Links to several mail/web/ssh server setup pages)&#039;&#039;&lt;br /&gt;
* [[Changing passwords for ACF|Changing passwords]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- [[Running glibc programs]] Installation and Dev --&amp;gt;&lt;br /&gt;
* [[Setting the timezone]] &#039;&#039;(Not needed for the default musl- or uClibc-based installs)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Further Help and Information ===&lt;br /&gt;
* [[FAQ|FAQs]]&lt;br /&gt;
* [[Tutorials and Howtos]]&lt;br /&gt;
* [[Contribute|How to Contribute]]&lt;br /&gt;
* [[Developer Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;/div&gt;</summary>
		<author><name>Aduty</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=LVM_on_LUKS&amp;diff=15725</id>
		<title>LVM on LUKS</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=LVM_on_LUKS&amp;diff=15725"/>
		<updated>2019-02-25T21:39:37Z</updated>

		<summary type="html">&lt;p&gt;Aduty: /* Creating the Partition Layout */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
This documentation describes how to set up Alpine Linux using a logical volume (LV), that is installed in an encrypted partition. To encrypt the partition the logical volume manager (LVM) the volume group (VG) is installed in, the Device Mapper crypt (dm-crypt) module and Linux Unified Key Setup (LUKS) is used.&lt;br /&gt;
&lt;br /&gt;
Note that you must install the &amp;lt;code&amp;gt;/boot/&amp;lt;/code&amp;gt; directory on an unecrypted partition to boot correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Hard Disk Device Name ==&lt;br /&gt;
&lt;br /&gt;
The following documentation uses the &amp;lt;code&amp;gt;vda&amp;lt;/code&amp;gt; device as installation destination. If your environment uses a different device name for your hard disk, use the corresponding device names in the examples.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Setting up Alpine Linux Using LVM on Top of a LUKS Partition =&lt;br /&gt;
&lt;br /&gt;
To install Alpine Linux in logical volumes running on top of a LUKS encrypted partition, you cannot use the [[Installation|official installation]] procedure. The installation requires several manual steps you must run in the Alpine Linux Live CD environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Preparing the Temporary Installation Environment ==&lt;br /&gt;
&lt;br /&gt;
Before you begin to install Alpine Linux, prepare the temporary environment:&lt;br /&gt;
&lt;br /&gt;
{{Note|All settings in this section apply only to the temporary environment and not to the later installed Alpine Linux on your hard disk.}}&lt;br /&gt;
&lt;br /&gt;
* Boot the latest Alpine Linux Installation CD.&lt;br /&gt;
&lt;br /&gt;
* At the login prompt, use the &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user without password to log in.&lt;br /&gt;
&lt;br /&gt;
* Optionally, set the keyboard language:&lt;br /&gt;
&lt;br /&gt;
 # setup-keymap&lt;br /&gt;
&lt;br /&gt;
: The default keyboard mapping is &amp;lt;code&amp;gt;us-us&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Configure the network interface:&lt;br /&gt;
&lt;br /&gt;
 # setup-interfaces&lt;br /&gt;
&lt;br /&gt;
: If you set a static IP address, additionally configure DNS be able to resolve host names:&lt;br /&gt;
&lt;br /&gt;
 # setup-dns&lt;br /&gt;
&lt;br /&gt;
* Enable the network interface. For example:&lt;br /&gt;
&lt;br /&gt;
 # ifup eth0&lt;br /&gt;
&lt;br /&gt;
* Set an apk repository and update the cache:&lt;br /&gt;
&lt;br /&gt;
 # setup-apkrepos&lt;br /&gt;
 # apk update&lt;br /&gt;
&lt;br /&gt;
* Install the following packages required to set up LVM and LUKS:&lt;br /&gt;
&lt;br /&gt;
 # apk add haveged lvm2 cryptsetup e2fsprogs syslinux&lt;br /&gt;
&lt;br /&gt;
: Optionally, you can install a different editor, such as &amp;lt;code&amp;gt;nano&amp;lt;/code&amp;gt;, to edit files in later steps if you do not want to use VI.&lt;br /&gt;
&lt;br /&gt;
* Optionally, start the &amp;lt;code&amp;gt;haveged&amp;lt;/code&amp;gt; service for unpredictable random numbers used for encryption:&lt;br /&gt;
&lt;br /&gt;
 # rc-service haveged start&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating the Partition Layout ==&lt;br /&gt;
&lt;br /&gt;
Linux requires an unencrypted &amp;lt;code&amp;gt;/boot/&amp;lt;/code&amp;gt; partition to boot. You can assign the remaining space for the encrypted LVM physical volume (PV).&lt;br /&gt;
&lt;br /&gt;
* Start the &amp;lt;code&amp;gt;fdisk&amp;lt;/code&amp;gt; utility to set up partitions:&lt;br /&gt;
&lt;br /&gt;
 # fdisk /dev/vda&lt;br /&gt;
&lt;br /&gt;
:* Create the &amp;lt;code&amp;gt;/boot/&amp;lt;/code&amp;gt; partition:&lt;br /&gt;
::* Enter &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; &amp;amp;rarr; &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; &amp;amp;rarr; &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; &amp;amp;rarr; &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; &amp;amp;rarr; &amp;lt;code&amp;gt;+100m&amp;lt;/code&amp;gt; to create a new 100 MB primary partition.&lt;br /&gt;
&lt;br /&gt;
:* Set the &amp;lt;code&amp;gt;/boot/&amp;lt;/code&amp;gt; partition active:&lt;br /&gt;
::* Enter &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; &amp;amp;rarr; &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
:* Create the LVM PV partition:&lt;br /&gt;
::* Enter &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; &amp;amp;rarr; &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; &amp;amp;rarr; &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; to start creating the next partition. Press &amp;lt;code&amp;gt;Enter&amp;lt;/code&amp;gt; to select the default start cylinder. Enter the size of partition. For example, &amp;lt;code&amp;gt;512m&amp;lt;/code&amp;gt; for 512 MB or &amp;lt;code&amp;gt;5g&amp;lt;/code&amp;gt; for 5 GB. Alternatively press &amp;lt;code&amp;gt;Enter&amp;lt;/code&amp;gt; to set the maximum available size.&lt;br /&gt;
&lt;br /&gt;
:* Set the partition type for the LVM PV:&lt;br /&gt;
::* Enter &amp;lt;code&amp;gt;t&amp;lt;/code&amp;gt; &amp;amp;rarr; &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; &amp;amp;rarr; &amp;lt;code&amp;gt;8e&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:* To verify the settings, press &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt;. The output shows, for example:&lt;br /&gt;
&lt;br /&gt;
    Device Boot     Start       End     Blocks   Id System&lt;br /&gt;
 /dev/vda1   *          1       100      50368+  83 Linux&lt;br /&gt;
 /dev/vda2            101     10402    5192208   8e Linux LVM&lt;br /&gt;
&lt;br /&gt;
* Press &amp;lt;code&amp;gt;w&amp;lt;/code&amp;gt; to save the changes.&lt;br /&gt;
&lt;br /&gt;
* Optionally, wipe the LVM PV partition with random values:&lt;br /&gt;
&lt;br /&gt;
 # haveged -n 0 | dd of=/dev/vda2&lt;br /&gt;
&lt;br /&gt;
: Depending on the size of the partition, this process can take several minutes to hours.&lt;br /&gt;
&lt;br /&gt;
== Encrypting the LVM Physical Volume Partition == &lt;br /&gt;
&lt;br /&gt;
* To encrypt the partition which will later contain the LVM PV:&lt;br /&gt;
&lt;br /&gt;
 # cryptsetup luksFormat /dev/vda2&lt;br /&gt;
&lt;br /&gt;
:{{Note|Alpine Linux uses the &amp;lt;code&amp;gt;en-us&amp;lt;/code&amp;gt; keyboard mapping when prompting for the password to encrypt the partition at boot time. If you changed the keyboard map in the temporary environment, the password you enter during encrypting the partition in this step, may not match the password you will enter during the system boots.}}&lt;br /&gt;
: If you prefer setting an individual hashing algorithm and hashing schema:&lt;br /&gt;
:* To run a benchmark:&lt;br /&gt;
&lt;br /&gt;
 # cryptsetup benchmark&lt;br /&gt;
&lt;br /&gt;
:* To encrypt the partition using individual settings, enter, for example:&lt;br /&gt;
&lt;br /&gt;
 # cryptsetup -v -c serpent-xts-plain64 -s 512 --hash whirlpool --iter-time 5000 --use-random luksFormat /dev/vda2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating the Logical Volumes and File Systems ==&lt;br /&gt;
&lt;br /&gt;
* Open the LUKS partition:&lt;br /&gt;
&lt;br /&gt;
 # cryptsetup open --type luks /dev/vda2 lvmcrypt&lt;br /&gt;
&lt;br /&gt;
* Create the PV on &amp;lt;code&amp;gt;/dev/vda&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 # pvcreate /dev/mapper/lvmcrypt&lt;br /&gt;
&lt;br /&gt;
* Create the &amp;lt;code&amp;gt;vg0&amp;lt;/code&amp;gt; LVM VG in the &amp;lt;code&amp;gt;/dev/mapper/lvmcrypt&amp;lt;/code&amp;gt; PV:&lt;br /&gt;
&lt;br /&gt;
 # vgcreate vg0 /dev/mapper/lvmcrypt&lt;br /&gt;
&lt;br /&gt;
* Create the LVs:&lt;br /&gt;
&lt;br /&gt;
: In the following you will create a LV for the root partition. However, you can use the same command with a different LV name to create further LVs for other mount points you want to create.&lt;br /&gt;
&lt;br /&gt;
:* To create a 2 GB LV named &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;vg0&amp;lt;/code&amp;gt; VG:&lt;br /&gt;
&lt;br /&gt;
 # lvcreate -L 2G vg0 -n root&lt;br /&gt;
&lt;br /&gt;
: Create a 512 MB swap LV:&lt;br /&gt;
&lt;br /&gt;
 # lvcreate -L 512M vg0 -n swap&lt;br /&gt;
&lt;br /&gt;
* The LVs created in the previous steps are automatically marked active. To verify, enter:&lt;br /&gt;
&lt;br /&gt;
 # lvscan&lt;br /&gt;
&lt;br /&gt;
: Format the &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; LV using the ext4 file system:&lt;br /&gt;
&lt;br /&gt;
 # mkfs.ext4 /dev/vg0/root&lt;br /&gt;
&lt;br /&gt;
: If you created further LVs in the previous step, create the file systems on them using the same command with the path to the LV.&lt;br /&gt;
&lt;br /&gt;
* Format the swap LV:&lt;br /&gt;
&lt;br /&gt;
 # mkswap /dev/vg0/swap&lt;br /&gt;
&lt;br /&gt;
* Format the &amp;lt;code&amp;gt;/dev/vda1&amp;lt;/code&amp;gt; device for the &amp;lt;code&amp;gt;/boot/&amp;lt;/code&amp;gt; partition using the ext4 file system:&lt;br /&gt;
&lt;br /&gt;
 # mkfs.ext4 /dev/vda1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mounting the File Systems ==&lt;br /&gt;
&lt;br /&gt;
Before you can install Alpine Linux, you must mount the partitions and LVs:&lt;br /&gt;
&lt;br /&gt;
* Mount the root LV to the &amp;lt;code&amp;gt;/mnt/&amp;lt;/code&amp;gt; directory:&lt;br /&gt;
&lt;br /&gt;
 # mount -t ext4 /dev/vg0/root /mnt/&lt;br /&gt;
&lt;br /&gt;
* Create &amp;lt;code&amp;gt;/mnt/boot/&amp;lt;/code&amp;gt; directory and mount the &amp;lt;code&amp;gt;/dev/vda1&amp;lt;/code&amp;gt; partition in this directory:&lt;br /&gt;
&lt;br /&gt;
 # mkdir /mnt/boot/&lt;br /&gt;
 # mount -t ext4 /dev/vda1 /mnt/boot/&lt;br /&gt;
&lt;br /&gt;
: If you created further partitions or LVs, create the mount points within the &amp;lt;code&amp;gt;/mnt/&amp;lt;/code&amp;gt; directory and mount the devices.&lt;br /&gt;
&lt;br /&gt;
== Installing Alpine Linux ==&lt;br /&gt;
&lt;br /&gt;
In this step you will install Alpine Linux in the &amp;lt;code&amp;gt;/mnt/&amp;lt;/code&amp;gt; directory, which contains the mounted file system structure:&lt;br /&gt;
&lt;br /&gt;
* Install Alpine Linux:&lt;br /&gt;
&lt;br /&gt;
 # setup-disk -m sys /mnt/&lt;br /&gt;
&lt;br /&gt;
: The installer downloads the latest packages to install the base installation. Additionally, the installer automatically creates the entries for the mount points in the &amp;lt;code&amp;gt;fstab&amp;lt;/code&amp;gt; file, which are currently mounted in the &amp;lt;code&amp;gt;/mnt/&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
: {{Note|The automatic writing of the master boot record (MBR) fails in this step. You will write the MBR later manually to the disk.}}&lt;br /&gt;
&lt;br /&gt;
* To enable the operating system to decrypt the PV at boot time, create the &amp;lt;code&amp;gt;/mnt/etc/crypttab&amp;lt;/code&amp;gt; file. Enter the following line into the file to decrypt the &amp;lt;code&amp;gt;/dev/vda2&amp;lt;/code&amp;gt; partition using the &amp;lt;code&amp;gt;luks&amp;lt;/code&amp;gt; module and map it to the &amp;lt;code&amp;gt;lvmcrypt&amp;lt;/code&amp;gt; name:&lt;br /&gt;
&lt;br /&gt;
 lvmcrypt    /dev/vda2    none    luks&lt;br /&gt;
&lt;br /&gt;
* The swap LV is not automatically added to the &amp;lt;code&amp;gt;fstab&amp;lt;/code&amp;gt; file. To add it manually, add the following line to the &amp;lt;code&amp;gt;/mnt/etc/fstab&amp;lt;/code&amp;gt; file:&lt;br /&gt;
&lt;br /&gt;
 /dev/vg0/swap    swap    swap    defaults    0 0&lt;br /&gt;
&lt;br /&gt;
* Edit the &amp;lt;code&amp;gt;/mnt/etc/mkinitfs/mkinitfs.conf&amp;lt;/code&amp;gt; file and append the &amp;lt;code&amp;gt;cryptsetup&amp;lt;/code&amp;gt; module to the &amp;lt;code&amp;gt;features&amp;lt;/code&amp;gt; parameter:&lt;br /&gt;
&lt;br /&gt;
 features=&amp;quot;ata base ide scsi usb virtio ext4 lvm &amp;lt;u&amp;gt;cryptsetup&amp;lt;/u&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* Rebuild the initial RAM disk:&lt;br /&gt;
&lt;br /&gt;
 # mkinitfs -c /mnt/etc/mkinitfs/mkinitfs.conf -b /mnt/ $(ls /mnt/lib/modules/)&lt;br /&gt;
&lt;br /&gt;
: The command uses the settings from the &amp;lt;code&amp;gt;mkinitfs.conf&amp;lt;/code&amp;gt; file set in the &amp;lt;code&amp;gt;-c&amp;lt;/code&amp;gt; parameter to generate the RAM disk. The command is executed in the &amp;lt;code&amp;gt;/mnt/&amp;lt;/code&amp;gt; directory and the RAM disk is generated using the modules for the installed kernel. Without setting the kernel version using the &amp;lt;code&amp;gt;$(ls /mnt/lib/modules/&amp;lt;/code&amp;gt;) option, &amp;lt;code&amp;gt;mkinitfs&amp;lt;/code&amp;gt; tries to generate the RAM disk using the kernel version installed in the temporary environment, which can differ from the latest one installed by the &amp;lt;code&amp;gt;setup-disk&amp;lt;/code&amp;gt; utility.&lt;br /&gt;
&lt;br /&gt;
* Edit the &amp;lt;code&amp;gt;/mnt/etc/update-extlinux.conf&amp;lt;/code&amp;gt; file and append the following kernel options to the &amp;lt;code&amp;gt;default_kernel_opts&amp;lt;/code&amp;gt; parameter:&lt;br /&gt;
&lt;br /&gt;
 default_kernel_opts=&amp;quot;... &amp;lt;u&amp;gt;cryptroot=/dev/vda2 cryptdm=lvmcrypt&amp;lt;/u&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
: The &amp;lt;code&amp;gt;cryptroot&amp;lt;/code&amp;gt; parameter sets the name of the device that contains the root file system. The &amp;lt;code&amp;gt;cryptdm&amp;lt;/code&amp;gt; parameter sets the name of the mapping previously set in the &amp;lt;code&amp;gt;crypttab&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
* Because the &amp;lt;code&amp;gt;update-extlinux&amp;lt;/code&amp;gt; utility operators only on the &amp;lt;code&amp;gt;/boot/&amp;lt;/code&amp;gt; directory, temporarily change the root to the &amp;lt;code&amp;gt;/mnt/&amp;lt;/code&amp;gt; directory and update the boot loader configuration:&lt;br /&gt;
&lt;br /&gt;
 # chroot /mnt/&lt;br /&gt;
 # update-extlinux&lt;br /&gt;
 # exit&lt;br /&gt;
&lt;br /&gt;
: Ignore the errors the &amp;lt;code&amp;gt;update-extlinux&amp;lt;/code&amp;gt; utility displays.&lt;br /&gt;
&lt;br /&gt;
* Write the MBR to the &amp;lt;code&amp;gt;/dev/vda&amp;lt;/code&amp;gt; device:&lt;br /&gt;
&lt;br /&gt;
 # dd bs=440 count=1 conv=notrunc if=/mnt/usr/share/syslinux/mbr.bin of=/dev/vda&lt;br /&gt;
&lt;br /&gt;
== Unmounting the Volumes and Partitions ==&lt;br /&gt;
&lt;br /&gt;
* Umount &amp;lt;code&amp;gt;/mnt/boot/&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/mnt/&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 # umount /mnt/boot/&lt;br /&gt;
 # umount /mnt/&lt;br /&gt;
&lt;br /&gt;
: {{Note|If you mounted further partitions or LVs below &amp;lt;code&amp;gt;/mnt/&amp;lt;/code&amp;gt;, you must first unmount all of them before you can unmount &amp;lt;code&amp;gt;/mnt/&amp;lt;/code&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
* Disable the swap partition:&lt;br /&gt;
&lt;br /&gt;
 # swapoff -a&lt;br /&gt;
&lt;br /&gt;
* Deactivate the VG:&lt;br /&gt;
&lt;br /&gt;
 # vgchange -a n&lt;br /&gt;
&lt;br /&gt;
* Close the &amp;lt;code&amp;gt;lvmcrypt&amp;lt;/code&amp;gt; device:&lt;br /&gt;
&lt;br /&gt;
 # cryptsetup luksClose lvmcrypt&lt;br /&gt;
&lt;br /&gt;
* Reboot the system:&lt;br /&gt;
&lt;br /&gt;
 # reboot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
&lt;br /&gt;
== General Procedure ==&lt;br /&gt;
&lt;br /&gt;
In case your system fails to boot, you can verify the settings and fix incorrect configurations:&lt;br /&gt;
&lt;br /&gt;
* [[#Preparing_the_Temporary_Installation_Environment|Prepare the temporary installation environment]]&lt;br /&gt;
&lt;br /&gt;
* Activate the VGs:&lt;br /&gt;
&lt;br /&gt;
 # vgchange -a y&lt;br /&gt;
&lt;br /&gt;
* [[#Mounting_the_File_Systems|Mount the file systems]]&lt;br /&gt;
&lt;br /&gt;
* Verify that you run the steps described in the [[#Installing_Alpine_Linux|Installing Alpine Linux]] section correctly. Update the configuration if necessary.&lt;br /&gt;
&lt;br /&gt;
* [[#Unmounting_the_Volumes_and_Partitions|Unmount the volumes and partitions]]&lt;br /&gt;
&lt;br /&gt;
= Hardening =&lt;br /&gt;
&lt;br /&gt;
* To harden, you should disable DMA[https://old.iseclab.org/papers/acsac2012dma.pdf] and install a hardened version of AES (TRESOR[https://www1.informatik.uni-erlangen.de/tresor] or Loop-Amnesia[http://moongate.ydns.eu/amnesia.html]) since by default cryptsetup with luks uses AES by default.&lt;br /&gt;
* Disable DMA in the BIOS and set the password for the BIOS according to Wikipedia.[https://en.wikipedia.org/wiki/DMA_attack]&lt;br /&gt;
* Blacklist kernel modules that use DMA and any unused expansion modules (FireWire, CardBus, ExpressCard, Thunderbolt, USB 3.0, PCI Express and hotplug modules) that use DMA.&lt;br /&gt;
&lt;br /&gt;
[[Category:Storage]]&lt;br /&gt;
[[Category:Security]]&lt;/div&gt;</summary>
		<author><name>Aduty</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Include:Abump&amp;diff=15723</id>
		<title>Include:Abump</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Include:Abump&amp;diff=15723"/>
		<updated>2019-02-25T05:53:15Z</updated>

		<summary type="html">&lt;p&gt;Aduty: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The tool &amp;lt;tt&amp;gt;abump&amp;lt;/tt&amp;gt; is a utility to bump pkgver in APKBUILD files if the package gets an update to a newer upstream release.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|&amp;lt;nowiki&amp;gt;abump [-hR]&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;abump options&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;-h&#039;&#039;&#039;  Show this help&lt;br /&gt;
* &#039;&#039;&#039;-R&#039;&#039;&#039;  Run abuild with -R for recursive building&lt;br /&gt;
* &#039;&#039;&#039;-k&#039;&#039;&#039;  Keep existing packages&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Aduty</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Abuild_and_Helpers&amp;diff=15722</id>
		<title>Abuild and Helpers</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Abuild_and_Helpers&amp;diff=15722"/>
		<updated>2019-02-25T05:47:50Z</updated>

		<summary type="html">&lt;p&gt;Aduty: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The abuild package provides scripts you need when creating packages for Alpine Linux. The abuild package and its friends are installed automatically along with the &amp;lt;tt&amp;gt;alpine-sdk&amp;lt;/tt&amp;gt; package.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add alpine-sdk}}&lt;br /&gt;
&lt;br /&gt;
The [http://git.alpinelinux.org/cgit/abuild.git/tree/ git repository] always contains the latest version of the scripts, example-files, and makefiles.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Building and maintaining packages ==&lt;br /&gt;
&lt;br /&gt;
=== abuild ===&lt;br /&gt;
{{:Include:Abuild}}&lt;br /&gt;
&lt;br /&gt;
=== abump ===&lt;br /&gt;
{{:Include:Abump}}&lt;br /&gt;
&lt;br /&gt;
=== apkgrel ===&lt;br /&gt;
&amp;lt;!-- Shouldn&#039;t this be apkrel? None of the other packaging tools use &amp;quot;apkg...&amp;quot;. Or perhaps it should be unified with abump? --&amp;gt;&lt;br /&gt;
{{:Include:Apkgrel}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Generating new APKBUILDs ==&lt;br /&gt;
&lt;br /&gt;
=== newapkbuild ===&lt;br /&gt;
To create the actual APKBUILD file {{Pkg|newapkbuild}} can serve you a template to start with. It will create a directory with the given package name, place an example/template APKBUILD file in the given directory, and fill some variables if those are provided.&lt;br /&gt;
&lt;br /&gt;
{{:Include:Newapkbuild}}&lt;br /&gt;
&lt;br /&gt;
=== apkbuild-cpan ===&lt;br /&gt;
{{:Include:Apkbuild-cpan}}&lt;br /&gt;
&lt;br /&gt;
=== apkbuild-pypi ===&lt;br /&gt;
{{:Include:Apkbuild-pypi}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Signing packages and indexes ==&lt;br /&gt;
&lt;br /&gt;
=== abuild-sign ===&lt;br /&gt;
{{:Include:Abuild-sign}}&lt;br /&gt;
&lt;br /&gt;
=== abuild-tar ===&lt;br /&gt;
{{:Include:Abuild-tar}}&lt;br /&gt;
&lt;br /&gt;
=== buildrepo ===&lt;br /&gt;
{{:Include:Buildrepo}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Setting up the build environment ==&lt;br /&gt;
&lt;br /&gt;
=== abuild-keygen ===&lt;br /&gt;
{{:Include:Abuild-keygen}}&lt;br /&gt;
&lt;br /&gt;
=== buildlab ===&lt;br /&gt;
See the [[Buildlab|buildlab]] page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ToDo&lt;br /&gt;
=== cmp-apks-iso ===&lt;br /&gt;
&lt;br /&gt;
=== devbuild ===&lt;br /&gt;
&lt;br /&gt;
=== initramfs-init ===&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aduty</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Abuild_and_Helpers&amp;diff=15721</id>
		<title>Abuild and Helpers</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Abuild_and_Helpers&amp;diff=15721"/>
		<updated>2019-02-25T05:41:41Z</updated>

		<summary type="html">&lt;p&gt;Aduty: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The abuild package provides scripts you need when creating packages for Alpine Linux. The abuild and its friends are installed automatically along with the &amp;lt;tt&amp;gt;alpine-sdk&amp;lt;/tt&amp;gt; package.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add alpine-sdk}}&lt;br /&gt;
&lt;br /&gt;
The [http://git.alpinelinux.org/cgit/abuild.git/tree/ git repository] always contains the latest version of the scripts, example-files, and makefiles.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Building and maintaining packages ==&lt;br /&gt;
&lt;br /&gt;
=== abuild ===&lt;br /&gt;
{{:Include:Abuild}}&lt;br /&gt;
&lt;br /&gt;
=== abump ===&lt;br /&gt;
{{:Include:Abump}}&lt;br /&gt;
&lt;br /&gt;
=== apkgrel ===&lt;br /&gt;
&amp;lt;!-- Shouldn&#039;t this be apkrel? None of the other packaging tools use &amp;quot;apkg...&amp;quot;. Or perhaps it should be unified with abump? --&amp;gt;&lt;br /&gt;
{{:Include:Apkgrel}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Generating new APKBUILDs ==&lt;br /&gt;
&lt;br /&gt;
=== newapkbuild ===&lt;br /&gt;
To create the actual APKBUILD file {{Pkg|newapkbuild}} can serve you a template to start with. It will create a directory with the given package name, place an example/template APKBUILD file in the given directory, and fill some variables if those are provided.&lt;br /&gt;
&lt;br /&gt;
{{:Include:Newapkbuild}}&lt;br /&gt;
&lt;br /&gt;
=== apkbuild-cpan ===&lt;br /&gt;
{{:Include:Apkbuild-cpan}}&lt;br /&gt;
&lt;br /&gt;
=== apkbuild-pypi ===&lt;br /&gt;
{{:Include:Apkbuild-pypi}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Signing packages and indexes ==&lt;br /&gt;
&lt;br /&gt;
=== abuild-sign ===&lt;br /&gt;
{{:Include:Abuild-sign}}&lt;br /&gt;
&lt;br /&gt;
=== abuild-tar ===&lt;br /&gt;
{{:Include:Abuild-tar}}&lt;br /&gt;
&lt;br /&gt;
=== buildrepo ===&lt;br /&gt;
{{:Include:Buildrepo}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Setting up the build environment ==&lt;br /&gt;
&lt;br /&gt;
=== abuild-keygen ===&lt;br /&gt;
{{:Include:Abuild-keygen}}&lt;br /&gt;
&lt;br /&gt;
=== buildlab ===&lt;br /&gt;
See the [[Buildlab|buildlab]] page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ToDo&lt;br /&gt;
=== cmp-apks-iso ===&lt;br /&gt;
&lt;br /&gt;
=== devbuild ===&lt;br /&gt;
&lt;br /&gt;
=== initramfs-init ===&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aduty</name></author>
	</entry>
</feed>