diff --git a/debian_iso_image.inc b/debian_iso_image.inc index 52b42fda..ab871a8a 100644 --- a/debian_iso_image.inc +++ b/debian_iso_image.inc @@ -29,6 +29,10 @@ igb-uio-rt #initramfs-trigger initramfs-trigger +# Intel Quartzville Linux Driver +iqvlinux +iqvlinux-rt + #intel-opae-fpgaa kmod-opae-fpga-driver kmod-opae-fpga-driver-rt diff --git a/debian_pkg_dirs b/debian_pkg_dirs index ab4ad7da..4a0fb1cf 100644 --- a/debian_pkg_dirs +++ b/debian_pkg_dirs @@ -8,6 +8,7 @@ kernel-modules/intel-ice kernel-modules/intel-ice-cvl-2.54 kernel-modules/intel-igb_uio kernel-modules/intel-opae-fpga +kernel-modules/intel-qv kernel-modules/mlnx-ofa_kernel kernel-modules/qat17 livepatch/kpatch-prebuilt diff --git a/debian_pkg_dirs_rt b/debian_pkg_dirs_rt index 3da9ba79..b297470b 100644 --- a/debian_pkg_dirs_rt +++ b/debian_pkg_dirs_rt @@ -8,6 +8,7 @@ kernel-modules/intel-ice kernel-modules/intel-ice-cvl-2.54 kernel-modules/intel-igb_uio kernel-modules/intel-opae-fpga +kernel-modules/intel-qv kernel-modules/mlnx-ofa_kernel kernel-modules/qat17 livepatch/kpatch-prebuilt diff --git a/kernel-modules/intel-qv/debian/deb_folder/changelog b/kernel-modules/intel-qv/debian/deb_folder/changelog new file mode 100644 index 00000000..21c0c50d --- /dev/null +++ b/kernel-modules/intel-qv/debian/deb_folder/changelog @@ -0,0 +1,5 @@ +iqvlinux (1.2.0.19-1) unstable; urgency=medium + + * Initial release + + -- Rogerio Ferraz Wed, 9 Nov 2022 12:25:00 +0000 diff --git a/kernel-modules/intel-qv/debian/deb_folder/control b/kernel-modules/intel-qv/debian/deb_folder/control new file mode 100644 index 00000000..eb9e3a8f --- /dev/null +++ b/kernel-modules/intel-qv/debian/deb_folder/control @@ -0,0 +1,14 @@ +Source: iqvlinux +Section: kernel +Priority: optional +Maintainer: StarlingX Developers +Build-Depends: debhelper-compat (= 13), linux@KERNEL_TYPE@-headers-5.10.0-6@KERNEL_TYPE@-amd64, linux@KERNEL_TYPE@-kbuild-5.10, linux@KERNEL_TYPE@-keys-5.10 +Standards-Version: 4.5.1 +Rules-Requires-Root: no + +Package: iqvlinux@KERNEL_TYPE@ +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: This package provides the iqvlinux kernel module(s). + This package provides the iqvlinux kernel module(s) built + for the Linux kernel using the amd64 processors. diff --git a/kernel-modules/intel-qv/debian/deb_folder/copyright b/kernel-modules/intel-qv/debian/deb_folder/copyright new file mode 100644 index 00000000..d8afba9a --- /dev/null +++ b/kernel-modules/intel-qv/debian/deb_folder/copyright @@ -0,0 +1,14 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ + +Upstream-Name: iqvlinux +Upstream-Contact: Intel Corporation +Source: iqvlinux.tar.gz in https://sourceforge.net/projects/e1000/files/iqvlinux/ +Files: * +Copyright: (c) 2022 Intel Corporation. +License: GPL-2 + + The full GNU General Public License is included in this distribution in the + file called "COPYING". + + On Debian-based systems the full text of the GNU General Public License + version 2 license can be found in `/usr/share/common-licenses/GPL-2'. diff --git a/kernel-modules/intel-qv/debian/deb_folder/patches/0001-Do-not-disable-module-signing.patch b/kernel-modules/intel-qv/debian/deb_folder/patches/0001-Do-not-disable-module-signing.patch new file mode 100644 index 00000000..978a0246 --- /dev/null +++ b/kernel-modules/intel-qv/debian/deb_folder/patches/0001-Do-not-disable-module-signing.patch @@ -0,0 +1,26 @@ +From 581ad581c4b6b7e980503cd8bfc50486577003b1 Mon Sep 17 00:00:00 2001 +From: Rogerio Ferraz +Date: Sun, 4 Dec 2022 22:04:20 -0300 +Subject: [PATCH] Do not disable module signing + +Signed-off-by: Rogerio Ferraz +--- + src/linux/driver/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/linux/driver/Makefile b/src/linux/driver/Makefile +index ad35e12..59a030e 100644 +--- a/src/linux/driver/Makefile ++++ b/src/linux/driver/Makefile +@@ -41,7 +41,7 @@ else # ifneq($(KERNELRELEASE),) + + DRIVER := iqvlinux + +-DISABLE_MODULE_SIGNING := Yes ++DISABLE_MODULE_SIGNING := No + INSTALL_MOD_DIR ?= kernel/drivers/net + + COMMON_MK ?= $(wildcard common.mk) +-- +2.17.1 + diff --git a/kernel-modules/intel-qv/debian/deb_folder/patches/series b/kernel-modules/intel-qv/debian/deb_folder/patches/series new file mode 100644 index 00000000..f26195d0 --- /dev/null +++ b/kernel-modules/intel-qv/debian/deb_folder/patches/series @@ -0,0 +1 @@ +0001-Do-not-disable-module-signing.patch diff --git a/kernel-modules/intel-qv/debian/deb_folder/rules b/kernel-modules/intel-qv/debian/deb_folder/rules new file mode 100755 index 00000000..7f1262b4 --- /dev/null +++ b/kernel-modules/intel-qv/debian/deb_folder/rules @@ -0,0 +1,62 @@ +#!/usr/bin/make -f +# +# Copyright (c) 2022 Wind River Systems, Inc. +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +# output every command that modifies files on the build system. +#export DH_VERBOSE = 1 + +export LINUX_DRIVER_BUILD_DIR="$(PWD)/src/linux/driver" +export NALDIR="$(PWD)" + +WITH_MOD_SIGN ?= 1 + +kheaders_name=$(shell ls /usr/src | grep linux@KERNEL_TYPE@-headers | grep amd64) +export KSRC=/usr/src/$(kheaders_name) +kversion=$(shell echo $(kheaders_name) | sed 's/linux@KERNEL_TYPE@-headers-//g') +kmod_name=iqvlinux +version=$(shell dpkg-parsechangelog | sed -n 's/^Version: *\([^-]\+\)-.\+/\1/p') + +ifeq ($(WITH_MOD_SIGN),1) +pkg_name=iqvlinux@KERNEL_TYPE@ +endif +pkg_common_name=iqvlinux-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 + +%: + dh $@ --sourcedirectory=src/linux/driver/ + +override_dh_auto_install: + dh_install ./src/linux/driver/iqvlinux.ko lib/modules/$(kversion)/kernel/drivers/net/ + +override_dh_strip: + dh_strip + find debian -name '*.ko' | xargs strip -g +ifeq ($(WITH_MOD_SIGN),1) + @echo "Sign the modules!" + ./debian/sign_modules ./debian/$(pkg_name)/lib/modules/$(kversion)/kernel/drivers/net/ $(privkey) $(pubkey) +endif diff --git a/kernel-modules/intel-qv/debian/deb_folder/sign_modules b/kernel-modules/intel-qv/debian/deb_folder/sign_modules new file mode 100755 index 00000000..f3476fd6 --- /dev/null +++ b/kernel-modules/intel-qv/debian/deb_folder/sign_modules @@ -0,0 +1,31 @@ +#!/bin/bash + +# parameters: +# (1) modules' path; (2) privkey for signing; (3) pubkey for signing + +privkey=$2 +pubkey=$3 + +if [ ! -f /usr/lib/linux@KERNEL_TYPE@-kbuild-*/scripts/sign-file ]; then + echo "Tool sign-file doesn't exist!" + exit 1 +fi + +found=0 +for module in $(find $1 -type f -name \*.ko); do + found=1 + echo ${module} + /usr/lib/linux@KERNEL_TYPE@-kbuild-*/scripts/sign-file sha256 \ + ${privkey} ${pubkey} ${module} + if [ $? -eq 1 ]; then + echo "Fail to sign!" + exit 1 + fi +done + +if [ ${found} -eq 1 ]; then + echo "Signed successfully!" +else + echo "No ko found!" + exit 1 +fi diff --git a/kernel-modules/intel-qv/debian/deb_folder/source/format b/kernel-modules/intel-qv/debian/deb_folder/source/format new file mode 100644 index 00000000..163aaf8d --- /dev/null +++ b/kernel-modules/intel-qv/debian/deb_folder/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/kernel-modules/intel-qv/debian/dl_hook b/kernel-modules/intel-qv/debian/dl_hook new file mode 100755 index 00000000..846eea5c --- /dev/null +++ b/kernel-modules/intel-qv/debian/dl_hook @@ -0,0 +1,18 @@ +#!/bin/bash +set -x + +# $1: Name of directory where the source code is extracted to. +# It corresponds to the build name taken from changelog.QV_ZIP + +PKG_BUILD_NAME=$1 +PKG_BUILD_DIR=$(realpath `pwd`/"${PKG_BUILD_NAME}") + +QV_SOURCE=iqvlinux.tar.gz + +mkdir -p "${PKG_BUILD_DIR}/iqvlinux" + +# Unpack source code +tar xzf "${QV_SOURCE}" -C "${PKG_BUILD_DIR}" + +# Clean-up +rm -rf *.tar.gz diff --git a/kernel-modules/intel-qv/debian/meta_data.yaml b/kernel-modules/intel-qv/debian/meta_data.yaml new file mode 100644 index 00000000..4143b9cc --- /dev/null +++ b/kernel-modules/intel-qv/debian/meta_data.yaml @@ -0,0 +1,13 @@ +--- +debver: 1.2.0.19-1 +debname: iqvlinux +dl_path: + name: iqvlinux.tar.gz + url: "http://mirror.starlingx.cengn.ca/mirror/debian/sourceforge.net/\ + projects/e1000/files/iqvlinux/1.2.0.19/iqvlinux.tar.gz/download" + md5sum: a1277f6c75c62005d75a8c9676032236 + sha256sum: c86c1a394c27474f793641db82803a9784d02ce92de802b99b46a7736757019d +dl_hook: dl_hook +revision: + dist: $STX_DIST + PKG_GITREVCOUNT: true