about summary refs log tree commit diff
path: root/xuname
blob: ed3b442e9b8b3be8a25e1981032de81141aa1c6f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
# xuname - display system info relevant for debugging Void

OS=Void
KVER=$(uname -r)
MACH=$(xbps-uhelper arch)
OUTDATED=$(xbps-install -Mun)
HOLD=$(xbps-query -H)
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 %s\n' \
	"$OS" "$KVER" "$MACH" "$CPU${VM:+/$VM}" "${OUTDATED:+not}uptodate" "${HOLD:+ hold}" "$REPO"