From 7d052c4a68df8aa5010e240db311674a32f837c2 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Sat, 13 Aug 2016 12:58:30 +0100 Subject: 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= to DEB_BUILD_OPTIONS) into a dpdk-modules- 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 --- debian/kernel-version | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100755 debian/kernel-version (limited to 'debian/kernel-version') 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 +# 2010-2016 Russ Allbery +# +# 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 . +# +# 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 = )) { + if ($line =~ /"(.+)"/) { + print "$1\n"; + $found = 1; + } + } +} +exit 0 if $found; +if (open (VERSION, "$ksrc/include/generated/utsrelease.h")) { + if (defined(VERSION) && ($line = )) { + 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 = )) { + print "$line"; +} +exit 0; -- cgit 1.2.3-korg