Alpine setup scripts: Difference between revisions

From Alpine Linux
m (→‎setup-disk: reword -L switch)
(added heading and content setup-wayland-base)
 
(188 intermediate revisions by 32 users not shown)
Line 1: Line 1:
{{Draft}}
Feature descriptions for available Alpine Linux setup scripts ({{Path|/sbin/setup-*}}).


This page summarizes the low-level behavior of the {{Path|/sbin/setup-*}} scripts on the Alpine ISO (and in a normal Alpine install).
These scripts can be installed by using <code>apk</code> to install the <code>alpine-conf</code> package.
 
If you don't have an Alpine Linux install, you can find and examine the scripts in their [https://github.com/alpinelinux/alpine-conf git repository].


== setup-alpine ==
== setup-alpine ==


For a higher-level walkthrough (using the "sys" installmode), see [[Install to disk|Basic HDD install]].
This is the main Alpine configuration and installation script.
 
This script accepts the following command-line switches (you can run <code>setup-alpine -h</code> to see a usage message).


{{Gloss|-a|Create an overlay file: this creates a temporary directory and saves its location in ROOT; however, the script doesn't export this variable so I think this feature isn't currently functional.}}
The script interactively walks the user through executing several auxiliary <code>setup-*</code> scripts, in the order shown below.
;-c <i>answerfile</i>
:Create a new "answerfile", with default choices. You can edit the file and then invoke <code>setup-alpine -f <i>answerfile</i></code>.
;-f <i>answerfile</i>
:Use an existing "answerfile", which may override some or all of the interactive prompts.
{{Gloss|-q|Run in "quick mode." See below for details.}}


The script's behavior is to do the following, in order. Bracketed options represent extra configuration choices that can be supplied when running the auxiliary setup scripts manually, or by supplying an "answerfile".
The bracketed options represent example configuration choices, formatted as they may be supplied when manually calling the auxiliary setup scripts, or using a <code>setup-alpine</code> "answerfile" (see below).


# <code>setup-keymap</code> [us us]
# <code>setup-keymap</code> [us us]
# <code>setup-hostname</code> [-n alpine-test]
# [[#setup-hostname|setup-hostname]] [-n alpine-test]
# [[#setup-interfaces|setup-interfaces]] [-i < interfaces-file]
# [[#setup-interfaces|setup-interfaces]] [-i < interfaces-file]
# <code>/etc/init.d/networking --quiet start &</code>
# <code>rc-service networking --quiet start &</code>
# if none of the networking interfaces were configured using dhcp, then: <code>setup-dns</code> [-d example.com -n "8.8.8.8 [...]"]
# if none of the networking interfaces were configured using dhcp, then: <code>[[#setup-dns|setup-dns]]</code> [-d example.com -n "192.168.0.1 [...]"]
# set the root password
# set the root password
# if not in quick mode, then: [[#setup-timezone|setup-timezone]] [-z UTC | -z America/New_York | -p EST+5]
# if not in quick mode, then: <code>[[#setup-timezone|setup-timezone]]</code> [-z UTC | -z America/New_York | -p EST+5]
# enable the new hostname (<code>/etc/init.d/hostname --quiet restart</code>)
# enable the new hostname (<code>rc-service hostname --quiet restart</code>)
# add <code>networking</code> and <code>urandom</code> to the '''boot''' rc level, and <code>acpid</code> and <code>cron</code> to the '''default''' rc level, and start the '''boot''' and '''default''' rc services
# add <code>networking</code> and <code>seedrng</code> (also referred to as <code>urandom</code> in versions prior to OpenRC 0.45) to the '''boot''' rc level, and <code>acpid</code> and <code>crond</code> to the '''default''' rc level, and start the '''boot''' and '''default''' rc services
# extract the fully-qualified domain name and hostname from {{Path|/etc/resolv.conf}} and <code>hostname</code>, and update {{Path|/etc/hosts}}
# extract the fully-qualified domain name and hostname from {{Path|/etc/resolv.conf}} and <code>hostname</code>, and update {{Path|/etc/hosts}}
# <code>[[#setup-proxy|setup-proxy]]</code> [-q <nowiki>"http://webproxy:8080"</nowiki>], and activate proxy if it was configured
# <code>setup-apkrepos</code> [-r (to select a mirror randomly)]
# <code>setup-apkrepos</code> [-r (to select a mirror randomly)]
# if not in quick mode, then: <code>setup-sshd</code> [-c openssh | dropbear | none]
# [[#setup-user|setup-user]]
# if not in quick mode, then: <code>setup-ntp</code> [-c chrony | openntpd | none]
# if not in quick mode, then: <code>[[#setup-sshd|setup-sshd]]</code> [-c openssh | dropbear | none]
# if not in quick mode, then: <code>DEFAULT_DISK=none</code> [[#setup-disk|setup-disk]] <code>-q</code> [-m data /dev/sda]
# if not in quick mode, then: <code>setup-ntp</code> [-c chrony | openntpd | busybox | none]
# if installation mode selected during setup-disk was "data" instead of "sys", then: <code>setup-lbu</code> [/media/sdb1]
# if not in quick mode, then: <code>DEFAULT_DISK=none</code> <code>[[#setup-disk|setup-disk]]</code> <code>-q</code> [-m data /dev/sda] (see [[Installation#Installation_Overview]] about the disk modes)
# if installation mode selected during setup-disk was "data" instead of "sys", then: <code>setup-apkcache</code> [/media/sdb1/cache | none]
# if installation mode selected during setup-disk was "data" instead of "sys", then: <code>setup-lbu</code> [{{Path|/media/sdb1}}]
# if installation mode selected during setup-disk was "data" instead of "sys", then: <code>setup-apkcache</code> [{{Path|/media/sdb1/cache}} | none]
 
 
<code>setup-alpine</code> itself accepts the following command-line switches:
 
{{Define|-h|Shows the up-to-date usage help message.}}
 
{{Define|-a|Create an overlay file: this creates a temporary directory and saves its location in ROOT; however, the script doesn't export this variable so I think this feature isn't currently functional.}}
;-c <var>answerfile</var>
:Create a new answerfile with default choices. You can edit the file and then invoke <code>setup-alpine -f <var>answerfile</var></code>.
;-f <var>answerfile</var>
: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 <code>setup-alpine</code> 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.
{{Define|-q|Run in "quick mode".}}
 
