about summary refs log tree commit diff
path: root/xuname
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2017-04-20 13:22:09 +0200
committerLeah Neukirchen <leah@vuxu.org>2017-04-20 13:22:09 +0200
commitc5136aa720bcf5f25533fd811f752c142c725e05 (patch)
treeab4ad5f55cd92772e19a278bb8aad6d6a0901d63 /xuname
parentf7031167e95e12b6c1498f04672b4454c9d851bd (diff)
downloadxtools-c5136aa720bcf5f25533fd811f752c142c725e05.tar.gz
xtools-c5136aa720bcf5f25533fd811f752c142c725e05.tar.xz
xtools-c5136aa720bcf5f25533fd811f752c142c725e05.zip
add xuname
Diffstat (limited to 'xuname')
-rwxr-xr-xxuname21
1 files changed, 21 insertions, 0 deletions
diff --git a/xuname b/xuname
new file mode 100755
index 0000000..198399d
--- /dev/null
+++ b/xuname
@@ -0,0 +1,21 @@
+#!/bin/sh
+# xuname - display system info relevant for debugging Void
+
+OS=Void
+KVER=$(uname -r)
+MACH=$(xbps-uhelper arch)
+OUTDATED=$(xbps-install -Mun)
+VM=$(dmesg | awk '/Hypervisor detected/{print $NF}')
+CPU=$(cat /proc/cpuinfo |awk '/^vendor_id/{print $NF;exit}')
+REPO=$(xbps-query --regex -p repository -s '.' | cut -d/ -f2- | sort -u | awk '
+	/^\/repo.voidlinux.eu\/current\/multilib/ {m=m"m"}
+	/^\/repo.voidlinux.eu\/current\/debug/ {d=d"d"}
+	/^\/repo.voidlinux.eu\/current\/.*\/nonfree/ {n=n"n"}
+	/^\/repo.voidlinux.eu\/current/ {r=r"r"}
+	/xdowngrade-/ {D=D"D"}
+	!/repo.voidlinux.eu/ && !/xdowngrade-/ {F=F"F"}
+	END { print r m d n D F }
+')
+
+printf '%s %s %s %s %s %s\n' \
+	"$OS" "$KVER" "$MACH" "$CPU${VM+/$VM}" "${OUTDATED+not}uptodate" "$REPO"