File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change 27
27
erofsFlags = builtins . concatStringsSep " " config . microvm . storeDiskErofsFlags ;
28
28
squashfsFlags = builtins . concatStringsSep " " config . microvm . storeDiskSquashfsFlags ;
29
29
30
+ mkfsCommand =
31
+ {
32
+ squashfs = "gensquashfs ${ squashfsFlags } -D store --all-root -q $out" ;
33
+ erofs = "mkfs.erofs ${ erofsFlags } -T 0 --all-root -L nix-store --mount-point=/nix/store $out store" ;
34
+ } . ${ config . microvm . storeDiskType } ;
35
+
30
36
writeClosure = pkgs . writeClosure or pkgs . writeReferencesToFile ;
31
37
32
38
storeDiskContents = writeClosure (
82
88
done
83
89
84
90
echo Creating a ${ config . microvm . storeDiskType }
85
- bwrap $BWRAP_ARGS -- time ${ {
86
- squashfs = "gensquashfs ${ squashfsFlags } -D store --all-root -q $out" ;
87
- erofs = "mkfs.erofs ${ erofsFlags } -T 0 --all-root -L nix-store --mount-point=/nix/store $out store" ;
88
- } . ${ config . microvm . storeDiskType } }
91
+ bwrap $BWRAP_ARGS -- time ${ mkfsCommand } || \
92
+ (
93
+ echo "Bubblewrap failed. Falling back to copying...">&2
94
+ cp -a $(sort -u ${ storeDiskContents } ) store/
95
+ time ${ mkfsCommand }
96
+ )
89
97
'' ;
90
98
} )
91
99
You can’t perform that action at this time.
0 commit comments