Install using clr-installer and a configuration file

This page explains how to install Clear Linux* OS using the clr-installer tool with a configuration file. The configuration file (clr-installer.yaml) can be reused to duplicate the same installation configuration on additional machines.

Process

This guide describes two methods for using a configuration file with the clr-installer tool. You can use either method to achieve the same goal. Choose the method that works best for your setup.

If you are installing Clear Linux OS for the first time, we recommend Example 1.

To clone an existing Clear Linux OS setup on another system, we recommend Example 2.

Example 1

This method uses a configuration file template to perform a new installation.

Perform the following steps:

  1. Go to Downloads and download the latest Clear Linux OS Server image.

    For example: https://download.clearlinux.org/releases/30010/clear/clear-30010-live-server.iso.xz

  2. Follow the instructions to Create a bootable USB drive based on your OS.

  3. Boot up the USB thumb drive.

  4. Select Clear Linux OS from the menu.

  5. In the console window, log in as root and set a password.

  6. Verify you have a network connection to the Internet and configure proxy settings if you’re working behind a firewall.

  7. Download a live-server.yaml template.

    For example:

    curl -O https://download.clearlinux.org/releases/30010/clear/config/image/live-server.yaml
    
  8. Edit the template and change the settings as needed.

    Commonly-changed settings include:

  1. Under block-devices, set “file: “/dev/sda”” or enter your preferred device.
  2. Under targetMedia, set the third partition size to “0” to use the entire disk space.
  3. Under bundles, add additional bundles as needed.
  4. Delete the post-install section unless you have post-installation scripts.
  5. Under Version, set a version number. To use the latest version, set to “0”.

Commonly-changed settings are shown in lines 15, 34, 37, and 51 below. See Installer YAML Syntax for more details.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
          #clear-linux-config

          # c-basic-offset: 2; tab-width: 2; indent-tabs-mode: nil
          # vi: set shiftwidth=2 tabstop=2 expandtab:
          # :indentSize=2:tabSize=2:noTabs=true:

          # File:         developer-live-server.yaml
          # Use Case:     Live Image which boots into login prompt
          #               Optionally allows for installing Clear Linux OS
          #               using the TUI clr-installer by running clr-installer

          # switch between aliases if you want to install to an actual block device
          # i.e /dev/sda
          block-devices: [
             {name: "bdevice", file: "/dev/sda"}
          ]

          targetMedia:
          - name: ${bdevice}
            type: disk
            children:
            - name: ${bdevice}1
              fstype: vfat
              mountpoint: /boot
              size: "150M"
              type: part
            - name: ${bdevice}2
              fstype: swap
              size: "32M"
              type: part
            - name: ${bdevice}3
              fstype: ext4
              mountpoint: /
              size: "0"
              type: part

          bundles: [os-core, os-core-update, NetworkManager, clr-installer, vim]

          autoUpdate: false
          postArchive: false
          postReboot: false
          telemetry: false
          iso: true
          keepImage: true
          autoUpdate: false

          keyboard: us
          language: en_US.UTF-8
          kernel: kernel-native

          version: 30010

Start the installation with the command:

clr-installer --config live-server.yaml

Example 2

This method uses a saved configuration file from a previous installation, which you can use to easily duplicate the installation on additional machines.

Perform the following steps:

  1. Open a console window on a system where Clear Linux OS was installed to retrieve a copy of the configuration file.

  2. In the console window, log in as root and enter your password.

  3. Change directory to /root and copy the clr-installer.yaml file to a USB thumb drive.

    cd /root
    cp clr-installer.yaml <USB-thumb-drive>
    

Start the installation on the target with the following steps:

  1. Go to Downloads and download the latest Clear Linux OS Server image.

    For example: https://download.clearlinux.org/releases/30010/clear/clear-30010-live-server.iso.xz

  2. Follow the instructions to Create a bootable USB drive based on your OS.

  3. Boot up the USB thumb drive.

  4. Select Clear Linux OS from the menu.

  5. In the console window, log in as root and set a password.

  6. Verify you have a network connection to the Internet and configure proxy settings if you’re working behind a firewall.

  7. Plug in and mount the USB thumb drive containing the retrieved clr-installer.yaml configuration file.

  8. Start the installation with the command:

    clr-installer --config clr-installer.yaml