Skip to main content
  1. Docs/

JSON Configuration

793 words·4 mins
Table of Contents

October Linux provides an installer that takes a JSON configuration file to deploy your system. The JSON defines things like disk partitioning, users and extra packages you want installed.

This page goes over all you need to know to prepare your JSON configuration to deploy a fully operational system.

Full JSON example
#

{
  "drives" : [
    {
      "path": "/dev/xyz",
      "append": true/false,
      "partitions": [
        {
          "size": {
            "amount": 1234,
            "unit": "MiB/GiB/etc.",
            "takeRemaining": true/false
          },
          "fileSystem": "btrfs/ext4",
          "partitionType": "gpt partition type (guid)",
          "mountPoint": "/absolute/path/to/directory"
        }
      ]
    }
  ],
  "users": [
    {
      "username": "[username]",
      "password": "[password]",
      "homepath": "[path to home]",
      "sudoer": true
    }
  ],
  "mirrorCountries": [
    "list of countries"
  ],
  "timezone": "[user timezone]",
  "locale": "[user locale]",
  "hostname": "[user hostname]",
  "rootPassword": "[root password]",
  "bestEffortGPU": true,
  "extraPackages": {
    "officialRepositories": ["package1", "package2"],
    "aur": ["package1", "package2"]
  }
}

Drives
#

Drives contains an array of “drives” and those contain partitions. This section dictates what partitions to create on which drives.

Example
#

A basic drive configuration looks like this:

"drives": [
  {
    "path": "/dev/sda",
    "append": false,
    "partitions": [
      {
        "size": {
          "amount": 1,
          "unit": "GiB"
        },
        "partitionType": "C12A7328-F81F-11D2-BA4B-00A0C93EC93B"
      },
      {
        "size": {
          "amount": 4,
          "unit": "GiB"
        },
        "partitionType": "0657FD6D-A4AB-43C4-84E5-0933C84B4F4F"
      },
      {
        "size": {
          "takeRemaining": true
        },
        "partitionType": "4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709",
        "fileSystem": "ext4"
      }
    ]
  }
],

Supported partition table
#

Currently, the installer only supports GPT drives, so make sure to format drives on which you’ll create partitions to GPT before running the installer.

This can be done by doing:

$ fdisk /dev/sda
Command (m for help): g
Command (m for help): w

Supported partition types
#

The installer currently support all the listed partition types below. The ones with an asterisk are needed for the system to be functional.

NameGUIDDescription
EFI*C12A7328-F81F-11D2-BA4B-00A0C93EC93BUsed for the booloader to boot the system.
SWAP*0657FD6D-A4AB-43C4-84E5-0933C84B4F4FSystems swap space.
Root*4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709The partition that will have root (/).
File System0FC63DAF-8483-4772-8E79-3D69D8477DE4Partition with data on it.
Home933AC7E1-2EB4-4F13-B844-0E14E2AEF915Optional partition for home directory.

Supported file systems
#

The installer currently support two file systems:

  • btrfs
  • ext4

Drive, partition and size keys
#

This is a table of all the keys and descriptions for each of them.

Drive keys
#

NametypeDescriptionNeeded
pathstringThe absolute path to the drive.Yes
appendbooleanWhether the new partitions will be appended to the existing partition table or replace it.Yes
partitionsarray of objectsArray of all the partitions that need to be created.Yes

Partition keys
#

NametypeDescriptionNeeded
sizeobjectThe size of the new partition.Yes
partitionTypestringThe GUID of the partition type.Yes
fileSystemstringThe partition file system.If partitionType is not EFI or SWAP.
mountPointstringThe mount point of the driveIf partitionType is not EFI, SWAP or Root.

Size keys
#

NametypeDescriptionNeeded
amountintegerThe size of the new drive.If takeRemaining is false or not present.
unitstringThe unit of the given amount. Units are in *iB (like GiB).If amount is specified.
takeRemainingbooleanIf true, it will take the remaining space of the drive for this partition.If no amount is specified.

User
#

Users contains an array of users that needs to be created after the installation.

Users configuration example
#

{
  "username": "testuser",
  "password": "test",
  "homepath": "/home/testuser",
  "sudoer": true
}

User keys
#

NameTypeDescriptionNeeded
usernamestringThe username of the user.Yes
passwordstringThe password of the user.Yes
homepathstringThe absolute path to the user home folder.No. Default: /home/[username]
sudoerbooleanIs the user a sudoer on the new install.Yes

General configuration
#

This part contains all the more “general” configuration of the installation.

General configuration example
#

{
  "mirrorCountries": ["Canada"],
  "timezone": "America/Montreal",
  "locale": "US.UTF-8",
  "hostname": "testhostname",
  "rootPassword": "test",
  "bestEffortGPU": false,
  "extraPackages": {
    "officialRepositories": ["package1", "package2"],
    "aur": ["package1", "package2"]
  }
}

General configuration keys
#

NameTypeDescriptionNeeded
mirrorCountriesarray of stringsNames of the countries you want to use mirrors from. They can be seen on the Arch Wiki.Yes
timezonestringThe timezone you want the system to be set to.Yes
localestringThe locale you want to set on the system. Only UTF-8 locales are supported.Yes
hostnamestringThe hostname of the new system.Yes
rootPasswordstringThe root password on the new install.Yes
bestEffortGPUbooleanIf true, it will attempt to install the drivers for the systems GPU on the new install. Only Nvidia, AMD and Intel are supported.Yes
extraPackagesobjectThe extra packages to be installed on the system.No
extraPackages.officialRepositoriesarray of stringsThe extra packages to be installed from the official Arch Linux repositoriesNo
extraPackages.aurarray of stringsThe extra packages to be installed from the Arch User Repository (AUR)No

Related