aboutsummaryrefslogtreecommitdiffstats
path: root/community/apt-dater-host/apk-improve-Machine-Type-reporting.patch
diff options
context:
space:
mode:
authorHenrik Riomar <henrik.riomar@gmail.com>2018-03-17 18:29:56 +0100
committerJakub Jirutka <jakub@jirutka.cz>2018-03-31 17:40:23 +0200
commitae72fb1bb7becb1a2f2fce03b6b4eaf28ff692f5 (patch)
tree07fa54bbfda19bd6269aeae7c6c5c64fcc8e4c8f /community/apt-dater-host/apk-improve-Machine-Type-reporting.patch
parenta7a19674bec66451f937eb018091c4b132323b53 (diff)
downloadaports-ae72fb1bb7becb1a2f2fce03b6b4eaf28ff692f5.tar.bz2
aports-ae72fb1bb7becb1a2f2fce03b6b4eaf28ff692f5.tar.xz
community/apt-dater-host: improve-Machine-Type-reporting
See https://github.com/DE-IBH/apt-dater-host/pull/24
Diffstat (limited to 'community/apt-dater-host/apk-improve-Machine-Type-reporting.patch')
-rw-r--r--community/apt-dater-host/apk-improve-Machine-Type-reporting.patch62
1 files changed, 62 insertions, 0 deletions
diff --git a/community/apt-dater-host/apk-improve-Machine-Type-reporting.patch b/community/apt-dater-host/apk-improve-Machine-Type-reporting.patch
new file mode 100644
index 0000000000..021436aeb5
--- /dev/null
+++ b/community/apt-dater-host/apk-improve-Machine-Type-reporting.patch
@@ -0,0 +1,62 @@
+From f90d99ca8c4a04396d94ef42abe794d6ce75173b Mon Sep 17 00:00:00 2001
+From: Henrik Riomar <henrik.riomar@gmail.com>
+Date: Sat, 27 Jan 2018 19:50:38 +0100
+Subject: [PATCH] apk: improve Machine Type reporting
+
+Report Xen-PV, xen-dom0 or xen-domU to apt-dater (instead of just xen).
+---
+ apk/apt-dater-host | 13 +++++++------
+ 1 file changed, 7 insertions(+), 6 deletions(-)
+
+diff --git a/apk/apt-dater-host b/apk/apt-dater-host
+index 25c9fb8..3bd8829 100755
+--- a/apk/apt-dater-host
++++ b/apk/apt-dater-host
+@@ -4,13 +4,13 @@
+ #
+ # Implementation of the protocol described in
+ # https://github.com/DE-IBH/apt-dater-host/blob/master/doc/ADP-0.6
+-# using Busybox ash, awk and sed for use with Alpine Linux
++# using Busybox ash, awk, sed, and tr for use with Alpine Linux
+ #
+ # Author:
+ # Henrik Riomar <henrik.riomar@gmail.com>
+ #
+ # Copyright Holder:
+-# 2016, 2017 (C) Henrik Riomar
++# 2016-2018 (C) Henrik Riomar
+ #
+ # License:
+ # This program is free software; you can redistribute it and/or modify
+@@ -32,6 +32,7 @@ ADP_VERSION="0.6"
+ ROOT_CMD="sudo"
+ APK_CMD="/sbin/apk"
+ VIRT_WHAT_CMD="/usr/sbin/virt-what --test-root=/"
++DMESG_CMD="dmesg"
+
+ err=255 # exit code returned by Perl from die()
+
+@@ -94,16 +95,16 @@ get_pkg_stat()
+ # VIRT: ${Name}
+ get_virt()
+ {
+- virt=$(dmesg | awk '/Hypervisor detected:/ {print $NF}')
++ virt=$($DMESG_CMD | awk -F': ' '/Hypervisor detected:/ {print $NF}')
+ if [ -n "$virt" ]; then
+- echo "VIRT: $virt"
++ echo "VIRT: $(echo "$virt" | tr -s ' ' '-')"
+ else
+- virt=$($VIRT_WHAT_CMD 2> /dev/null)
++ virt=$($VIRT_WHAT_CMD 2> /dev/null | tail -1)
+ ret=$?
+ if [ -z "$virt" ]; then
+ [ $ret -eq 0 ] && echo "VIRT: Physical" || echo "VIRT: Unknown"
+ else
+- echo "VIRT: $(echo $virt | awk '{print $1}')"
++ echo "VIRT: $(echo "$virt" | tr -s ' ' '-')"
+ fi
+ fi
+ }
+--
+2.11.0
+