Make sure the distro is installed on WSL1

So we can edit its filesystem afterwards.
This commit is contained in:
Difegue 2021-09-27 16:31:45 +02:00 committed by GitHub
parent 0c54b1a035
commit f9d6721546
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -119,14 +119,14 @@ namespace Setup
session.Log("Installing WSL Distro from package.tar");
session.Log("package.tar location: " + packageLocation);
var wslProc = Process.Start("wsl.exe", $"--import lanraragi \"{distroLocation}\" \"{packageLocation}\"");
var wslProc = Process.Start("wsl.exe", $"--import lanraragi \"{distroLocation}\" \"{packageLocation}\" --version 1");
wslProc.WaitForExit();
session.Log("Exit code of wsl.exe is " + wslProc.ExitCode);
// We delete /etc/resolv.conf here as it's a leftover from the package's origins as a Docker image.
// Deleting it in Linux would be too late as WSL already started!
var cmd = $"/S /K \"del \"{distroLocation}\\rootfs\\etc\\resolv.conf\"\"";
var cmd = $"/S /K \"del \"{distroLocation}\\rootfs\\etc\\resolv.conf\"\" && exit";
session.Log("Running cmd.exe with arguments" + cmd);
Process.Start("cmd.exe", cmd).WaitForExit();
});