Welcome to the repository of my personal dream system image built using mkosi.
This entire project started out as an attempt to implement Fitting Everything Together. So it would be beneficial to first read that, as the following will mostly build on top of that with certain deviations.
- Format: VFAT
- Size: 0.5G
This is the partition intended to hold the systemd-boot
bootloader, its configuration and some small EFI binaries that
should be listed in the bootloader interface. When dual-booting with Windows this also houses its bootloader files.
- Format: VFAT
- Size: 2G
This is a separate partition to EFI
partition because the EFI
partition created by Windows is limited to 100M in
size by default and being able to dual-boot with Windows is one of the main intended use-cases. This partition holds a
UKI for each usr
partition that one should be able to boot into.
- Label:
NekkOS_<version>
- Format: dm-verity (EROFS)
- Size: 5G
Note
During partitioning the B partition gets the label of _empty
to be populated on first update.
dm-verity based system partition that contains the minimal usable system to boot into. Each update to the base system switches between populating the A and B version of the partitions.
- Label:
NekkOS_<version>
- Format: dm-verity (HASH)
- Size: 0.5G
Note
During partitioning the B partition gets the label of _empty
to be populated on first update.
Contains dm-verity integrity hash data for the matching usr
partition.
- Format: LUKS (swap)
- Size: 100% RAM
Note
Encrypt partition contents using LUKS2, tied to TPM2 PCR 7 and 11 as well as with a backup password.
The minimum size should be at least enough to enable system hibernation. This partition is used to aid in memory management, especially when the system is under memory related pressure.
- Format: LUKS (BTRFS)
- Size: 0.5G
Note
Encrypt partition contents using LUKS2, tied to TPM2 PCR 7 and 11 as well as with a backup password.
This partition is by default read-only and can be remounted as read-write when needed.
This partition only contains the root filesystem structure and a few basic configuration files that are populated during
installation by running systemd-firstboot
. This is required because machine-id
is used in the UUID calculation for
the var
partition and therefor needs to be unique for each installation.
- Format: LUKS (BTRFS)
- Size: remaining
Note
Encrypt partition contents using LUKS2, tied to TPM2 PCR 7 and 11 as well as with a backup password.
This is the required mutable partition for system state. /home/
bind mounts into a directory within this partition,
so that the 2 mutable locations do not need to be separate partitions, which would likely result in them needing to be
resized when one of them is nearing maximum capacity.
For more detailed information on some of the directories please visit the following site: https://www.freedesktop.org/software/systemd/man/latest/file-hierarchy.html
/
: mount point for theroot
partition/boot/
: mount point for theXBOOTLDR
partition/efi/
: mount point for theESP
partition/srv/
: mount point for thesrv
partition/tmp/
: mount point for atmpfs
/home/
: mount point for thehome
partition/root/
: administrator home directory/etc/
: administrator configuration files
/run/
: runtime data, sockets and similar files/run/log/
: runtime system logs/run/user/
: per-user$XDG_RUNTIME_DIR
/usr/
: mount point for theusr
partition/usr/bin/
: system executable files/usr/lib/
: system library files/usr/libexec/
: package executable files/usr/share/
: package resource files/usr/etc/
: package configuration files
/var/
: mount point forvar
partition/var/tmp/
: mount point fortmp
partition/var/cache/
: persistent system cache/var/lib/
: persistent system data/var/log/
: persistent system logs/var/home/
:systemd-homed
managed user accounts/var/lock/
: system device and resource lock files/var/spool/
: printer, mail and similar queues
/bin/
->/usr/bin/
/lib/
->/usr/lib/
/var/run/
->/run/
$XDG_CACHE_HOME
(default:~/.cache/
) : persistent user cache$XDG_CONFIG_HOME
(default:~/.config/
): user configuration files$XDG_BIN_HOME
(default:~/.local/bin/
): user executable files$XDG_LIB_HOME
(default:~/.local/lib/
): user library files$XDG_DATA_HOME
(default:~/.local/share/
): user shared resources$XDG_STATE_HOME
(default:~/.local/state/
): persistent user state
$ systemd-repart --dry-run=false --defer-partitions=var "$DRIVE"
$ systemd-firstboot --image="$DRIVE" --prompt --setup-machine-id
$ systemd-repart --image="$DRIVE" --dry-run=false
$ bootctl install --image="$DRIVE"