Install using clr-installer and a configuration file¶
In addition to the interactive GUI and text-based modes, clr-installer also supports an unattended mode where you simply provide it a YAML configuration file.
This guide shows you two examples of how to use its unattended mode.
Prerequisites¶
For installation onto bare metal, ensure that your target system supports these requirements:
Download and make bootable USB of the live server image¶
Example 1: Fresh installation onto bare metal¶
This example uses a YAML configuration file to perform a new installation.
Boot up the Clear Linux OS Live Server USB thumb drive.
Select Clear Linux OS from the menu.
In the console window, log in as root and set a password.
Verify you have a network connection to the Internet and configure proxy settings if you’re working behind a firewall.
Download a sample YAML configuration file. For example, if you want to install Clear Linux OS with a desktop GUI, you might want to use
live-desktop.yaml
. Or you can use thelive-server.yaml
if you want to install a non-GUI version of Clear Linux OS.Desktop:
curl -O https://cdn.download.clearlinux.org/current/config/image/live-desktop.yaml
Server:
curl -O https://cdn.download.clearlinux.org/current/config/image/live-server.yaml
Edit the YAML configuration file and change the settings as needed.
Commonly-changed settings include (refer to the example below):
Under block-devices (line 15), set your target media. For example:
file: "/dev/sda"
.Under targetMedia (line 34), set the third partition size to “0” to use the entire disk space.
Under bundles (line 37), add additional bundles as needed.
Delete the post-install section unless you have post-installation scripts.
Under Version (line 50), set a version number. To use the latest version, set to “0”.
See Installer YAML Syntax for more details.
1 #clear-linux-config 2 3 # c-basic-offset: 2; tab-width: 2; indent-tabs-mode: nil 4 # vi: set shiftwidth=2 tabstop=2 expandtab: 5 # :indentSize=2:tabSize=2:noTabs=true: 6 7 # File: developer-live-server.yaml 8 # Use Case: Live Image which boots into login prompt 9 # Optionally allows for installing Clear Linux OS 10 # using the TUI clr-installer by running clr-installer 11 12 # switch between aliases if you want to install to an actual block device 13 # i.e /dev/sda 14 block-devices: [ 15 {name: "bdevice", file: "/dev/sda"} 16 ] 17 18 targetMedia: 19 - name: ${bdevice} 20 type: disk 21 children: 22 - name: ${bdevice}1 23 fstype: vfat 24 mountpoint: /boot 25 size: "150M" 26 type: part 27 - name: ${bdevice}2 28 fstype: swap 29 size: "32M" 30 type: part 31 - name: ${bdevice}3 32 fstype: ext4 33 mountpoint: / 34 size: "0" 35 type: part 36 37 bundles: [os-core, os-core-update, NetworkManager, clr-installer, vim] 38 39 autoUpdate: false 40 postArchive: false 41 postReboot: false 42 telemetry: false 43 iso: true 44 keepImage: true 45 46 keyboard: us 47 language: en_US.UTF-8 48 kernel: kernel-native 49 50 version: 30010
Start the unattended installation using the –config option.
clr-installer --config live-server.yaml
Reboot your system after installation is completed.
Example 2: Replicate a previous installation¶
This example uses a saved configuration file from a previous installation, which you can use to easily clone the installation on additional machines , ideally with the same hardware configuration.
Warning
Be aware of the following when applying a saved configuration on a new machine:
Make sure the target media on the new machine matches up
The users’ credentials will be replicated as well
On a system where Clear Linux OS was installed, open a terminal window.
Get root privilege.
sudo su
Copy the
clr-installer.yaml
from/root
to a USB thumb drive.cp /root/clr-installer.yaml <USB-thumb-drive>
Install on target system.
Boot up the Clear Linux OS Live Server USB thumb drive.
Select Clear Linux OS from the menu.
In the console window, log in as root and set a password.
Verify you have a network connection to the Internet and configure proxy settings if you’re working behind a firewall.
Plug in and mount the USB thumb drive containing the retrieved
clr-installer.yaml
configuration file.Doublecheck to make sure the target media in the saved configuration file matches with the target system’s.
Start the installation.
clr-installer --config clr-installer.yaml
Reboot your system after installation is completed.