Revert "detect-virt: also detect "microsoft" as WSL"

WSL2 will soon (TM) include the "WSL2" string in /proc/sys/kernel/osrelease
so the workaround will no longer be necessary.
We have several different cloud images which do include the "microsoft"
string already, which would break this detection. They are for internal
usage at the moment, but the userspace side can come from all over the
place so it would be quite hard to track and downstream-patch to avoid
breakages.

This reverts commit a2f838d590.
This commit is contained in:
Luca Boccassi 2020-04-27 12:04:35 +01:00 committed by Zbigniew Jędrzejewski-Szmek
parent 7229ec02ab
commit 4096043f05

View file

@ -464,12 +464,10 @@ int detect_container(void) {
goto finish;
}
/* "Official" way of detecting WSL https://github.com/Microsoft/WSL/issues/423#issuecomment-221627364,
* ... and a working one, since the official one doesn't actually work ;(
*/
/* "Official" way of detecting WSL https://github.com/Microsoft/WSL/issues/423#issuecomment-221627364 */
r = read_one_line_file("/proc/sys/kernel/osrelease", &o);
if (r >= 0 &&
(strstr(o, "Microsoft") || strstr(o, "microsoft") || strstr(o, "WSL"))) {
(strstr(o, "Microsoft") || strstr(o, "WSL"))) {
r = VIRTUALIZATION_WSL;
goto finish;
}