Blame SOURCES/0002-Move-docker-and-podman-tests-up-add-comments.patch

f3cb73
From 57966df6adddbebc4f4a6b9db7680d99344b0b1c Mon Sep 17 00:00:00 2001
f3cb73
From: "Richard W.M. Jones" <rjones@redhat.com>
f3cb73
Date: Thu, 22 Dec 2022 10:34:03 +0000
f3cb73
Subject: [PATCH] Move docker and podman tests up, add comments
f3cb73
f3cb73
Refactor to bring related tests closer together and make the comments
f3cb73
more uniform.
f3cb73
---
f3cb73
 virt-what.in | 31 +++++++++++++++----------------
f3cb73
 1 file changed, 15 insertions(+), 16 deletions(-)
f3cb73
f3cb73
diff --git a/virt-what.in b/virt-what.in
f3cb73
index 170bc24ab..c6e4a1e00 100644
f3cb73
--- a/virt-what.in
f3cb73
+++ b/virt-what.in
f3cb73
@@ -165,7 +165,6 @@ fi
f3cb73
 # /proc/vz - always exists if OpenVZ kernel is running (inside and outside
f3cb73
 # container)
f3cb73
 # /proc/bc - exists on node, but not inside container.
f3cb73
-
f3cb73
 if [ -d "${root}/proc/vz" -a ! -d "${root}/proc/bc" ]; then
f3cb73
     echo openvz
f3cb73
 fi
f3cb73
@@ -173,13 +172,13 @@ fi
f3cb73
 # Check for LXC containers
f3cb73
 # http://www.freedesktop.org/wiki/Software/systemd/ContainerInterface
f3cb73
 # Added by Marc Fournier
f3cb73
-
f3cb73
 if [ -e "${root}/proc/1/environ" ] &&
f3cb73
     tr '\000' '\n' < "${root}/proc/1/environ" |
f3cb73
         grep -Eiq '^container=lxc'; then
f3cb73
     echo lxc
f3cb73
 fi
f3cb73
 
f3cb73
+# Check for Illumos LX
f3cb73
 if [ -e "${root}/proc/1/environ" ] &&
f3cb73
     tr '\0' '\n' < "${root}/proc/1/environ" | grep -q '^container=zone$' &&
f3cb73
     [ -e "${root}/proc/version" ] &&
f3cb73
@@ -187,6 +186,20 @@ if [ -e "${root}/proc/1/environ" ] &&
f3cb73
     echo illumos-lx
f3cb73
 fi
f3cb73
 
f3cb73
+# Check for Docker.
f3cb73
+if [ -f "${root}/.dockerenv" ] || [ -f "${root}/.dockerinit" ] || \
f3cb73
+   grep -qF /docker/ "${root}/proc/self/cgroup" 2>/dev/null; then
f3cb73
+    echo docker
f3cb73
+fi
f3cb73
+
f3cb73
+# Check for Podman.
f3cb73
+if [ -e "${root}/proc/1/environ" ] &&
f3cb73
+    cat "${root}/proc/1/environ" | tr '\000' '\n' | grep -Eiq '^container=podman'; then
f3cb73
+    echo podman
f3cb73
+elif grep -qF /libpod- "${root}/proc/self/cgroup" 2>/dev/null; then
f3cb73
+    echo podman
f3cb73
+fi
f3cb73
+
f3cb73
 # Check for Linux-VServer
f3cb73
 if test -e "${root}/proc/self/status" \
f3cb73
    && cat "${root}/proc/self/status" | grep -q "VxID: [0-9]*"; then
f3cb73
@@ -381,20 +394,6 @@ if ! "$skip_lkvm"; then
f3cb73
     fi
f3cb73
 fi
f3cb73
 
f3cb73
-# Check for Docker.
f3cb73
-if [ -f "${root}/.dockerenv" ] || [ -f "${root}/.dockerinit" ] || \
f3cb73
-   grep -qF /docker/ "${root}/proc/self/cgroup" 2>/dev/null; then
f3cb73
-    echo docker
f3cb73
-fi
f3cb73
-
f3cb73
-# Check for Podman.
f3cb73
-if [ -e "${root}/proc/1/environ" ] &&
f3cb73
-    cat "${root}/proc/1/environ" | tr '\000' '\n' | grep -Eiq '^container=podman'; then
f3cb73
-    echo podman
f3cb73
-elif grep -qF /libpod- "${root}/proc/self/cgroup" 2>/dev/null; then
f3cb73
-    echo podman
f3cb73
-fi
f3cb73
-
f3cb73
 # Check ppc64 lpar, kvm or powerkvm
f3cb73
 
f3cb73
 # example /proc/cpuinfo line indicating 'not baremetal'
f3cb73
-- 
f3cb73
2.31.1
f3cb73