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

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