<br>
 
== setup-hostname ==
 
:<code>setup-hostname</code> [-h] [-n hostname]
 
Options:
 
'''-h''' <var>Show help</var>
 
'''-n''' <var>Specify hostname</var>
 
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 '-' or is too long).
The script can be invoked manually or is called as part of the <code>setup-alpine</code> script.
 
<br>


== setup-interfaces ==
== setup-interfaces ==
:<code>setup-interfaces</code> [-i < interfaces-file]
{{Cmd|setup-interfaces [-i &lt; <var>interfaces-file</var>]}}
 
Note that the contents of <var>interfaces-file</var> 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:
 
{{Cat|/etc/network/interfaces|auto lo
iface lo inet loopback
 
auto eth0
iface eth0 inet dhcp
    hostname alpine-test
}}
 
== setup-dns ==
 
:<code>setup-dns</code> [-h] [-d domain name] [-n name server]
 
Options:
 
'''-h''' <var>Show help</var>
 
'''-d''' <var>specify search domain name</var>
 
'''-n''' <var>name server IP</var>
 
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 <code>setup-dns</code> will allow interactive use of the script, or the options can be specified.
 
The information fed to this script is written to {{Path|/etc/resolv.conf}}
 
Example usage (with 192.168.0.1 being the local router/dns-forwarder): {{Cmd|setup-dns -d example.org -n 192.168.0.1}}
 
Example {{Path|/etc/resolv.conf}}:
 
{{Cat|/etc/resolv.conf|search example.org
nameserver 192.168.0.1
}}


An interfaces file has the format of {{Path|/etc/network/interfaces}}, such as:
It can be run manually but is also invoked in the <code>setup-alpine</code> script unless interfaces are configured for DHCP.


auto lo
<br>
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
    hostname alpine-test


== setup-timezone ==
== setup-timezone ==
:<code>setup-timezone</code> [-z UTC | -z America/New_York | -p EST+5]
:<code>setup-timezone</code> [-z UTC | -z America/New_York | -p EST+5]


Can pre-select the timezone using either of these switches:
Can pre-select the timezone using either of these switches:


* '''-z''' <i>subfolder of</i> {{Path|/usr/share/zoneinfo}}
'''-z''' <var>subfolder of</var> {{Path|/usr/share/zoneinfo}}
* '''-p''' <i>POSIX TZ format</i>
 
'''-p''' <var>POSIX TZ format</var>


== setup-disk ==
To manually change the time-zone, see [[Setting the timezone]].
 
== setup-proxy ==
 
:<code>setup-proxy</code> [-hq] [PROXYURL]
 
Options:
 
'''-h''' <var>Show help</var>
 
'''-q''' <var>Quiet mode</var> prevents changes from taking effect until after reboot
 
This script requests the system proxy to use in the form <code>http://<proxyurl>:<port></code> for example:
<code><nowiki>http://10.0.0.1:8080</nowiki></code>
 
To set no system proxy use <code>none</code>.
This script exports the following environmental variables:
 
<code>http_proxy=$proxyurl</code>
 
<code>https_proxy=$proxyurl</code>
 
<code>ftp_proxy=$proxyurl</code>
 
where <code>$proxyurl</code> is the value input. 
If <code>none</code> was chosen then the value it is set to a blank value (and so no proxy is used).
 
<br>
 
== setup-apkrepos ==
 
:<code>setup-apkrepos</code> [-fhr] [REPO...]
 
Setup <code>apk</code> repositories.
 
options:
 
'''-c'''  <var>Enable the community repo</var>
 
'''-f'''  <var>Detect and add fastest mirror</var>
 
'''-h'''  <var>Show help</var>
 
'''-r'''  <var>Add a random mirror and do not prompt</var>
 
'''-1'''  <var>Add first mirror on the list (normally a CDN)</var>
 
This is run as part of the <code>setup-alpine</code> script.
 
<br>
 
== setup-user ==
 
:<code>setup-user</code> [-h] [-a] [-u] [-f FULLNAME] [-g GROUPS] [-k SSHKEY] [USERNAME]


:<code>DEFAULT_DISK=none setup-disk -q</code> [-m data | sys] [<i>mountpoint directory</i> | /dev/sda ...]
Options:


This script accepts the following command-line switches:
'''-h''' <var>Show help</var>


