<?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=Crusa</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=Crusa"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Crusa"/>
	<updated>2026-05-03T10:44:18Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=UniFi_Controller&amp;diff=18140</id>
		<title>UniFi Controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=UniFi_Controller&amp;diff=18140"/>
		<updated>2020-11-01T16:22:16Z</updated>

		<summary type="html">&lt;p&gt;Crusa: missing option for adduser command&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC right}}&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
This guide explains how to install the generic Unix UniFi Controller, as available from [http://www.ubnt.com/ Ubiquity Networks]. At the time of writing this, a native Alpine Linux package is not available.&lt;br /&gt;
&lt;br /&gt;
Furthermore, this guide uses the incredibly reliable and efficient [http://www.skarnet.org/software/s6/ s6] supervision suite to start and control the UniFi Controller.&lt;br /&gt;
&lt;br /&gt;
A summarised schematic of what will be installed on the filesystem.&lt;br /&gt;
&lt;br /&gt;
The choice of &amp;lt;code&amp;gt;/srv&amp;lt;/code&amp;gt; for the UniFi Controller&#039;s root directory is based on the fact that it contains both run-time and configuration data, so installing to &amp;lt;code&amp;gt;/usr/local&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;/opt&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt; didn&#039;t seem apt. Feel free to adjust the steps below, replacing &amp;lt;code&amp;gt;/srv/unifi&amp;lt;/code&amp;gt; with wherever you would prefer to install the UniFi Controller software.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/&lt;br /&gt;
`--etc&lt;br /&gt;
   |-- unifi&lt;br /&gt;
   |   `-- log&lt;br /&gt;
   |-- srv&lt;br /&gt;
   |   `-- unifi&lt;br /&gt;
   |       |-- bin&lt;br /&gt;
   |       |-- conf&lt;br /&gt;
   |       |-- data&lt;br /&gt;
   |       |-- dl&lt;br /&gt;
   |       |-- lib&lt;br /&gt;
   |       |-- logs&lt;br /&gt;
   |       |-- run&lt;br /&gt;
   |       `-- webapps&lt;br /&gt;
   |-- run&lt;br /&gt;
   |   `-- openrc&lt;br /&gt;
   |          `-- s6-scan&lt;br /&gt;
   |              `-- unifi --&amp;gt; /etc/unifi&lt;br /&gt;
    `-- var&lt;br /&gt;
        `-- log&lt;br /&gt;
            `-- unifi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Prerequisite Packages =&lt;br /&gt;
&lt;br /&gt;
== OpenJDK 8 JRE ==&lt;br /&gt;
&lt;br /&gt;
Install &amp;lt;code&amp;gt;openjdk8-jre&amp;lt;/code&amp;gt; from the community repository.&lt;br /&gt;
&lt;br /&gt;
Edit &amp;lt;code&amp;gt;/etc/apk/respositories&amp;lt;/code&amp;gt; and uncomment the appropriate community repository for your Alpine version:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;http://host.name/alpine_version/community&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Update the package cache.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;apk update&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the package.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;apk add openjdk8-jre&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== MongoDB ==&lt;br /&gt;
&lt;br /&gt;
Install MongoDB&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;apk add mongodb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== s6 ==&lt;br /&gt;
&lt;br /&gt;
Install [http://www.skarnet.org/software/s6/ s6]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;apk add s6&amp;lt;/code&amp;gt; which is a service supervision suite, for reliably and efficiently starting, stopping and keeping services running.&lt;br /&gt;
&lt;br /&gt;
The below shows a schematic process tree of how the UniFi Controller will be started and supervised by s6. The controller is written in Java, hence the Java process and it in turn, launches a dedicated instance of MongoDB to store its configuration and run-time data.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
init&lt;br /&gt;
`-- s6-svscan&lt;br /&gt;
    `-- s6-supervise&lt;br /&gt;
        |-- s6-log&lt;br /&gt;
        `-- java&lt;br /&gt;
            `-- mongod&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Install UniFi Controller =&lt;br /&gt;
&lt;br /&gt;
Create the &amp;lt;code&amp;gt;unifi&amp;lt;/code&amp;gt; user and group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;adduser -D -H -h /srv/unifi unifi&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change to the parent folder within which you wish to install the UniFi Controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd /srv&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Download the generic unix archive of the &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; you wish to install.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;wget http://www.ubnt.com/downloads/unifi/VERSION/UniFi.unix.zip&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unpack the archive.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;unzip UniFi.unix.zip&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rename the unpacked directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mv UniFi unifi&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change ownership.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;chown -R unifi:unifi unifi&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lock down permissions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;chmod o-rwx unifi&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change into the UniFi bin directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd /srv/unifi/bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remove the existing file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rm mongod&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create a symlink to &amp;lt;code&amp;gt;/usr/bin/mongod&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ln -s /usr/bin/mongod&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Configure Service Management =&lt;br /&gt;
&lt;br /&gt;
== Create UniFi Service Directory and Files ==&lt;br /&gt;
&lt;br /&gt;
Create an s6 service directory for UniFi.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mkdir -p /etc/unifi/log&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add the &amp;lt;code&amp;gt;run&amp;lt;/code&amp;gt; script, using your favourite editor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vim /etc/unifi/run&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy and paste the following into it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/ash&lt;br /&gt;
&lt;br /&gt;
user=&#039;unifi&#039;&lt;br /&gt;
group=&#039;unifi&#039;&lt;br /&gt;
&lt;br /&gt;
exec 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
base=&#039;/srv/unifi&#039;&lt;br /&gt;
&lt;br /&gt;
if [ -d $base ]; then&lt;br /&gt;
    cd $base&lt;br /&gt;
    chown -R $user:$group .&lt;br /&gt;
    version=`head -1 webapps/ROOT/app-unifi/.version`&lt;br /&gt;
    echo &amp;quot;Starting UniFi Controller $version&amp;quot;&lt;br /&gt;
    exec s6-setuidgid $user java -jar lib/ace.jar start&lt;br /&gt;
else&lt;br /&gt;
    echo &amp;quot;Missing $base ... aborting&amp;quot;&lt;br /&gt;
    touch down&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensure that the &amp;lt;code&amp;gt;run&amp;lt;/code&amp;gt; script is executable:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;chmod 755 /etc/unifi/run&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add the &amp;lt;code&amp;gt;log/run&amp;lt;/code&amp;gt; script, using your favourite editor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vim /etc/unifi/log/run&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy and paste the following into it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/ash&lt;br /&gt;
&lt;br /&gt;
log_user=&#039;log&#039;&lt;br /&gt;
&lt;br /&gt;
exec s6-setuidgid $log_user s6-log -b n20 s1000000 t /var/log/unifi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensure that the log/run script is executable:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;chmod 755 /etc/unifi/run&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Create log User and Directory ==&lt;br /&gt;
&lt;br /&gt;
Create the &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; user and group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;adduser -D -H -h /var/log log&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the &amp;lt;code&amp;gt;/var/log/unifi&amp;lt;/code&amp;gt; directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mkdir -p /var/log/unifi&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Update the directory ownership.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;chown log:log /var/log/unifi&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lock down the permissions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;chmod 750 /var/log/unifi&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Create the OpenRC Service Script ==&lt;br /&gt;
&lt;br /&gt;
Open the script file using your favourite editor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vim /etc/init.d/unifi&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paste the following into it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/sbin/openrc-run&lt;br /&gt;
&lt;br /&gt;
name=&amp;quot;unifi&amp;quot;&lt;br /&gt;
supervisor=s6&lt;br /&gt;
s6_service_path=&amp;quot;${RC_SVCDIR}/s6-scan/${name}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
depend() {&lt;br /&gt;
	need net s6-svscan&lt;br /&gt;
	after firewall&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
start_pre() {&lt;br /&gt;
        if [ ! -L &amp;quot;${RC_SVCDIR}/s6-scan/${name}&amp;quot; ]; then&lt;br /&gt;
	        ln -s &amp;quot;/etc/${name}&amp;quot; &amp;quot;${RC_SVCDIR}/s6-scan/${name}&amp;quot;&lt;br /&gt;
	fi&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensure that the script is executable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;chmod 755 /etc/init.d/unifi&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Start the UniFi Controller Service ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rc-service unifi start&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configure the UniFi Controller Service to start on boot ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rc-update add unifi boot&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Simple Backup Script =&lt;br /&gt;
&lt;br /&gt;
Create &amp;lt;code&amp;gt;/usr/local/bin/unifi-backup&amp;lt;/code&amp;gt; using your favourite editor.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; This script assumes the use of s6-svc to control unifi. I will modify it in time, to use rc-service instead.&lt;br /&gt;
&lt;br /&gt;
Paste the following into the file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/ash&lt;br /&gt;
&lt;br /&gt;
conf_dir=&#039;/etc/unifi&#039;&lt;br /&gt;
backup_dir=&#039;/srv/backup/unifi&#039;&lt;br /&gt;
service_dir=&#039;/run/openrc/s6-scan/unifi&#039;&lt;br /&gt;
&lt;br /&gt;
start_state=&#039;down&#039;&lt;br /&gt;
&lt;br /&gt;
if s6-svok $service_dir; then&lt;br /&gt;
    if s6-svstat -o up,ready $service_dir | grep -q true; then&lt;br /&gt;
        echo &#039;Stopping the UniFi Controller&#039;&lt;br /&gt;
        start_state=&#039;up&#039;&lt;br /&gt;
        s6-svc -d $service_dir&lt;br /&gt;
        sleep 3&lt;br /&gt;
    fi&lt;br /&gt;
else&lt;br /&gt;
    echo &#039;Warning: The UniFi Controller is not supervised&#039;&lt;br /&gt;
    exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if s6-svstat -o up $service_dir | grep -q false; then&lt;br /&gt;
    echo &#039;Success: The UniFi Controller was stopped&#039;&lt;br /&gt;
else&lt;br /&gt;
    echo &#039;Error: The UniFi Controller is still running&#039;&lt;br /&gt;
    exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
stamp=`date +%Y-%m-%d_%H%M%S`&lt;br /&gt;
&lt;br /&gt;
mkdir -p $backup_dir&lt;br /&gt;
cd $backup_dir&lt;br /&gt;
mkdir &amp;quot;data-$stamp&amp;quot;&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;Backing up to /srv/backup/unifi/data-$stamp.tar.gz&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if rsync -az /srv/unifi/data/ &amp;quot;data-$stamp&amp;quot;; then&lt;br /&gt;
    echo &#039;* rsync succeeded&#039;&lt;br /&gt;
    if tar czf &amp;quot;data-$stamp.tar.gz&amp;quot; &amp;quot;data-$stamp&amp;quot;; then&lt;br /&gt;
        echo &#039;* tar succeeded&#039;&lt;br /&gt;
        rm -rf &amp;quot;data-$stamp&amp;quot;&lt;br /&gt;
        echo &#039;Backup succeeded&#039;&lt;br /&gt;
    else&lt;br /&gt;
        echo &#039;Backup failed: tar failed&#039;&lt;br /&gt;
	exit 1&lt;br /&gt;
    fi&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [ &amp;quot;$start_state&amp;quot; == &#039;up&#039; ]; then&lt;br /&gt;
    echo &#039;Starting the UniFi Controller&#039;&lt;br /&gt;
    s6-svc -u $service_dir&lt;br /&gt;
    sleep 5&lt;br /&gt;
    s6-svstat $service_dir&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[category:Networking]]&lt;/div&gt;</summary>
		<author><name>Crusa</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Raspberry_Pi&amp;diff=16460</id>
		<title>Raspberry Pi</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Raspberry_Pi&amp;diff=16460"/>
		<updated>2019-09-25T09:48:27Z</updated>

		<summary type="html">&lt;p&gt;Crusa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC right}}&lt;br /&gt;
&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 for the &#039;&#039;&#039;armhf architecture&#039;&#039;&#039; 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;
# If you used fdisk to create the partition you need to create a filesystem on it with mkdosfs -F 32 /dev/sdX1&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;
Note: You should be safe using the &#039;&#039;&#039;armhf&#039;&#039;&#039; build on all versions of Raspberry Pi (including Pi Zero and Compute Modules); but it may perform less optimally on recent versions of Raspberry Pi. The &#039;&#039;&#039;armv7&#039;&#039;&#039; build is compatible with Raspberry Pi 2 Model B. The &#039;&#039;&#039;aarch64&#039;&#039;&#039; build should be compatible with Raspberry Pi 2 Model v1.2, and is compatible with Raspberry Pi 3 and Compute Module 3.&lt;br /&gt;
&lt;br /&gt;
=== Wifi support ===&lt;br /&gt;
If you need wifi to work, perform the following before unmounting the SD card:&lt;br /&gt;
# [https://github.com/RPi-Distro/firmware-nonfree/tree/master/brcm Download] the latest broadcom drivers for the Raspberry Pi to your machine and &lt;br /&gt;
# Copy them to [SD card]/firmware/brcm/.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
git clone --depth 1 https://github.com/RPi-Distro/firmware-nonfree.git&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cp firmware-nonfree/brcm/* [SD card]/firmware/brcm&lt;br /&gt;
&amp;lt;/code&amp;gt;&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;
=== WiFi on boot ===&lt;br /&gt;
If you have already [[Connecting_to_a_wireless_access_point|configured wifi]] during the setup, the connection will not return on reboot.&lt;br /&gt;
You will need to start up a service to automatically connect to the wireless access point.&lt;br /&gt;
# Run &amp;lt;code&amp;gt;rc-update add wpa_supplicant boot&amp;lt;/code&amp;gt; to connect to the wireless access point on boot.&lt;br /&gt;
# Run it manually with &amp;lt;code&amp;gt;/etc/init.d/wpa_supplicant start&amp;lt;/code&amp;gt;.&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;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
[[category:ARM]]&lt;/div&gt;</summary>
		<author><name>Crusa</name></author>
	</entry>
</feed>