#!/usr/bin/make -f # # output every command that modifies files on the build system. #export DH_VERBOSE = 1 %: dh $@ WITH_MOD_SIGN ?= 1 kheaders_name=$(shell ls /usr/src | grep linux@KERNEL_TYPE@-headers | grep amd64) kheaders_common=$(shell ls /usr/src | grep linux@KERNEL_TYPE@-headers | grep common) export KSRC=/usr/src/$(kheaders_name) export KSRC_COMMON=/usr/src/$(kheaders_common) kversion=$(shell echo $(kheaders_name) | sed 's/linux@KERNEL_TYPE@-headers-//g') kmod_name=ice bundle_version=cvl-4.10 version=$(shell dpkg-parsechangelog | sed -n 's/^Version: *\([^-]\+\)-.\+/\1/p') pkg_name=ice-$(bundle_version)@KERNEL_TYPE@ pkg_common_name=ice-$(bundle_version)-common _sysconfdir=/etc _defaultdocdir=/usr/share/doc _mandir=/usr/share/man ifeq ($(WITH_MOD_SIGN),1) _keydir ?= /usr/src/kernels/$(kversion)/ privkey ?= $(_keydir)/signing_key.pem pubkey ?= $(_keydir)/signing_key.x509 endif override_dh_auto_install: dh_install src/$(kmod_name).ko /lib/modules/$(kversion)/extra/$(kmod_name)-$(bundle_version)/ dh_install -p$(pkg_common_name) pci.updates $(_defaultdocdir)/kmod-$(kmod_name)-$(version)/ dh_install -p$(pkg_common_name) README $(_defaultdocdir)/kmod-$(kmod_name)-$(version)/ dh_install -p$(pkg_common_name) $(kmod_name).7 $(_mandir)/man7/$(kmod_name)-$(version)/ # Install both the OS default regular DDP fw and the COMMS version dh_installdirs -p$(pkg_common_name) /lib/firmware/updates/intel/$(kmod_name)-$(version)/ddp/ install -m 644 ddp/README debian/$(pkg_common_name)/lib/firmware/updates/intel/$(kmod_name)-$(version)/ddp/ install -m 644 ddp/LICENSE debian/$(pkg_common_name)/lib/firmware/updates/intel/$(kmod_name)-$(version)/ddp/ install -m 644 ddp/ice-*.pkg debian/$(pkg_common_name)/lib/firmware/updates/intel/$(kmod_name)-$(version)/ddp/ # Make the regular DDP fw be the default one to load dh_installdirs -p$(pkg_common_name) /lib/firmware/intel/$(kmod_name)/ddp/ ln -frs debian/$(pkg_common_name)/lib/firmware/updates/intel/$(kmod_name)-$(version)/ddp/ice-*.pkg debian/$(pkg_common_name)/lib/firmware/intel/$(kmod_name)/ddp/$(version)-ice.pkg override_dh_strip: dh_strip find debian -name '*.ko' | xargs strip -g ifeq ($(WITH_MOD_SIGN),1) @echo "Sign the modules!" /usr/lib/linux@KERNEL_TYPE@-kbuild-*/scripts/sign-file sha256 $(privkey) $(pubkey) \ ./debian/$(pkg_name)/lib/modules/$(kversion)/extra/$(kmod_name)-$(bundle_version)/$(kmod_name).ko endif override_dh_auto_build: dh_auto_build -D ./src