-
-
Notifications
You must be signed in to change notification settings - Fork 138
Description
Zstandard is a loseless compression algorithm, and dual-licensed under BSD OR GPLv2.
WSL supports importing quite a few formats already like .tar.
, .tar.xz
, .tar.gz
and .tar.zst
.
I'm aware of #109 and agree with the size increase worry. Regarding implementation, do you mean a go package for the compression algorithms or something else? If you mean packages, I think this or this would work.
To test if it's possible, I just blindly modified
Lines 20 to 22 in 3672589
var ( | |
defaultRootFiles = []string{"install.tar", "install.tar.gz", "rootfs.tar", "rootfs.tar.gz", "install.ext4.vhdx", "install.ext4.vhdx.gz"} | |
) |
.tar.zst
just works. A more thorough support would require importing the package and change Lines 106 to 124 in 3672589
// uncompress and copy | |
rootPathLower := strings.ToLower(rootPath) | |
if strings.HasSuffix(rootPathLower, ".gz") { | |
// compressed with gzip | |
gr, err := gzip.NewReader(src) | |
if err != nil { | |
return err | |
} | |
_, err = io.Copy(dest, gr) | |
if err != nil { | |
return err | |
} | |
} else { | |
// not compressed | |
_, err = io.Copy(dest, src) | |
if err != nil { | |
return err | |
} | |
} |
A test build of wsldl is available here and I successfully built DevuanWSL based on that. Running Devuan.exe
does register the instance and it works flawlessly as far as I can tell so it should be feasible I guess.