]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Revert "detect-virt: also detect "microsoft" as WSL"
authorLuca Boccassi <luca.boccassi@microsoft.com>
Mon, 27 Apr 2020 11:04:35 +0000 (12:04 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 28 Apr 2020 11:13:12 +0000 (13:13 +0200)
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

index f21a36c6fea1b1368ccc299c2277e88e94a65998..c6bff6b16e814a3d50968e3f7d4622eccdfee7f3 100644 (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;
         }