From ea8a6996905aac9aa171d86b3e94ea094b7669d1 Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Mon, 30 Sep 2019 18:31:45 +0200 Subject: xuname: add rootless hypervisor detection as fallback --- xuname | 1 + 1 file changed, 1 insertion(+) (limited to 'xuname') diff --git a/xuname b/xuname index 8dbcf17..7c63755 100755 --- a/xuname +++ b/xuname @@ -7,6 +7,7 @@ MACH=$(xbps-uhelper arch) OUTDATED=$(xbps-install -Mun) HOLD=$(xbps-query -H) VM=$(dmesg 2>/dev/null | awk '/Hypervisor detected/{print $NF}') +[ -z "$VM" ] && grep -q hypervisor /proc/cpuinfo && VM=VM CPU=$(cat /proc/cpuinfo |awk '/^vendor_id/{print $NF;exit}') [ -z "$CPU" ] && CPU=$(cat /proc/cpuinfo |awk '/^platform/{print $NF;exit}') REPO=$(xbps-query --regex -p repository -s '.' | cut -d/ -f2- | sort -u | awk ' -- cgit 1.4.1