<?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=Mikep</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=Mikep"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Mikep"/>
	<updated>2026-05-03T08:11:25Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Configure_Networking&amp;diff=22076</id>
		<title>Configure Networking</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Configure_Networking&amp;diff=22076"/>
		<updated>2022-07-11T03:56:32Z</updated>

		<summary type="html">&lt;p&gt;Mikep: Add notes about DHCPv6 after spending a day troubleshooting.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page will assist you in setting up networking on Alpine Linux.&lt;br /&gt;
{{Note|You must be logged in as root in order to perform the actions on this page.}}&lt;br /&gt;
&lt;br /&gt;
= Setting System Hostname =&lt;br /&gt;
To set the system hostname:&lt;br /&gt;
{{Cmd|echo &amp;quot;shortname&amp;quot; &amp;gt; /etc/hostname}}&lt;br /&gt;
&lt;br /&gt;
Then, to activate the change:&lt;br /&gt;
{{Cmd|hostname -F /etc/hostname}}&lt;br /&gt;
&lt;br /&gt;
If you&#039;re using IPv6, you should also add the following special IPv6 addresses to your &amp;lt;code&amp;gt;/etc/hosts&amp;lt;/code&amp;gt; file:&lt;br /&gt;
&amp;lt;pre&amp;gt;::1             localhost ipv6-localhost ipv6-loopback&lt;br /&gt;
fe00::0         ipv6-localnet&lt;br /&gt;
ff00::0         ipv6-mcastprefix&lt;br /&gt;
ff02::1         ipv6-allnodes&lt;br /&gt;
ff02::2         ipv6-allrouters&lt;br /&gt;
ff02::3         ipv6-allhosts&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Tip|If you&#039;re going to use automatic IP configuration, such as IPv4 DHCP or IPv6 Stateless Autoconfiguration, you can skip ahead to [[#Configuring_DNS|Configuring DNS]].  Otherwise, if you&#039;re going to use a static IPv4 or IPv6 address, continue below.}}&lt;br /&gt;
&lt;br /&gt;
For a static IP configuration, it&#039;s common to also add the machine&#039;s hostname you just set (above) to the &amp;lt;code&amp;gt;/etc/hosts&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an IPv4 example:&lt;br /&gt;
&amp;lt;pre&amp;gt;192.168.1.150   shortname.domain.com&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And here&#039;s an IPv6 example:&lt;br /&gt;
&amp;lt;pre&amp;gt;2001:470:ffff:ff::2   shortname.domain.com&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Configuring DNS =&lt;br /&gt;
{{Tip|&#039;&#039;&#039;For users of IPv4 DHCP:&#039;&#039;&#039; Please note that &amp;lt;code&amp;gt;/etc/resolv.conf&amp;lt;/code&amp;gt; will be completely overwritten with any nameservers provided by DHCP.&lt;br /&gt;
If DHCP does not provide any nameservers, then &amp;lt;code&amp;gt;/etc/resolv.conf&amp;lt;/code&amp;gt; will still be overwritten, but will not contain any nameservers!}}&lt;br /&gt;
&lt;br /&gt;
For a static IP address and static nameservers, use one of the following examples.&lt;br /&gt;
&lt;br /&gt;
For IPv4 nameservers, edit your &amp;lt;code&amp;gt;/etc/resolv.conf&amp;lt;/code&amp;gt; file to look like this:&amp;lt;br /&amp;gt;&lt;br /&gt;
The following example uses [http://en.wikipedia.org/wiki/Google_Public_DNS Google&#039;s Public DNS servers].&lt;br /&gt;
 nameserver 8.8.8.8&lt;br /&gt;
 nameserver 8.8.4.4&lt;br /&gt;
&lt;br /&gt;
For IPv6 nameservers, edit your &amp;lt;code&amp;gt;/etc/resolv.conf&amp;lt;/code&amp;gt; file to look like this:&amp;lt;br /&amp;gt;&lt;br /&gt;
The following example uses [http://www.he.net/ Hurricane Electric&#039;s] public DNS server.&lt;br /&gt;
 nameserver 2001:470:20::2&lt;br /&gt;
You can also use Hurricane Electric&#039;s public IPv4 DNS server:&lt;br /&gt;
 nameserver 74.82.42.42&lt;br /&gt;
&lt;br /&gt;
{{Tip|If you decide to use Hurricane Electric&#039;s nameserver, be aware that it is &#039;Google-whitelisted&#039;. What does this mean?  It allows you access to many of Google&#039;s services via IPv6. (Just don&#039;t add other, non-whitelisted, nameservers to &amp;lt;code&amp;gt;/etc/resolv.conf&amp;lt;/code&amp;gt; — ironically, such as Google&#039;s Public DNS Servers.) Read [http://www.google.com/intl/en/ipv6/ here] for more information.}}&lt;br /&gt;
&lt;br /&gt;
= Enabling IPv6 (Optional) =&lt;br /&gt;
&lt;br /&gt;
If you use IPv6, do the following to enable IPv6 now and at each boot:&lt;br /&gt;
{{Cmd|modprobe ipv6&lt;br /&gt;
echo &amp;quot;ipv6&amp;quot; &amp;gt;&amp;gt; /etc/modules}}&lt;br /&gt;
&lt;br /&gt;
= Interface Configuration =&lt;br /&gt;
&lt;br /&gt;
== Loopback Configuration (Required) ==&lt;br /&gt;
{{Note|The loopback configuration must appear first in &amp;lt;code&amp;gt;/etc/network/interfaces&amp;lt;/code&amp;gt; to prevent networking issues.}}&lt;br /&gt;
To configure loopback, add the following to a new file &amp;lt;code&amp;gt;/etc/network/interfaces&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;auto lo&lt;br /&gt;
iface lo inet loopback&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above works to set up the IPv4 loopback address (127.0.0.1), and the IPv6 loopback address (&amp;lt;code&amp;gt;::1&amp;lt;/code&amp;gt;) — if you enabled IPv6.&lt;br /&gt;
&lt;br /&gt;
== Wireless Configuration ==&lt;br /&gt;
&lt;br /&gt;
See [[Connecting to a wireless access point]].&lt;br /&gt;
&lt;br /&gt;
== Ethernet Configuration ==&lt;br /&gt;
For the following Ethernet configuration examples, we will assume that you are using Ethernet device &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Initial Configuration ===&lt;br /&gt;
Add the following to the file &amp;lt;code&amp;gt;/etc/network/interfaces&amp;lt;/code&amp;gt;, above any IP configuration for &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;auto eth0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== IPv4 DHCP Configuration ===&lt;br /&gt;
Add the following to the file &amp;lt;code&amp;gt;/etc/network/interfaces&amp;lt;/code&amp;gt;, below the &amp;lt;code&amp;gt;auto eth0&amp;lt;/code&amp;gt; definition:&lt;br /&gt;
&amp;lt;pre&amp;gt;iface eth0 inet dhcp&amp;lt;/pre&amp;gt;&lt;br /&gt;
By default, the busybox DHCP client (udhcpc) requests a static set of options from the DHCP server. If you need to extend this set, you can do so by setting some additional command line options for the DHCP client, via the &amp;lt;code&amp;gt;udhcpc_opts&amp;lt;/code&amp;gt; in your interface configuration. The following example requests&lt;br /&gt;
&amp;lt;code&amp;gt;domain-search&amp;lt;/code&amp;gt; option:&lt;br /&gt;
&amp;lt;pre&amp;gt;iface eth0 inet dhcp&lt;br /&gt;
    udhcpc_opts -O search&amp;lt;/pre&amp;gt;&lt;br /&gt;
For a complete list of command line options for udhcpc, see [https://busybox.net/downloads/BusyBox.html#udhcpc this document].&lt;br /&gt;
&lt;br /&gt;
=== IPv4 Static Address Configuration ===&lt;br /&gt;
Add the following to the file &amp;lt;code&amp;gt;/etc/network/interfaces&amp;lt;/code&amp;gt;, below the &amp;lt;code&amp;gt;auto eth0&amp;lt;/code&amp;gt; definition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;iface eth0 inet static&lt;br /&gt;
        address 192.168.1.150&lt;br /&gt;
        netmask 255.255.255.0&lt;br /&gt;
        gateway 192.168.1.1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since Alpine 3.13 must be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;iface eth0 inet static&lt;br /&gt;
        address 192.168.1.150/24&lt;br /&gt;
        gateway 192.168.1.1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Additional IP addresses ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;iface eth0 inet static&lt;br /&gt;
        address 192.168.1.150&lt;br /&gt;
        netmask 255.255.255.0&lt;br /&gt;
&lt;br /&gt;
iface eth0 inet static&lt;br /&gt;
        address 192.168.1.151/24&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since Alpine 3.13 must be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;iface eth0 inet static&lt;br /&gt;
        address 192.168.1.150/24&lt;br /&gt;
        gateway 192.168.1.1&lt;br /&gt;
&lt;br /&gt;
iface eth0 inet static&lt;br /&gt;
        address 192.168.1.151/24&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== IPv6 DHCP Configuration ===&lt;br /&gt;
Alpine&#039;s use of ifupdown-ng supports three DHCP clients: udhcpc, dhclient, and dhcpcd. Of these, only dhcpcd can interact with both DHCP and DHCPv6 from the same process, which ifupdown-ng requires. Thus the IPv4 DHCP configuration given above will also result in the use of DHCPv6, but only if you install the dhcpcd package. (The ifupdown-ng scripts prioritize dhclient over udhcpc, and they prioritize dhcpcd over dhclient; see &amp;lt;code&amp;gt;/usr/libexec/ifupdown-ng/dhcp&amp;lt;/code&amp;gt;.)&lt;br /&gt;
&lt;br /&gt;
=== IPv6 Stateless Autoconfiguration ===&lt;br /&gt;
Add the following to the file &amp;lt;code&amp;gt;/etc/network/interfaces&amp;lt;/code&amp;gt;, below the &amp;lt;code&amp;gt;auto eth0&amp;lt;/code&amp;gt; definition:&lt;br /&gt;
&amp;lt;pre&amp;gt;iface eth0 inet6 auto&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== IPv6 Static Address Configuration ===&lt;br /&gt;
Add the following to the file &amp;lt;code&amp;gt;/etc/network/interfaces&amp;lt;/code&amp;gt;, below the &amp;lt;code&amp;gt;auto eth0&amp;lt;/code&amp;gt; definition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;iface eth0 inet6 static&lt;br /&gt;
        address 2001:470:ffff:ff::2&lt;br /&gt;
        netmask 64&lt;br /&gt;
        gateway 2001:470:ffff:ff::1&lt;br /&gt;
        pre-up echo 0 &amp;gt; /proc/sys/net/ipv6/conf/eth0/accept_ra&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since Alpine Linux 3.13 must be as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;iface eth0 inet6 static&lt;br /&gt;
        address 2001:470:ffff:ff::2/64&lt;br /&gt;
        gateway 2001:470:ffff:ff::1&lt;br /&gt;
        pre-up echo 0 &amp;gt; /proc/sys/net/ipv6/conf/eth0/accept_ra&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example: Dual-Stack Configuration ==&lt;br /&gt;
&lt;br /&gt;
This example shows a dual-stack configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;auto lo&lt;br /&gt;
iface lo inet loopback&lt;br /&gt;
&lt;br /&gt;
auto eth0&lt;br /&gt;
&lt;br /&gt;
iface eth0 inet static&lt;br /&gt;
        address 192.168.1.150&lt;br /&gt;
       netmask 255.255.255.0&lt;br /&gt;
        gateway 192.168.1.1&lt;br /&gt;
&lt;br /&gt;
iface eth0 inet6 static&lt;br /&gt;
        address 2001:470:ffff:ff::2&lt;br /&gt;
        netmask 64&lt;br /&gt;
        gateway 2001:470:ffff:ff::1&lt;br /&gt;
        pre-up echo 0 &amp;gt; /proc/sys/net/ipv6/conf/eth0/accept_ra&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take care since Alpine 3.13 must be as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;auto lo&lt;br /&gt;
iface lo inet loopback&lt;br /&gt;
&lt;br /&gt;
auto eth0&lt;br /&gt;
&lt;br /&gt;
iface eth0 inet static&lt;br /&gt;
        address 192.168.1.150/24&lt;br /&gt;
        gateway 192.168.1.1&lt;br /&gt;
&lt;br /&gt;
iface eth0 inet6 static&lt;br /&gt;
        address 2001:470:ffff:ff::2/64&lt;br /&gt;
        gateway 2001:470:ffff:ff::1&lt;br /&gt;
        pre-up echo 0 &amp;gt; /proc/sys/net/ipv6/conf/eth0/accept_ra&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Firewalling with iptables and ip6tables =&lt;br /&gt;
&lt;br /&gt;
See also: [[Alpine Wall]] - [[How-To Alpine Wall]] - [[Alpine Wall User&#039;s Guide]]&lt;br /&gt;
&lt;br /&gt;
== Install iptables/ip6tables ==&lt;br /&gt;
* To install iptables:&lt;br /&gt;
: {{Cmd|apk add iptables}}&lt;br /&gt;
&lt;br /&gt;
* To install ip6tables:&lt;br /&gt;
: {{Cmd|apk add ip6tables}}&lt;br /&gt;
&lt;br /&gt;
* To install the man pages for iptables and ip6tables:&lt;br /&gt;
: {{Cmd|apk add iptables-doc}}&lt;br /&gt;
&lt;br /&gt;
== Configure iptables/ip6tables ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Save Firewall Rules ==&lt;br /&gt;
&lt;br /&gt;
=== For iptables ===&lt;br /&gt;
# Set iptables to start on reboot&lt;br /&gt;
#* {{ Cmd| rc-update add iptables }}&lt;br /&gt;
# Write the firewall rules to disk&lt;br /&gt;
#* {{ Cmd| /etc/init.d/iptables save}}&lt;br /&gt;
# If you use Alpine Local Backup:&lt;br /&gt;
&amp;lt;!-- Not needed on Alpine &amp;gt; 2.3&lt;br /&gt;
## Add the firewall rules to Alpine Local Backup&lt;br /&gt;
##* {{ Cmd| lbu add /var/lib/iptables/rules-save }}&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
## Save the configuration&lt;br /&gt;
##* {{ Cmd| lbu ci }}&lt;br /&gt;
&lt;br /&gt;
=== For ip6tables ===&lt;br /&gt;
# Set ip6tables to start on reboot&lt;br /&gt;
#* {{ Cmd| rc-update add ip6tables }}&lt;br /&gt;
# Write the firewall rules to disk&lt;br /&gt;
#* {{ Cmd| /etc/init.d/ip6tables save}}&lt;br /&gt;
# If you use Alpine Local Backup:&lt;br /&gt;
&amp;lt;!-- Not needed on Alpine &amp;gt; 2.3&lt;br /&gt;
## Add the firewall rules to Alpine Local Backup&lt;br /&gt;
##* {{ Cmd| lbu add /var/lib/ip6tables/rules-save }}&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
## Save the configuration&lt;br /&gt;
##* {{ Cmd| lbu ci }}&lt;br /&gt;
&lt;br /&gt;
= Activating Changes and Testing Connectivity =&lt;br /&gt;
Changes made to &amp;lt;code&amp;gt;/etc/network/interfaces&amp;lt;/code&amp;gt; can be activated by running:&lt;br /&gt;
{{Cmd|/etc/init.d/networking restart}}&lt;br /&gt;
If you did not get any errors, you can now test that networking is configured properly by attempting to ping out:&lt;br /&gt;
{{Cmd|ping www.google.com}}&lt;br /&gt;
&amp;lt;pre&amp;gt;PING www.l.google.com (74.125.47.103) 56(84) bytes of data.&lt;br /&gt;
64 bytes from yw-in-f103.1e100.net (74.125.47.103): icmp_seq=1 ttl=48 time=58.5 ms&lt;br /&gt;
64 bytes from yw-in-f103.1e100.net (74.125.47.103): icmp_seq=2 ttl=48 time=56.4 ms&lt;br /&gt;
64 bytes from yw-in-f103.1e100.net (74.125.47.103): icmp_seq=3 ttl=48 time=57.0 ms&lt;br /&gt;
64 bytes from yw-in-f103.1e100.net (74.125.47.103): icmp_seq=4 ttl=48 time=60.2 ms&lt;br /&gt;
^C&lt;br /&gt;
--- www.l.google.com ping statistics ---&lt;br /&gt;
4 packets transmitted, 4 received, 0% packet loss, time 3007ms&lt;br /&gt;
rtt min/avg/max/mdev = 56.411/58.069/60.256/1.501 ms&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For an IPv6 traceroute (&amp;lt;code&amp;gt;traceroute6&amp;lt;/code&amp;gt;), you will first need to install the &amp;lt;code&amp;gt;iputils&amp;lt;/code&amp;gt; package:&lt;br /&gt;
{{Cmd|apk add iputils}}&lt;br /&gt;
&lt;br /&gt;
Then run &amp;lt;code&amp;gt;traceroute6&amp;lt;/code&amp;gt;:&lt;br /&gt;
{{Cmd|traceroute6 ipv6.google.com}}&lt;br /&gt;
&amp;lt;pre&amp;gt;traceroute to ipv6.l.google.com (2001:4860:8009::67) from 2001:470:ffff:ff::2, 30 hops max, 16 byte packets&lt;br /&gt;
 1  2001:470:ffff:ff::1 (2001:470:ffff:ff::1)  3.49 ms  0.62 ms  0.607 ms&lt;br /&gt;
 2  *  *  *&lt;br /&gt;
 3  *  *  *&lt;br /&gt;
 4  pr61.iad07.net.google.com (2001:504:0:2:0:1:5169:1)  134.313 ms  95.342 ms  88.425 ms&lt;br /&gt;
 5  2001:4860::1:0:9ff (2001:4860::1:0:9ff)  100.759 ms  100.537 ms  89.907 ms&lt;br /&gt;
 6  2001:4860::1:0:5db (2001:4860::1:0:5db)  115.563 ms  102.946 ms  106.191 ms&lt;br /&gt;
 7  2001:4860::2:0:a7 (2001:4860::2:0:a7)  101.754 ms  100.475 ms  100.512 ms&lt;br /&gt;
 8  2001:4860:0:1::c3 (2001:4860:0:1::c3)  99.272 ms  111.989 ms  99.835 ms&lt;br /&gt;
 9  yw-in-x67.1e100.net (2001:4860:8009::67)  101.545 ms  109.675 ms  99.431 ms&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Additional Utilities =&lt;br /&gt;
&lt;br /&gt;
== iproute2 ==&lt;br /&gt;
&lt;br /&gt;
You may wish to install the &#039;iproute2&#039; package (note that this will also install iptables if not yet installed)&lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add iproute2}}&lt;br /&gt;
&lt;br /&gt;
This provides the &#039;ss&#039; command which is IMHO a &#039;better&#039; version of netstat.&lt;br /&gt;
&lt;br /&gt;
Show listening tcp ports:&lt;br /&gt;
{{Cmd|ss -tl}}&lt;br /&gt;
&lt;br /&gt;
Show listening tcp ports and associated processes:&lt;br /&gt;
{{Cmd|ss -ptl}}&lt;br /&gt;
&lt;br /&gt;
Show listening and established tcp connections:&lt;br /&gt;
{{Cmd|ss -ta}}&lt;br /&gt;
&lt;br /&gt;
Show socket usage summary:&lt;br /&gt;
{{Cmd|ss -s}}&lt;br /&gt;
&lt;br /&gt;
Show more options:&lt;br /&gt;
{{Cmd|ss -h}}&lt;br /&gt;
&lt;br /&gt;
== drill ==&lt;br /&gt;
&lt;br /&gt;
You may also wish to install &#039;drill&#039; (it will also install the &#039;ldns&#039; package) which is a superior (IMHO) replacement for nslookup and dig etc:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add drill}}&lt;br /&gt;
&lt;br /&gt;
Then use it as you would for dig:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|drill alpinelinux.org @8.8.8.8}}&lt;br /&gt;
&lt;br /&gt;
To perform a reverse lookup (get a name from an IP) use the following syntax:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|drill -x 8.8.8.8 @208.67.222.222}}&lt;br /&gt;
&lt;br /&gt;
= Related articles =&lt;br /&gt;
&lt;br /&gt;
You may also wish to review the following network related articles:&lt;br /&gt;
&lt;br /&gt;
[[Vlan|VLAN setup]]&lt;br /&gt;
&lt;br /&gt;
[[Bonding|Bonding setup]]&lt;br /&gt;
&lt;br /&gt;
[[Bridge|Network bridge setup]]&lt;br /&gt;
&lt;br /&gt;
[[udhcpc|udhcpc configuration]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Networking]]&lt;/div&gt;</summary>
		<author><name>Mikep</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Alpine_configuration_management_scripts&amp;diff=22072</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=22072"/>
		<updated>2022-07-10T19:43:59Z</updated>

		<summary type="html">&lt;p&gt;Mikep: Fix use of &amp;#039;|&amp;#039; in setup-ntp change.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Feature descriptions for available Alpine Linux setup scripts ({{Path|/sbin/setup-*}}).&lt;br /&gt;
&lt;br /&gt;
These scripts can be installed by using &amp;lt;code&amp;gt;apk&amp;lt;/code&amp;gt; to install the &amp;lt;code&amp;gt;alpine-conf&amp;lt;/code&amp;gt; package.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t have an Alpine Linux install, you can find and examine the scripts in their [https://github.com/alpinelinux/alpine-conf git repository].&lt;br /&gt;
&lt;br /&gt;
== setup-alpine ==&lt;br /&gt;
&lt;br /&gt;
This is the main Alpine configuration and installation script.&lt;br /&gt;
&lt;br /&gt;
The script interactively walks the user through executing several auxiliary &amp;lt;code&amp;gt;setup-*&amp;lt;/code&amp;gt; scripts, in the order shown below.&lt;br /&gt;
&lt;br /&gt;
The bracketed options represent example configuration choices, formatted as they may be supplied when manually calling the auxiliary setup scripts, or using a &amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt; &amp;quot;answerfile&amp;quot; (see below).&lt;br /&gt;
&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: &amp;lt;code&amp;gt;[[#setup-dns|setup-dns]]&amp;lt;/code&amp;gt; [-d example.com -n &amp;quot;192.168.0.1 [...]&amp;quot;]&lt;br /&gt;
# set the root password&lt;br /&gt;
# if not in quick mode, then: &amp;lt;code&amp;gt;[[#setup-timezone|setup-timezone]]&amp;lt;/code&amp;gt; [-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;crond&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;
# &amp;lt;code&amp;gt;[[#setup-proxy|setup-proxy]]&amp;lt;/code&amp;gt; [-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: &amp;lt;code&amp;gt;[[#setup-sshd|setup-sshd]]&amp;lt;/code&amp;gt; [-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; &amp;lt;code&amp;gt;[[#setup-disk|setup-disk]]&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;-q&amp;lt;/code&amp;gt; [-m data /dev/sda] (see [[Installation#Installation_Overview]] about the disk modes)&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;
&lt;br /&gt;
&amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt; itself accepts the following command-line switches:&lt;br /&gt;
&lt;br /&gt;
{{Define|-h|Shows the up-to-date usage help 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 answerfile 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 answerfile, which may override some or all of the interactive prompts. You can also specify a HTTP(S) or FTP URL for &amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt; to [https://gitlab.alpinelinux.org/alpine/alpine-conf/-/merge_requests/22 download] an answerfile from. Doing so will spin up a temporary networking config if one is not already active.&lt;br /&gt;
{{Define|-q|Run in &amp;quot;quick mode&amp;quot;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&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;
&amp;lt;br&amp;gt;&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;
&amp;lt;br&amp;gt;&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 (with 192.168.0.1 being the local router/dns-forwarder): {{Cmd|setup-dns -d example.org -n 192.168.0.1}}&lt;br /&gt;
&lt;br /&gt;
Example {{Path|/etc/resolv.conf}}:&lt;br /&gt;
&lt;br /&gt;
 search example.org&lt;br /&gt;
 nameserver 192.168.0.1&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;
&amp;lt;br&amp;gt;&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;
&amp;lt;br&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;&amp;lt;nowiki&amp;gt;http://10.0.0.1:8080&amp;lt;/nowiki&amp;gt;&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;
&amp;lt;br&amp;gt;&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;
&amp;lt;br&amp;gt;&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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== setup-ntp ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;From [https://en.wikipedia.org/wiki/Network_Time_Protocol Wikipedia]&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;Network Time Protocol (NTP)&#039;&#039;&#039; is a networking protocol for clock synchronization between computer systems over packet-switched, variable-latency data networks. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Cmd|usage: setup-ntp [-h] [busybox{{!}}openntpd{{!}}chrony{{!}}none]&lt;br /&gt;
&lt;br /&gt;
Setup NTP time synchronization&lt;br /&gt;
&lt;br /&gt;
options:&lt;br /&gt;
 -h  Show this help&lt;br /&gt;
&lt;br /&gt;
 User is prompted if no NTP daemon is specified}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;setup-ntp&amp;lt;/code&amp;gt; script is stored in {{Path|/sbin/setup-ntp}} and allows quick and simple setup of the NTP 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;
&amp;lt;br&amp;gt;&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|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|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|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, that go beyond above alpine-disk options, you can partition, format, and mount your volumes manually, and 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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== setup-lbu ==&lt;br /&gt;
&lt;br /&gt;
This script will only be invoked for by &amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt; when installing &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; installation types (ramdisk)&lt;br /&gt;
&lt;br /&gt;
It configures where &amp;lt;code&amp;gt;lbu commit&amp;lt;/code&amp;gt; will store the .apkovl backup. See [[Alpine local backup]] for more information.&lt;br /&gt;
&lt;br /&gt;
When started, &amp;lt;code&amp;gt;setup-lbu&amp;lt;/code&amp;gt; will prompt where to store your data. The options it will prompt for will be taken from the directories found in &amp;lt;code&amp;gt;/media&amp;lt;/code&amp;gt; (except for &amp;lt;code&amp;gt;cdrom&amp;lt;/code&amp;gt;). [not sure how these are mounted: are they automatically mounted by setup-lbu? Does the user have to manually mount using another tty?]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== setup-apkcache ==&lt;br /&gt;
&lt;br /&gt;
This script will only be invoked for by &amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt; when installing &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; installation types (ramdisk)&lt;br /&gt;
&lt;br /&gt;
It configures where to save the apk package files. The apkcache is where apk stores downloaded packages, such that the system does not need to download them again on each reboot, and doesn&#039;t have to depend on the network. See [[Local APK cache]] for a detailed explanation.&lt;br /&gt;
&lt;br /&gt;
You should be able to use a partition that you set up in the previous steps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&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;
It allows to create boot media that boots the system running from RAM memory (diskless) like the installation images, but using a writable (i.e. not iso9660) filesystem. So that it can also serve to store local customizations (e.g. apkovl files and cached packages). &lt;br /&gt;
&lt;br /&gt;
First, the script copies files from an ISO image (as file on a CD/DVD/USB etc.) onto a USB-Stick/CompactFlash/SDCard etc., or harddisk partition. And then, it installs the syslinux bootloader to make the device bootable.&lt;br /&gt;
&lt;br /&gt;
However, its current syslinux installation seems to fail on non-FAT32 partitions. So in these cases, you may start over with a FAT32 filesystem, or rather with the desired filesystem and using &amp;lt;code&amp;gt;setup-bootable&amp;lt;/code&amp;gt; only with the &amp;lt;code&amp;gt;-u&amp;lt;/code&amp;gt; option, to skip the syslinux install, and then refer to the [[Create_a_Bootable_Device#Manually_copying_Alpine_files|manual method]] to fix the problem, or use one of the other bootloader options, instead.&lt;br /&gt;
&lt;br /&gt;
{{Tip| The [[Bootloaders]] page shows different ways to setup booting, and multi-boot menus!}}  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The setup-bootable 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;
Suppose the target device is /dev/sdXY, then this partition can be prepared for booting with&lt;br /&gt;
{{Cmd|# setup-bootable -v /media/&amp;lt;installation-media-device&amp;gt; /dev/sdXY&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
For the manual way to set up boot media see [[Create_a_Bootable_Device#Manually_copying_Alpine_files|Manually_copying_Alpine_files]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== setup-xorg-base ==&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;
It configures a graphical environment, installing basic Xorg packages and udev (replacing mdev), and is also required for Wayland sessions.&lt;br /&gt;
&lt;br /&gt;
The script installs, among other packages, e.g.: &amp;lt;code&amp;gt;xorg-server xf86-input-libinput xinit udev&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Additional packages to install may be supplied as arguments.&lt;br /&gt;
{{cmd|setup-xorg-base [additional package(s) to install]}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Video packages (optional) ====&lt;br /&gt;
&lt;br /&gt;
You may install specific xf86 xorg driver packages for your video card&#039;s chipset, as they may support specific features, effects and acceleration modes, and avoid error messages during X initialization.&lt;br /&gt;
&lt;br /&gt;
However, the most basic X features should work fine with just using the default kernel video-modesetting drivers.&lt;br /&gt;
&lt;br /&gt;
Info about the particular video cards that are installed in the computer may be found in the list of PCI devices:&lt;br /&gt;
{{cmd|# apk add pciutils&lt;br /&gt;
$ lspci}}&lt;br /&gt;
&lt;br /&gt;
To see available video driver packages run:&lt;br /&gt;
{{cmd|$ apk search xf86-video}}&lt;br /&gt;
&lt;br /&gt;
For example, &lt;br /&gt;
* For an Sis video chipset install &#039;xf86-video-sis&#039;.&lt;br /&gt;
{{Cmd|# apk add xf86-video-sis}}&lt;br /&gt;
&lt;br /&gt;
Others:&lt;br /&gt;
* For Intel video chipsets install &#039;xf86-video-intel&#039; and see [[Intel Video]].&lt;br /&gt;
{{Tip|In some cases, freezes on suspend/resume stop happening when changing the video port the monitor is connected to.}}&lt;br /&gt;
* For AMD Radeon Video see [[Radeon_Video]]&lt;br /&gt;
* For Alix1D use xf86-video-geode.&lt;br /&gt;
* In KVM/QEMU guests see [[QEMU#Using_Xorg_inside_Qemu|Xorg within KVM/QEMU]]&lt;br /&gt;
* In VirtualBox guests use xf86-video-vboxvideo, and install the [[VirtualBox_guest_additions|VirtualBox guest additions]] as well. They contain important parts for the driver.&lt;br /&gt;
* In VMware guests use xf86-video-vmware&lt;br /&gt;
* In Hyper-V guests use xf86-video-fbdev and install the [[Hyper-V_guest_services|Hyper-V guest services]] as well.&lt;br /&gt;
&lt;br /&gt;
==== Input packages ====&lt;br /&gt;
&lt;br /&gt;
If the &amp;lt;b&amp;gt;Numlock&amp;lt;/b&amp;gt; settings are not working, or getting &amp;lt;b&amp;gt;&#039;setleds not found&#039;&amp;lt;/b&amp;gt; errors:&lt;br /&gt;
&lt;br /&gt;
{{cmd|# apk add kbd}}&lt;br /&gt;
&lt;br /&gt;
If some input device is not working at all, the available xf86-input drivers can be listed with:&lt;br /&gt;
{{cmd|$ apk search xf86-input}}&lt;br /&gt;
&lt;br /&gt;
You probably at least want {{cmd| xf86-input-libinput}} or {{cmd| xf86-input-evdev}} &lt;br /&gt;
&lt;br /&gt;
libinput is for Wayland with wrapper for Xorg. evdev is Xorg only.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Typical legacy drivers (not packaged. at least as of 2/2022):&lt;br /&gt;
&lt;br /&gt;
{{cmd|# apk add xf86-input-mouse xf86-input-keyboard}}&lt;br /&gt;
&lt;br /&gt;
And for touchpad tapping support on many laptops, also:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|# apk add xf86-input-synaptics}}&lt;br /&gt;
&lt;br /&gt;
==== Configure xorg-server (optional) ====&lt;br /&gt;
&lt;br /&gt;
On most systems, xorg should be able to autodetect all devices. However you can still configure xorg-server by hand by launching:&lt;br /&gt;
{{Cmd|# Xorg -configure}}&lt;br /&gt;
This will create a `/root/xorg.conf.new` file. You can modify this file to fit your needs.&amp;lt;BR&amp;gt;&lt;br /&gt;
(When finished modifying and testing the above configuration file, move it to `/etc/X11/xorg.conf` for normal usage.)&lt;br /&gt;
&lt;br /&gt;
==== Keyboard Layout (optional) ====&lt;br /&gt;
&lt;br /&gt;
If you use a keyboard layout different than &amp;quot;us&amp;quot;, and you are using a window manager or desktop environment that does not support to configure the keyboard layout itself, then you need to&lt;br /&gt;
&lt;br /&gt;
* [[Repositories#Enabling_the_community_repository|Enable the &amp;quot;community&amp;quot; repository]]&lt;br /&gt;
&lt;br /&gt;
and install setxkbmap:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|# apk add setxkbmap}}&lt;br /&gt;
&lt;br /&gt;
Then try&lt;br /&gt;
 # setxkbmap &amp;lt;%a language layout from /usr/share/X11/xkb/rules/xorg.lst%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to make it persistent add this section to /etc/X11/xorg.conf:&lt;br /&gt;
{{Cmd|Section &amp;quot;InputClass&amp;quot;&lt;br /&gt;
	Identifier	&amp;quot;Keyboard Default&amp;quot;&lt;br /&gt;
	MatchIsKeyboard	&amp;quot;yes&amp;quot;&lt;br /&gt;
	Option		&amp;quot;XkbLayout&amp;quot; &amp;quot;&amp;lt;%a language layout from /usr/share/X11/xkb/rules/xorg.lst%&amp;gt;&amp;quot;&lt;br /&gt;
EndSection&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to change the keymap when logging into X is to use ~/.xinitrc.  The following example loads a British keymap, simply add this line to the beginning of the file:&lt;br /&gt;
&amp;lt;code&amp;gt;setxkbmap gb &amp;amp;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you need to create the ~/.xinitrc file, you may also want to add a second line like &amp;lt;code&amp;gt;exec openbox-session&amp;lt;/code&amp;gt; to still start the window manager with &amp;lt;code&amp;gt;startx&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;xinit&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Documentation needed ==&lt;br /&gt;
&lt;br /&gt;
=== setup-xen-dom0 ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&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;
&amp;lt;br&amp;gt;&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;
= See also =&lt;br /&gt;
* [[Installation]]&lt;br /&gt;
* [[Installation#Post-Install|Post Install]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;/div&gt;</summary>
		<author><name>Mikep</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Alpine_configuration_management_scripts&amp;diff=22071</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=22071"/>
		<updated>2022-07-10T19:38:46Z</updated>

		<summary type="html">&lt;p&gt;Mikep: Update documentation of setup-ntp, which seems to have dropped the -c flag some time before Alpine 3.16.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Feature descriptions for available Alpine Linux setup scripts ({{Path|/sbin/setup-*}}).&lt;br /&gt;
&lt;br /&gt;
These scripts can be installed by using &amp;lt;code&amp;gt;apk&amp;lt;/code&amp;gt; to install the &amp;lt;code&amp;gt;alpine-conf&amp;lt;/code&amp;gt; package.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t have an Alpine Linux install, you can find and examine the scripts in their [https://github.com/alpinelinux/alpine-conf git repository].&lt;br /&gt;
&lt;br /&gt;
== setup-alpine ==&lt;br /&gt;
&lt;br /&gt;
This is the main Alpine configuration and installation script.&lt;br /&gt;
&lt;br /&gt;
The script interactively walks the user through executing several auxiliary &amp;lt;code&amp;gt;setup-*&amp;lt;/code&amp;gt; scripts, in the order shown below.&lt;br /&gt;
&lt;br /&gt;
The bracketed options represent example configuration choices, formatted as they may be supplied when manually calling the auxiliary setup scripts, or using a &amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt; &amp;quot;answerfile&amp;quot; (see below).&lt;br /&gt;
&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: &amp;lt;code&amp;gt;[[#setup-dns|setup-dns]]&amp;lt;/code&amp;gt; [-d example.com -n &amp;quot;192.168.0.1 [...]&amp;quot;]&lt;br /&gt;
# set the root password&lt;br /&gt;
# if not in quick mode, then: &amp;lt;code&amp;gt;[[#setup-timezone|setup-timezone]]&amp;lt;/code&amp;gt; [-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;crond&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;
# &amp;lt;code&amp;gt;[[#setup-proxy|setup-proxy]]&amp;lt;/code&amp;gt; [-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: &amp;lt;code&amp;gt;[[#setup-sshd|setup-sshd]]&amp;lt;/code&amp;gt; [-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; &amp;lt;code&amp;gt;[[#setup-disk|setup-disk]]&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;-q&amp;lt;/code&amp;gt; [-m data /dev/sda] (see [[Installation#Installation_Overview]] about the disk modes)&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;
&lt;br /&gt;
&amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt; itself accepts the following command-line switches:&lt;br /&gt;
&lt;br /&gt;
{{Define|-h|Shows the up-to-date usage help 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 answerfile 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 answerfile, which may override some or all of the interactive prompts. You can also specify a HTTP(S) or FTP URL for &amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt; to [https://gitlab.alpinelinux.org/alpine/alpine-conf/-/merge_requests/22 download] an answerfile from. Doing so will spin up a temporary networking config if one is not already active.&lt;br /&gt;
{{Define|-q|Run in &amp;quot;quick mode&amp;quot;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&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;
&amp;lt;br&amp;gt;&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;
&amp;lt;br&amp;gt;&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 (with 192.168.0.1 being the local router/dns-forwarder): {{Cmd|setup-dns -d example.org -n 192.168.0.1}}&lt;br /&gt;
&lt;br /&gt;
Example {{Path|/etc/resolv.conf}}:&lt;br /&gt;
&lt;br /&gt;
 search example.org&lt;br /&gt;
 nameserver 192.168.0.1&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;
&amp;lt;br&amp;gt;&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;
&amp;lt;br&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;&amp;lt;nowiki&amp;gt;http://10.0.0.1:8080&amp;lt;/nowiki&amp;gt;&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;
&amp;lt;br&amp;gt;&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;
&amp;lt;br&amp;gt;&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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== setup-ntp ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;From [https://en.wikipedia.org/wiki/Network_Time_Protocol Wikipedia]&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;Network Time Protocol (NTP)&#039;&#039;&#039; is a networking protocol for clock synchronization between computer systems over packet-switched, variable-latency data networks. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Cmd|usage: setup-ntp [-h] [busybox|openntpd|chrony|none]&lt;br /&gt;
&lt;br /&gt;
Setup NTP time synchronization&lt;br /&gt;
&lt;br /&gt;
options:&lt;br /&gt;
 -h  Show this help&lt;br /&gt;
&lt;br /&gt;
 User is prompted if no NTP daemon is specified}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;setup-ntp&amp;lt;/code&amp;gt; script is stored in {{Path|/sbin/setup-ntp}} and allows quick and simple setup of the NTP 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;
&amp;lt;br&amp;gt;&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|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|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|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, that go beyond above alpine-disk options, you can partition, format, and mount your volumes manually, and 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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== setup-lbu ==&lt;br /&gt;
&lt;br /&gt;
This script will only be invoked for by &amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt; when installing &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; installation types (ramdisk)&lt;br /&gt;
&lt;br /&gt;
It configures where &amp;lt;code&amp;gt;lbu commit&amp;lt;/code&amp;gt; will store the .apkovl backup. See [[Alpine local backup]] for more information.&lt;br /&gt;
&lt;br /&gt;
When started, &amp;lt;code&amp;gt;setup-lbu&amp;lt;/code&amp;gt; will prompt where to store your data. The options it will prompt for will be taken from the directories found in &amp;lt;code&amp;gt;/media&amp;lt;/code&amp;gt; (except for &amp;lt;code&amp;gt;cdrom&amp;lt;/code&amp;gt;). [not sure how these are mounted: are they automatically mounted by setup-lbu? Does the user have to manually mount using another tty?]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== setup-apkcache ==&lt;br /&gt;
&lt;br /&gt;
This script will only be invoked for by &amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt; when installing &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; installation types (ramdisk)&lt;br /&gt;
&lt;br /&gt;
It configures where to save the apk package files. The apkcache is where apk stores downloaded packages, such that the system does not need to download them again on each reboot, and doesn&#039;t have to depend on the network. See [[Local APK cache]] for a detailed explanation.&lt;br /&gt;
&lt;br /&gt;
You should be able to use a partition that you set up in the previous steps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&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;
It allows to create boot media that boots the system running from RAM memory (diskless) like the installation images, but using a writable (i.e. not iso9660) filesystem. So that it can also serve to store local customizations (e.g. apkovl files and cached packages). &lt;br /&gt;
&lt;br /&gt;
First, the script copies files from an ISO image (as file on a CD/DVD/USB etc.) onto a USB-Stick/CompactFlash/SDCard etc., or harddisk partition. And then, it installs the syslinux bootloader to make the device bootable.&lt;br /&gt;
&lt;br /&gt;
However, its current syslinux installation seems to fail on non-FAT32 partitions. So in these cases, you may start over with a FAT32 filesystem, or rather with the desired filesystem and using &amp;lt;code&amp;gt;setup-bootable&amp;lt;/code&amp;gt; only with the &amp;lt;code&amp;gt;-u&amp;lt;/code&amp;gt; option, to skip the syslinux install, and then refer to the [[Create_a_Bootable_Device#Manually_copying_Alpine_files|manual method]] to fix the problem, or use one of the other bootloader options, instead.&lt;br /&gt;
&lt;br /&gt;
{{Tip| The [[Bootloaders]] page shows different ways to setup booting, and multi-boot menus!}}  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The setup-bootable 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;
Suppose the target device is /dev/sdXY, then this partition can be prepared for booting with&lt;br /&gt;
{{Cmd|# setup-bootable -v /media/&amp;lt;installation-media-device&amp;gt; /dev/sdXY&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
For the manual way to set up boot media see [[Create_a_Bootable_Device#Manually_copying_Alpine_files|Manually_copying_Alpine_files]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== setup-xorg-base ==&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;
It configures a graphical environment, installing basic Xorg packages and udev (replacing mdev), and is also required for Wayland sessions.&lt;br /&gt;
&lt;br /&gt;
The script installs, among other packages, e.g.: &amp;lt;code&amp;gt;xorg-server xf86-input-libinput xinit udev&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Additional packages to install may be supplied as arguments.&lt;br /&gt;
{{cmd|setup-xorg-base [additional package(s) to install]}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Video packages (optional) ====&lt;br /&gt;
&lt;br /&gt;
You may install specific xf86 xorg driver packages for your video card&#039;s chipset, as they may support specific features, effects and acceleration modes, and avoid error messages during X initialization.&lt;br /&gt;
&lt;br /&gt;
However, the most basic X features should work fine with just using the default kernel video-modesetting drivers.&lt;br /&gt;
&lt;br /&gt;
Info about the particular video cards that are installed in the computer may be found in the list of PCI devices:&lt;br /&gt;
{{cmd|# apk add pciutils&lt;br /&gt;
$ lspci}}&lt;br /&gt;
&lt;br /&gt;
To see available video driver packages run:&lt;br /&gt;
{{cmd|$ apk search xf86-video}}&lt;br /&gt;
&lt;br /&gt;
For example, &lt;br /&gt;
* For an Sis video chipset install &#039;xf86-video-sis&#039;.&lt;br /&gt;
{{Cmd|# apk add xf86-video-sis}}&lt;br /&gt;
&lt;br /&gt;
Others:&lt;br /&gt;
* For Intel video chipsets install &#039;xf86-video-intel&#039; and see [[Intel Video]].&lt;br /&gt;
{{Tip|In some cases, freezes on suspend/resume stop happening when changing the video port the monitor is connected to.}}&lt;br /&gt;
* For AMD Radeon Video see [[Radeon_Video]]&lt;br /&gt;
* For Alix1D use xf86-video-geode.&lt;br /&gt;
* In KVM/QEMU guests see [[QEMU#Using_Xorg_inside_Qemu|Xorg within KVM/QEMU]]&lt;br /&gt;
* In VirtualBox guests use xf86-video-vboxvideo, and install the [[VirtualBox_guest_additions|VirtualBox guest additions]] as well. They contain important parts for the driver.&lt;br /&gt;
* In VMware guests use xf86-video-vmware&lt;br /&gt;
* In Hyper-V guests use xf86-video-fbdev and install the [[Hyper-V_guest_services|Hyper-V guest services]] as well.&lt;br /&gt;
&lt;br /&gt;
==== Input packages ====&lt;br /&gt;
&lt;br /&gt;
If the &amp;lt;b&amp;gt;Numlock&amp;lt;/b&amp;gt; settings are not working, or getting &amp;lt;b&amp;gt;&#039;setleds not found&#039;&amp;lt;/b&amp;gt; errors:&lt;br /&gt;
&lt;br /&gt;
{{cmd|# apk add kbd}}&lt;br /&gt;
&lt;br /&gt;
If some input device is not working at all, the available xf86-input drivers can be listed with:&lt;br /&gt;
{{cmd|$ apk search xf86-input}}&lt;br /&gt;
&lt;br /&gt;
You probably at least want {{cmd| xf86-input-libinput}} or {{cmd| xf86-input-evdev}} &lt;br /&gt;
&lt;br /&gt;
libinput is for Wayland with wrapper for Xorg. evdev is Xorg only.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Typical legacy drivers (not packaged. at least as of 2/2022):&lt;br /&gt;
&lt;br /&gt;
{{cmd|# apk add xf86-input-mouse xf86-input-keyboard}}&lt;br /&gt;
&lt;br /&gt;
And for touchpad tapping support on many laptops, also:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|# apk add xf86-input-synaptics}}&lt;br /&gt;
&lt;br /&gt;
==== Configure xorg-server (optional) ====&lt;br /&gt;
&lt;br /&gt;
On most systems, xorg should be able to autodetect all devices. However you can still configure xorg-server by hand by launching:&lt;br /&gt;
{{Cmd|# Xorg -configure}}&lt;br /&gt;
This will create a `/root/xorg.conf.new` file. You can modify this file to fit your needs.&amp;lt;BR&amp;gt;&lt;br /&gt;
(When finished modifying and testing the above configuration file, move it to `/etc/X11/xorg.conf` for normal usage.)&lt;br /&gt;
&lt;br /&gt;
==== Keyboard Layout (optional) ====&lt;br /&gt;
&lt;br /&gt;
If you use a keyboard layout different than &amp;quot;us&amp;quot;, and you are using a window manager or desktop environment that does not support to configure the keyboard layout itself, then you need to&lt;br /&gt;
&lt;br /&gt;
* [[Repositories#Enabling_the_community_repository|Enable the &amp;quot;community&amp;quot; repository]]&lt;br /&gt;
&lt;br /&gt;
and install setxkbmap:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|# apk add setxkbmap}}&lt;br /&gt;
&lt;br /&gt;
Then try&lt;br /&gt;
 # setxkbmap &amp;lt;%a language layout from /usr/share/X11/xkb/rules/xorg.lst%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to make it persistent add this section to /etc/X11/xorg.conf:&lt;br /&gt;
{{Cmd|Section &amp;quot;InputClass&amp;quot;&lt;br /&gt;
	Identifier	&amp;quot;Keyboard Default&amp;quot;&lt;br /&gt;
	MatchIsKeyboard	&amp;quot;yes&amp;quot;&lt;br /&gt;
	Option		&amp;quot;XkbLayout&amp;quot; &amp;quot;&amp;lt;%a language layout from /usr/share/X11/xkb/rules/xorg.lst%&amp;gt;&amp;quot;&lt;br /&gt;
EndSection&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to change the keymap when logging into X is to use ~/.xinitrc.  The following example loads a British keymap, simply add this line to the beginning of the file:&lt;br /&gt;
&amp;lt;code&amp;gt;setxkbmap gb &amp;amp;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you need to create the ~/.xinitrc file, you may also want to add a second line like &amp;lt;code&amp;gt;exec openbox-session&amp;lt;/code&amp;gt; to still start the window manager with &amp;lt;code&amp;gt;startx&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;xinit&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Documentation needed ==&lt;br /&gt;
&lt;br /&gt;
=== setup-xen-dom0 ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&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;
&amp;lt;br&amp;gt;&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;
= See also =&lt;br /&gt;
* [[Installation]]&lt;br /&gt;
* [[Installation#Post-Install|Post Install]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;/div&gt;</summary>
		<author><name>Mikep</name></author>
	</entry>
</feed>