Skip to content

Install from an Arch host

This page installs Obarun onto a target partition, using a running Arch system or an Arch live medium as the machine that drives the installation. The result is a bare-metal Obarun system.

Nothing is converted

The Arch host is not turned into Obarun. It keeps running Arch, it is only lending you its pacstrap and its network. What you get at the end is a separate Obarun installation on the target partition, which you then boot.

Throughout, the host is the Arch system you are running from, /, and the target is the prepared and mounted partition, /mnt.

Assumptions

  • You have partitioned, formatted and mounted the target under /mnt, as described in the Arch Wiki installation guide. On a UEFI machine, also see EFI system partition and the manual UEFI installation page here.
  • The network works.
  • arch-install-scripts is installed on the host, so you have pacstrap, arch-chroot and genfstab. A bare Arch image does not ship it: pacman -S arch-install-scripts.
  • You are in a root shell.

Why the extra steps

Obarun adds repositories that must sit above the Arch ones in /etc/pacman.conf, so that Obarun's packages win over Arch's where both exist. pacstrap uses the host's pacman configuration, and the host is an Arch system. The first steps therefore teach the host's pacman about Obarun before letting pacstrap run.

1. Point the host at the Obarun repositories

Back up the host configuration first:

# cp -a /etc/pacman.conf /etc/pacman.conf.arch

Edit /etc/pacman.conf and insert these blocks immediately above the first Arch repository, [core]:

[obcore]
SigLevel = Never
Server = https://cloud.server.obarun.org/$repo/os/$arch/

[obextra]
SigLevel = Never
Server = https://cloud.server.obarun.org/$repo/os/$arch/

SigLevel = Never is needed only to break a chicken-and-egg problem: the key that signs the Obarun repositories is shipped by an Obarun package, so the first sync has to happen unverified. Step 3 installs that key, and step 5 is where signatures start being checked for real.

2. Sync

# pacman -Sy

The output must list the repositories in this order, Obarun first:

obcore
obextra
core
extra

3. Trust the Obarun signing key, on the host

Do not skip this step, and do not move it later

This is the step the whole procedure hangs on. pacman -r /mnt relocates the root, the database and the logs, but it does not relocate GPGDir. Check it yourself:

# pacman -r /mnt --config /mnt/etc/pacman.conf --verbose -Sy
Root      : /mnt/
GPG Dir   : /etc/pacman.d/gnupg/

So pacstrap verifies Obarun packages against the host's keyring, which on a stock Arch system does not know the Obarun key. Populating the target's keyring does not help, because nothing reads it during pacstrap.

# pacman -S --needed obarun-keyring
# pacman-key --populate obarun

Confirm the host now trusts the key that signs the repositories:

# pacman-key --list-keys [email protected]

Without this, step 5 stops with key ... is unknown, then could not be looked up remotely, and ERROR: Failed to install packages to new root.

4. Install pacman into the target

# mkdir -p /mnt/var/lib/pacman
# pacman -Sy pacman -r /mnt --noconfirm

This puts Obarun's pacman.conf at /mnt/etc/pacman.conf, which the next step uses.

--noconfirm matters for more than saving keystrokes. Several packages here have two providers, one from obcore and one from Arch's core, and libudev.so is the one that counts: libeudev on the Obarun side, systemd-libs on the Arch side. The obcore package is always listed first and --noconfirm takes it, so the target gets libeudev and no systemd library finds its way into a system whose entire point is not to have one.

5. Bootstrap the base system

# pacstrap -c -G -M -C /mnt/etc/pacman.conf /mnt base linux

The options matter: -C /mnt/etc/pacman.conf makes pacstrap use Obarun's configuration rather than the host's, -M skips copying the host mirrorlist, -G skips copying the host keyring, and -c keeps packages in the host's cache. Do not drop -C /mnt/etc/pacman.conf.

Without -i, pacstrap runs pacman with --noconfirm, which is what you want here for the same reason as in step 4: the provider choices resolve to the obcore packages on their own.

Substitute another kernel for linux if you want one, and append any extra packages you already know you need, such as a text editor, a network daemon and a bootloader. You can run pacstrap again later for anything you forgot.

6. Configure the target

First the target's own keyring:

# arch-chroot /mnt pacman-key --init
# arch-chroot /mnt pacman-key --populate archlinux obarun

This is the keyring the installed system will use for its own upgrades. Step 3 dealt with the host, this deals with the target.

Uncomment a mirror before the next command

-M kept the host mirrorlist out of the target, and the one the pacman-mirrorlist package ships has every server commented out. Uncomment at least one:

# $EDITOR /mnt/etc/pacman.d/mirrorlist

Skip this and the sync below stops with failed to synchronize all databases (no servers configured for repository). Pacman uses the first uncommented server and only falls back on failure, so put the closest mirrors at the top.

Then the rest:

# arch-chroot /mnt pacman -Sy
# $EDITOR /mnt/etc/locale.gen
# arch-chroot /mnt locale-gen
# genfstab -U /mnt >> /mnt/etc/fstab
# arch-chroot /mnt passwd
# $EDITOR /mnt/etc/hosts

7. Enable the boot module

This is the step that makes the system bootable under 66:

# arch-chroot /mnt 66 enable boot@system

It prints one line per service it activates, ending with boot@system itself. The boot@ module declares the tree it belongs to, so this creates the boot tree, places it in the boot group, and fills it with the services that bring the machine up, tty-earlier@tty12 included.

Set the hostname, which the module owns:

# arch-chroot /mnt 66 configure -r HOSTNAME=myhost boot@system
# arch-chroot /mnt 66 reconfigure boot@system

configure alone changes nothing

66 configure writes the new value into the module's configuration file, but the enabled services still carry the old one. 66 reconfigure is what parses the module again and applies the change. Forget it and the machine boots with the previous hostname.

Check the result:

# arch-chroot /mnt 66 -z tree status boot

You should see Groups : boot, Allowed : root, and the module's services listed under Contents.

Enabled : no is correct here

A tree in the boot group cannot be enabled with 66 tree enable, and 66 tree status will keep reporting Enabled : no. 66 manages those trees itself during boot. Nothing to fix.

Everything else the module configures, timezone, keymap, console font, fstab handling, LVM, and so on, is described in The boot module.

8. Bootloader

Install and configure the bootloader as documented by Arch. Its default kernel command line will do: 66 boots with the root passed as ro or as rw, the difference being only whether fsck checks the root on the way up. A ZFS root may needs rw. See GRUB or Syslinux.

9. Create a user

On Obarun tty@tty12 is available as an emergency console, and root cannot log in there. If no other console is enabled and you have not created an unprivileged account, a failed boot leaves you locked out. Create a user and give it a password before you reboot. See Consoles and tty12.

10. Restore the host

Do not skip this on a normal Arch installation

If the host is a real system rather than a live medium, put its own pacman configuration back, or it will keep pulling Obarun packages:

# cp -a /etc/pacman.conf.arch /etc/pacman.conf

The Obarun key you added to the host keyring in step 3 is harmless and can stay. Remove it with pacman -Rs obarun-keyring if you would rather not keep it.

Done

Reboot the machine into the target, or arch-chroot /mnt again to keep configuring it from the host. Then read First boot.