Home - ODEX-TOS/tos-installer-backend GitHub Wiki

Welcome to the tos-installer-backend wiki!

Here you can gather information on how to write both data.yaml and config.yaml All the options available on them and how to write them.

model/execution

Here is an example of a full data.yaml file

models:
  - disks:
      - disk:
          device: "/dev/sda" # can also be /dev/disk/by-uuid or a command in the form $(command here)
          size: "499G"
          gpt: true # is the partitiontable gpt or msdos (by default gpt if not set)
          table: true # build a new partition table (by default true). If this is set to false the below partitions will be added to an exisiting partitiontable
          partitions:
            - partition:
                name: "efi" # just a usefull name to assign a partitions
                mount: "/boot/efi" # place to mount the partition
                filesystem: "fat32" # type of filesystem as defined in model.models.partition.EFilesystem
                start: "1MiB" # parted syntax for defining a location
                end: "200MiB"
            - partition:
                name: "boot" # just a usefull name to assign a partitions
                mount: "/boot" # place to mount the partition
                filesystem: "ext4" # type of filesystem as defined in model.models.partition.EFilesystem
                start: "200MiB" # parted syntax for defining a location
                end: "800MiB"
            - partition:
                name: "swap"
                mount: "swap"
                filesystem: "ext4"
                start: "800MiB"
                end: "8GiB"
            - partition:
                name: "root"
                mount: "/"
                filesystem: "luks"
                start: "8GiB"
                end: "98%"
                encrypted: True
                password: "a"
                logicvolumes:
                  - volume:
                      name: "root"
                      size: "200G"
                      mountpoint: "/"
                  - volume:
                      name: "home"
                      size: "200G"
                      mountpoint: "/home"
            - partition:
                name: "offset"
                mount: "/tmp"
                filesystem: "ext4"
                start: "97%"
                end: "99%"
                offset: 8 # set the partition number here. This means that partition number 5, 6 and 7 are configured elsewhere (eg a exisiting ubuntu install)
            - partition:
                name: "offset"
                mount: "/proc"
                filesystem: "ext4"
                offset: 9 # all partition below the first offset need to be manually set to another number
                resize: true # by default false. If this is true
                size: "1GB" # a resize partition doesn't need a start or end. It only needs a new size set
  - chroots:
      - chroot:
          name: "alpha" # name of the user to chroot
          mount: "/media" # alternative mountpoint to chroot to
      - chroot:
          name: "root"
  - users:
      - user:
          name: "alpha" # user by the name alpha
          password: "123" # the password of said user
      - user:
          name: "zetta"
          password: "456"
          shell: "/bin/zsh" # default shell for the user
          groups:
            - wheel
            - power
  - system:
      local: "en_US.UTF-8"
      keymap: "be-latin1"
      hostname: "tos"
      password: "123"
  - packages:
      - package:
          name: "userpackages"
          install: "yay -Syu --noconfirm"
          packagefile: "packages.txt" # either from a file
          package: # or a list in this format
            - a
            - b
  - scripts:
      # todo script should have a user an base command (/bin/sh)
      - script:
          name: "script1"
          file: "test.sh"
          command: |
            echo hello world
            echo hello 2 $USER
      - script:
          name: "script2"
          file: "show.sh"
  - network:
      ssid: "ssid"
      password: "passphrase"
execution:
  - partitiontable: "/dev/sda" # build a partition table
  - format: "/dev/sda" # format a drive
  - format: "efi" # format partition based on its name
  - mount: "/dev/sda" # mount all partitions from this drive you can also specify a partition
  - network: # try to get a network connection if no connection already exists
  - bootstrap: # bootstrap the system
  - fstab: # generate fstab based on mounted partitions
  - chroot:
      user: "root" # execute the next steps in the chrooted environment
      steps:
        - systemsetup:
        - createuser: "alpha"
        - bootloader: "/dev/sda" # point to a disk model
  - chroot:
      user: "alpha"
      steps:
        - packages: "userpackages"
        - script: "script1"
  - script: "script1"

Config file

Here is an example of how a config.yaml file should look like

INSTALLCOMMAND: "pacman -Syu --noconfirm" # command to install software

IP: "8.8.8.8" # ip to check network connection
WIFI_CONNECT_COMMAND: "wifi-menu" # command to interactivally connect to the network
WIFI_CONNECT_COMMAND_WITH_PASSWORD: "nmcli device wifi connect '{}' password '{}'" # command to automaticaly connect to a network

DEFAULT_SHELL: "/bin/bash" # default shell for new users
USERADD: "useradd -m -p {} -g users -G {} -s {} {}" # command to add new users
MOUNTPOINT: "/mnt" # default mountpoint

# bootloader related commands
BOOTLOADER_EFI: "grub-install --efi-directory /boot/efi --force {}"
BOOTLOADER_DOS: "grub-install --root-directory=/boot {}"
BOOTLOADER_CONFIG: "grub-mkconfig -o /boot/grub/grub.cfg"

# system settings
LOCAL: "en_US.UTF-8"
KEYMAP: "be-latin1"
HOSTNAME: "tos"
ROOT_PWD: "123"

CHROOT: "arch-chroot -u {} {}"

# encryption command
LUKS: "cryptsetup luksFormat -v -s 512 -h sha512 {}"
LUKS_OPEN: "cryptsetup open {} luks_lvm"
LUKS_NAME: "tos"
LUKS_DEVICE: "/dev/mapper/luks_lvm"

# fstab commands
FSTAB: "genfstab -U -p /mnt > /mnt/etc/fstab"

GROUPS:
  - audio
  - lp
  - optical
  - storage
  - video
  - wheel
  - games
  - power

HERESTRING: "EOF"

BOOTSTRAP: "pacstrap --noconfirm /mnt"

BOOTSTRAP_PACKAGES:
  - base
  - base-devel
  - efibootmgr
  - vim
  - dialog
  - grub
# an array of kernels to be installed on the system
# eg you can do both linux and linux-lts or something
LINUX:
  - linux