Skip to content

Commit

Permalink
ixgbe: Support packaging for DKMS on Debian based systems
Browse files Browse the repository at this point in the history
To allow easy deployment of out of tree module package it's source code,
configuration and manual page(s) for DKMS on Debian and it's derivates
(e.g. Ubuntu).

Building package for future deployment on target system is done using
dpkg-buildpackage(1) tool:

  $ cd ixgbe/
  $ dpkg-buildpackage -b -us -uc
  ...
  $ cd ..
  $ ls -1 ixgbe[_-]*
  ixgbe-dkms_5.19.9-netctl-1_all.deb
  ixgbe_5.19.9-netctl-1_amd64.changes

Now on target system install above package and it's dependencies:

  # apt-get -y install dkms linux-headers
  # dpkg -i ixgbe-dkms_5.19.9-netctl-1_all.deb

Note that linux-headers package(s) should be installed for all
linux-image packages you want to build this module.

Verify installation by checking output from dpkg(1) and modinfo(8):

  # modinfo ixgbe -k <kernel_version_to_check> | head -n10

For example:

  # modinfo ixgbe -k $(uname -r) | head -n10
  filename:       /lib/modules/5.15.0-94-generic/updates/dkms/ixgbe.ko
  version:        5.19.9
                  ^^^^^^
  ...

module version should match to ixgbe-dkms package version.

Signed-off-by: Serhey Popovych <[email protected]>
  • Loading branch information
serhepopovych committed Feb 15, 2024
1 parent 03d603d commit 445ff32
Show file tree
Hide file tree
Showing 16 changed files with 126 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,14 @@ series
*.orig
*~
\#*#

# Git files and directories we do not want to ignore
!/debian/source/
!/debian/patches/

!/debian/*-dkms.conf
!/debian/*-dkms.dkms
!/debian/*-dkms.docs
!/debian/*-dkms.install
!/debian/*-dkms.manpages
!/debian/*-dkms.modprobe
5 changes: 5 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ixgbe (5.19.9-netctl-1) unstable; urgency=medium

* Initial release. (Closes: #123456)

-- Serhey Popovych <[email protected]> Thu, 15 Feb 2024 00:09:08 +0200
1 change: 1 addition & 0 deletions debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9
21 changes: 21 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Source: ixgbe
Section: kernel
Priority: extra
Maintainer: Serhey Popovych <[email protected]>
Build-Depends: debhelper (>= 9), dkms
Standards-Version: 5.19.9
Homepage: https://github.com/serhepopovych/ixgbe
Vcs-Git: https://github.com/serhepopovych/ixgbe.git
Vcs-Browser: https://github.com/serhepopovych/ixgbe

Package: ixgbe-dkms
Architecture: all
Depends: ${misc:Depends}
Description: dkms source for the out of Linux Kernel tree ixgbe driver
This is Intel 10GbE Ethernet Controller out of tree ixgbe driver.
.
Installation of the ixgbe-dkms package will disable the in-kernel ixgbe
module. To re-enable them, the ixgbe-dkms package must be purged.
.
This package provides the dkms source code for the ixgbe kernel module.
Kernel source or headers are required to compile these modules.
45 changes: 45 additions & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: ixgbe
Source: https://github.com/serhepopovych/ixgbe.git

Files: *
Copyright: © 1999-2017 Intel Corporation
License: GPL-2

Files: debian/*
Copyright: © 2018-2019 Serhey Popovych <[email protected]>
License: GPL-2.0+

Files: tests/*
Copyright: © 2018-2019 Serhey Popovych <[email protected]>
License: GPL-2.0+

License: GPL-2
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2
as published by the Free Software Foundation.
.
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.
.
On Debian systems, the complete text of the GNU General
Public License 2 can be found in "/usr/share/common-licenses/GPL-2".

License: GPL-2.0+
This package 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 package 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 program. If not, see <http://www.gnu.org/licenses/>
.
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
2 changes: 2 additions & 0 deletions debian/gbp.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[DEFAULT]
pristine-tar = True
2 changes: 2 additions & 0 deletions debian/ixgbe-dkms.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Prefer DKMS modules installed with package over ones provided with kernel
override ixgbe * updates/dkms
10 changes: 10 additions & 0 deletions debian/ixgbe-dkms.dkms
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
PACKAGE_NAME="ixgbe"
PACKAGE_VERSION="#MODULE_VERSION#"
AUTOINSTALL="YES"
REMAKE_INITRD="NO"

BUILT_MODULE_LOCATION[0]=""
BUILT_MODULE_NAME[0]="$PACKAGE_NAME"
DEST_MODULE_LOCATION[0]="/updates/dkms"

MAKE[0]="'make' BUILD_KERNEL=${kernelver}"
1 change: 1 addition & 0 deletions debian/ixgbe-dkms.docs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
README
1 change: 1 addition & 0 deletions debian/ixgbe-dkms.install
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
debian/ixgbe-dkms.conf etc/depmod.d/
1 change: 1 addition & 0 deletions debian/ixgbe-dkms.manpages
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ixgbe.7
5 changes: 5 additions & 0 deletions debian/ixgbe-dkms.modprobe
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Adjust and uncomment options line below to enable unsupported SFPs
#
# See ixgbe(7) for more information on available parameters.

#options ixgbe allow_unsupported_sfp=1,1
18 changes: 18 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/make -f

#export DH_VERBOSE=1

VERSION := $(shell dpkg-parsechangelog | sed -nr '/^Version:/s/Version: (.*:)?(.*)-(.*)/\2/p')

%:
dh $@ --with dkms,quilt

override_dh_install:
dh_install src/*.c src/*.h src/Makefile src/common.mk src/kcompat-*.sh usr/src/ixgbe-$(VERSION)/
find debian/ixgbe-dkms/usr/src -type f -perm -5 -print0 2>/dev/null | xargs -0r chmod a-X

override_dh_dkms:
dh_dkms -V $(VERSION)

# do nothing
override_dh_auto_configure override_dh_auto_build override_dh_auto_test override_dh_auto_install override_dh_auto_clean:
1 change: 1 addition & 0 deletions debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (quilt)
2 changes: 2 additions & 0 deletions debian/source/options
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
compression = "xz"
compression-level = 9
Empty file added debian/watch
Empty file.

0 comments on commit 445ff32

Please sign in to comment.