ba34c6
Name:           virt-what
ed076f
Version:        1.25
b853a2
Release:        3%{?dist}
ba34c6
Summary:        Detect if we are running in a virtual machine
ba34c6
License:        GPLv2+
ba34c6
ba34c6
URL:            http://people.redhat.com/~rjones/virt-what/
ba34c6
Source0:        http://people.redhat.com/~rjones/virt-what/files/%{name}-%{version}.tar.gz
ba34c6
ed076f
# Maintainer script which helps with handling patches.
ed076f
Source1:       copy-patches.sh
ed076f
ed076f
# Patches are maintained in the following repository:
b853a2
# http://git.annexia.org/?p=virt-what.git;a=shortlog;h=refs/heads/rhel-8.8
ed076f
ed076f
# Patches.
b853a2
Patch0001:     0001-Rearrange-lxc-test-to-avoid-use-of-cat.patch
b853a2
Patch0002:     0002-Move-docker-and-podman-tests-up-add-comments.patch
b853a2
Patch0003:     0003-podman-Fix-location-of-test-file-proc-1-environ.patch
b853a2
Patch0004:     0004-Detect-OCI-containers.patch
b853a2
Patch0005:     0005-Add-support-for-Alibaba-cloud-on-aarch64.patch
ed076f
ed076f
BuildRequires:  make
ba34c6
BuildRequires:  git
ed076f
BuildRequires:  autoconf, automake, libtool
ba34c6
ba34c6
# This is provided by the build root, but we make it explicit
ba34c6
# anyway in case this was dropped from the build root in future.
ed076f
BuildRequires:  gcc
ba34c6
BuildRequires:  /usr/bin/pod2man
ba34c6
ba34c6
# Required at build time in order to do 'make check' (for getopt).
ba34c6
BuildRequires:  util-linux
ba34c6
ba34c6
# virt-what script uses dmidecode and getopt (from util-linux).
ba34c6
# RPM cannot detect this so make the dependencies explicit here.
ba34c6
%ifarch aarch64 %{ix86} x86_64
ba34c6
Requires:       dmidecode
ba34c6
%endif
ba34c6
Requires:       util-linux
ba34c6
ba34c6
# Runs the 'which' program to find the helper.
ba34c6
Requires:       which
ba34c6
ba34c6
ba34c6
%description
ba34c6
virt-what is a shell script which can be used to detect if the program
ba34c6
is running in a virtual machine.
ba34c6
ba34c6
The program prints out a list of "facts" about the virtual machine,
ba34c6
derived from heuristics.  One fact is printed per line.
ba34c6
ba34c6
If nothing is printed and the script exits with code 0 (no error),
ba34c6
then it can mean either that the program is running on bare-metal or
ba34c6
the program is running inside a type of virtual machine which we don't
ba34c6
know about or can't detect.
ba34c6
ba34c6
Current types of virtualization detected:
ba34c6
ed076f
 - alibaba_cloud      Alibaba cloud
ed076f
 - alibaba_cloud-ebm
ed076f
 - aws                Amazon Web Services
ed076f
 - bhyve              FreeBSD hypervisor
ed076f
 - docker             Docker container
ed076f
 - google_cloud       Google cloud
ed076f
 - hyperv             Microsoft Hyper-V
ed076f
 - ibm_power-kvm      IBM POWER KVM
ed076f
 - ibm_power-lpar_shared IBM POWER LPAR (hardware partition)
ba34c6
 - ibm_power-lpar_dedicated
ed076f
 - ibm_systemz-*      IBM SystemZ Direct / LPAR / z/VM / KVM
ed076f
 - illumos-lx         Illumos with Linux syscall emulation
ed076f
 - ldoms              Oracle VM Server for SPARC Logical Domains
ed076f
 - linux_vserver      Linux VServer container
ed076f
 - lxc                Linux LXC container
ed076f
 - kvm                Linux Kernel Virtual Machine (KVM)
ed076f
 - lkvm               LKVM / kvmtool
ed076f
 - nutanix_ahv        Nutanix Acropolis Hypervisor (AHV)
ed076f
 - openvz             OpenVZ or Virtuozzo
ed076f
 - ovirt              oVirt node
ed076f
 - parallels          Parallels Virtual Platform
ed076f
 - podman             Podman container
ed076f
 - powervm_lx86       IBM PowerVM Lx86 Linux/x86 emulator
ed076f
 - qemu               QEMU (unaccelerated)
ed076f
 - redhat             Red Hat hypervisor
ed076f
 - rhev               Red Hat Enterprise Virtualization
ed076f
 - uml                User-Mode Linux (UML)
ed076f
 - virtage            Hitachi Virtualization Manager (HVM) Virtage LPAR
ed076f
 - virtualbox         VirtualBox
