I'm using storage section of autoinstal for simple custom /dev/sda disk layout: sda1 (512MB) /boot, sda2 (2GB) swap, sda3 (-1) /. I'm having problem defining swap properly. Curtin docs claim it to be:
- define partition,
- define format with fstype: swap,
- define mount without path with some options: (options: pri=1,discard=pages).
My simple config:
storage:
version: 1
# swap:
# filename: /dev/sda2
# size: 2GB
# maxsize: 2GB
config:
- type: disk
id: sda
path: /dev/sda
ptable: msdos
name: system-disk
wipe: superblock
grub_device: true
- type: partition
id: sda-sda1
number: 1
size: 512MB
device: sda
name: boot-partition
flag: boot
- type: partition
id: sda-sda2
number: 2
size: 2GB
device: sda
name: swap-partition
flag: swap
- type: partition
id: sda-sda3
number: 3
size: -1
device: sda
name: root-partition
- type: format
id: sda-sda1-fs
fstype: ext4
label: boot
volume: sda-sda1
- type: format
id: sda-sda2-fs
fstype: swap
label: swap
volume: sda-sda2
- type: format
id: sda-sda3-fs
fstype: ext4
label: root
volume: sda-sda3
- type: mount
id: sda-sda1-fs-mount1
path: /boot
device: sda-sda1-fs
- type: mount
id: sda-sda2-fs-mount1
options: pri=2,discard=pages
device: sda-sda2-fs
- type: mount
id: sda-sda3-fs-mount1
path: /
device: sda-sda3-fs
At install I get is: "TypeError: __init__() missing 1 required positional argument: 'path'
". If I remove entry with id: sda-sda2-fs-mount1 (the one for swap) and uncomment swap section pointing to /dev/sda2. I get working swap.
How to define swap using only config section. Mixing several solutions is not elegant solution imho.