From 4096043f05b5e9e5c306ea24d34fcc4e2977e18d Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Mon, 27 Apr 2020 12:04:35 +0100 Subject: [PATCH] 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 a2f838d59075a49b012f9b7056664f7ffeed44d2. --- src/basic/virt.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/basic/virt.c b/src/basic/virt.c index f21a36c6fea..c6bff6b16e8 100644 --- a/src/basic/virt.c +++ b/src/basic/virt.c @@ -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; } -- 2.47.3