Skip to content

Commit

Permalink
nixos/repart: add loop module to initrd
Browse files Browse the repository at this point in the history
Systemd-repart will use loopback devices for partition creation if it is
able to, and will fallback to doing "offline" partition creation writing
data directly to files. From what I see looking at the repart code,
there are specific features that cannot be taken advantage of when not
using loopback devices (e.g. no BTRFS subvolumes in systemd v255) and in
certain places they have to perform some manual re-sizing work that can
otherwise be avoided.
  • Loading branch information
jmbaur committed Jan 5, 2024
1 parent 3e2503b commit 1dad7f6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions nixos/modules/system/boot/systemd/repart.nix
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ in
}
];

# systemd-repart uses loopback devices for partition creation
boot.initrd.availableKernelModules = lib.optional initrdCfg.enable "loop";

boot.initrd.systemd = lib.mkIf initrdCfg.enable {
additionalUpstreamUnits = [
"systemd-repart.service"
Expand Down

0 comments on commit 1dad7f6

Please sign in to comment.