<?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=Ewtoombs</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=Ewtoombs"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Ewtoombs"/>
	<updated>2026-04-29T00:20:21Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Bootstrapping_Alpine_Linux&amp;diff=29096</id>
		<title>Bootstrapping Alpine Linux</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Bootstrapping_Alpine_Linux&amp;diff=29096"/>
		<updated>2025-02-20T11:10:06Z</updated>

		<summary type="html">&lt;p&gt;Ewtoombs: /* Install */ Downloading the public keys without https is a stupid idea.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
= VPS =&lt;br /&gt;
This section is to provide a means to bootstrap Alpine Linux on any VPS.&lt;br /&gt;
&lt;br /&gt;
== Process ==&lt;br /&gt;
 &lt;br /&gt;
=== Prepare ===&lt;br /&gt;
&lt;br /&gt;
Download apk binary file for your architecture or boot from an Alpine live ISO.&lt;br /&gt;
&lt;br /&gt;
Hint to download apk :&lt;br /&gt;
&amp;lt;pre&amp;gt;wget https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v2.14.6/x86_64/apk.static&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Install ===&lt;br /&gt;
&lt;br /&gt;
Assuming your alpine rootfs is mounted in &#039;&#039;&#039;/tmp/target&#039;&#039;&#039; and you downloaded apk binary (not using the live ISO).&lt;br /&gt;
&lt;br /&gt;
You may want to replace &amp;quot;latest-stable&amp;quot; from the URL by a specific version of Alpine (e.g. v3.20, v3.21).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo ./apk.static --arch $(arch) -X https://dl-cdn.alpinelinux.org/alpine/latest-stable/main/ -U --allow-untrusted --root /tmp/target --initdb add alpine-base&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* edit /tmp/target/etc/fstab&lt;br /&gt;
* edit /tmp/target/etc/inittab&lt;br /&gt;
* edit /tmp/target/etc/resolv.conf&lt;br /&gt;
* mount proc/sys/dev&lt;br /&gt;
&amp;lt;pre&amp;gt;for a in proc sys dev; do mount -o bind /$a /tmp/target/$a; done&amp;lt;/pre&amp;gt;&lt;br /&gt;
* chroot into your new installation&lt;br /&gt;
&amp;lt;pre&amp;gt;chroot /tmp/target /bin/sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
* setup hostname&lt;br /&gt;
&amp;lt;pre&amp;gt;setup-hostname&amp;lt;/pre&amp;gt;&lt;br /&gt;
* setup network&lt;br /&gt;
&amp;lt;pre&amp;gt;setup-interfaces&amp;lt;/pre&amp;gt;&lt;br /&gt;
* setup repos&lt;br /&gt;
&amp;lt;pre&amp;gt;setup-apkrepos -f&amp;lt;/pre&amp;gt;&lt;br /&gt;
* add a few base packages&lt;br /&gt;
&amp;lt;pre&amp;gt;apk update&lt;br /&gt;
apk add linux-lts linux-firmware-none acpi mkinitfs&amp;lt;/pre&amp;gt;&lt;br /&gt;
* add services to boot&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rc-update add acpid default&lt;br /&gt;
rc-update add bootmisc boot&lt;br /&gt;
rc-update add crond default&lt;br /&gt;
rc-update add devfs sysinit&lt;br /&gt;
rc-update add dmesg sysinit&lt;br /&gt;
rc-update add hostname boot&lt;br /&gt;
rc-update add hwclock boot&lt;br /&gt;
rc-update add hwdrivers sysinit&lt;br /&gt;
rc-update add killprocs shutdown&lt;br /&gt;
rc-update add mdev sysinit&lt;br /&gt;
rc-update add modules boot&lt;br /&gt;
rc-update add mount-ro shutdown&lt;br /&gt;
rc-update add networking boot&lt;br /&gt;
rc-update add savecache shutdown&lt;br /&gt;
rc-update add seedrng boot&lt;br /&gt;
rc-update add swap boot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bootloader ===&lt;br /&gt;
&lt;br /&gt;
=== Notes ===&lt;br /&gt;
If you have bootstrapped Alpine Linux from an existing system in a different partition and intend to boot into it, you should always include the root filesystem type (rootfstype) in the kernel parameter (bootloader option), since by default kernel does not automatically load any filesystem modules for root partition, unless specified. That way mount will not complain about being unable to mount root partition on /sysroot.&lt;br /&gt;
&lt;br /&gt;
Example bootloader option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;root=UUID=AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE rw rootfstype=ext4 vfat&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
* [https://www.linode.com/docs/tools-reference/custom-kernels-distros/running-a-custom-linux-distro-on-a-linode-vps Running a Custom Linux Distribution on a Linode]&lt;br /&gt;
* [https://www.linode.com/docs/tools-reference/custom-kernels-distros/run-a-custom-compiled-kernel-with-pvgrub Run a Custom Compiled Kernel with PV-GRUB]&lt;br /&gt;
* [[Replacing non-Alpine Linux with Alpine remotely]]&lt;br /&gt;
* [[Install Alpine on Amazon EC2]]&lt;br /&gt;
* [[Alpine setup scripts]]&lt;br /&gt;
* [https://serverfault.com/questions/98950/how-do-i-chain-boot-from-grub-to-syslinux How do I chain boot from grub to syslinux?]&lt;br /&gt;
* [https://web.archive.org/web/20151008232205/http://uggedal.com/journal/alpine-linux-on-linode/ Alpine Linux on Linode]&lt;br /&gt;
* [[Installing Alpine Linux in a chroot]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
[[Category:Virtualization]]&lt;/div&gt;</summary>
		<author><name>Ewtoombs</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Raspberry_Pi&amp;diff=22625</id>
		<title>Raspberry Pi</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Raspberry_Pi&amp;diff=22625"/>
		<updated>2022-10-10T20:37:23Z</updated>

		<summary type="html">&lt;p&gt;Ewtoombs: /* Preparation */ Extract the tarball, lol&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{warning | 11 Feb 2021 - There is currently a known bug upstream &amp;lt;br /&amp;gt;[https://github.com/raspberrypi/firmware/issues/1529 kernel/initramfs cannot be loaded from subdirectory with same name as volume label] }}&lt;br /&gt;
&lt;br /&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;
# [http://alpinelinux.org/downloads/ Download] the Alpine for Raspberry Pi tarball. 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, Raspberry Pi 3 and Compute Module 3, and Raspberry Pi 4 model B.&lt;br /&gt;
# [[Create_a_Bootable_Device#Manually_copying_Alpine_files|Create a bootable FAT32 partition on your SD card.]] The partitioning and formatting part of the instructions on the linked page could be done using a graphical partitioning tool such as [https://en.wikipedia.org/wiki/GNOME_Disks gnome-disks], just make sure the partition type is &amp;lt;code&amp;gt;W95 FAT32 (LBA)&amp;lt;/code&amp;gt;. (The current type can be found in the &amp;quot;Type&amp;quot; column in the output of &amp;lt;code&amp;gt;fdisk -l&amp;lt;/code&amp;gt;.)&lt;br /&gt;
# Extract the tarball to the root of the bootable FAT32 partition.&lt;br /&gt;
&lt;br /&gt;
To setup a headless system, a bootstrapping configuration overlay file [https://github.com/macmpi/alpine-linux-headless-bootstrap  headless.apkovl.tar.gz] may be added to enable basic networking, so that following configuration steps can be performed under &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt;. Pi Zero may be configured with simple USB ethernet-gadget networking with another computer sharing its internet connection.&lt;br /&gt;
&lt;br /&gt;
Optionally create a &#039;&#039;&#039;usercfg.txt&#039;&#039;&#039; file on the partition to configure low-level system settings. Specifications can be found [https://www.raspberrypi.org/documentation/configuration/config-txt here]. However, note some settings can only be set directly in &#039;&#039;&#039;config.txt&#039;&#039;&#039;, which may be overwritten after updates. In particular, &amp;lt;code&amp;gt;gpu_mem&amp;lt;/code&amp;gt; will have no effect when specified in &#039;&#039;&#039;usercfg.txt&#039;&#039;&#039; ([https://github.com/raspberrypi/firmware/issues/1332 source]). Some interesting values include:&lt;br /&gt;
* To enable the UART console: &amp;lt;code&amp;gt;enable_uart=1&amp;lt;/code&amp;gt;&lt;br /&gt;
* To enable audio: &amp;lt;code&amp;gt;dtparam=audio=on&amp;lt;/code&amp;gt;&lt;br /&gt;
* If you see black edges around your screen after booting the Pi, you can add &amp;lt;code&amp;gt;disable_overscan=1&amp;lt;/code&amp;gt;&lt;br /&gt;
* If you plan to install on a Pi Compute Module 4 with I/O board, you may need to add: &amp;lt;code&amp;gt;otg_mode=1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Recent versions include Broadcom firmware files. If you&#039;re using an older Alpine version, see [[#Wireless_support_with_older_Alpine_images|section below]].&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Alpine Linux will be installed in [[Installation#Installation_Handbook|diskless mode]], hence you need to use [[Alpine local backup|Alpine Local Backup (lbu)]] to save your modifications between reboots.&lt;br /&gt;
&lt;br /&gt;
For users who will be using their Raspberry Pi in scenarios where there is not expected to be significant changes to disk after setup (like running a static HTTP server), this is likely preferable, as running the entire system from memory will improve performance (by avoiding the slow SD card) and improve the SD card life (by reducing the writes to the card, as all logging will happen in RAM). Diskless installations still allow you to install packages, save local files, and tune the system to your needs. &lt;br /&gt;
&lt;br /&gt;
However, if you:&lt;br /&gt;
* Expect there will be constant changes to the disk after initial setup (for example, if you expect people to login and save files to their home directories)&lt;br /&gt;
* Need logs to persist after reboot&lt;br /&gt;
* Plan to install packages which consume more space than can be loaded into RAM&lt;br /&gt;
* Want to install kernel modules (such as ZFS or Wireguard)&lt;br /&gt;
&lt;br /&gt;
Then you may be better served by a [[Classic install or sys mode on Raspberry Pi|sys-mode installation]]. &lt;br /&gt;
&lt;br /&gt;
Follow these steps to install Alpine Linux in Diskless Mode:&lt;br /&gt;
&lt;br /&gt;
# Insert the SD card into the Raspberry Pi and power 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;
After installation, make sure 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;
Note: this does not upgrade the kernel. In order to upgrade the kernel, a full upgrade of the Alpine Linux version must be performed as described in [[Upgrading Alpine#Upgrading Alpine Linux on other removable media (such as CF/USB)|upgrading Alpine Linux for removable media]].&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, thus 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 the Raspberry Pi does not have a clock, 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 you have a&lt;br /&gt;
NTP daemon installed and running.  If you are not sure, you can install an 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;
The 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 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 during bootup.&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;
=== Enable OpenGL (Raspberry Pi 3/4) ===&lt;br /&gt;
Remount the boot partition writeable (i.e. &amp;lt;code&amp;gt;/media/mmcblk0p1&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
{{cmd|mount /media/mmcblk0p1 -o rw,remount}}&lt;br /&gt;
&lt;br /&gt;
Add the following lines to &amp;lt;code&amp;gt;/media/mmcblk0p1/config.txt&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 dtoverlay=vc4-kms-v3d&lt;br /&gt;
&lt;br /&gt;
If you are experiencing graphical issues, you can also try:&lt;br /&gt;
&lt;br /&gt;
 dtoverlay=vc4-fkms-v3d&lt;br /&gt;
&lt;br /&gt;
And perhaps also raising the default &amp;lt;code&amp;gt;gpu_mem&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 gpu_mem=128&lt;br /&gt;
&lt;br /&gt;
Note that raising the gpu memory is not likely to [https://www.raspberrypi.com/documentation/computers/config_txt.html#gpu_mem actually improve performance on the Pi4]&lt;br /&gt;
&lt;br /&gt;
Install the Mesa drivers:&lt;br /&gt;
&lt;br /&gt;
{{cmd|&amp;lt;nowiki&amp;gt;apk add mesa-dri-gallium&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Then reboot:&lt;br /&gt;
&lt;br /&gt;
{{cmd|lbu_commit -d; reboot}}&lt;br /&gt;
&lt;br /&gt;
=== WiFi drivers ===&lt;br /&gt;
As of Alpine 3.14, the WiFi drivers for the Raspberry Pi were moved from &amp;lt;code&amp;gt;linux-firmware-brcm&amp;lt;/code&amp;gt; to the &amp;lt;code&amp;gt;linux-firmware-cypress&amp;lt;/code&amp;gt; package (source?). Since the images seem to be an outdated version of the former, Wi-Fi will work during installation, but after the first update it will break.&lt;br /&gt;
Use the ethernet interface to download the required packages:&lt;br /&gt;
&lt;br /&gt;
{{cmd|apk add linux-firmware-cypress}}&lt;br /&gt;
&lt;br /&gt;
And reboot.&lt;br /&gt;
&lt;br /&gt;
== Persistent storage ==&lt;br /&gt;
=== Loopback image with overlayfs ===&lt;br /&gt;
&lt;br /&gt;
When you install Alpine in diskless mode, the entire system is loaded into memory at boot. If you want additional storage (for example, if you need more space than offered by your RAM) we need to create loop-back storage onto the SD card 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 using the /usr directory here, but you can use /home or anything else. &lt;br /&gt;
{{Warning|Overlay workdir needs to be an empty directory on the same filesystem mount as the upper directory. So each overlay must use its own workdir.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkdir /media/persist/usr &lt;br /&gt;
mkdir /media/persist/.work_usr &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_usr 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_usr 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, not to the persistent 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 be sure to 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;
{{Merge|Classic install or sys mode on Raspberry Pi|There&#039;s an existing page for sys-installations on RasPi.}}&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 them.&lt;br /&gt;
The Raspberry Pi doesn&#039;t need them to boot.&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 at shutdown.&lt;br /&gt;
&lt;br /&gt;
N.B. &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, in which case,&lt;br /&gt;
copying the files to boot partition manually, 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 Raspberry Pi 3 ===&lt;br /&gt;
See [[Classic install or sys mode on Raspberry Pi]] and https://web.archive.org/web/20171125115835/https://forum.alpinelinux.org/comment/1084#comment-1084&lt;br /&gt;
&lt;br /&gt;
=== Persistent Installation on Raspberry Pi 4 ===&lt;br /&gt;
As of 3.14, setup-alpine should ask you if you want to create a sys mode partition on your Raspberry Pi 4.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== Long boot time when running headless ===&lt;br /&gt;
&lt;br /&gt;
If no peripherals are connected, the system might hang for an exceptionally long period of time while it attempts to accumulate entropy.&lt;br /&gt;
&lt;br /&gt;
If this is the case, simply plugging in any USB device should work around this issue.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alternatively&#039;&#039;&#039;, installing haveged, the random numbers generator, would speed up the process: &lt;br /&gt;
&lt;br /&gt;
  apk update &lt;br /&gt;
  apk add haveged&lt;br /&gt;
  rc-update add haveged boot&lt;br /&gt;
  lbu commit -d&lt;br /&gt;
  service haveged start&lt;br /&gt;
&lt;br /&gt;
(Tested on a raspberry pi zero W in headless mode, no USB connected, Alpine 3.10.3)&lt;br /&gt;
&lt;br /&gt;
=== apk indicating &#039;No space left on device&#039; ===&lt;br /&gt;
&lt;br /&gt;
Note some models of the Raspberry Pi such as the 3A+ only have 512M of RAM, which on fresh Alpine deployment will only leave around 200M for tmpfs root. It&#039;s important to keep this limitation in mind when using these boards.&lt;br /&gt;
&lt;br /&gt;
=== Wireless support with older Alpine images ===&lt;br /&gt;
&lt;br /&gt;
If you need Wi-Fi, you&#039;ll need to [https://github.com/RPi-Distro/firmware-nonfree/tree/master/brcm download] the latest Broadcom drivers to your SD card.&lt;br /&gt;
(Replace /mnt/sdcard with the correct mount point.)&lt;br /&gt;
&lt;br /&gt;
  git clone --depth 1 https://github.com/RPi-Distro/firmware-nonfree.git&lt;br /&gt;
  cp firmware-nonfree/brcm/* /mnt/sdcard/firmware/brcm&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;
* [[Raspberry Pi 3 - Browser Client]]&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;
* [[Tutorials and Howtos#Raspberry Pi]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
[[Category: Raspberry]]&lt;/div&gt;</summary>
		<author><name>Ewtoombs</name></author>
	</entry>
</feed>