diff options
author | Luca Boccassi <luca.boccassi@gmail.com> | 2016-08-13 12:58:30 +0100 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@gmail.com> | 2016-08-15 21:02:10 +0100 |
commit | 7d052c4a68df8aa5010e240db311674a32f837c2 (patch) | |
tree | 35cd274bd055bf87f35b2decf943a95045c9bc80 /debian/kernel-version | |
parent | 12600e8bbf0b4795791954ab79ca4525b895a83d (diff) |
Add optional binary kernel modules package
Add optional binary kernel modules package, disabled by default
(build with DEB_BUILD_OPTIONS=kernel_modules to enable). If enabled
will build kernel modules against the local, current kernel version
(override by adding ksrc=<path/to/kernel/sources> to
DEB_BUILD_OPTIONS) into a dpdk-modules-<kernel version> package.
Useful for downstream projects that ship a complete ISO, where it is
not desirable to include a whole building environment for DKMS
packages.
Change-Id: I7e0ab239eaf08da71f9d58d60e32abf7cd42bec4
Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
Diffstat (limited to 'debian/kernel-version')
-rwxr-xr-x | debian/kernel-version | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/debian/kernel-version b/debian/kernel-version new file mode 100755 index 00000000..16ab01b4 --- /dev/null +++ b/debian/kernel-version @@ -0,0 +1,61 @@ +#!/usr/bin/perl +# +# Copyright (c) 2009-2016 Andreas Beckmann <anbe@debian.org> +# 2010-2016 Russ Allbery <rra@debian.org> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this script. If not, see <http://www.gnu.org/licenses/>. +# +# This program comes from: +# https://anonscm.debian.org/viewvc/pkg-nvidia/packages/nvidia-graphics-drivers/trunk/debian/module/debian/kernel-version?view=markup +# The original copyright and license (GPL2+) can be found at: +# https://anonscm.debian.org/viewvc/pkg-nvidia/packages/nvidia-graphics-drivers/trunk/debian/copyright?view=markup +# +# Extract the kernel version from the kernel version header file. Takes the +# kernel source path as its only argument. If the version header couldn't be +# found, print nothing and exit quietly. + +use warnings; + +my $ksrc = shift; +unless ($ksrc && (-f "$ksrc/include/linux/version.h" || -f "$ksrc/include/generated/uapi/linux/version.h")) { + exit 0; +} +my $found = 0; +my $line; +if (open (VERSION, "$ksrc/include/linux/version.h")) { + if (defined(VERSION) && ($line = <VERSION>)) { + if ($line =~ /"(.+)"/) { + print "$1\n"; + $found = 1; + } + } +} +exit 0 if $found; +if (open (VERSION, "$ksrc/include/generated/utsrelease.h")) { + if (defined(VERSION) && ($line = <VERSION>)) { + if ($line =~ /UTS_RELEASE *"(.+)"/) { + print "$1\n"; + $found = 1; + } + } +} +exit 0 if $found; +# kernel.release is no longer useful since 3.1.0 +unless (open (VERSION, "$ksrc/include/config/kernel.release")) { + exit 0; +} +if (defined(VERSION) && ($line = <VERSION>)) { + print "$line"; +} +exit 0; |