summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Kitsinger (SwooshyCueb)2021-07-14 22:37:20 -0400
committerMarkus Kitsinger (SwooshyCueb)2021-07-14 22:37:20 -0400
commit236b60c98d9b5fe4bc3a4299f4f6c6062cb26d78 (patch)
treea71cbb0006e4058e6b7079a1c080bfa9698fd741
downloadaur-236b60c98d9b5fe4bc3a4299f4f6c6062cb26d78.tar.gz
Initial commit
-rw-r--r--.SRCINFO21
-rw-r--r--.gitignore6
-rw-r--r--Makefile.dkms12
-rw-r--r--PKGBUILD62
-rw-r--r--dkms.conf.in8
5 files changed, 109 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..34ec864dfe02
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,21 @@
+pkgbase = rr-zen-workaround-dkms-git
+ pkgdesc = Kernel module for disabling hw SpecLockMap optimization on AMD Zen CPUs (for rr)
+ pkgver = 0.20200921_235022.r6.g2f430f0
+ pkgrel = 1
+ url = https://gist.github.com/glandium/01d54cefdb70561b5f6675e08f2990f2
+ arch = any
+ license = GPL2
+ makedepends = git
+ depends = dkms
+ provides = rr-zen-workaround-dkms
+ conflicts = rr-zen-workaround-dkms
+ options = !strip
+ options = !debug
+ source = rr-zen-workaround::git+https://gist.github.com/01d54cefdb70561b5f6675e08f2990f2.git
+ source = dkms.conf.in
+ source = Makefile.dkms
+ sha384sums = SKIP
+ sha384sums = 621446b40aa7bbbb0fa04bc6aacd676c487dd7f805222e930006ab8cd5602671745deb39b4424156029310986ca44d4f
+ sha384sums = 9429f2a19e06d22a61f02c09d95e82ceadafd09cfad879096bb67e48151b4006b7eab4c027937873231073958a98d91e
+
+pkgname = rr-zen-workaround-dkms-git
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..d962b16fb0ee
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,6 @@
+/src
+/pkg
+*.tar
+*.tar.*
+
+/rr-zen-workaround
diff --git a/Makefile.dkms b/Makefile.dkms
new file mode 100644
index 000000000000..faa968fb8ac8
--- /dev/null
+++ b/Makefile.dkms
@@ -0,0 +1,12 @@
+ifneq (${KERNELRELEASE},)
+obj-m += zen_workaround.o
+else
+KVER ?= $(shell uname -r)
+KDIR ?= /lib/modules/$(KVER)/build
+
+default:
+ $(MAKE) -C $(KDIR) M=$$PWD modules
+
+clean:
+ $(MAKE) -C $(KDIR) M=$$PWD clean
+endif
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..dbcc2d303cb6
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,62 @@
+# Maintainer: Markus Kitsinger (SwooshyCueb) <root@swooshalicio.us>
+
+pkgname='rr-zen-workaround-dkms-git'
+_pkgname_nogit="${pkgname%-git}"
+_pkgname_nodkms="${_pkgname_nogit%-dkms}"
+_modname="${_pkgname_nodkms//-/_}"
+pkgver=0.20200921_235022.r6.g2f430f0
+pkgrel=1
+pkgdesc="Kernel module for disabling hw SpecLockMap optimization on AMD Zen CPUs (for rr)"
+arch=('any')
+url='https://gist.github.com/glandium/01d54cefdb70561b5f6675e08f2990f2'
+license=('GPL2')
+depends=('dkms')
+makedepends=('git')
+provides=('rr-zen-workaround-dkms')
+conflicts=('rr-zen-workaround-dkms')
+options=('!strip' '!debug')
+source=("${_pkgname_nodkms}::git+https://gist.github.com/01d54cefdb70561b5f6675e08f2990f2.git"
+ "dkms.conf.in"
+ "Makefile.dkms")
+sha384sums=('SKIP'
+ '621446b40aa7bbbb0fa04bc6aacd676c487dd7f805222e930006ab8cd5602671745deb39b4424156029310986ca44d4f'
+ '9429f2a19e06d22a61f02c09d95e82ceadafd09cfad879096bb67e48151b4006b7eab4c027937873231073958a98d91e')
+
+pkgver() {
+ # We have no version number, and no git tags, so make a version number
+ # using the latest commit date, the number of commits in the branch, and
+ # the hash of HEAD
+
+ cd "${srcdir}/${_pkgname_nodkms}"
+
+ # Get the latest commit date:
+ _timestamp="$(git log --date=unix --full-history --date-order --format='%ct%n%at' | sort -nr | head -1)"
+ _datestr="$(date -d @"${_timestamp}" -u +'%Y%m%d_%H%M%S')"
+
+ # Get commit count:
+ _commit_qty="$(git rev-list --count HEAD)"
+
+ # Get commit hash:
+ _commit_hash="$(git rev-parse --short HEAD)"
+
+ echo "0.${_datestr}.r${_commit_qty}.g${_commit_hash}"
+}
+
+build() {
+ # pkgver is not updated until after prepare, so this needs to be in build()
+ sed -e "s/@PACKAGE_VERSION@/${pkgver}/g" "${srcdir}/dkms.conf.in" > "${srcdir}/dkms.conf"
+}
+
+package() {
+ # module src dir
+ _pkgmoddir="${pkgdir}/usr/src/${_pkgname_nodkms}-${pkgver}"
+ # create module src dir
+ install -dm755 "${_pkgmoddir}"
+ # install module source files
+ cp -r "${srcdir}/${_pkgname_nodkms}"/* "${_pkgmoddir}"
+ # install dkms.conf
+ install -Tm644 "${srcdir}/dkms.conf" "${_pkgmoddir}/dkms.conf"
+ # install our Makefile
+ rm -f "${_pkgmoddir}/Makefile"
+ install -Tm644 "${srcdir}/Makefile.dkms" "${_pkgmoddir}/Makefile"
+}
diff --git a/dkms.conf.in b/dkms.conf.in
new file mode 100644
index 000000000000..614ca9f27ac3
--- /dev/null
+++ b/dkms.conf.in
@@ -0,0 +1,8 @@
+PACKAGE_NAME="rr-zen-workaround"
+PACKAGE_VERSION="@PACKAGE_VERSION@"
+BUILT_MODULE_NAME[0]="zen_workaround"
+DEST_MODULE_NAME[0]="rr_zen_workaround"
+BUILT_MODULE_LOCATION[0]=""
+DEST_MODULE_LOCATION[0]="/kernel/drivers/misc"
+AUTOINSTALL="yes"
+BUILD_EXCLUSIVE_ARCH="(x86|i.86|x86_64|amd64)"