Alpine setup scripts

From Alpine Linux
Revision as of 11:18, 4 March 2012 by Dubiousjim (talk | contribs) (Links 2)
Jump to navigation Jump to search

This page summarizes the low-level behavior of the /sbin/setup-* scripts on the Alpine ISO (and in a normal Alpine install).


This script accepts the following command-line arguments (you can run setup-alpine -h to see a usage message).

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.

Create a new "answer file", with default choices. You can edit the file and then invoke setup-alpine -f FILE.

Use an existing "answer file", which may override some or all of the interactive prompts.

Run in "quick mode." See below for details. FIXME

The script's behavior is to do the following, in order. Bracketed options represent extra configuration choices than can be supplied when running the auxiliary setup scripts manually, or by supplying an "answer file".

  1. setup-keymap [us us]
  2. setup-hostname [-n alpine-test]
  3. [#setup-interfaces setup-interfaces] [-i < interfaces-file]
  4. /etc/init.d/networking --quiet start &
  5. if none of the networking interfaces were configured using dhcp, then: setup-dns [-d -n " [more...]"]
  6. set the root password
  7. if not in quick mode, then: [#setup-timezone setup-timezone] [-z UTC]
  8. enable the new hostname (/etc/init.d/hostname --quiet restart)
  9. add networking and urandom to the "boot" rc level, and acpid and cron 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-apkrepos [-r (to select a mirror randomly)]
  12. if not in quick mode, then: setup-sshd [-c openssh | dropbear | none]
  13. if not in quick mode, then: setup-ntp [-c chrony | openntpd | none]
  14. if not in quick mode, then: [#setup-disk DEFAULT_DISK=none setup-disk -q] [-m data /dev/sda]
  15. if not in quick mode, and the selected installation mode was "data" instead of "sys", then: setup-lbu [/media/sdb1]
  16. if not in quick mode, and the selected installation mode was "data" instead of "sys", then: setup-apkcache [/media/sdb1/cache | none]


An interfaces file has the format of /etc/network/interfaces, such as:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp
    hostname alpine-test


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

  • -z <subfolder of /usr/share/zoneinfo>
  • -p <POSIX TZ format>


To be added.


Must be run manually, to be added.


Must be run manually, to be added.


Installs the following packages: xorg-server xf86-video-vesa xf86-input-evdev xf86-input-mouse xf86-input-keyboard udev.

Additional packages can be supplied as arguments to setup-xorg-base. You might need, for example, some of: xf86-input-synaptics xf86-video-something xinit.

Documentation needed


Uses openbox.


Uses ssmtp.