Skip to content

Operation

Uri Herrera edited this page Feb 20, 2019 · 1 revision

General

znx will work only on 64 bit UEFI systems. This is not a bug, but a design. Feel free to fork the project, if your needs aren't addressed by our goals.

Files

znx consists of basically three files:

  • bootx64.efi: A GRUB2 image suitable for booting in x64 UEFI machines.
  • grub.cfg: A GRUB2 script that detects the available images in the system during boot.
  • znx: This is a shell script responsible of image management (deployments, removals, updates, etc.).

Conventions

Image: Child directories of the /STORE directory (the filesystem serves as a database) whose names are in the format [a-zA-Z0-9]_.+/[a-zA-Z0-9]_.+. Contains at least one ISO-9660 file, called IMAGE.0, and a directory called DATA. Possibly a second ISO-9660 file, called IMAGE.0.zs-old, which is a backup of the former file (only exists after an update is performed).

A device that is to be managed by znx should be initialized in the first place. Initializing a device consists of two steps: a) all data in the device is wiped, and b) two partitions are created on the device; the first with 64MB in size (this will be the ESP), and the second that fills-up the rest of the free space (this one will contain user data and images).

+------------------------+-------------------------------+
|         ESP            |             Data              |
|------------------------+-------------------------------|
| - Size: 64MB.          | - Size: Device size - 64MB.   |
| - Filesystem: FAT32.   | - Filesystem: BTRFS.          |
| - Label: ZNX_BOOT.     | - Label: ZNX_DATA.            |
+------------------------+-------------------------------+

The ZNX_BOOT partition has the following contents:

/efi
/efi/boot
/efi/boot/bootx64.efi

/boot
/boot/grub
/boot/grub/grub.cfg

The ZNX_DATA partition has the following contents:

/STORE

When the user deploys an image (see the commands section for more information), znx will create a subdirectory in /STORE: /STORE/<VENDOR>/<RELEASE>. Inside this directory, one ISO image will be stored, and another subdirectory will be created: /STORE/<VENDOR>/<RELEASE>/DATA. This directory will serve as the root mount point of the writeable overlays that are mounted at boot time. So, after an image is deployed, the contents of the ZNX_DATA partition will be:

/STORE
/STORE/<VENDOR>
/STORE/<VENDOR>/<RELEASE>
/STORE/<VENDOR>/<RELEASE>/IMAGE.0
/STORE/<VENDOR>/<RELEASE>/DATA

This is a lot more simple than the Filesystem Hierarchy Standard.

About the initramfs

znx doesn't attempt to handle the boot-time overlay mount points. It's up to the distribution developers to enable this features in their initial RAM filesystems (it's pretty straightforward, though; just see this and this). With this few lines of code, data persistence can be enabled.

WIP

Clone this wiki locally
You can’t perform that action at this time.