<?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=Cos</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=Cos"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Cos"/>
	<updated>2026-05-01T05:22:23Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Wi-Fi&amp;diff=29681</id>
		<title>Wi-Fi</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Wi-Fi&amp;diff=29681"/>
		<updated>2025-04-13T06:12:03Z</updated>

		<summary type="html">&lt;p&gt;Cos: Update dead link to its new location&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Alpine Linux supports two wireless daemons i.e [[#wpa_supplicant|wpa_supplicant]] and [[iwd]]. This page describes how to set up a wireless network connection using the default daemon [[#wpa_supplicant|wpa_supplicant]]. The [[iwd]] daemon is also fully supported in Alpine Linux. {{Note|Do not use both wireless daemons i.e [[#wpa_supplicant|wpa_supplicant]] and [[iwd]] simultaneously, as it leads to conflicts.}}&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
Working wireless drivers. To list your available network interfaces use the commands {{ic|ip link}} or {{ic|ip a}}. Refer to [[#Troubleshooting|Troubleshooting]] section if you don&#039;t see any wireless interfaces (e.g. {{Path|wlan0}}). &lt;br /&gt;
&lt;br /&gt;
== Setup-interfaces ==&lt;br /&gt;
&lt;br /&gt;
The [[Configure_Networking#setup-interfaces|setup-interfaces]] script automates the installation and configuration of&lt;br /&gt;
&amp;lt;code&amp;gt;wpa_supplicant&amp;lt;/code&amp;gt; daemon to use Wi-Fi. [[NetworkManager]] can then be used to manage your Wi-Fi  using various gui/tui tools.&lt;br /&gt;
&lt;br /&gt;
== Manual configuration ==&lt;br /&gt;
&lt;br /&gt;
To get started install {{Pkg|wpa_supplicant}} package: {{Cmd|# apk add wpa_supplicant}}&lt;br /&gt;
&lt;br /&gt;
Use this command to add your Wi-Fi network to wpa_supplicant: {{Cmd|# wpa_passphrase &#039;ExampleWifiSSID&#039; &#039;ExampleWifiPassword&#039; &amp;gt; /etc/wpa_supplicant/wpa_supplicant.conf}}&lt;br /&gt;
&#039;&#039;(Access point not broadcasting its SSID requires additional line &amp;lt;code&amp;gt;scan_ssid=1&amp;lt;/code&amp;gt; in the file {{Path|/etc/wpa_supplicant/wpa_supplicant.conf}})&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{Note|the Wi-Fi SSID and password are case sensitive and the single quote before and after the SSID and password need to be there}}&lt;br /&gt;
&lt;br /&gt;
Start wpa_supplicant in the foreground to check if wireless connection succeeds.{{Cmd|# wpa_supplicant -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Optional security precaution:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By default {{Pkg|wpa_supplicant}} will store your Wi-Fi password in plain text:{{Cat|/etc/wpa_supplicant/wpa_supplicant.conf|&amp;lt;nowiki&amp;gt;network={&lt;br /&gt;
    ssid=&amp;quot;&amp;lt;YourSSIDShouldBeHere&amp;gt;&amp;quot;&lt;br /&gt;
        #psk=&amp;quot;&amp;lt;YourPasswordShouldBeHereInPlainText&amp;gt;&amp;quot;&lt;br /&gt;
    psk=&amp;lt;RandomLettersAndNumbersShouldBeHere&amp;gt;&lt;br /&gt;
}&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
If you dont want your stored password in plain text just delete the line with &amp;lt;code&amp;gt;#psk=&amp;quot;&amp;lt;YourPasswordShouldBeHereInPlainText&amp;gt;&amp;quot;&amp;lt;/code&amp;gt; on it.&lt;br /&gt;
&lt;br /&gt;
If all is well, run it as a daemon in the background by setting the {{Path|-B}} option. {{Cmd|# wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf}}&lt;br /&gt;
&lt;br /&gt;
Configure the interface with an IP address.{{Cmd|# udhcpc -i wlan0}}&lt;br /&gt;
&lt;br /&gt;
Sanity check: the interface should have a {{Path|inet}} address. {{Cmd|$ ip addr show wlan0}}&lt;br /&gt;
&lt;br /&gt;
Add a entry for the desired interface (e.g. &amp;lt;code&amp;gt;wlan0&amp;lt;/code&amp;gt;) in the file as follows:{{Cat|/etc/network/interfaces|auto lo&lt;br /&gt;
auto wlan0&lt;br /&gt;
iface wlan0 inet dhcp}}&lt;br /&gt;
&lt;br /&gt;
{{Warning|Don&#039;t remove or comment out the &#039;&#039;&#039;auto lo&#039;&#039;&#039; entry}}&lt;br /&gt;
&lt;br /&gt;
Sanity check: Make sure {{Path|/etc/wpa_supplicant/wpa_supplicant.conf}} is the correct configuration for the wireless access point you want to connect to.&lt;br /&gt;
&lt;br /&gt;
Bring the interface down. {{Cmd|# ip link set wlan0 down}}&lt;br /&gt;
&lt;br /&gt;
Manually restart (or &#039;&#039;&#039;start&#039;&#039;&#039;) &#039;&#039;&#039;networking&#039;&#039;&#039;.{{Cmd|# rc-service networking --quiet restart &amp;amp;}}&lt;br /&gt;
&lt;br /&gt;
Perform [[Configure_Networking#Connectivity_testing|sanity checks]]. For issues related to name resolution, refer [[Configure_Networking#Configuring_DNS|Networking]] section.&lt;br /&gt;
&lt;br /&gt;
=== Service configuration ===&lt;br /&gt;
{{Seealso|NetworkManager}}&lt;br /&gt;
&lt;br /&gt;
Proceed to configure wpa_supplicant service to start automatically on boot, if networking works properly: {{Cmd|# rc-update add wpa_supplicant boot}}&lt;br /&gt;
Also ensure that &#039;&#039;&#039;networking&#039;&#039;&#039; is set to automatically start on boot: {{Cmd|# rc-update add networking boot}}&lt;br /&gt;
&lt;br /&gt;
Manage wpa_supplicant service using the standard &#039;&#039;&#039;start&#039;&#039;&#039;, &#039;&#039;&#039;stop&#039;&#039;&#039; and &#039;&#039;&#039;restart&#039;&#039;&#039; options. For eg: to start wpa_supplicant service: {{Cmd|# rc-service wpa_supplicant start}}&lt;br /&gt;
&lt;br /&gt;
=== Launching udhcpc through wpa_cli actions ===&lt;br /&gt;
&lt;br /&gt;
With the above configuration, udhcpc will only run once at boot. If the Wifi isn&#039;t available then, or the network changes after booting, udhcpc needs to be notified. You can automatically notify udhcpc of network changes by using a wpa_cli action file, such as the one installed by default at {{Path|/etc/wpa_supplicant/wpa_cli.sh}}.&lt;br /&gt;
&lt;br /&gt;
To manually start a wpa_cli daemon with an action file, use the `-a` option: {{Cmd|# wpa_cli -a /etc/wpa_supplicant/wpa_cli.sh}}&lt;br /&gt;
&lt;br /&gt;
To do this automatically, use the `wpa_cli` service included in {{Pkg|wpa_supplicant-openrc}}: {{Cat|/etc/conf.d/wpa_cli|&amp;lt;nowiki&amp;gt;WPACLI_OPTS=&amp;quot;-a /etc/wpa_supplicant/wpa_cli.sh&amp;quot;&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
Add the service to start at boot: {{Cmd|# rc-update add wpa_cli boot}}&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
If the commands {{ic|ip link}} or {{ic|ip a}} do not show any {{Path|wlan0}} interface, you probably need to load and/or install drivers/firmware. In most cases installing {{Pkg|linux-firmware}} should get you the required drivers. Installation of this package can produce errors on diskless or data disk modes. If such errors occur, switch to system disk mode.&lt;br /&gt;
&lt;br /&gt;
If you are using a &#039;&#039;&#039;Broadcom chipset&#039;&#039;&#039;, see the [[#Broadcom_Wi-Fi_Chipset_Users|Broadcom Wi-Fi section]].&lt;br /&gt;
&lt;br /&gt;
Bring up the desired interface: {{Cmd|# ip link set wlan0 up}}&lt;br /&gt;
&lt;br /&gt;
=== Check dmesg ===&lt;br /&gt;
&lt;br /&gt;
Run dmesg and check for errors related to the wireless interface. Usually, dmesg gives maximum information related to network and all other hardware.&lt;br /&gt;
{{Cmd|# dmesg}}&lt;br /&gt;
&lt;br /&gt;
=== checking network cards ===&lt;br /&gt;
&lt;br /&gt;
{{Cmd|$ cat /proc/net/dev }} lists the network interfaces that are detected. If the expected interfaces are not available, Check what network hardware chip you have using lspci or lsusb:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|$ lspci -nn }}&lt;br /&gt;
{{Cmd|$ lsusb }}&lt;br /&gt;
&lt;br /&gt;
Refer [[How to get regular stuff working#Hardware_Management|hardware management]], if the above output lacks sufficient information.&lt;br /&gt;
&lt;br /&gt;
Check what driver the card uses and modprobe it. Check that the card is in master mode.&lt;br /&gt;
Check what driver you need on the [https://wireless.docs.kernel.org/en/latest/en/users/drivers/b43.html#list-of-hardware b43 compatibility page]&lt;br /&gt;
&lt;br /&gt;
=== Broadcom Wi-Fi Chipset Users  ===&lt;br /&gt;
&lt;br /&gt;
The Broadcom chipset is quite popular among older computers. The b43 driver is included in the linux-lts or linux-edge kernel packages. However, you might need to compile the firmware manually for this chipset as it is not included in linux-firmware for some cards. &lt;br /&gt;
&lt;br /&gt;
To check what broadcom chip you have using lspci:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|$ lspci -nn -d 14e4:}}&lt;br /&gt;
&lt;br /&gt;
====B43==== &lt;br /&gt;
&lt;br /&gt;
Download firmware cutter. {{Cmd|$ apk add b43-fwcutter}}&lt;br /&gt;
&lt;br /&gt;
Now we have everything to download the proprietary driver and extract the firmware from it: {{Cmd|&amp;lt;nowiki&amp;gt;# export FIRMWARE_INSTALL_DIR=&amp;quot;/lib/firmware&amp;quot;&lt;br /&gt;
$ wget http://www.lwfinger.com/b43-firmware/broadcom-wl-5.100.138.tar.bz2&lt;br /&gt;
$ tar xjf broadcom-wl-5.100.138.tar.bz2&lt;br /&gt;
$ b43-fwcutter -w &amp;quot;$FIRMWARE_INSTALL_DIR&amp;quot; broadcom-wl-5.100.138/linux/wl_apsta.o&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
More information can be found [http://linuxwireless.sipsolutions.net/en/users/Drivers/b43/#Other_distributions_not_mentioned_above here].&lt;br /&gt;
&lt;br /&gt;
Now you need to use modprobe so the device will show up: {{Cmd|# modprobe b43}}&lt;br /&gt;
&lt;br /&gt;
Now continue with the normal instructions. &lt;br /&gt;
&lt;br /&gt;
====wl ====&lt;br /&gt;
&lt;br /&gt;
You can use APKBUILD from [https://codeberg.org/NeYurii/broadcom-wl here]. It uses [[Alpine kernel module support]] for automatic building and updating driver for new kernel versions. Instructions can be found in the [https://codeberg.org/NeYurii/broadcom-wl broadcom-wl repository].&lt;br /&gt;
&lt;br /&gt;
Alternately, install the software to build a driver: {{Cmd|apk add git alpine-sdk linux-headers linux-lts-dev}}&lt;br /&gt;
&lt;br /&gt;
Then install the driver build repo (this is archived, however it&#039;s legacy so that doesn&#039;t matter): {{Cmd|git clone https://github.com/antoineco/broadcom-wl&lt;br /&gt;
cd broadcom-wl&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Then follow the build instructions listed in the git repo: {{Cmd|make&lt;br /&gt;
doas make install&lt;br /&gt;
doas depmod -A&lt;br /&gt;
doas modprobe wl&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Reboot and you have a working wl driver. Now continue with the normal instructions.&lt;br /&gt;
&lt;br /&gt;
=== Rfkill ===&lt;br /&gt;
&lt;br /&gt;
An error message &amp;lt;code&amp;gt;ioctl 0x8914 failed: No error information&amp;lt;/code&amp;gt;, is the &amp;lt;code&amp;gt;busybox ip&amp;lt;/code&amp;gt;&#039;s way of saying your wireless radio is rfkilled, which means the wireless card is blocked by kernel. This can be changed using rfkill. To show the current status of your Wi-Fi: &lt;br /&gt;
&amp;lt;p style=&amp;quot;background-color:#f9f9f9; border:1px dashed #2f6fab; line-height:1.1em; padding:1em; font-family:monospace; font-size:10pt; white-space:pre; overflow:auto;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:green;&amp;quot;&amp;gt;~&amp;lt;/span&amp;gt;&#039;&#039;&#039;$&#039;&#039;&#039; rfkill list&lt;br /&gt;
0: phy0: wlan&lt;br /&gt;
    Soft blocked: no&lt;br /&gt;
    Hard blocked: no&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the card is hard-blocked, use the hardware button or switch to unblock it. If the card is not hard-blocked but soft-blocked, use the following command: {{Cmd|# rfkill unblock wifi}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Configure_Networking| Networking in Alpine Linux]]&lt;br /&gt;
* [[Iwd|iwd]] - An alternate to wpa_supplicant&lt;br /&gt;
* [[NetworkManager]] - Front-end to Networking&lt;br /&gt;
* [https://wiki.postmarketos.org/wiki/WiFi PostmarketOS Wiki]&lt;br /&gt;
* [https://wiki.archlinux.org/title/Network_configuration/Wireless Archwiki]&lt;br /&gt;
* [https://wiki.gentoo.org/wiki/Wi-Fi Gentoo Wiki]&lt;br /&gt;
* [[Alpine kernel module support]] - A fully automated solution for building kernel modules&lt;br /&gt;
* [https://unix.stackexchange.com/questions/606073/how-to-build-kernel-modules-in-alpine-3-12 Build kernel modules manually]&lt;br /&gt;
&lt;br /&gt;
[[Category:Networking]]&lt;/div&gt;</summary>
		<author><name>Cos</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=PXE_boot&amp;diff=19847</id>
		<title>PXE boot</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=PXE_boot&amp;diff=19847"/>
		<updated>2021-07-15T16:35:31Z</updated>

		<summary type="html">&lt;p&gt;Cos: Clarify that alpine_repo=auto does not work.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;This functionality is still largely prototypal. Some things could still be broken.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Guide to options=&lt;br /&gt;
; ip&lt;br /&gt;
: &#039;&#039;&#039;Required for PXE.&#039;&#039;&#039;&lt;br /&gt;
: Set &amp;lt;code&amp;gt;ip=dhcp&amp;lt;/code&amp;gt; to get an IP via DHCP. (Requires af_packet.ko in the initrd, in addition to the modules needed for your NIC.)&lt;br /&gt;
: Set &amp;lt;code&amp;gt;ip=&amp;lt;em&amp;gt;client-ip&amp;lt;/em&amp;gt;::&amp;lt;em&amp;gt;gateway-ip&amp;lt;/em&amp;gt;:&amp;lt;em&amp;gt;netmask&amp;lt;/em&amp;gt;::[&amp;lt;em&amp;gt;device&amp;lt;/em&amp;gt;]:&amp;lt;/code&amp;gt; to specify an IP manually. &amp;lt;code&amp;gt;&amp;lt;em&amp;gt;device&amp;lt;/em&amp;gt;&amp;lt;/code&amp;gt; is a device name (e.g. &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt;). If one is not specified, one is chosen automatically.&lt;br /&gt;
&lt;br /&gt;
; apkovl&lt;br /&gt;
: Valid forms include:&lt;br /&gt;
:* A HTTP, HTTPS or FTP URL to an apkovl.tar.gz file which will be retrieved and applied.&lt;br /&gt;
:* &amp;lt;code&amp;gt;&amp;lt;em&amp;gt;device_name&amp;lt;/em&amp;gt;[:&amp;lt;em&amp;gt;fs_type&amp;lt;/em&amp;gt;]:&amp;lt;em&amp;gt;path&amp;lt;/em&amp;gt;&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;device_name&amp;lt;/code&amp;gt; does not include &amp;lt;code&amp;gt;/dev&amp;lt;/code&amp;gt; (e.g., &amp;lt;code&amp;gt;sda&amp;lt;/code&amp;gt;). &amp;lt;code&amp;gt;fs_type&amp;lt;/code&amp;gt; is optional (e.g. &amp;lt;code&amp;gt;ext4&amp;lt;/code&amp;gt;). &amp;lt;code&amp;gt;path&amp;lt;/code&amp;gt; expresses the path on the device to the apkovl.tar.gz file.&lt;br /&gt;
:* A relative path, interpreted relative to the root of the &amp;lt;code&amp;gt;alpine_dev&amp;lt;/code&amp;gt;.&lt;br /&gt;
:* If not specified, a file matching &amp;lt;code&amp;gt;*.apkovl.tar.gz&amp;lt;/code&amp;gt; is searched for in the root of the &amp;lt;code&amp;gt;ovl_dev&amp;lt;/code&amp;gt;. (If more than one exists in the root of a device, all are ignored.)&lt;br /&gt;
&lt;br /&gt;
; alpine_dev (this parameter is no longer used)&lt;br /&gt;
: The &amp;lt;code&amp;gt;alpine_dev&amp;lt;/code&amp;gt; specifies a device used for reference data which must reside on a filesystem; currently, this is only the case for kernel modules.&lt;br /&gt;
: This is also used to obtain APKs if a repository is not explicitly specified; see below.&lt;br /&gt;
: Valid forms include:&lt;br /&gt;
:* A device name, not including &amp;lt;code&amp;gt;/dev/&amp;lt;/code&amp;gt;.&lt;br /&gt;
:* &amp;lt;code&amp;gt;UUID=&amp;lt;em&amp;gt;filesystem-uuid&amp;lt;/em&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:* &amp;lt;code&amp;gt;LABEL=&amp;lt;em&amp;gt;filesystem-label&amp;lt;/em&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:* &amp;lt;code&amp;gt;nfs:&amp;lt;em&amp;gt;ip-address&amp;lt;/em&amp;gt;:&amp;lt;em&amp;gt;path&amp;lt;/em&amp;gt;&amp;lt;/code&amp;gt;, specifying an NFS export to use as the device. You may need to add modules to the initrd.&lt;br /&gt;
&lt;br /&gt;
; ovl_dev (this parameter is no longer used)&lt;br /&gt;
: Valid forms include:&lt;br /&gt;
:* &amp;lt;code&amp;gt;&amp;lt;em&amp;gt;device_name&amp;lt;/em&amp;gt;[:&amp;lt;em&amp;gt;fs_type&amp;lt;/em&amp;gt;]&amp;lt;/code&amp;gt;&lt;br /&gt;
:* If not specified, various devices are searched for a file matching &amp;lt;code&amp;gt;*.apkovl.tar.gz&amp;lt;/code&amp;gt; in the root directory.&lt;br /&gt;
: This argument can contain the fields &amp;lt;code&amp;gt;{MAC}&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;{UUID}&amp;lt;/code&amp;gt;, which will be substituted with the MAC address of the NIC used by Alpine and the system&#039;s DMI &amp;quot;Product UUID&amp;quot; respectively. If these substitutions are used, the value passed to ovl_dev must be enclosed in quotes. e.g. &amp;lt;code&amp;gt;ovl_dev=&amp;quot;&amp;lt;nowiki&amp;gt;http://.../&amp;lt;/nowiki&amp;gt;{MAC}.apkovl.tar.gz&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
; alpine_repo&lt;br /&gt;
: &#039;&#039;&#039;Required.&#039;&#039;&#039;&lt;br /&gt;
: &amp;lt;code&amp;gt;/etc/apk/repositories&amp;lt;/code&amp;gt; will be filled from this. May be a URL. Otherwise, try and find a directory containing the marker file &amp;lt;code&amp;gt;.boot_repository&amp;lt;/code&amp;gt; on the &amp;lt;code&amp;gt;alpine_dev&amp;lt;/code&amp;gt;. Please note that although &amp;quot;auto&amp;quot; might appear documented as a valid value, it will not work when PXE booting.&lt;br /&gt;
&lt;br /&gt;
; modloop&lt;br /&gt;
: If the specified file is of http/ftp or https (if wget is installed), the modloop file will be downloaded to the /lib directory and will be mounted afterwards&lt;br /&gt;
: e.g. modloop=http://192.168.1.1/pxe/alpine/grsec.modloop.squashfs in the append section of your [[Bootloaders|bootloader]]&lt;br /&gt;
&lt;br /&gt;
; console&lt;br /&gt;
: Examples:&lt;br /&gt;
:* &amp;lt;code&amp;gt;tty0&amp;lt;/code&amp;gt;&lt;br /&gt;
:* &amp;lt;code&amp;gt;ttyS1 &amp;lt;/code&amp;gt;&lt;br /&gt;
:* &amp;lt;code&amp;gt;ttyAMA0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; acpi&lt;br /&gt;
: Valid forms include:&lt;br /&gt;
:* &amp;lt;code&amp;gt;force&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; ssh_key&lt;br /&gt;
: Valid forms include:&lt;br /&gt;
:* A HTTP, HTTPS or FTP URL to a public SSH key which will be retrieved and added to the list of authorized SSH keys.&lt;br /&gt;
&lt;br /&gt;
; modules&lt;br /&gt;
&lt;br /&gt;
=HOWTO=&lt;br /&gt;
Alpine can be PXE booted starting with Alpine 2.6-rc2. In order to accomplish this you must complete the following steps:&lt;br /&gt;
&lt;br /&gt;
* Set up a DHCP server and configure it to support PXE boot.&lt;br /&gt;
* Set up a TFTP server to serve the PXE bootloader.&lt;br /&gt;
* Set up an HTTP server to serve the rest of the boot files.&lt;br /&gt;
* Set up an NFS server from which Alpine can load kernel modules.&lt;br /&gt;
* Configure mkinitfs to generate a PXE-bootable initrd.&lt;br /&gt;
&lt;br /&gt;
This article describes a setup using gpxe as a PXE bootloader, but you could also use PXELINUX. &lt;br /&gt;
&lt;br /&gt;
Standard setup of all involved services is not covered here; advice on setting up basic DHCP/TFTP/HTTP/NFS/etc. is widely available.&lt;br /&gt;
&lt;br /&gt;
==Set up a DHCP server and configure it to support PXE boot==&lt;br /&gt;
If you use the ISC DHCP server (package &amp;quot;dhcp&amp;quot;), amend your &amp;lt;code&amp;gt;subnet&amp;lt;/code&amp;gt; block like so:&lt;br /&gt;
  next-server 10.0.0.1;&lt;br /&gt;
  filename &amp;quot;gpxe.kpxe&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
==Set up a TFTP server to serve the PXE bootloader==&lt;br /&gt;
Install a TFTP server (package &amp;quot;tftp-hpa&amp;quot;). You will need to place a gPXE image at &amp;lt;code&amp;gt;/var/tftproot/gpxe.kpxe&amp;lt;/code&amp;gt;. You can generate an image online at [http://rom-o-matic.eu/ ROM-o-matic.eu]. Select the &amp;quot;.kpxe&amp;quot; output format and the &amp;quot;undionly&amp;quot; driver. You will need to specify a custom boot script. Select &amp;quot;Customize&amp;quot;. The following boot script works well:&lt;br /&gt;
  dhcp net0&lt;br /&gt;
  chain http://${net0/next-server}/gpxe-script&lt;br /&gt;
You can include &amp;lt;code&amp;gt;${net0/mac}&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;${uuid}&amp;lt;/code&amp;gt; in the URL for the interface MAC address and machine UUID respectively.&lt;br /&gt;
&lt;br /&gt;
Note that as of writing, ROM-o-matic appears to produce a buggy image unless it is used with the &amp;quot;undionly&amp;quot; driver. If you require a different driver, consider building gPXE yourself, especially if you experience inexplicable connectivity issues. Common symptoms are a seemingly correctly configured, randomly functional network connection which appears to suffer from extreme packet loss.&lt;br /&gt;
&lt;br /&gt;
==Set up an HTTP server to serve the rest of the PXE boot files==&lt;br /&gt;
Suppose you have an HTTP server configured to serve from &amp;lt;code&amp;gt;/srv/http&amp;lt;/code&amp;gt;. Place an appropriate gPXE script, such as the following, at &amp;lt;code&amp;gt;/srv/http/prov/gpxe-script&amp;lt;/code&amp;gt;:&lt;br /&gt;
  #!gpxe&lt;br /&gt;
  kernel http://${net0/next-server}/prov/grsec ip=dhcp alpine_dev=nfs:${net0/next-server}:/srv/nfs/depot alpine_repo=http://nl.alpinelinux.org/alpine/v2.5/main/&lt;br /&gt;
  initrd http://${net0/next-server}/prov/pxerd&lt;br /&gt;
  boot&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=dhcp&amp;lt;/code&amp;gt; instructs the initrd to obtain an IP via DHCP. The NFS share specified by &amp;lt;code&amp;gt;alpine_dev&amp;lt;/code&amp;gt; will be mounted. &amp;lt;code&amp;gt;alpine_repo&amp;lt;/code&amp;gt; specifies an apk repository to use.&lt;br /&gt;
&lt;br /&gt;
==Using lpxelinux instead of gPXE==&lt;br /&gt;
&lt;br /&gt;
Since recent version of syslinux, pxelinux also has support to boot over ftp/http.&amp;lt;br/&amp;gt;&lt;br /&gt;
The pxelinux.cfg/default file (or specific MAC address file name) should be in the same format as with regular syslinux.&amp;lt;br/&amp;gt;&lt;br /&gt;
You will need to use a copy of the &#039;&#039;&#039;lpxelinux.0&#039;&#039;&#039; found when installing syslinux on alpine: /usr/share/syslinux/lpxelinux.0 and copy it to your tftp server.&amp;lt;br/&amp;gt;&lt;br /&gt;
Don&#039;t forget to also copy ldlinux.c32, as its a dependency of syslinux variants (see documentation). &lt;br /&gt;
&lt;br /&gt;
 DEFAULT alpine&lt;br /&gt;
 LINUX http://ipaddr/grsec&lt;br /&gt;
 INITRD http://ipaddr/grsec.gz&lt;br /&gt;
 APPEND ip=dhcp modules=loop,squashfs,sd-mod,usb-storage alpine_repo=http://repo-url modloop=http://ipaddr/grsec.modloop.squashfs apkovl=http://ipaddr/localhost.apkovl.tar.gz&lt;br /&gt;
&lt;br /&gt;
==Using pxelinux instead of gPXE==&lt;br /&gt;
&lt;br /&gt;
Since recent version of syslinux, pxelinux also has support to boot over tftp.&amp;lt;br/&amp;gt;&lt;br /&gt;
The pxelinux.cfg/default file (or specific MAC address file name) should be in the same format as with regular syslinux.&amp;lt;br/&amp;gt;&lt;br /&gt;
You will need to use a copy of the &#039;&#039;&#039;pxelinux.0&#039;&#039;&#039; found when installing syslinux on alpine: /usr/share/syslinux/pxelinux.0 and copy it to your tftp server.&amp;lt;br/&amp;gt;&lt;br /&gt;
Don&#039;t forget to also copy ldlinux.c32, as its a dependency of syslinux variants (see documentation). &lt;br /&gt;
&lt;br /&gt;
 PROMPT 0&lt;br /&gt;
 TIMEOUT 3&lt;br /&gt;
 default alpine&lt;br /&gt;
 LABEL alpine&lt;br /&gt;
 LINUX alpine-vmlinuz-grsec&lt;br /&gt;
 INITRD alpine-pxerd&lt;br /&gt;
 APPEND ip=dhcp alpine_dev=nfs:192.168.1.1:/srv/boot/alpine modloop=http://192.168.1.1/modloop-grsec nomodeset quiet apkovl=http://192.168.1.1/localhost.apkovl.tar.gz&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;vmlinuz-grsec&#039;&#039; is taken from a system running in memory from usb.&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;pxerd&#039;&#039; is generated on a system running in memory from usb. With network nfs and virtio_net added.&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;/srv/boot/alpine&#039;&#039; is a copy of /media/usb from a system running in memory from usb.&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;modules=loop,squashfs,sd-mod,usb-storage&#039;&#039; is not needed as loop and squashfs are hard coded into the init script and we do not use sd nor usb.&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;modloop=http://ipaddr/grsec.modloop.squashfs&#039;&#039; does not seems to work. Without neither...(*)&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;apkovl=http://ipaddr/localhost.apkovl.tar.gz&#039;&#039;.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(*) about the modloop problem: /etc/init.d/modloop tries to load the file from /media/nfs instead of /media/alpine and starts trying to mount it! (unsuccessfully) A fix to it is (a proposal) see http://bugs.alpinelinux.org/issues/4015&lt;br /&gt;
&lt;br /&gt;
==Set up an NFS server from which Alpine can load kernel modules==&lt;br /&gt;
&lt;br /&gt;
NOTE: by adding modloop with http support, this is no need for modules.&lt;br /&gt;
&lt;br /&gt;
Set up an NFS share at &amp;lt;code&amp;gt;/srv/nfs/depot&amp;lt;/code&amp;gt; and export it via /etc/exports:&lt;br /&gt;
  /srv/nfs/depot  *(ro,no_root_squash,no_subtree_check)&lt;br /&gt;
&lt;br /&gt;
This export does not currently need to contain anything, unless you wish to use it to serve apks, in which case ensure that a file &amp;quot;.boot_repository&amp;quot; is created in the directory containing architecture subdirectories and remove alpine_repo from the kernel arguments. The repository will be autodetected by searching for &amp;quot;.boot_repository&amp;quot;. Eventually Alpine will be able to load kernel modules from this export.&lt;br /&gt;
&lt;br /&gt;
==Configure mkinitfs to generate a PXE-bootable initrd==&lt;br /&gt;
&lt;br /&gt;
NOTE: There is currently a mkinitfs profile just for networking called: network.&lt;br /&gt;
Using it will automatically add pxe support and all ethernet drivers to the initramfs.&lt;br /&gt;
&lt;br /&gt;
You need to add drivers for any Ethernet cards with which you might PXE boot to your initrd. To do this, create &amp;lt;code&amp;gt;/etc/mkinitfs/features.d/network.modules&amp;lt;/code&amp;gt;. List any kernel drivers you require for your Ethernet card. If you are using an Intel E1000 card (this is used by VMware and VirtualBox, and so is good for testing), add&lt;br /&gt;
  kernel/drivers/net/ethernet/intel/e1000/*.ko&lt;br /&gt;
&lt;br /&gt;
You also must create the following files so that the modules and scripts necessary for DHCP and NFS are inserted into the initrd.&lt;br /&gt;
  /etc/mkinitfs/features.d/dhcp.files, containing:&lt;br /&gt;
    /usr/share/udhcpc/default.script&lt;br /&gt;
  /etc/mkinitfs/features.d/dhcp.modules, containing:&lt;br /&gt;
    kernel/net/packet/af_packet.ko&lt;br /&gt;
  /etc/mkinitfs/features.d/nfs.modules, containing:&lt;br /&gt;
    kernel/fs/nfs/*&lt;br /&gt;
Finally edit &amp;lt;code&amp;gt;/etc/mkinitfs/mkinitfs.conf&amp;lt;/code&amp;gt; and add features &#039;&#039;&#039;squashfs, network, dhcp and nfs&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Generate a PXE-capable initrd by running&lt;br /&gt;
  mkinitfs -o /srv/http/prov/pxerd&lt;br /&gt;
&lt;br /&gt;
You should now be able to PXE-boot Alpine Linux. This feature is still in development and non-fatal post-initrd boot errors (regarding modloop, etc.) are to be expected.&lt;br /&gt;
&lt;br /&gt;
==Specifying an apkovl==&lt;br /&gt;
&lt;br /&gt;
The location of the .apkovl to load can be specified using the kernel parameters `apkovl`. (Full definitions above.)&lt;br /&gt;
&lt;br /&gt;
For example, to have the apkovl loaded from the device sda5 add to the kernel arguments:&lt;br /&gt;
 apkovl=sda5&lt;br /&gt;
&lt;br /&gt;
Or, to load a specific apkovl from a HTTP server:&lt;br /&gt;
  apkovl=http://..../file.apkovl.tar.gz&lt;br /&gt;
&lt;br /&gt;
All string occurences of {MAC} and {UUID} in this parameter will be substituted with the MAC address of the boot interface and the machine UUID respectively. If you use these strings, ensure you place the URL in quotes.&lt;br /&gt;
&lt;br /&gt;
==A note about UEFI==&lt;br /&gt;
If you are booting a uefi system you will need to append initrd=initrdname to the kernel options to boot correctly.&lt;br /&gt;
&lt;br /&gt;
[[Category:Booting]]&lt;/div&gt;</summary>
		<author><name>Cos</name></author>
	</entry>
</feed>