Commit 68921014 authored by Chloe Kudryavtsev's avatar Chloe Kudryavtsev

[Style] consistency pass

parent 32e304f0
......@@ -4,9 +4,8 @@ If you're here, it's because you want to install alpine semi-automatically, or b
Either way, this section of the handbook describes, step by step, how to get a system up and running.
In this section you will find the usage of the various `setup-*` utilities, as well as explanations as to what they do.
== Keyboard Layout
// MAINT: kbd-bkeymaps, loadkmap, setup-keymap
== Keyboard Layout
Keyboard layout is controlled by the `loadkmap` service file.
In `/etc/conf.d/loadkmap` a variable (`KEYMAP`) is defined.
The file this variable points to is the keymap that will be loaded.
......@@ -27,9 +26,8 @@ setup-keymap us us <1>
----
<1> this will copy and use `/usr/share/bkeymaps/us/us.bmap.gz`
== Hostname
// MAINT: setup-hostname
== Hostname
Your hostname is the name of your computer.
It is important that hostnames on your local area network be unique.
If you need recommendations as to what to make your hostname, you can refer to https://tools.ietf.org/html/rfc1178[RFC 1178].
......@@ -59,15 +57,13 @@ For example, if you were to set your hostname to "alpine", with no particular do
Now that you are done, you should apply the hostname using either `rc-service hostname restart` or `/etc/init.d/hostname restart`.
== Networking
// TODO: rewrite this whole section, once wpa_cli etc is fixed
== Networking
Before you configure the rest of the system, you should set up networking.
This will allow you, for instance, to fetch bootloaders, configure sshd (to continue this setup from the comfort of a different, graphically-enabled machine), and other such desirable features.
=== Configure Wireless Networking
// MAINT: setup-interfaces
=== Configure Wireless Networking
If your system does not have an ethernet port (or connection) available, you will need to set up wireless connectivity.
It is strongly recommended that you try to avoid this.
......@@ -86,7 +82,6 @@ You can find guides around various wireless networking management solutions (inc
====
=== DHCP
In most cases, you will want to use DHCP.
If you are on a professional network, or have a common home router, you very likely have it available.
It is also very common on networks in general.
......@@ -99,7 +94,6 @@ In case this doesn't work (or you're on a wireless network), you may need to run
In such a scenario, the script will ask you questions about your network topology, that you can answer.
=== Static IP
In some cases, your network will not have DHCP available.
In that scenario, you will need to edit `/etc/network/interfaces` and `/etc/resolv.conf` on your own.
If you ran `setup-interfaces`, it will have asked you if you want to do any manual editing of the network configuration.
......@@ -128,7 +122,6 @@ include::example$static.interfaces[]
----
=== DNS
If you did not end up using DHCP, you will also need to set up DNS.
This is done by editing the `/etc/resolv.conf` file.
In most cases, you can use `1.1.1.1`, `8.8.8.8` or `9.9.9.9` as your DNS server.
......@@ -151,14 +144,12 @@ Feel free to leave the answer blank, as it is optional.
====
=== Applying Configuration
Once all of the above is accounted for, you can now start the networking configuration.
This is done by running `rc-service networking start`.
If desired, you can also set it to load during boot, using `rc-update add networking boot`.
== Timezone
// MAINT: musl/tzdata
== Timezone
Unless you live in the GMT timezone, you may be interested in having your device know where you (or it) is located, time-wise.
On musl, the timezone is defined by the `TZ` environment variable, which should either mention a POSIX-style timezone, directly point at a file, or have a standard `Area/SubArea` definition, which must be found under `/usr/share/zoneinfo`, `/share/zoneinfo` or `/etc/zoneinfo`.
......@@ -198,7 +189,6 @@ This is a technical difference, that you likely do not need to worry about, but
====
== Repositories
If you want to be able to install packages, you're going to want to have some repositories.
// MAINT: alpine images
By default, your boot medium will come with a built-in repository that is on the boot medium itself.
......@@ -222,20 +212,16 @@ include::example$repositories.apk[]
Assuming your network configuration is done, you may also use the `setup-apkrepos` utility, which will fetch a list of valid repositories, and give you a choice between them (and options such as "random").
== Root Password
At this point, you should set up a root password.
This is easy to do - simply run `passwd` and follow the prompts.
NOTE: You will not see your own typing - this is normal, it is obscured to stop people from being able to peek at your screen, even if just to see the number of characters in your passwords.
== SSH
// MAINT: setup-sshd
// MAINT: Alpine CD getting a default graphical interface / moving from getty
== SSH
SSH is very convenient to have - it means you can be in the comfort of your terminal emulator, rather than a raw getty (the full-screen emulator that shows up when booting up an alpine install medium).
Now that we have networking, we can set up an ssh daemon.
// MAINT: available sshd
There are currently two primary secure shell daemons available - openssh and dropbear.
The latter is more simple, but has its own (incompatible) key format, and can only be configured through command line arguments - as such, it is not recommended for beginners.
You can install either one using `apk add name`, where name is either "dropbear" or "openssh" respectively.
......@@ -245,9 +231,8 @@ WARNING: By default, you cannot use SSH to log in as root using a password.
Note that this can also be done for you by the `setup-sshd` utility - it will ask you which one you would like, install, start and enable it for you.
== NTP
// MAINT: setup-ntp
== NTP
It may be useful to make sure that your clock is correct.
This can be achieved by using an NTP daemon.
Some of the common ones are `chronyd` and `openntpd`.
......@@ -264,9 +249,8 @@ As such, temporarily, it is recommended that you use the `setup-ntp` script and
Note that this can also be done for you by the `setup-ntp` utility - it will ask you which one you would like, install, start and enable it for you.
== Partitioning Your Disk
// MAINT: parted availability, fdisk, setup-disk
== Partitioning Your Disk
=== `setup-disk`
The `setup-disk` utility can do the rest of this work for you.
......@@ -287,8 +271,8 @@ However, in other cases, it is recommended that you at least consider doing this
These are not covered in this handbook.
====
==== Options and Settings
// MAINT: setup-disk
==== Options and Settings
`setup-disk` is configured through command line arguments, as well as environment variables.
In most cases, if you want setup-disk to do all the work for you, you should not need to specify anything beyond `-m sys`, as in `setup-disk -m sys`.
This is an incomplete listing - it lacks anything mentioning non-disk installations, as well as anything overly complex (such as automatic lvm/raid).
......@@ -317,7 +301,6 @@ Any missing information will be queried from you by `setup-disk`, so only change
In the scenario where the bootloader installation causes problems, see the sections that follow.
=== Parted
:ex_3_sda3: Notice how the `3` in `/dev/sda3` comes from the fact that this is the 3rd partition we created (it also has the 3 in the number in the above planning table).
Parted is GNU's PARTition EDitor.
......@@ -367,7 +350,6 @@ p mklabel msdos <2>
<2> Parted supports both interactive and non-interactive commands. This is the equivalent to running `parted -a optimal /dev/sda`, then entering `mklabel msdos` into the prompt, or entering `mklabel` into the prompt, and answering `msdos` to the incoming question. The specifics as to how you perform the below are up to you.
==== BIOS + MS-DOS
Under a BIOS setup with an MS-DOS partition table, we can only have 4 primary partitions, and are limited to 2TB disks.
Extended partitions are outside of the scope of this handbook.
Under BIOS+MS-DOS, we can use the MBR for installing the bootloader, so we only need to worry about the actual data partitions.
......@@ -399,7 +381,6 @@ mkfs.ext4 /dev/sda3 <2>
<2> {ex_3_sda3}
==== BIOS + GPT
Under a BIOS setup with a GPT partition table, we do not have an MBR, so we will need to create one.
Here is an example of a partitioning scheme:
......@@ -432,7 +413,6 @@ mkfs.ext4 /dev/sda4
<2> {ex_3_sda3}
==== UEFI + GPT
Under a UEFI setup, you need to use GPT with an ESP partition.
It must be FAT32 formatted, and can be used as your boot partition.
Here is an example of a partitioning scheme:
......@@ -462,9 +442,8 @@ mkfs.ext4 /dev/sda3 <2>
<1> This last section creates the filesystems. In this example, we use ext4 for `/boot` and `/` - you can use any of the supported filesystems.
<2> {ex_3_sda3}
=== Finalizing
// MAINT: setup-disk
=== Finalizing
Now that your filesystems are formatted, you have to mount them under a mountpoint (usually `/mnt`).
"Mounting" a filesystem is like assigning a drive letter to a hard drive, but can be done under any directory.
Here is an example of how you would mount the <<_uefi_gpt>> set under `/mnt`:
......
......@@ -2,7 +2,6 @@
:experimental: // TODO: make sure experimental is enabled on Antora
== Available Options
=== Architecture
Computer hardware, and CPUs in particular, come in several different architectures.
A very common consumer architecture is known as x86_64 - the traditional Intel x86 architecture with AMD's 64-bit extensions.
......@@ -18,8 +17,8 @@ s390x:: IBM Z-Systems and Mainframes
// TODO: mention that aarch64 is supposed to support EFI
Under some circumstances, you may also use armhf and aarch64 architectures - relevant to ARM chips, 32bit and 64bit respectively.
=== Image Type
// MAINT: downloads page
=== Image Type
Alpine offers a variety of downloadable https://alpinelinux.org/downloads/[images].
The image varieties relevant to this handbook are as follows:
......@@ -44,9 +43,8 @@ If you aren't sure what image to use, you should use extended, assuming your arc
Otherwise, you should use the standard image.
== Downloading
=== Obtaining the Chosen Media
// MAINT: downloads page
=== Obtaining the Chosen Media
Image downloads are available at https://alpinelinux.org/downloads/[alpinelinux.org].
Press the button under your chosen image type, that corresponds to your target architecture.
This will link to a direct download of your image.
......@@ -104,12 +102,10 @@ gpg --verify alpine.iso.asc alpine.iso
----
== Using the Image
A `.iso` file on its own is not very useful.
You can either flash it to a usb stick, or burn it to a physical cd/dvd.
=== USB Drive
On Windows and MacOS hosts, it is most convenient to use a dedicated utility, such as https://www.balena.io/etcher/[Etcher].
See that project's documentation in case any further details are required.
......@@ -139,7 +135,6 @@ You can find more details on those in the dd manual page (`dd(1)`).
====
=== Burning to a CD/DVD
Another way to utilize the `.iso` file is by burning it on a CD or DVD.
This is also useful on older systems, that do not know how to boot from a USB drive.
......@@ -148,7 +143,6 @@ On MacOS, you can select the `.iso` file, and then press menu:File[Burn Disk Ima
On Windows 8 and above, you can right-click the `.iso` file, and then press btn:[Burn Disk Image].
==== [Linux] Burning an Image File
On Linux hosts, there are no default built-in tools to burn images.
This handbook recommends using k3b - a graphical utility inside of which one can select menu:Tools[Burn CD Image].
......@@ -163,7 +157,6 @@ cdrecord dev=/dev/sr0 alpine.iso <1>
<1> This needs to be run as root, unless your user has write access to the output block device.
== Booting
Once you have prepared your appropriate installation medium, you need to boot into the Alpine Linux live environment.
During the bootup of your system, you should have the option to enter BIOS/UEFI settings, alongside what is often called "One Time Boot Override", or "Boot Selection".
......
= `setup-alpine`
// MAINT: this whole page, on alpine-conf
= `setup-alpine`
Now that you are booted in, you can log-in without a password as the root user.
Alpine has a script called `setup-alpine`, which performs basic installation procedures.
......@@ -8,7 +8,6 @@ However, no script is perfect, so it is recommended that if your use-case is not
For example, if you have no access to a wired network, you will need to configure xref:manual.adoc#_networking[Networking] yourself.
== `setup-alpine -q`
The q, or "quick" mode of the `setup-alpine` script allows one to get a trivial system configuration running quickly, to then proceed with other installation tasks, possibly remotely.
Under quick mode, `setup-alpine` will:
......@@ -40,7 +39,6 @@ The steps quick mode skips are, in order:
- Configuring apk's caching mechanism
== Full `setup-alpine`
`setup-alpine` in normal mode will do all of the abovementioned steps, under some conditions, and will rely much less on default values.
It is recommended to use this mode directly if your scenario is trivial.
......@@ -54,7 +52,6 @@ If all of these apply, you can simply run `setup-alpine` and follow the prompts
If they do not, it may still be appropriate, but you will need to customize its behavior with an answer file and/or environment variables.
== Answer Files
You can preprogram various answers to `setup-alpine` 's questions.
Here is the answer file it generates for you if you ask it to.
......
......@@ -7,14 +7,14 @@ This handbook contains installation instructions for a typical user, as well as
This handbook will focus on the traditional "to disk" style of installation, and target primarily desktop and server systems.
If your use-case is different, you should be sufficiently familiar with Linux, and can consult the Developer Handbook and manual pages for further details.
== Where to Get Help?
// MAINT: mailing lists and irc channels
== Where to Get Help?
If you run into problems, you can ask for help in the irc://chat.freenode.net/#alpine-linux[#alpine-linux] irc channel, available on the freenode network.
You can also send an email to the mailto:alpine-user@lists.alpinelinux.org[Alpine-User] mailing list.
== How to Contribute?
// MAINT: irc channels
== How to Contribute?
If you believe you can help with the documentation project, or have a specific improvement in mind, you can join the irc://chat.freenode.net/#alpine-docs[#alpine-docs] irc channel, to offer help or submit your patch.
// TODO: add link to developer handbook once it's done
......@@ -26,7 +26,6 @@ As such, it is impossible to escape having *some* technical jargon and conventio
Here are a few things to watch out for, in case you are new to computing or Linux.
=== Definitions
BIOS::
Basic Input-Output System - a very simple program that runs immediately after POST.
Used on older computers to perform configuration and initially execute the bootloader.
......
= Working with the Alpine Package Keeper (`apk`)
// MAINT: apk-tools - whole page
= Working with the Alpine Package Keeper (`apk`)
`apk` is the Alpine Package Keeper - the distribution's package manager.
It is used to manage the packages (software and otherwise) of the system.
It is the primary method for installing additional software, and is available in the `apk-tools` package.
== Normal Usage
=== Repositories and Mirrors
// MAINT: repositories and versions
=== Repositories and Mirrors
`apk` fetches information about available packages, as well as the packages themselves from various mirrors, which contain various repositories.
Sometimes, those terms are used interchangeably.
Here is a summary of relevant definitions:
......@@ -54,9 +52,8 @@ NOTE: This example uses the `http://` protocol. `ftp://` and `https://` protocol
// TODO: xref to installation part that's relevant
NOTE: This file should already have been been partially populated when you installed alpine.
=== Searching for Packages
// MAINT: apk-search and pkgs.alpinelinux.org
=== Searching for Packages
In order to know what package to install, one must be able to find packages.
Alpine has a specialized https://pkgs.alpinelinux.org[web interface] dedicated to looking through various available packages.
However, `apk` also provides a built-in searching mechanism.
......@@ -78,9 +75,8 @@ apk search -e so:libsqlite3.so.* <4>
<3> You can exclude partial matches using `-e`.
<4> You can specify that what you're searching for is a library using the `so:` prefix (or the `cmd:` prefix for commands, and `pc:` prefix for pkg-config files) - it will work with `-e` (in fact, the prefix is required for this use-case if `-e` is used).
=== Installing Packages
// MAINT: apk-add
=== Installing Packages
Once you know what package you want to install, you must know how to do that.
Apk's `add` command is more strict than the `search` command - wildcards are not available, for instance.
// TODO: gotchas, already asked in #a-docs
......@@ -117,9 +113,8 @@ apk add pc:msgpack <5>
NOTE: If `apk add` finds multiple matching packages (for example multiple `cmd:` matches), it will select the one with the highest version number.
=== Upgrading Packages
// MAINT: apk-update, apk-upgrade
=== Upgrading Packages
Updating the system using apk is very simple.
One need only run `apk upgrade`.
Technically, this is two steps: `apk update`, followed by `apk upgrade` proper.
......@@ -134,9 +129,8 @@ Simply invoking it normally with present you with the difference between the two
NOTE: `apk update` is only ran once your cache is invalidated, which by default happens every 4 hours.
=== Querying Package Information
// MAINT: apk-info
=== Querying Package Information
In some cases, it may be useful to inspect packages or files to see various details.
For this use, the `info` subcommand exists.
It may be used on any package, installed or not, though the information on the latter will be more limited.
......@@ -146,9 +140,8 @@ By default, `info` will list the package description, webpage and installed size
// MAINT: apk-info: `apk info -h` output
For more details (such as a list of flags the subcommand supports), you can use the `apk info -h` output's "Info options" section or see the manual page.
=== Removing Packages
// MAINT: apk-del
=== Removing Packages
Often, it is desirable to remove a package.
This can be done using the `del` subcommand, with a base syntax that is identical to the `add` subcommand.
......@@ -159,7 +152,6 @@ NOTE: Removing a package will automatically remove all of its dependencies that
The `del` subcommand also supports the `-r` flag, which will remove all packages that depend on the package being removed as well, rather than error out due to the package being needed.
=== Cleanup
Many package managers have specific features to "clean up".
A common one is `apt`, which has an `autoremove` subcommand.
Apk does this by default when removing packages.
......@@ -168,18 +160,15 @@ It is also possible to clear out the apk cache, assuming it is enabled.
You can do this using `apk cache clean`.
== Advanced Usage
=== World
The packages you want to have explicitly installed are listed in the "world file", available in `/etc/apk/world`.
It is safe to edit it by hand.
If you've edited it by hand, you may run `apk add` with no arguments to bring the package selection to a consistent state.
NOTE: Virtuals like `cmd:`, `so:` and `pc:` will appear as such in your world file - this is why using `so:` is discouraged - the soname might get bumped!
=== Virtuals
// MAINT: apk-add -t
=== Virtuals
While `cmd:`, `so:` and `pc:` packages are automatically created virtuals, you can create your own as well.
These allow for quick removal of purpose-specific packages.
See the following examples for details:
......@@ -194,7 +183,6 @@ apk add a b c --virtual abc <3>
<3> This is equivalent to the first example.
=== Swapping Repositories
When alpine has a new release, the repository path will change.
Assuming you are going forward in time (e.g from `3.8` to `3.9`), you can simply edit `/etc/apk/repositories` and run `apk upgrade --available`.
......
= Working with OpenRC
// MAINT: openrc, whole page
= Working with OpenRC
OpenRC is the init system used in alpine.
The init system manages the services, startup and shutdown of your computer.
......@@ -13,12 +13,9 @@ If in doubt, use the canonical name, as is shown in this document.
====
== Normal Usage
=== Manipulating Services
// MAINT: openrc, whole page
==== Runtime Service Manipulation
// MAINT: rc-service
You manipulate services on a running system using the `rc-service` command.
This allows you to start, stop, and check the status of a given service, amongst other things.
See the following basic examples:
......@@ -47,9 +44,8 @@ Only run the specified command if the service is currently started.
NOTE: Services may define additional commands you can use. See more on this in <<_custom_service_commands>>.
==== On-Boot Service Manipulation
// MAINT: rc-update
==== On-Boot Service Manipulation
OpenRC operates under a system called "runlevels".
More on that in <<_switching_runlevels>> and <<_custom_runlevels>>.
Enabling a service means putting it in a runlevel, usually one that will get loaded automatically (but not necessarily so!).
......@@ -72,16 +68,14 @@ rc-update delete chronyd -a <5>
<5> Remove the chronyd service from all runlevels.
=== Configuring Services
Various services may need additional configuration.
Most will have dedicated configuration files in `/etc` - you can see documentation on the specific service for more details.
However, some services need configuration applied to them as part of the launch procedure - such as passing a flag to the binary when first started.
This can be done in the `/etc/conf.d` directory, under the name of the service in question.
For example, for a service named "base", the configuration file would be `/etc/conf.d/base`.
=== System Status
// MAINT: rc-status
=== System Status
The `rc-status` utility is a fast way to view the current state of your system's services.
By default, it will list all the services in the current runlevel.
You can select a different runlevel by specifying it, for instance, `rc-status boot` will list all the services in the boot runlevel.
......@@ -110,7 +104,6 @@ For example, adding the `sshd` service to the `default` runlevel is creating a s
Creating a new runlevel thus involves creating a new directory under `/etc/runlevels`.
==== Runlevel Stacking
Most of the time, you do not want to shut down all of your `default` services if you're switching to the `office` runlevel.
Runlevel "inheritance" is acheived through runlevel stacking.
If you pass the `-s` flag to `rc-update`, you can actually add a runlevel to a runlevel.
......@@ -124,17 +117,14 @@ rc-update add myvpn office
----
==== Switching Runlevels
Once you have a custom runlevel you want to switch to, you can do so using the `openrc` command.
As per the above example, you would use `openrc office` to switch to your new runlevel, and `openrc default` to switch back.
=== System Configuration
// TODO: expand
=== System Configuration
System-wide configuration of OpenRC happens in `/etc/rc.conf`.
=== Multi-Services
In some cases, you may want the same bit of code to do different things under different circumstances.
For example, normally, the difference between various instances of `agetty` are just the tty they run on.
In these cases, you can use symlinks to manage dynamic configuration differences.
......@@ -146,16 +136,14 @@ The intended way to use this is by symlinking the "base" service (`agetty`) to t
This mechanism also allows you to specify custom configuration for that service, for more details, see <<_extended_conf_d_names>>.
=== Custom Service Commands
Commands other than `start`, `stop` and `status` may be available.
A common example is `save`, used by `iptables`.
Their usage is identical to that of the built-in ones.
You can look inside the `init.d` script at various `extra*commands` variables which give a listing of the available ones.
// TODO: what's extra_started_commands etc?
=== Extended `conf.d` Names
// MAINT: the insanity in sh/opnenrc-init.sh.in
=== Extended `conf.d` Names
There are 4 total files that may play a role in the configuration of a service.
Assume that `base` stands for the name of the base server, `ext` is the extension (as per <<_multi_services>>) and `runlevel` is the runlevel it's in.
Under those conditions, the files involved are:
......
......@@ -5,7 +5,6 @@ The following sections will provide a list of general recommendations to ease yo
The remaining sections will describe how to use (on a user level) various Alpine-native solutions, such as the package manager, firewall, and so on.
== Creating a Normal User
Now that you are up and running, you will want a normal, non-root user to perform most daily tasks with.
You can either use the built-in busybox utility `adduser`, or the utility available in the `shadow` package named `useradd`.
......@@ -26,7 +25,6 @@ useradd -m -U -s /bin/ash jane <1>
Once your user has been created, if the utility you used has not asked you to set a password, you should do so now, using `passwd foo`, where "foo" is the username in question.
== Granting Your User Administrative Access
Sometimes, you'll want to do something that *does* require administrative powers.
While you may switch to a different tty and log in as root, this is often inconvenient.
You may gain root privileges ad-hoc using either the built-in busybox utility `su`, or the common external utility `sudo`, available in the package named the same way.
......@@ -58,9 +56,8 @@ sudo command with arguments <5>
<4> You may need to log out and log back in for the group listing to update. `sudo -i` is the equivalent of `su -` otherwise.
<5> This will run "command with arguments" as the default `sudo` user - root.
== Getting a Graphical Environment
// MAINT: alpine-desktop, alpine-conf (setup-xorg-base)
== Getting a Graphical Environment
Most people will often want something more than just a raw tty.
This section describes how to get a supported graphical interface, as well as some additional notes (for example, how to use a different type of GUI).
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment