diff options
-rw-r--r-- | .SRCINFO | 18 | ||||
-rw-r--r-- | .project | 17 | ||||
-rw-r--r-- | .pydevproject | 5 | ||||
-rw-r--r-- | PKGBUILD | 61 | ||||
-rw-r--r-- | README.md | 20 | ||||
-rw-r--r-- | blacklist-mic-host.conf | 1 | ||||
-rwxr-xr-x | buildandcopy.sh | 26 | ||||
-rw-r--r-- | dkms.conf | 7 | ||||
-rw-r--r-- | mpss-modules-dkms.install | 41 |
9 files changed, 196 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..49a2be5c3165 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,18 @@ +pkgbase = mpss + pkgver = 3.7.1 + pkgrel = 1 + url = https://software.intel.com/en-us/articles/intel-manycore-platform-software-stack-mpss + arch = x86_64 + license = GPL2 + depends = dkms + source = dkms.conf + source = blacklist-mic-host.conf + sha256sums = a76162c169073060ee3a966e95342f29b3e342c956d29169c10a6dd97e342fa5 + sha256sums = 42dda3527ed2496b851c0fad6a841f660a0c086ecf742bb4f132308b9e38d913 + source_x86_64 = git+https://github.com/marcelhuberfoo/mpss-modules.git#branch=ModuleAndKernelUpdates + sha256sums_x86_64 = SKIP + +pkgname = mpss-modules-dkms + pkgdesc = Intel® Manycore Platform Software Stack; mic Kernel module + install = mpss-modules-dkms.install + diff --git a/.project b/.project new file mode 100644 index 000000000000..29db1617c991 --- /dev/null +++ b/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>arch-mpss-modules-dkms</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.python.pydev.PyDevBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.python.pydev.pythonNature</nature> + </natures> +</projectDescription> diff --git a/.pydevproject b/.pydevproject new file mode 100644 index 000000000000..40e9f40a0ade --- /dev/null +++ b/.pydevproject @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<?eclipse-pydev version="1.0"?><pydev_project> +<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property> +<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property> +</pydev_project> diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..d3985cffafe0 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,61 @@ +# Maintainer: Marcel Huber <`echo "moc tknup liamg tä oofrebuhlecram" | rev`> + +pkgbase=mpss +pkgname=(mpss-modules-dkms) +pkgver=3.7.1 +pkgrel=1 +arch=('x86_64') +url="https://software.intel.com/en-us/articles/intel-manycore-platform-software-stack-mpss" +license=('GPL2') +depends=('dkms') +source=(dkms.conf + blacklist-mic-host.conf) +source_x86_64=(git+https://github.com/marcelhuberfoo/mpss-modules.git#branch=ModuleAndKernelUpdates) +sha256sums=('a76162c169073060ee3a966e95342f29b3e342c956d29169c10a6dd97e342fa5' + '42dda3527ed2496b851c0fad6a841f660a0c086ecf742bb4f132308b9e38d913') +sha256sums_x86_64=('SKIP') + +## within each split package’s packaging function: +# arch +# backup +# changelog +# conflicts +# depends +# groups +# install +# license +# optdepends +# options +# pkgdesc +# provides +# replaces +# url + +package_mpss-modules-dkms() { + install=$pkgname.install + pkgdesc="Intel® Manycore Platform Software Stack; mic Kernel module" + _pkgname=${pkg%-*} + msg2 "Starting make conf_install...$(pwd)" + make -C $_pkgname DESTDIR="$pkgdir" sysconfdir=/etc includedir=/usr/include \ + conf_install dev_install + + # Copy dkms.conf + install -Dm644 dkms.conf "${pkgdir}"/usr/src/${_pkgname}-${pkgver}/dkms.conf + install -Dm644 blacklist-mic-host.conf "${pkgdir}"/etc/modprobe.d/ + sed -e "s|/sbin/modprobe|/usr/bin/modprobe|" \ + -i "${pkgdir}"/etc/sysconfig/modules/mic.modules + + sed '8,9 d' \ + -i "${pkgdir}"/etc/udev/rules.d/50-udev-mic.rules + + sed -e "s/@_PKGNAME@/${_pkgname}/" \ + -e "s/@PKGVER@/${pkgver}/" \ + -i "${pkgdir}"/usr/src/${_pkgname}-${pkgver}/dkms.conf + + msg2 "Copy sources (including Makefile) for dmks build..." + cp -r ${_pkgname}/* "${pkgdir}"/usr/src/${_pkgname}-${pkgver}/ + cp ${_pkgname}/.mpss-metadata "${pkgdir}"/usr/src/${_pkgname}-${pkgver}/ + rm "${pkgdir}"/usr/src/${_pkgname}-${pkgver}/*mic.* + + install -D -m644 ${_pkgname}/COPYING "$pkgdir/usr/share/licenses/$pkgname/LICENSE" +} diff --git a/README.md b/README.md new file mode 100644 index 000000000000..3675d377c689 --- /dev/null +++ b/README.md @@ -0,0 +1,20 @@ +arch-nvidia-docker +============ + + ArchLinux PKGBUILD for nvidia-docker tools https://github.com/NVIDIA/nvidia-docker + + The package source build is submitted to AUR at: https://aur.archlinux.org/packages/nvidia-docker/ + +Building and submitting the package +---------------------- + +* Update PKGBUILD and set `pkgver` to match new version from https://github.com/NVIDIA/nvidia-docker/releases +* Update the checksums using `updpkgsums` +* Make the package using `makepkg --force --nodeps --cleanbuild` +* Check the submitting guidelines at https://wiki.archlinux.org/index.php/Arch%20User%20Repository#Submitting%20packages +* `makepkg --printsrcinfo > .SRCINFO` +* `git add .SRCINFO` +* `git commit -m "useful commit message"` +* `git push origin` + +To automate most of the steps, you could also use the `buildandcopy.sh` script provided. diff --git a/blacklist-mic-host.conf b/blacklist-mic-host.conf new file mode 100644 index 000000000000..920080d0bf53 --- /dev/null +++ b/blacklist-mic-host.conf @@ -0,0 +1 @@ +blacklist mic_host diff --git a/buildandcopy.sh b/buildandcopy.sh new file mode 100755 index 000000000000..8593b99e2c6f --- /dev/null +++ b/buildandcopy.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +thedirs="." +repodir=/home/own-repo + +thingsToDo=( + 'for n in $thedirs; do ( cd $n && updpkgsums; makepkg --force --nodeps --nobuild; makepkg --printsrcinfo > .SRCINFO ); done' + 'git diff --quiet --no-ext-diff --exit-code && echo clean || ( git diff -b -w && git add -p && git commit ) || true' + 'for n in $thedirs; do ( cd $n && updpkgsums; makepkg --force --nodeps --cleanbuild ); done' + 'test -n "$repodir" -a -d "$repodir" && for n in $thedirs; do for pkgdir in $(find $n -name "*.tar.xz" -printf "%h\n" | sort | uniq); do cpfn=$(ls -tc1 $pkgdir/*.tar.xz | head -1); echo "move [$cpfn]? (y*|n)"; read v; if [ ! "$v" = "n" -a ! "$v" = "N" ]; then sh -c "mv --interactive --update $cpfn $repodir && ( repo-add --new --quiet ${repodir}/ownrepo.db.tar.gz $repodir/$(basename $cpfn); )"; fi; done; done' + 'git push origin' + 'for n in $thedirs; do ( cd $n && makepkg --nodeps --noextract --force --nobuild --noarchive --nocheck --noprepare --skipinteg --clean ); done' +) + +set -e + +for n in "${thingsToDo[@]}"; do + echo "Continue with [$n] (y*|n)?" + read v + if [ "$v" = "n" -o "$v" = "N" ]; then + echo "..command skipped.."; + else + eval "$n"; + fi +done + diff --git a/dkms.conf b/dkms.conf new file mode 100644 index 000000000000..2c8ab211c2a8 --- /dev/null +++ b/dkms.conf @@ -0,0 +1,7 @@ +PACKAGE_NAME="@_PKGNAME@" +PACKAGE_VERSION="@PKGVER@" +MAKE[0]="make modules" +CLEAN="make clean" +BUILT_MODULE_NAME[0]="mic" +DEST_MODULE_LOCATION[0]="/extra" +AUTOINSTALL="yes"
\ No newline at end of file diff --git a/mpss-modules-dkms.install b/mpss-modules-dkms.install new file mode 100644 index 000000000000..cc497e3990a7 --- /dev/null +++ b/mpss-modules-dkms.install @@ -0,0 +1,41 @@ +_my_pkgname=mpss-modules-dkms +_my_kmod=${_my_pkgname%-*} + +# version (without -$pkgrel): ${1%%-*} + +# arg 1: the new package version +post_install() { + local newver=${1%%-*} + dkms add --force -m $_my_kmod -v $newver + cat << EOF +==> To build and install your modules run: dkms install -m $_my_kmod -v $newver +==> To do this automatically at startup run: systemctl enable dkms.service +==> To do this automatically while building a new kernel add 'dkms' hook to + the HOOKS variable in /etc/mkinitcpio.conf +EOF +} + +# arg 1: the old package version +pre_remove() { + local oldver=${1%%-*} + # Remove modules using dkms + [ -n "$oldver" ] && dkms remove -m $_my_kmod -v $oldver --all &>/dev/null || true +} + +# arg 1: the new package version +# arg 2: the old package version +pre_upgrade() { + local curver=${2%%-*} + # $2 might be unset due to a bug. See, https://bugs.archlinux.org/task/32278 + # Query current version using pacman as fallback + [ -n "$curver" ] || curver=$(pacman -Q $_my_pkgname | cut -d' ' -f2) + pre_remove "$curver" +} + +# arg 1: the new package version +# arg 2: the old package version +post_upgrade() { + post_install "$1" +} + +# vim:set ts=2 sw=2 ft=sh et: |