Skip to content

Commit

Permalink
fix: wait for the correct mount before attempting to create an overla…
Browse files Browse the repository at this point in the history
…yfs (closes astro#186)

also adds a requires on module loading to 9p shares which can also be affected
  • Loading branch information
oddlama authored and astro committed Jan 18, 2024
1 parent 088ba56 commit ccf44d6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions nixos-modules/microvm/mounts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ lib.mkIf config.microvm.guest.enable {
"/nix/store" = {
device = roStoreDisk;
fsType = storeDiskType;
options = [ "x-systemd.after=systemd-modules-load.service" ];
options = [ "x-systemd.requires=systemd-modules-load.service" ];
neededForBoot = true;
};
}
Expand All @@ -65,7 +65,7 @@ lib.mkIf config.microvm.guest.enable {
"/nix/.ro-store" = {
device = roStoreDisk;
fsType = storeDiskType;
options = [ "x-systemd.after=systemd-modules-load.service" ];
options = [ "x-systemd.requires=systemd-modules-load.service" ];
neededForBoot = true;
};
}
Expand Down Expand Up @@ -115,8 +115,8 @@ lib.mkIf config.microvm.guest.enable {
device = tag;
fsType = proto;
options = {
"virtiofs" = [ "defaults" "x-systemd.after=systemd-modules-load.service" ];
"9p" = [ "trans=virtio" "version=9p2000.L" "msize=65536" ];
"virtiofs" = [ "defaults" "x-systemd.requires=systemd-modules-load.service" ];
"9p" = [ "trans=virtio" "version=9p2000.L" "msize=65536" "x-systemd.requires=systemd-modules-load.service" ];
}.${proto};
} // lib.optionalAttrs (source == "/nix/store" || mountPoint == config.microvm.writableStoreOverlay) {
neededForBoot = true;
Expand All @@ -139,7 +139,7 @@ lib.mkIf config.microvm.guest.enable {
before = [ "initrd-fs.target" ];
requires = [ "rw-store.service" ];
after = [ "rw-store.service" ];
unitConfig.RequiresMountsFor = "${roStore}";
unitConfig.RequiresMountsFor = "/sysroot/${roStore}";
} ];
services.rw-store = {
unitConfig = {
Expand Down

0 comments on commit ccf44d6

Please sign in to comment.