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 2727 erofsFlags = builtins . concatStringsSep " " config . microvm . storeDiskErofsFlags ;
2828 squashfsFlags = builtins . concatStringsSep " " config . microvm . storeDiskSquashfsFlags ;
2929
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+
3036 writeClosure = pkgs . writeClosure or pkgs . writeReferencesToFile ;
3137
3238 storeDiskContents = writeClosure (
8288 done
8389
8490 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+ )
8997 '' ;
9098 } )
9199
You can’t perform that action at this time.
0 commit comments