Merge pull request #566 from robertbaldyga/deb-dkms

Introduce DKMS support for DEB packages
This commit is contained in:
Robert Baldyga 2020-11-05 14:01:32 +01:00 committed by GitHub
commit 539e64e2c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 47 additions and 11 deletions

View File

@ -2,9 +2,9 @@
# Copyright(c) 2012-2020 Intel Corporation # Copyright(c) 2012-2020 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause-Clear # SPDX-License-Identifier: BSD-3-Clause-Clear
# #
# If KERNELRELEASE is defined, we've been invoked from the # If $(M) is defined, we've been invoked from the
# kernel build system and can use its language. # kernel build system and can use its language.
ifneq ($(KERNELRELEASE),) ifneq ($(M),)
include $(M)/config.mk include $(M)/config.mk
@ -16,8 +16,9 @@ obj-y += cas_disk/
else else
OCFDIR=$(PWD)/../ocf OCFDIR=$(PWD)/../ocf
KERNEL_DIR ?= "/lib/modules/$(shell uname -r)/build"
PWD=$(shell pwd) PWD=$(shell pwd)
KERNEL_VERSION ?= "$(shell uname -r)"
KERNEL_DIR ?= "/lib/modules/$(KERNEL_VERSION)/build"
MODULES_DIR=/lib/modules/$(shell uname -r)/extra MODULES_DIR=/lib/modules/$(shell uname -r)/extra
DISK_MODULE = cas_disk DISK_MODULE = cas_disk

View File

@ -2,7 +2,7 @@
# Copyright(c) 2012-2020 Intel Corporation # Copyright(c) 2012-2020 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause-Clear # SPDX-License-Identifier: BSD-3-Clause-Clear
# #
ifneq ($(KERNELRELEASE),) ifneq ($(M),)
ifeq ($(CAS_EXT_EXP),1) ifeq ($(CAS_EXT_EXP),1)
EXTRA_CFLAGS += -DWI_AVAILABLE EXTRA_CFLAGS += -DWI_AVAILABLE

View File

@ -32,7 +32,7 @@ DEPENDENCIES_TAR=(tar)
DEPENDENCIES_ZIP=(zip) DEPENDENCIES_ZIP=(zip)
DEPENDENCIES_RPM=(rpmbuild tar) DEPENDENCIES_RPM=(rpmbuild tar)
DEPENDENCIES_SRPM=("${DEPENDENCIES_RPM[@]}") DEPENDENCIES_SRPM=("${DEPENDENCIES_RPM[@]}")
DEPENDENCIES_DEB=(debuild dh fakeroot tar) DEPENDENCIES_DEB=(debuild dh fakeroot tar dkms)
DEPENDENCIES_DSC=("${DEPENDENCIES_DEB[@]}") DEPENDENCIES_DSC=("${DEPENDENCIES_DEB[@]}")
# List of relative submodule directories: # List of relative submodule directories:
SUBMODULES=( SUBMODULES=(

View File

@ -0,0 +1,11 @@
PACKAGE_NAME="<CAS_NAME>-modules"
PACKAGE_VERSION="#MODULE_VERSION#"
BUILT_MODULE_NAME[0]="cas_disk"
BUILT_MODULE_NAME[1]="cas_cache"
BUILT_MODULE_LOCATION[0]="modules/cas_disk/"
BUILT_MODULE_LOCATION[1]="modules/cas_cache/"
DEST_MODULE_LOCATION[0]="/extra"
DEST_MODULE_LOCATION[1]="/extra"
PRE_BUILD="./configure"
MAKE[0]="make -j -C modules/ KERNEL_VERSION=$kernelver"
AUTOINSTALL=yes

View File

@ -1 +1,9 @@
lib/modules/ ./.metadata/* usr/src/<CAS_NAME>-modules-<CAS_VERSION>/.metadata/
./modules/* usr/src/<CAS_NAME>-modules-<CAS_VERSION>/modules/
./ocf/* usr/src/<CAS_NAME>-modules-<CAS_VERSION>/ocf/
./utils/* usr/src/<CAS_NAME>-modules-<CAS_VERSION>/utils/
./configure.d/* usr/src/<CAS_NAME>-modules-<CAS_VERSION>/configure.d/
./configure usr/src/<CAS_NAME>-modules-<CAS_VERSION>/
./Makefile usr/src/<CAS_NAME>-modules-<CAS_VERSION>/
./LICENSE usr/src/<CAS_NAME>-modules-<CAS_VERSION>/
./version usr/src/<CAS_NAME>-modules-<CAS_VERSION>/

View File

@ -4,6 +4,12 @@
-- <PACKAGE_MAINTAINER> <PACKAGE_DATE> -- <PACKAGE_MAINTAINER> <PACKAGE_DATE>
open-cas-linux (20.03.3.0303-1) trusty; urgency=medium
* Add DKMS support
-- Robert Baldyga <robert.baldyga@intel.com> Mon, 02 Nov 2020 18:47:04 +0200
open-cas-linux (20.03.2.0295-1) trusty; urgency=medium open-cas-linux (20.03.2.0295-1) trusty; urgency=medium
* Initial OpenCAS DEB package release * Initial OpenCAS DEB package release

View File

@ -2,7 +2,7 @@ Source: <CAS_NAME>
Section: utils Section: utils
Priority: optional Priority: optional
Maintainer: <PACKAGE_MAINTAINER> Maintainer: <PACKAGE_MAINTAINER>
Build-Depends: debhelper (>= 11), gawk, libelf-dev, linux-headers-generic Build-Depends: debhelper (>= 11), gawk, libelf-dev, linux-headers-generic, dkms
Standards-Version: 4.1.2 Standards-Version: 4.1.2
Homepage: <CAS_HOMEPAGE> Homepage: <CAS_HOMEPAGE>
Vcs-Git: <CAS_GIT> Vcs-Git: <CAS_GIT>
@ -21,7 +21,7 @@ Description: Open Cache Acceleration Software
Package: <CAS_NAME>-modules Package: <CAS_NAME>-modules
Architecture: amd64 Architecture: amd64
Depends: ${misc:Depends} Depends: ${misc:Depends}, debhelper (>= 9), dkms
Description: Open Cache Acceleration Software kernel modules (${kver}) Description: Open Cache Acceleration Software kernel modules (${kver})
Open Cache Acceleration Software (Open CAS) is an open source project Open Cache Acceleration Software (Open CAS) is an open source project
encompassing block caching software libraries, adapters, tools and more. encompassing block caching software libraries, adapters, tools and more.

View File

@ -4,13 +4,23 @@
#export DH_VERBOSE = 1 #export DH_VERBOSE = 1
%: %:
dh $@ dh $@ --with dkms
override_dh_auto_configure : override_dh_auto_configure :
./configure
override_dh_auto_build :
(cd utils/; ./cas_version_gen build)
make -C casadm
override_dh_auto_install : override_dh_auto_install :
make install_files DESTDIR="$(shell pwd)/debian/tmp" make -C casadm install_files DESTDIR="$(shell pwd)/debian/tmp"
make -C utils install_files DESTDIR="$(shell pwd)/debian/tmp"
# clean and generate version again before installing sources for DKMS
make distclean
(cd utils/; ./cas_version_gen)
override_dh_dkms :
dh_dkms -V $(DEB_VERSION_UPSTREAM)
override_dh_installsystemd : override_dh_installsystemd :
dh_installsystemd --no-start dh_installsystemd --no-start