ed076f
 - virtualpc          Microsoft VirtualPC
ed076f
 - vmm                vmm OpenBSD hypervisor
ed076f
 - vmware             VMware
ed076f
 - xen                Xen
ed076f
 - xen-dom0           Xen dom0 (privileged domain)
ed076f
 - xen-domU           Xen domU (paravirtualized guest domain)
ed076f
 - xen-hvm            Xen guest fully virtualized (HVM)
ba34c6
ba34c6
ba34c6
%prep
ed076f
%autosetup -S git
ed076f
ed076f
# Always rebuild upstream autotools files.
ed076f
autoreconf -i
ba34c6
ba34c6
ba34c6
%build
ba34c6
%configure
ba34c6
make
ba34c6
ba34c6
ba34c6
%install
ed076f
%make_install
ba34c6
ba34c6
ba34c6
%check
ed076f
if ! make -k check ; then
ed076f
    find -name test-suite.log -exec cat {} \;
ba34c6
    exit 1
ba34c6
fi
ba34c6
ba34c6
%files
ba34c6
%doc README COPYING
ba34c6
%{_sbindir}/virt-what
ba34c6
%{_libexecdir}/virt-what-cpuid-helper
ba34c6
%{_mandir}/man1/*.1*
ba34c6
ba34c6
ba34c6
%changelog
b853a2
* Mon Jan 30 2023 Richard W.M. Jones <rjones@redhat.com> - 1.25-3
b853a2
- Add support for Alibaba cloud on aarch64
b853a2
  resolves: rhbz#2165518
b853a2
b853a2
* Thu Jan 05 2023 Richard W.M. Jones <rjones@redhat.com> - 1.25-2
b853a2
- Add support for OCI containers
b853a2
  resolves: rhbz#2155233
b853a2
ed076f
* Wed Aug 17 2022 Richard W.M. Jones <rjones@redhat.com> - 1.25-1
ed076f
- Rebase to 1.25
ed076f
  resolves: rhbz#2118195
ed076f
ed076f
* Tue Apr 19 2022 Richard W.M. Jones <rjones@redhat.com> - 1.18-14
ed076f
- Add guest detection for RHEL hypervisors
ed076f
  resolves: rhbz#2076628
ed076f
- Update patches to 1.22
ed076f
c0ee7c
* Mon Sep 06 2021 Richard W.M. Jones <rjones@redhat.com> - 1.18-13
c0ee7c
- Support for Docker
c0ee7c
  resolves: rhbz#2000834
c0ee7c
fcf72c
* Fri Jun 18 2021 Richard W.M. Jones <rjones@redhat.com> - 1.18-12
fcf72c
- Support for VMware on aarch64
fcf72c
  resolves: rhbz#1959154
fcf72c
fcf72c
* Wed Jun 02 2021 Richard W.M. Jones <rjones@redhat.com> - 1.18-11
fcf72c
- Add gating tests
fcf72c
  resolves: rhbz#1967094
fcf72c
fcf72c
* Wed Apr 28 2021 Richard W.M. Jones <rjones@redhat.com> - 1.18-10
fcf72c
- Rebuild for fixed binutils on aarch64
fcf72c
  resolves: rhbz#1954455
fcf72c
6f448a
* Tue Apr 13 2021 Richard W.M. Jones <rjones@redhat.com> - 1.18-9
6f448a
- Fix crash on non-KVM platforms through incorrect use of CPUID
6f448a
  related: rhbz#1756381
6f448a
6f448a
* Tue Dec 10 2019 Richard W.M. Jones <rjones@redhat.com> - 1.18-8
6f448a
- Add support for Nutanix AHV
6f448a
  resolves: rhbz#1756381
6f448a
- Add all patches since 1.18 was released, up to 1.20 and beyond.
6f448a
6f448a
* Thu Mar 21 2019 Richard W.M. Jones <rjones@redhat.com> - 1.18-7
6f448a
- Add gating tests resolves: rhbz#1682785
6f448a
ba34c6
* Wed Oct 31 2018 Richard W.M. Jones <rjones@redhat.com> - 1.18-6
ba34c6
- Add further patches to fix AWS support
ba34c6
  resolves: rhbz#1644497
ba34c6
ba34c6
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.18-5
ba34c6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
ba34c6
ba34c6
* Tue Oct 17 2017 Richard W.M. Jones <rjones@redhat.com> - 1.18-4
ba34c6
- Include upstream patches since 1.18 was released.
ba34c6
- dmidecode is also available on aarch64.
ba34c6
ba34c6
* Mon Jul 31 2017 Richard W.M. Jones <rjones@redhat.com> - 1.18-1
ba34c6
- New upstream version 1.18.
ba34c6
- Update RPM description section with complete list of supported guests.
ba34c6
- If ‘make check’ fails, dump ‘test-suite.log’.
ba34c6
ba34c6
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.15-6
ba34c6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
ba34c6
ba34c6
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.15-5
ba34c6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
ba34c6
ba34c6
* Tue Jun 14 2016 Richard W.M. Jones <rjones@redhat.com> - 1.15-4
ba34c6
- Require 'which' program.
ba34c6
ba34c6
* Fri Feb 05 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.15-3
ba34c6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
ba34c6
ba34c6
* Fri Jun 19 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.15-2
ba34c6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
ba34c6
ba34c6
* Tue Apr 21 2015 Richard W.M. Jones <rjones@redhat.com> - 1.15-1
ba34c6
- New upstream version 1.15.
ba34c6
- Remove patches, now upstream.
ba34c6
ba34c6
* Mon Aug 18 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.13-5
ba34c6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
ba34c6
ba34c6
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.13-4
ba34c6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
ba34c6
ba34c6
* Mon Oct 28 2013 Richard W.M. Jones <rjones@redhat.com> - 1.13-3
ba34c6
- Suppress warning message on Amazon EC2:
ba34c6
  "grep: /proc/xen/capabilities: No such file or directory"
ba34c6
ba34c6
* Wed Sep 11 2013 Richard W.M. Jones <rjones@redhat.com> - 1.13-2
ba34c6
- Include two upstream patches for detecting Xen and Linux VServer better
ba34c6
  (RHBZ#973663).
ba34c6
- Modernize the spec file.
ba34c6
ba34c6
* Mon Jul 29 2013 Richard W.M. Jones <rjones@redhat.com> - 1.13-1
ba34c6
- New upstream version 1.13.
ba34c6
ba34c6
* Fri Feb 15 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.12-3
ba34c6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
ba34c6
ba34c6
* Sun Jul 22 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.12-2
ba34c6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
ba34c6
ba34c6
* Sat Mar 17 2012 Richard W.M. Jones <rjones@redhat.com> - 1.12-1
ba34c6
- New upstream version 1.12.
ba34c6
ba34c6
* Wed Feb 29 2012 Richard W.M. Jones <rjones@redhat.com> - 1.11-3
ba34c6
- Remove ExclusiveArch, but don't require dmidecode except on
ba34c6
  i?86 and x86-64 (RHBZ#791370).
ba34c6
ba34c6
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.11-2
ba34c6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
ba34c6
ba34c6
* Fri May 27 2011 Richard W.M. Jones <rjones@redhat.com> - 1.11-1
ba34c6
- New upstream version 1.11.
ba34c6
ba34c6
* Wed May 25 2011 Richard W.M. Jones <rjones@redhat.com> - 1.10-1
ba34c6
- New upstream version 1.10.
ba34c6
ba34c6
* Tue Mar  8 2011 Richard W.M. Jones <rjones@redhat.com> - 1.9-1
ba34c6
- New upstream version 1.9.
ba34c6
ba34c6
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.8-2
ba34c6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
ba34c6
ba34c6
* Mon Jan 31 2011 Richard W.M. Jones <rjones@redhat.com> - 1.8-1
ba34c6
- New upstream version 1.8.
ba34c6
ba34c6
* Thu Jan 20 2011 Richard W.M. Jones <rjones@redhat.com> - 1.7-1
ba34c6
- New upstream version 1.7.
ba34c6
ba34c6
* Wed Jan 19 2011 Richard W.M. Jones <rjones@redhat.com> - 1.6-2
ba34c6
- New upstream version 1.6.
ba34c6
- BuildRequires 'getopt' from util-linux-ng.
ba34c6
ba34c6
* Tue Jan 18 2011 Richard W.M. Jones <rjones@redhat.com> - 1.5-1
ba34c6
- New upstream version 1.5.
ba34c6
- Add 'make check' section.
ba34c6
ba34c6
* Tue Jan 18 2011 Richard W.M. Jones <rjones@redhat.com> - 1.4-1
ba34c6
- New upstream version 1.4.
ba34c6
- More hypervisor types detected.
ba34c6
ba34c6
* Thu Oct 28 2010 Richard W.M. Jones <rjones@redhat.com> - 1.3-4
ba34c6
- Move configure into build (not prep).
ba34c6
ba34c6
* Thu Oct 28 2010 Richard W.M. Jones <rjones@redhat.com> - 1.3-3
ba34c6
- Initial import into Fedora.
ba34c6
ba34c6
* Tue Oct 19 2010 Richard W.M. Jones <rjones@redhat.com> - 1.3-2
ba34c6
- Make changes suggested by reviewer (RHBZ#644259).
ba34c6
ba34c6
* Tue Oct 19 2010 Richard W.M. Jones <rjones@redhat.com> - 1.3-1
ba34c6
- Initial release.