Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
aports
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
knuxify
aports
Commits
ae72fb1b
Commit
ae72fb1b
authored
7 years ago
by
Henrik Riomar
Committed by
Jakub Jirutka
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
community/apt-dater-host: improve-Machine-Type-reporting
See
https://github.com/DE-IBH/apt-dater-host/pull/24
parent
a7a19674
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
community/apt-dater-host/APKBUILD
+4
-2
4 additions, 2 deletions
community/apt-dater-host/APKBUILD
community/apt-dater-host/apk-improve-Machine-Type-reporting.patch
+62
-0
62 additions, 0 deletions
...y/apt-dater-host/apk-improve-Machine-Type-reporting.patch
with
66 additions
and
2 deletions
community/apt-dater-host/APKBUILD
+
4
−
2
View file @
ae72fb1b
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
# Maintainer: Henrik Riomar <henrik.riomar@gmail.com>
# Maintainer: Henrik Riomar <henrik.riomar@gmail.com>
pkgname
=
apt-dater-host
pkgname
=
apt-dater-host
pkgver
=
1.0.1
pkgver
=
1.0.1
pkgrel
=
0
pkgrel
=
1
pkgdesc
=
"Host helper application for apt-dater"
pkgdesc
=
"Host helper application for apt-dater"
url
=
"https://github.com/DE-IBH/apt-dater-host"
url
=
"https://github.com/DE-IBH/apt-dater-host"
arch
=
"noarch"
arch
=
"noarch"
...
@@ -11,6 +11,7 @@ checkdepends="bats checkbashisms"
...
@@ -11,6 +11,7 @@ checkdepends="bats checkbashisms"
subpackages
=
"
$pkgname
-doc"
subpackages
=
"
$pkgname
-doc"
source
=
"
$pkgname
-
$pkgver
.tar.gz::https://github.com/DE-IBH/
$pkgname
/archive/v
$pkgver
.tar.gz
source
=
"
$pkgname
-
$pkgver
.tar.gz::https://github.com/DE-IBH/
$pkgname
/archive/v
$pkgver
.tar.gz
apt-dater-host-fix-bashisms.patch
apt-dater-host-fix-bashisms.patch
apk-improve-Machine-Type-reporting.patch
"
"
builddir
=
"
$srcdir
/
$pkgname
-
$pkgver
"
builddir
=
"
$srcdir
/
$pkgname
-
$pkgver
"
...
@@ -31,4 +32,5 @@ package() {
...
@@ -31,4 +32,5 @@ package() {
install
-m0644
"
$pkgname
"
.1
"
$pkgdir
"
/usr/share/man/man1
install
-m0644
"
$pkgname
"
.1
"
$pkgdir
"
/usr/share/man/man1
}
}
sha512sums
=
"52d48ade6758cb1150be2f21ed4c9831b4254ccc749ae865321abea077737a49ff7aeefb4e643aa289d953d2847dcf83e94837fe510fa8f8bfe19cfda0fd9dbc apt-dater-host-1.0.1.tar.gz
sha512sums
=
"52d48ade6758cb1150be2f21ed4c9831b4254ccc749ae865321abea077737a49ff7aeefb4e643aa289d953d2847dcf83e94837fe510fa8f8bfe19cfda0fd9dbc apt-dater-host-1.0.1.tar.gz
6f695e1b1785f88217b5a32c509b5cb3c7a3f70069b042ad9770a4c1e86c4477abab2763579130f65e0c880976eb9f292bed3b42dda0d25e801696db479e55e8 apt-dater-host-fix-bashisms.patch"
6f695e1b1785f88217b5a32c509b5cb3c7a3f70069b042ad9770a4c1e86c4477abab2763579130f65e0c880976eb9f292bed3b42dda0d25e801696db479e55e8 apt-dater-host-fix-bashisms.patch
f56c38f9f8af119517965da8fe65a8d55f1e489ae8b3402cb72c55a7b876a658ee6dd7042342922fac3e5e59e872555914ca8e2f8dd723e98566ce6b16c341ce apk-improve-Machine-Type-reporting.patch"
This diff is collapsed.
Click to expand it.
community/apt-dater-host/apk-improve-Machine-Type-reporting.patch
0 → 100644
+
62
−
0
View file @
ae72fb1b
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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment