Re: [PATCH] Detect Illumos (SmartOS/OmniOS) LX virtualization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 11, 2022 at 11:28:56AM -0400, Steve Mokris wrote:
> Here's a revised version of my previous patch, based on discussion at https://github.com/TritonDataCenter/illumos-joyent/pull/415 .
> 
> ---

> +++ b/virt-what.in
> @@ -179,6 +179,13 @@ if [ -e "${root}/proc/1/environ" ] &&
>      echo lxc
>  fi
>  
> +if [ -e "${root}/proc/1/environ" ] &&
> +    cat "${root}/proc/1/environ" | tr '\000' '\n' | grep -q '^container=zone$' &&

Useless use of cat; this could be:

  tr '\0' '\n' < "${root}/proc/1/environ" | grep -q '^container=zone$' &&

> +    [ -e "${root}/proc/version" ] &&
> +    cat "${root}/proc/version" | grep -q 'BrandZ virtual linux'; then

and similarly,

grep -q 'BrandZ virtual linux' < "${root}/proc/version"; then

> +    echo illumos-lx
> +fi
> +
>  # Check for Linux-VServer
>  if test -e "${root}/proc/self/status" \
>     && cat "${root}/proc/self/status" | grep -q "VxID: [0-9]*"; then

But as it is a pre-existing pattern in this file, we could do it as a
separate cleanup.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org




[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux