Skip to content

Commit ccf44d6

Browse files
oddlamaastro
authored andcommitted
fix: wait for the correct mount before attempting to create an overlayfs (closes #186)
also adds a requires on module loading to 9p shares which can also be affected
1 parent 088ba56 commit ccf44d6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

nixos-modules/microvm/mounts.nix

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ lib.mkIf config.microvm.guest.enable {
3838
"/nix/store" = {
3939
device = roStoreDisk;
4040
fsType = storeDiskType;
41-
options = [ "x-systemd.after=systemd-modules-load.service" ];
41+
options = [ "x-systemd.requires=systemd-modules-load.service" ];
4242
neededForBoot = true;
4343
};
4444
}
@@ -65,7 +65,7 @@ lib.mkIf config.microvm.guest.enable {
6565
"/nix/.ro-store" = {
6666
device = roStoreDisk;
6767
fsType = storeDiskType;
68-
options = [ "x-systemd.after=systemd-modules-load.service" ];
68+
options = [ "x-systemd.requires=systemd-modules-load.service" ];
6969
neededForBoot = true;
7070
};
7171
}
@@ -115,8 +115,8 @@ lib.mkIf config.microvm.guest.enable {
115115
device = tag;
116116
fsType = proto;
117117
options = {
118-
"virtiofs" = [ "defaults" "x-systemd.after=systemd-modules-load.service" ];
119-
"9p" = [ "trans=virtio" "version=9p2000.L" "msize=65536" ];
118+
"virtiofs" = [ "defaults" "x-systemd.requires=systemd-modules-load.service" ];
119+
"9p" = [ "trans=virtio" "version=9p2000.L" "msize=65536" "x-systemd.requires=systemd-modules-load.service" ];
120120
}.${proto};
121121
} // lib.optionalAttrs (source == "/nix/store" || mountPoint == config.microvm.writableStoreOverlay) {
122122
neededForBoot = true;
@@ -139,7 +139,7 @@ lib.mkIf config.microvm.guest.enable {
139139
before = [ "initrd-fs.target" ];
140140
requires = [ "rw-store.service" ];
141141
after = [ "rw-store.service" ];
142-
unitConfig.RequiresMountsFor = "${roStore}";
142+
unitConfig.RequiresMountsFor = "/sysroot/${roStore}";
143143
} ];
144144
services.rw-store = {
145145
unitConfig = {

0 commit comments

Comments
 (0)