Skip to content

Create a pot: all the possible ways

Luca Pizzamiglio edited this page Mar 3, 2018 · 3 revisions

NOTE This page is still a draft!

This page's goal is to explain how the pot creation process works.

ZFS dataset of a pot

Every pot is built using at least 3 dataset:

  • base
  • packages
  • customization

A pot can have his own datasets or it can reuse datasets provided by other pots.

Moreover, a dataset can be reused in two ways:

  • "borrow": read-only mount the dataset provided by another pot (reuse "as-it-is")
  • "clone": clone the dataset provided by another pot (reuse as a template)

Create a base

What is a base? A Base is a vanilla FreeBSD image, that has a format suitable to be used by pots. In other words, a base is a special "root" pot.

The precondition is to have one base available, so create one

# pot create-base -r 11.1

This command will create the 3 basic datasets filled with a FreeBSD vanilla image:

  • base: a FreeBSD userspace environment (libraries, utilities, toolchain, daemons)
  • package: an empty dataset, because in a vanilla FreeBSD image there's no package
  • customization: a dataset filled with default FreeBSD configuration

This command creates also a special pot, called base-11_1, that can be used to modify the base's datasets

NOTE: Currently I use this special pot to create additional directories (mount point) and to run freebsd-upgrade

Create a pot : case #1

# pot create -p pot-case1 -b 11.1

This command creates a new pot, called pot-case1. It borrows the base dataset and it clones the other two datasets, package and customization from the base 11.1.

# pot create -p pot-case1 -b 11.1 -l 1

This command is fully equivalent and it makes explicit the pot "level": you can consider the pot level as the number of dataset that are borrowed.

The pot pot-case1, then, owns only two datasets (package and customization), while the base dataset is borrowed (AKA mounted in read-only) from the base.

Create a pot : case #2

# pot create -p pot-case2 -P pot-case1

This command creates a new pot, called pot-case2. It borrows the base dataset from the base 11.1, like pot-case1; it clones the other two datasets, package and customization, from the pot pot-case1

NOTE: in order to use pot-case1 as reference, pot-case1 has to be a level 1 (like pot-case2)

NOTE: the option -b 11.1 can be omitted, it can be deduced by the pot pot-case1

NOTE: this pot is still level 1, because the number of dataset borrowed is still 1

Create a pot : case #3

# pot create -p pot-case3 -P pot-case1 -l 2

This command creates a new pot, called pot-case3. It borrows the base dataset from the base 11.1, like pot-case1; it borrows the package dataset from pot-case1; it clones the dataset 'customization' from the pot pot-case1

NOTE In order to work in this way, pot-case1 has to be a level 1 pot

Create a pot : case #4

# pot create -p pot-case4 -P pot-case3 -l 2

This command creates a new level 2 pot, called pot-case4. It borrows the base dataset from the base 11.1; it borrow the package dataset from pot-case1 (like pot-case3 does); it clones the dataset 'customization' from the pot pot-case3

NOTE This command is syntactically the same as the case #3, but it uses a level 2 pot as reference/parent