;-k <i>kernel flavor</i>
'''-a''' <var>Create admin user. Add to wheel group and setup doas.</var>
;-o <i>apkovl file</i>
:Restore system from <i>apkovl file</i>
;-m data | sys
:Don't prompt for installation mode. With '''-m data''', the supplied devices are formatted using ext4 to use as a {{Path|/var}} volume.
{{Gloss|-r|Use RAID1 with a single disk (degraded mode)}}
{{Gloss|-L|Create and use volumes in a LVM group}}
;-s <i>swap size in MB</i>
:Use 0 to disable swap
{{Gloss|-q|Exit quietly if no disks are found}}
{{Gloss|-v|Verbose mode}}


The script also honors the following environment variables:
'''-u''' <var>Unlock the user automatically (eg. create the user non-interactively with an ssh key for login)</var>


<code>BOOT_SIZE</code>
'''-f''' <var>Set the full name for the user</var>
:Size of the boot partition in MB; defaults to 100. Only used if '''-m sys''' is specified or interactively selected.


<code>SWAP_SIZE</code>
'''-g''' <var>Comma or space separated list of groups to add user to</var>
: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't be more than 1/3 the size of the smallest disk, and if less than 64 will just be 0. Only used if '''-m sys''' is specified or interactively selected.


<code>ROOTFS</code>
'''-k''' <var>ssh key or URL to ssh key (eg. https://gitlab.alpinelinux.org/user.keys) or <code>none</code> for no key</var>
:Filesystem to use for the / volume; defaults to ext4. Only used if '''-m sys''' is specified or interactively selected. Supported filesystems are: ext2 ext3 ext4 btrfs.


<code>BOOTFS</code>
If USERNAME is not specified user will be prompted.
:Filesystem to use for the /boot volume; defaults to ext4. Only used if '''-m sys''' is specified or interactively selected. Supported filesystems are: ext2 ext3 ext4 btrfs.
<!-- VARFS -->


<code>MBR</code>
The setup-user script is stored in {{Path|/sbin/setup-user}} and allows quick and simple setup of user accounts.
:Path of MBR binary code, defaults to {{Path|/usr/share/syslinux/mbr.bin}}.
It can be run manually but is also invoked in the <code>setup-alpine</code> script.


<!-- Writes to /tmp/ovlfiles, /tmp/alpine-install-diskmode.out, and /tmp/sfdisk.out but that never seems to be used elsewhere. -->
<br>


== setup-sshd ==


=== Partitioning ===
:<code>setup-sshd</code> [-h] [-c choice of SSH daemon]


If you have complex partitioning needs, you can partition, format, and mount your volumes manually, then just supply the root mountpoint to <code>setup-disk</code>. Doing so implicitly behaves as though '''-m sys''' had also been specified.
Options:


'''-h''' <var>Show help</var>


==== RAID ====
'''-c''' <var>SSH daemon</var> where SSH daemon can be one of the following:
<code>setup-disk</code> will automatically build a RAID array if you supply the '''-r''' switch, or if you specify more than one device. The array will always be RAID1 (and --metadata=0.90) for the /boot volumes, but will be RAID5 for non-boot volumes when 3 or more devices are supplied.


If you instead want to build your RAID array manually, see [[Setting up a software raid1 array]]. Then format and mount the disks, and supply the root mountpoint to <code>setup-disk</code>.
<code>openssh</code> install the {{Pkg|openSSH}} daemon


==== LVM ====
<code>dropbear</code> install the {{Pkg|dropbear}} daemon
<code>setup-disk</code> will automatically build and use volumes in a LVM group if you supply the '''-L''' switch. The group and volumes created by the script will have the following names:


* volume group: '''vg0'''
<code>none</code> Do not install an SSH daemon
* swap volume: '''lv_swap''' (only created when swap size > 0)
* root volume: '''lv_root''' (only created when '''-m sys''' is specified or interactively selected)
* var volume: '''lv_var''' (only created when '''-m data''' is specified or interactively selected); also these volumes are currently always formatted as ext4.


The '''lv_var''' or '''lv_root''' volumes are created to occupy all remaining space in the volume group.
Example usage: {{Cmd|setup-sshd -c dropbear}}


If you need to change any of these settings, you can use <code>vgrename</code>, <code>lvrename</code>, <code>lvreduce</code> or <code>lvresize</code>.
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 & client.
It can be run manually but is also invoked in the <code>setup-alpine</code> script.


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 <code>setup-disk</code>.
<br>


== setup-ntp ==


<!--
''From [https://en.wikipedia.org/wiki/Network_Time_Protocol Wikipedia]'':
=Setup-Disk Usage=


usage: setup-disk [-hqr] [-k kernelflavor] [-m MODE] [-o apkovl] [-s SWAPSIZE]
The '''Network Time Protocol (NTP)''' is a networking protocol for clock synchronization between computer systems over packet-switched, variable-latency data networks.  
  [MOUNTPOINT | DISKDEV...]


Install alpine on harddisk.
<br>


If MOUNTPOINT is specified, then do a traditional disk install with MOUNTPOINT
{{Cmd|usage: setup-ntp [-h] [busybox{{!}}openntpd{{!}}chrony{{!}}none]
as root.


If DISKDEV is specified, then use the specified disk(s) without asking. If
Setup NTP time synchronization
multiple disks are specified then set them up in a RAID array. If there are
mode than 2 disks, then use raid level 5 instead of raid level 1.


options:
options:
  -h  Show this help
  -h  Show this help
-m  Use disk for MODE without asking, where MODE is either 'data' or 'root'
-o  Restore system from given apkovl file
-k  Use kernelflavor instead of $KERNEL_FLAVOR
-L  Use LVM to manage partitions
-q  Exit quietly if no disks are found
-r  Enable software raid1 with single disk
-s  Use SWAPSIZE MB instead of $SWAP_SIZE MB for swap (Use 0 to disable swap)
-v  Be more verbose about what is happening


User is prompted if no NTP daemon is specified}}
<code>setup-ntp</code> script is stored in {{Path|/sbin/setup-ntp}} and allows quick and simple setup of the NTP client,
It can be run manually but is also invoked in the <code>setup-alpine</code> script.
<br>
== setup-disk ==


==Disk Install Styles==
:<code>DEFAULT_DISK=none setup-disk -q</code> [-m data | sys] [<var>mountpoint directory</var> | {{Path|/dev/sda}} ...]


You can select between 'sys' or 'data'.
In "sys" mode, it's an installer, it permanently installs Alpine Linux on the disk, in "data" mode, it provides a larger and persistent {{Path|/var}} volume.


sys:
This script accepts the following command-line switches:
  This mode is a traditional disk install. The following partitions will be
  created on the disk: /boot, / (filesystem root) and swap.
   
  This mode may be used for development boxes, desktops, virtual servers, etc.


data:
;-k <var>kernel flavor</var>
  This mode uses your disk(s) for data storage, not for the operating system.
;-o <var>apkovl file</var>
  The system itself will run from tmpfs (RAM).
:Restore system from <var>apkovl file</var>
;-m data | sys
:Don't prompt for installation mode. With '''-m data''', the supplied devices are formatted to use as a {{Path|/var}} volume.
{{Define|-r|Use RAID1 with a single disk (degraded mode)}}
{{Define|-L|Create and use volumes in a LVM group}}
;-s <var>swap size in MB</var>
:Use 0 to disable swap
{{Define|-q|Exit quietly if no disks are found}}
{{Define|-v|Verbose mode}}


  Use this mode if you only want to use the disk(s) for a mailspool, databases,
The script honors the following [[#Environment Variables|environment variables]]:
  logs, etc.


none:
=== Environment Variables ===
  Run without installing to disk.


-->
The following environment variables can be combined and used.


<!--
If <code>BOOTLOADER</code> is specified, the specified bootloader will be used.
Create partition with with type "Linux" (83).
If no bootloader is specified, the default bootloader is syslinux(extlinux)
apk_add e2fsprogs rsync
except when EFI is detected or explicitly set by <code>USE_EFI</code> which will select grub.
mkfs.ext3 /dev/hda1
Supported bootloaders are: grub, syslinux
mount -t ext3 /dev/hda1 /mnt
ROOT=/mnt apk_add uclibc busybox apk-tools alpine-baselayout alpine-conf
# Install busybox links
mkdir /mnt/proc && mount --bind /proc /mnt/proc && chroot /mnt /bin/busybox --install -s && umount /mnt/proc
# Copy the apk repository
rsync -ruav /media/cdrom/apks /mnt
mkdir /mnt/etc/apk && echo "APK_PATH=file://apks" > /mnt/etc/apk/apk.conf
# Copy the hd/ext3 initramfs image, kernel and kernel modules
rsync -ruav /media/cdrom/kernel/generic/hd-ext3.gz /media/cdrom/kernel/generic/bzImage /mnt
rsync -ruav /lib/modules/* /mnt/lib/modules/
-->


== setup-bootable ==
If <code>KERNELOPTS</code> is specified, it will be appended to the kernel boot parameters.
This is a standalone script; it's not invoked by <code>setup-alpine</code> but must be run manually.
Default is: quiet
 
If <code>DISKLABEL</code> is specified, the specified partition label will be used.
if no partition label is specified, the default label will be dos
except when EFI is detected or explicitly set by <code>USE_EFI</code> which will select gpt.
Supported partition labels are: dos, gpt
 
If <code>BOOTFS</code>, <code>ROOTFS</code>, <code>VARFS</code> are specified, then format a partition with specified filesystem. If not specified, the default filesystem is ext4. <code>VARFS</code> is used, only if '''-m data''' is specified or interactively selected whereas <code>BOOTFS</code> and <code>ROOTFS</code> are used only if '''-m sys''' is specified or interactively selected.
 
Supported filesystems for
  boot: ext2, ext3, ext4, btrfs, xfs, vfat(EFI)
  root: ext2, ext3, ext4, btrfs, xfs
  var : ext2, ext3, ext4, btrfs, xfs
 
If <code>BOOT_SIZE</code> is specified, sets the size of the boot partition in MB; defaults to 100. Only used if '''-m sys''' is specified or interactively selected.
 
If <code>SWAP_SIZE</code> is specified, sets the 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't be more than 1/3 the size of the smallest disk, and if less than 64 will just be 0. Only used if '''-m sys''' is specified or interactively selected.
 
If <code>SYSROOT</code> is specified, sets the Mountpoint to use when creating volumes and doing traditional disk install ('''-m sys'''). Defaults to {{Path|/mnt}}.
 
If <code>MBR</code> is specified, sets the Path of MBR binary code, defaults to {{Path|/usr/share/syslinux/mbr.bin}}.
 
<!-- Writes to /tmp/ovlfiles, /tmp/alpine-install-diskmode.out, and /tmp/sfdisk.out but that never seems to be used elsewhere. -->
=== Partitioning ===
{{Main|Setting up disks manually}}
If you have complex partitioning needs, that go beyond [[#Environment Variables|environment variables]] for <code>setup-alpine</code>, you can partition, format, and mount your volumes manually, and then just supply the root mountpoint to <code>setup-disk</code>. Doing so implicitly behaves as though '''-m sys''' had also been specified.
 
==== RAID ====
<code>setup-disk</code> will automatically build a RAID array if you supply the '''-r''' 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 {{Path|/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.


Its purpose is to create media that boots into tmpfs by copying the contents of an ISO onto a USB key, CF, or similar media.
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 <code>setup-disk</code>.


For a higher-level walkthrough, see [[Installing_Alpine_on_USB#Creating_a_bootable_Alpine_Linux_USB_Stick_from_the_command_line|Creating a bootable Alpine Linux USB Stick from the command line]].
==== LVM ====
<code>setup-disk</code> will automatically build and use volumes in a LVM group if you supply the '''-L''' switch. The group and volumes created by the script will have the following names:


This script accepts the following arguments and command-line switches (you can run <code>setup-bootable -h</code> to see a usage message).
* volume group: '''vg0'''
* swap volume: '''lv_swap''' (only created when swap size > 0)
* root volume: '''lv_root''' (only created when '''-m sys''' is specified or interactively selected)
* var volume: '''lv_var''' (only created when '''-m data''' is specified or interactively selected)


:<code>setup-bootable <i>source</i></code> [<i>dest</i>]
The '''lv_var''' or '''lv_root''' volumes are created to occupy all remaining space in the volume group.


The argument <i>source</i> can be a directory or an ISO (will be mounted to <code>MNT</code> or {{Path|/mnt}}) or a URL (will be downloaded with <code>WGET</code> or <code>wget</code>). The argument <i>dest</i> can be a directory mountpoint, or will default to {{Path|/media/usb}} if not supplied.
If you need to change any of these settings, you can use <code>vgrename</code>, <code>lvrename</code>, <code>lvreduce</code> or <code>lvresize</code>.


{{Gloss|-k|Keep alpine_dev in {{Path|syslinux.cfg}}; otherwise, replace with UUID.}}
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 <code>setup-disk</code>.
{{Gloss|-u|Upgrade mode: keep existing {{Path|syslinux.cfg}} and don't run <code>syslinux</code>}}
{{Gloss|-f|Overwrite {{Path|syslinux.cfg}} even if '''-u''' was specified.}}
{{Gloss|-s|Force the running of <code>syslinux</code> even if '''-u''' was specified.}}
{{Gloss|-v|Verbose mode}}


The script will ensure that <i>source</i> and <i>dest</i> are available; will copy the contents of <i>source</i> to <i>dest</i>, ensuring first that there's enough space; and unless '''-u''' was specified, will make <i>dest</i> bootable.
<br>


== setup-lbu ==


<!--
This script will only be invoked for by <code>setup-alpine</code> when installing <code>data</code> installation types (ramdisk)
== Setting up the RAID ==
Set up a raid array as described [[Setting up a software raid1 array|here]].
In this document two raid arrays are configured: md0 for swap (512MB) and md1 for /var.


== Create filesystem ==
It configures where <code>lbu commit</code> will store the .apkovl backup. See [[Alpine local backup]] for more information.
We need to install the software to create the filesystem ("format" the partition).
apk_add e2fsprogs


If you use an Alpine release older than 1.3.8 you will need to manually create a link to /etc/mtab.
When started, <code>setup-lbu</code> will prompt where to store your data. The options it will prompt for will be taken from the directories found in <code>/media</code> (except for <code>cdrom</code>). [not sure how these are mounted: are they automatically mounted by setup-lbu? Does the user have to manually mount using another tty?]
ln -fs /proc/mounts /etc/mtab


Create the filesystem. The -j option makes it ext'''3'''. Without the -j option it will become non-journaling ext'''2'''. This step might take some time if your partition is big.
<br>
mke2fs -j /dev/md1


== setup-apkcache ==


Now edit /etc/fstab and add your new partitions. Mine looks like this:
This script will only be invoked for by <code>setup-alpine</code> when installing <code>data</code> installation types (ramdisk)
none            /proc          proc    defaults 0 0
none            /sys            sysfs  defaults 0 0
udev            /dev            tmpfs  size=100k 0 0
none            /dev/pts        devpts  defaults 0 0
tmpfs          /dev/shm        tmpfs  defaults 0 0
/dev/cdrom      /media/cdrom    iso9660 ro 0 0
/dev/fd0        /media/floppy  vfat    noauto  0 0
/dev/usba1      /media/usb      vfat    noauto  0 0
none            /proc/bus/usb  usbfs noauto 0 0
 
/dev/md0        swap            swap    defaults 0 0
/dev/md1        /var            ext3    defaults 0 0


== Move the data ==
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't have to depend on the network. See [[Local APK cache]] for a detailed explanation.
Now you should stop all services running that put anything in /var (syslog for example). If you have booted on a clean installation and not run setup-alpine, then no services should be running. However, some packages might have created dirs in /var so we need to backup /var mount the new and move all backed up dirs back to the raided /var.


mv /var /var.tmp
You should be able to use a partition that you set up in the previous steps.
mkdir /var
mount /var
mv /var.tmp/* /var
rmdir /var.tmp


Verify that everyting looks ok with the ''df'' utility.
<br>
~ $ df
Filesystem          1k-blocks      Used Available Use% Mounted on
none                    255172    23544    231628  9% /
udev                      100        0      100  0% /dev
/dev/cdrom              142276    142276        0 100% /media/cdrom
/dev/md1              37977060    181056  35866876  1% /var


== Survive reboots ==
== setup-bootable ==
Now we have everything up and running. We need to make sure that everything will be restored during next reboot.
This is a standalone script; it's not invoked by <code>setup-alpine</code> but must be run manually.


Create an initscript that will mount /var for you during boot. I call it /etc/init.d/mountdisk and it looks like this:
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).
#!/sbin/runscript
start() {
        ebegin "Mounting /var"
        mount /var
        eend $?
}
stop() {
        ebegin "Unmounting /var"
        umount /var
        eend $?
}


Make it exectutable:
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.
chmod +x /etc/init.d/mountdisk


'''NOTE:''' Since Alpine-1.7.3 there is a ''localmount'' script shipped so you will not need to create your own ''mountdisk'' script.
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 <code>setup-bootable</code> only with the <code>-u</code> 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.


And that /var is mounted *after* raid is created. The -k option will make alpine to unmount the /Var partition during boot. Also add start of swap too boot
{{Tip| The [[Bootloaders]] page shows different ways to setup booting, and multi-boot menus!}}  
rc_add -k -s 06 mountdisk
  rc_add -k -s 06 swap


The /dev/md* device nodes will not be created automatically so we need to put the on floppy too.
The setup-bootable script accepts the following arguments and command-line switches (you can run <code>setup-bootable -h</code> to see a usage message).
lbu include /dev/md*


If you have users on the server and want /home to be permanent, you can create a directory /var/home and create links to /var/home.
{{Cmd|setup-bootable <var>source</var> [<var>dest</var>]}}
mkdir /var/home
mv /home/* /var/home/
ln -s /var/home/* /home/


'''NOTE:''' You cannot just replace /home with a link that points to /var/home since the base has a /home directory. When the boot tries to copy the config from floppy it will fail because of the already existing /home directory.
The argument <var>source</var> can be a directory or an ISO (will be mounted to <code>MNT</code> or {{Path|/mnt}}) or a URL (will be downloaded with <code>WGET</code> or <code>wget</code>). The argument <var>dest</var> can be a directory mountpoint, or will default to {{Path|/media/usb}} if not supplied.


Make sure the links are stored to floppy:
{{Define|-k|Keep alpine_dev in {{Path|syslinux.cfg}}; otherwise, replace with UUID.}}
lbu include /home/*
{{Define|-u|Upgrade mode: keep existing {{Path|syslinux.cfg}} and don't run <code>syslinux</code>}}
{{Define|-f|Overwrite {{Path|syslinux.cfg}} even if '''-u''' was specified.}}
{{Define|-s|Force the running of <code>syslinux</code> even if '''-u''' was specified.}}
{{Define|-v|Verbose mode}}


Also remember to move any newly created users to /var/home and create a link:
The script will ensure that <var>source</var> and <var>dest</var> are available; will copy the contents of <var>source</var> to <var>dest</var>, ensuring first that there's enough space; and unless '''-u''' was specified, will make <var>dest</var> bootable.
adduser bob
mv /home/bob /var/home/
ln -s /var/home/bob /home/bob
lbu include /home/bob


Save to floppy:
Suppose the target device is {{Path|/dev/sdXY}}, then this partition can be prepared for booting with
lbu commit floppy
{{Cmd|# setup-bootable -v /media/<installation-media-device> /dev/sdXY
}}


== Test it works ==
For the manual way to set up boot media see [[Create_a_Bootable_Device#Manually_copying_Alpine_files|Manually_copying_Alpine_files]].
Reboot computer. Now should the raid start and /var should be mounted. Check with df:
~ $ df
Filesystem          1k-blocks      Used Available Use% Mounted on
none                    255172    23976    231196  9% /
mdev                      100        0      100  0% /dev
/dev/cdrom              140932    140932        0 100% /media/cdrom
/dev/md1              37977060    180984  35866948  1% /var


== Upgrades ==
<br>
Since the package database is placed on disk, you cannot update by simply replacing the CDROM. You will have to either run the upgrade on the new CDROM or run ''apk_add -u ... && update-conf'' manually.
-->


== setup-cryptswap ==
== setup-xorg-base ==
{{Seealso|Xorg}}
This is a standalone script; it's not invoked by <code>setup-alpine</code> but must be run manually.
This is a standalone script; it's not invoked by <code>setup-alpine</code> but must be run manually.


:<code>setup-cryptswap</code> [<i>partition</i> | none]
It configures a graphical environment, installing basic Xorg packages and [[eudev]] (replacing [[mdev]]), and is also required for Wayland sessions, if Xwayland is used.


<!--
The script installs, among other packages, e.g.: <code>xorg-server xf86-input-libinput xinit eudev</code>.
create partition with type "linux swap" (82)
mkswap /dev/sda2
echo -e "/dev/sda2 none swap sw 0 0" >> /mnt/etc/fstab
swapon /dev/sda2
free # shows how much swapspace


If you prefer maximum speed, you don't need configure any raid devices for swap. Just add 2 swap partitions on different disks and linux will stripe them automatically. The downside is that at the moment one disk fails, the system will go down. For better reliability, put swap on raid1.  
Additional packages to install may be supplied as arguments.
-->
{{cmd|setup-xorg-base [additional package(s) to install]}}


== setup-xorg-base ==
== setup-wayland-base ==
{{Seealso|Wayland}}
This is a standalone script; it's not invoked by <code>setup-alpine</code> but must be run manually.
This is a standalone script; it's not invoked by <code>setup-alpine</code> but must be run manually.


Installs the following packages: <code>xorg-server xf86-video-vesa xf86-input-evdev xf86-input-mouse xf86-input-keyboard udev</code>.
usage: setup-wayland-base [-h] [PKG..]
 
Set up system to use Wayland


Additional packages can be supplied as arguments to <code>setup-xorg-base</code>. You might need, for example, some of: <code>xf86-input-synaptics xf86-video-<em>something</em> xinit</code>.
options:
-h  Show this help


Installs the packages {{pkg|elogind}}, {{pkg|polkit-elogind}} and  {{pkg|eudev}}, enables community repository, enables the service for eudev and install the packages PKG if specified.
== setup-desktop ==
This script is used to set up a desktop environment. This is a replacement for the now-removed <code>alpine-desktop</code> package.
{{:Include:Setup-desktop}}


== Documentation needed ==
== Documentation needed ==


=== setup-gparted-desktop ===
=== setup-xen-dom0 ===
Uses openbox.


This is a standalone script; it's not invoked by <code>setup-alpine</code> but must be run manually.
<br>


=== setup-mta ===
=== setup-mta ===
Line 350: Line 406:
This is a standalone script; it's not invoked by <code>setup-alpine</code> but must be run manually.
This is a standalone script; it's not invoked by <code>setup-alpine</code> but must be run manually.


=== setup-alpine-web ===
<br>
This is a standalone script; it's not invoked by <code>setup-alpine</code> but must be run manually.


=== setup-acf ===
=== setup-acf ===
:<code>setup-acf</code> [-ahn] [-e email] [-l address] [PACKAGE...]
Options:
'''-a''' <var>Which acf-* packages to install</var>
'''-h''' <var>Show help</var>
'''-n''' <var>Don't create {{path|/etc/acf/passwd}}</var>
'''-e''' <var>email address (for TLS certificate)</var>
'''-l''' <var>hostname for mini_httpd</var> 
This is a standalone script; it's not invoked by <code>setup-alpine</code> but must be run manually.
This is a standalone script; it's not invoked by <code>setup-alpine</code> but must be run manually.


=== setup-ads ===
This script was named <code>setup-webconf</code> before Alpine 1.9 beta 4.
This is a standalone script; it's not invoked by <code>setup-alpine</code> but must be run manually.
 
See [[:Category:ACF|ACF pages]] for more information.
 
= See also =
* [[Installation]]
* [[Installation#Post-Install|Post Install]]
 
[[Category:Installation]]

Latest revision as of 06:41, 22 November 2024

Feature descriptions for available Alpine Linux setup scripts (/sbin/setup-*).

These scripts can be installed by using apk to install the alpine-conf package.

If you don't have an Alpine Linux install, you can find and examine the scripts in their git repository.

setup-alpine

This is the main Alpine configuration and installation script.

The script interactively walks the user through executing several auxiliary setup-* scripts, in the order shown below.

The bracketed options represent example configuration choices, formatted as they may be supplied when manually calling the auxiliary setup scripts, or using a setup-alpine "answerfile" (see below).

  1. setup-keymap [us us]
  2. setup-hostname [-n alpine-test]
  3. setup-interfaces [-i < interfaces-file]
  4. rc-service networking --quiet start &
  5. if none of the networking interfaces were configured using dhcp, then: setup-dns [-d example.com -n "192.168.0.1 [...]"]
  6. set the root password
  7. if not in quick mode, then: setup-timezone [-z UTC | -z America/New_York | -p EST+5]
  8. enable the new hostname (rc-service hostname --quiet restart)
  9. add networking and seedrng (also referred to as urandom in versions prior to OpenRC 0.45) to the boot rc level, and acpid and crond to the default rc level, and start the boot and default rc services
  10. extract the fully-qualified domain name and hostname from /etc/resolv.conf and hostname, and update /etc/hosts
  11. setup-proxy [-q "http://webproxy:8080"], and activate proxy if it was configured
  12. setup-apkrepos [-r (to select a mirror randomly)]
  13. setup-user
  14. if not in quick mode, then: setup-sshd [-c openssh | dropbear | none]
  15. if not in quick mode, then: setup-ntp [-c chrony | openntpd | busybox | none]
  16. if not in quick mode, then: DEFAULT_DISK=none setup-disk -q [-m data /dev/sda] (see Installation#Installation_Overview about the disk modes)
  17. if installation mode selected during setup-disk was "data" instead of "sys", then: setup-lbu [/media/sdb1]
  18. if installation mode selected during setup-disk was "data" instead of "sys", then: setup-apkcache [/media/sdb1/cache | none]


setup-alpine itself accepts the following command-line switches:

-h
Shows the up-to-date usage help message.

-a
Create an overlay file: this creates a temporary directory and saves its location in ROOT; however, the script doesn't export this variable so I think this feature isn't currently functional.

-c answerfile
Create a new answerfile with default choices. You can edit the file and then invoke setup-alpine -f answerfile.
-f answerfile
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 setup-alpine to download an answerfile from. Doing so will spin up a temporary networking config if one is not already active.

-q
Run in "quick mode".


setup-hostname

setup-hostname [-h] [-n hostname]

Options:

-h Show help

-n Specify hostname

This script allows quick and easy setup of the system hostname by writing it to /etc/hostname. The script prevents you from writing an invalid hostname (such as one that used invalid characters or starts with a '-' or is too long). The script can be invoked manually or is called as part of the setup-alpine script.


setup-interfaces

setup-interfaces [-i < interfaces-file]

Note that the contents of interfaces-file has to be supplied as stdin, rather than naming the file as an additional argument. The contents should have the format of /etc/network/interfaces, such as:

Contents of /etc/network/interfaces

auto lo iface lo inet loopback auto eth0 iface eth0 inet dhcp hostname alpine-test

setup-dns

setup-dns [-h] [-d domain name] [-n name server]

Options:

-h Show help

-d specify search domain name

-n name server IP

The setup-dns script is stored in /sbin/setup-dns and allows quick and simple setup of DNS servers (and a DNS search domain if required). Simply running setup-dns will allow interactive use of the script, or the options can be specified.

The information fed to this script is written to /etc/resolv.conf

Example usage (with 192.168.0.1 being the local router/dns-forwarder):

setup-dns -d example.org -n 192.168.0.1

Example /etc/resolv.conf:

Contents of /etc/resolv.conf

search example.org nameserver 192.168.0.1

It can be run manually but is also invoked in the setup-alpine script unless interfaces are configured for DHCP.


setup-timezone

setup-timezone [-z UTC | -z America/New_York | -p EST+5]

Can pre-select the timezone using either of these switches:

-z subfolder of /usr/share/zoneinfo

-p POSIX TZ format

To manually change the time-zone, see Setting the timezone.

setup-proxy

setup-proxy [-hq] [PROXYURL]

Options:

-h Show help

-q Quiet mode prevents changes from taking effect until after reboot

This script requests the system proxy to use in the form http://<proxyurl>:<port> for example: http://10.0.0.1:8080

To set no system proxy use none. This script exports the following environmental variables:

http_proxy=$proxyurl

https_proxy=$proxyurl

ftp_proxy=$proxyurl

where $proxyurl is the value input. If none was chosen then the value it is set to a blank value (and so no proxy is used).


setup-apkrepos

setup-apkrepos [-fhr] [REPO...]

Setup apk repositories.

options:

-c Enable the community repo

-f Detect and add fastest mirror

-h Show help

-r Add a random mirror and do not prompt

-1 Add first mirror on the list (normally a CDN)

This is run as part of the setup-alpine script.


setup-user

setup-user [-h] [-a] [-u] [-f FULLNAME] [-g GROUPS] [-k SSHKEY] [USERNAME]

Options:

-h Show help

-a Create admin user. Add to wheel group and setup doas.

-u Unlock the user automatically (eg. create the user non-interactively with an ssh key for login)

-f Set the full name for the user

-g Comma or space separated list of groups to add user to

-k ssh key or URL to ssh key (eg. https://gitlab.alpinelinux.org/user.keys) or none for no key

If USERNAME is not specified user will be prompted.

The setup-user script is stored in /sbin/setup-user and allows quick and simple setup of user accounts. It can be run manually but is also invoked in the setup-alpine script.


setup-sshd

setup-sshd [-h] [-c choice of SSH daemon]

Options:

-h Show help

-c SSH daemon where SSH daemon can be one of the following:

openssh install the openSSH daemon

dropbear install the dropbear daemon

none Do not install an SSH daemon

Example usage:

setup-sshd -c dropbear

The setup-sshd script is stored in /sbin/setup-sshd and allows quick and simple setup of either the OpenSSH or Dropbear SSH daemon & client. It can be run manually but is also invoked in the setup-alpine script.


setup-ntp

From Wikipedia:

The Network Time Protocol (NTP) is a networking protocol for clock synchronization between computer systems over packet-switched, variable-latency data networks.


usage: setup-ntp [-h] [busybox|openntpd|chrony|none] Setup NTP time synchronization options: -h Show this help User is prompted if no NTP daemon is specified

setup-ntp script is stored in /sbin/setup-ntp and allows quick and simple setup of the NTP client, It can be run manually but is also invoked in the setup-alpine script.


setup-disk

DEFAULT_DISK=none setup-disk -q [-m data | sys] [mountpoint directory | /dev/sda ...]

In "sys" mode, it's an installer, it permanently installs Alpine Linux on the disk, in "data" mode, it provides a larger and persistent /var volume.

This script accepts the following command-line switches:

-k kernel flavor
-o apkovl file
Restore system from apkovl file
-m data | sys
Don't prompt for installation mode. With -m data, the supplied devices are formatted to use as a /var volume.

-r
Use RAID1 with a single disk (degraded mode)

-L
Create and use volumes in a LVM group

-s swap size in MB
Use 0 to disable swap

-q
Exit quietly if no disks are found

-v
Verbose mode

The script honors the following environment variables:

Environment Variables

The following environment variables can be combined and used.

If BOOTLOADER is specified, the specified bootloader will be used. If no bootloader is specified, the default bootloader is syslinux(extlinux) except when EFI is detected or explicitly set by USE_EFI which will select grub. Supported bootloaders are: grub, syslinux

If KERNELOPTS is specified, it will be appended to the kernel boot parameters. Default is: quiet

If DISKLABEL is specified, the specified partition label will be used. if no partition label is specified, the default label will be dos except when EFI is detected or explicitly set by USE_EFI which will select gpt. Supported partition labels are: dos, gpt

If BOOTFS, ROOTFS, VARFS are specified, then format a partition with specified filesystem. If not specified, the default filesystem is ext4. VARFS is used, only if -m data is specified or interactively selected whereas BOOTFS and ROOTFS are used only if -m sys is specified or interactively selected.

Supported filesystems for

 boot: ext2, ext3, ext4, btrfs, xfs, vfat(EFI)
 root: ext2, ext3, ext4, btrfs, xfs
 var : ext2, ext3, ext4, btrfs, xfs

If BOOT_SIZE is specified, sets the size of the boot partition in MB; defaults to 100. Only used if -m sys is specified or interactively selected.

If SWAP_SIZE is specified, sets the 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't be more than 1/3 the size of the smallest disk, and if less than 64 will just be 0. Only used if -m sys is specified or interactively selected.

If SYSROOT is specified, sets the Mountpoint to use when creating volumes and doing traditional disk install (-m sys). Defaults to /mnt.

If MBR is specified, sets the Path of MBR binary code, defaults to /usr/share/syslinux/mbr.bin.

Partitioning

If you have complex partitioning needs, that go beyond environment variables for setup-alpine, you can partition, format, and mount your volumes manually, and then just supply the root mountpoint to setup-disk. Doing so implicitly behaves as though -m sys had also been specified.

RAID

setup-disk will automatically build a RAID array if you supply the -r switch, or if you specify more than one device. The array will always be RAID1 (and --metadata=0.90) for the /boot volumes, but will be RAID5 (and --metadata=1.2 for non-boot volumes when 3 or more devices are supplied.

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 setup-disk.

LVM

setup-disk will automatically build and use volumes in a LVM group if you supply the -L switch. The group and volumes created by the script will have the following names:

  • volume group: vg0
  • swap volume: lv_swap (only created when swap size > 0)
  • root volume: lv_root (only created when -m sys is specified or interactively selected)
  • var volume: lv_var (only created when -m data is specified or interactively selected)

The lv_var or lv_root volumes are created to occupy all remaining space in the volume group.

If you need to change any of these settings, you can use vgrename, lvrename, lvreduce or lvresize.

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 setup-disk.


setup-lbu

This script will only be invoked for by setup-alpine when installing data installation types (ramdisk)

It configures where lbu commit will store the .apkovl backup. See Alpine local backup for more information.

When started, setup-lbu will prompt where to store your data. The options it will prompt for will be taken from the directories found in /media (except for cdrom). [not sure how these are mounted: are they automatically mounted by setup-lbu? Does the user have to manually mount using another tty?]


setup-apkcache

This script will only be invoked for by setup-alpine when installing data installation types (ramdisk)

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't have to depend on the network. See Local APK cache for a detailed explanation.

You should be able to use a partition that you set up in the previous steps.


setup-bootable

This is a standalone script; it's not invoked by setup-alpine but must be run manually.

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).

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.

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 setup-bootable only with the -u option, to skip the syslinux install, and then refer to the manual method to fix the problem, or use one of the other bootloader options, instead.

Tip: The Bootloaders page shows different ways to setup booting, and multi-boot menus!

The setup-bootable script accepts the following arguments and command-line switches (you can run setup-bootable -h to see a usage message).

setup-bootable source [dest]

The argument source can be a directory or an ISO (will be mounted to MNT or /mnt) or a URL (will be downloaded with WGET or wget). The argument dest can be a directory mountpoint, or will default to /media/usb if not supplied.

-k
Keep alpine_dev in syslinux.cfg; otherwise, replace with UUID.

-u
Upgrade mode: keep existing syslinux.cfg and don't run syslinux

-f
Overwrite syslinux.cfg even if -u was specified.

-s
Force the running of syslinux even if -u was specified.

-v
Verbose mode

The script will ensure that source and dest are available; will copy the contents of source to dest, ensuring first that there's enough space; and unless -u was specified, will make dest bootable.

Suppose the target device is /dev/sdXY, then this partition can be prepared for booting with

# setup-bootable -v /media/<installation-media-device> /dev/sdXY

For the manual way to set up boot media see Manually_copying_Alpine_files.


setup-xorg-base

This is a standalone script; it's not invoked by setup-alpine but must be run manually.

It configures a graphical environment, installing basic Xorg packages and eudev (replacing mdev), and is also required for Wayland sessions, if Xwayland is used.

The script installs, among other packages, e.g.: xorg-server xf86-input-libinput xinit eudev.

Additional packages to install may be supplied as arguments.

setup-xorg-base [additional package(s) to install]

setup-wayland-base

This is a standalone script; it's not invoked by setup-alpine but must be run manually.

usage: setup-wayland-base [-h] [PKG..]

Set up system to use Wayland

options:

-h  Show this help

Installs the packages elogind, polkit-elogind and eudev, enables community repository, enables the service for eudev and install the packages PKG if specified.

setup-desktop

This script is used to set up a desktop environment. This is a replacement for the now-removed alpine-desktop package.

Note: Before installing any desktop,

Installation using setup-desktop

The Alpine Linux script for setting up a desktop quickly is setup-desktop.

# setup-desktop

On running the above command, you will be prompted to select a desktop environment.

Which desktop environment? ('gnome', 'plasma', 'xfce', 'mate', 'sway' or 'none') [none]

Once you have chosen a desktop environment, this script installs the chosen desktop along with all the necessary packages, firefox browser and adds the necessary services to run on startup. You can reboot when complete and the system will boot into a graphical login screen with the desktop environment. Depending on the desktop chosen, the script also activates the necessary services like dbus, elogind, login manager etc..

To view all the packages that are installed by the script for the chosen desktop you can issue the below command:

# cat /sbin/setup-desktop

Documentation needed

setup-xen-dom0


setup-mta

Uses ssmtp.

This is a standalone script; it's not invoked by setup-alpine but must be run manually.


setup-acf

setup-acf [-ahn] [-e email] [-l address] [PACKAGE...]

Options:

-a Which acf-* packages to install

-h Show help

-n Don't create /etc/acf/passwd

-e email address (for TLS certificate)

-l hostname for mini_httpd

This is a standalone script; it's not invoked by setup-alpine but must be run manually.

This script was named setup-webconf before Alpine 1.9 beta 4.

See ACF pages for more information.

See also