From ae5be09bbc35d7041897bf85bf86a5a885a12014 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E9=91=AB?= Date: Sat, 15 May 2021 16:42:04 +0800 Subject: [PATCH] feat: add driver package to build DEB package support in Debian DKMS format Log: add Debian packaging support --- .gitignore | 2 +- debian/README.Debian | 6 +++++ debian/README.source | 10 +++++++ debian/changelog | 5 ++++ debian/compat | 1 + debian/control | 22 ++++++++++++++++ debian/copyright | 48 ++++++++++++++++++++++++++++++++++ debian/rtl8188eu-dkms.postinst | 14 ++++++++++ debian/rtl8188eu-dkms.prerm | 15 +++++++++++ debian/rules | 32 +++++++++++++++++++++++ debian/source/format | 1 + dkms.conf | 7 +++++ 12 files changed, 162 insertions(+), 1 deletion(-) create mode 100644 debian/README.Debian create mode 100644 debian/README.source create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/rtl8188eu-dkms.postinst create mode 100644 debian/rtl8188eu-dkms.prerm create mode 100755 debian/rules create mode 100644 debian/source/format create mode 100644 dkms.conf diff --git a/.gitignore b/.gitignore index a916bfb..2846c9c 100644 --- a/.gitignore +++ b/.gitignore @@ -48,7 +48,7 @@ modules.builtin # # Debian directory (make deb-pkg) # -/debian/ +# /debian/ # # git files that we don't want to ignore even it they are dot-files diff --git a/debian/README.Debian b/debian/README.Debian new file mode 100644 index 0000000..f746435 --- /dev/null +++ b/debian/README.Debian @@ -0,0 +1,6 @@ +rtl8188eu for Debian +------------------- + + + + -- liuxin Sat, 15 May 2021 14:47:26 +0800 diff --git a/debian/README.source b/debian/README.source new file mode 100644 index 0000000..8296d59 --- /dev/null +++ b/debian/README.source @@ -0,0 +1,10 @@ +rtl8188eu for Debian +------------------- + + + + + + -- liuxin Sat, 15 May 2021 14:47:26 +0800 + diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..c4919b9 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +rtl8188eu (4.1.4-1) unstable; urgency=medium + + * Add driver package to build DEB package support in Debian DKMS format. + + -- liuxin Sat, 15 May 2021 14:47:26 +0800 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..b4de394 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +11 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..63b1cc7 --- /dev/null +++ b/debian/control @@ -0,0 +1,22 @@ +Source: rtl8188eu +Section: misc +Priority: optional +Maintainer: liuxin +Build-Depends: debhelper (>= 11), + dkms, + bc, + module-assistant, + build-essential +Standards-Version: 4.1.3 +Vcs-Browser: https://github.com/lwfinger/rtl8188eu +Vcs-Git: https://github.com/lwfinger/rtl8188eu.git + +Package: rtl8188eu-dkms +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: DKMS files to build and install rtl8188ec + The rtl8188ec driver provides the driver for USB wifi adapter. + This package contains the DKMS files to build and install rtl8188ec. + To install this package, you have to install the header files for your + current kernel manually (usually included in the "linux-headers-"). diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..6b86ea7 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,48 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: rtl8188eu +Source: https://github.com/lwfinger/rtl8188eu + +Files: * +Copyright: 2021 lwfinger +License: GPL-2.0+ + 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 program. If not, see . + . + On Debian systems, the complete text of the GNU General Public + License version 2 can be found in `/usr/share/common-licenses/GPL-2'. + +# If you want to use GPL v2 or later for the /debian/* files use +# the following clauses, or change it to suit. Delete these two lines +Files: debian/* +Copyright: 2021 liuxin +License: GPL-2+ + 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 + . + On Debian systems, the complete text of the GNU General + Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". + +# Please also look if there are files or directories which have a +# different copyright/license attached and list them here. +# Please avoid picking licenses with terms that are more restrictive than the +# packaged work, as it may make Debian's contributions unacceptable upstream. diff --git a/debian/rtl8188eu-dkms.postinst b/debian/rtl8188eu-dkms.postinst new file mode 100644 index 0000000..b498357 --- /dev/null +++ b/debian/rtl8188eu-dkms.postinst @@ -0,0 +1,14 @@ +#!/bin/bash + +DRV_NAME=8188eu +DRV_VERSION=4.1.4 + + +dkms add -m ${DRV_NAME} -v ${DRV_VERSION} +dkms build -m ${DRV_NAME} -v ${DRV_VERSION} +dkms install -m ${DRV_NAME} -v ${DRV_VERSION} +RESULT=$? + +echo "Finished running dkms install steps." + +exit $RESULT diff --git a/debian/rtl8188eu-dkms.prerm b/debian/rtl8188eu-dkms.prerm new file mode 100644 index 0000000..70fcc33 --- /dev/null +++ b/debian/rtl8188eu-dkms.prerm @@ -0,0 +1,15 @@ +#!/bin/bash + +DRV_NAME=8188eu +DRV_VERSION=4.1.4 + +dkms remove ${DRV_NAME}/${DRV_VERSION} --all + +RESULT=$? +if [[ "$RESULT" != "0" ]]; then + echo "Error occurred while running dkms remove." 2>&1 +else + echo "Finished running dkms removal steps." +fi + +exit $RESULT diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..9bdadc6 --- /dev/null +++ b/debian/rules @@ -0,0 +1,32 @@ +#!/usr/bin/make -f +# -*- makefile -*- + +include /usr/share/dpkg/default.mk + +export DH_VERBOSE = 1 +export DEB_BUILD_MAINT_OPTIONS = hardening=+all + +VERSION ?= $(shell dpkg-parsechangelog | sed -rne 's/^Version: ([0-9.]+).*$$/\1/p') + +%: + dh $@ --with dkms + +override_dh_auto_install: + dh_install -prtl8188eu-dkms -X.o -X.ko hostapd-0.8/ usr/src/8188eu-$(VERSION) + dh_install -prtl8188eu-dkms -X.o -X.ko include/ usr/src/8188eu-$(VERSION) + dh_install -prtl8188eu-dkms -X.o -X.ko os_dep/ usr/src/8188eu-$(VERSION) + dh_install -prtl8188eu-dkms -X.o -X.ko core/ usr/src/8188eu-$(VERSION) + dh_install -prtl8188eu-dkms -X.o -X.ko .git/ usr/src/8188eu-$(VERSION) + dh_install -prtl8188eu-dkms -X.o -X.ko hal/ usr/src/8188eu-$(VERSION) + dh_install -prtl8188eu-dkms rtl_hostapd.conf usr/src/8188eu-$(VERSION) + dh_install -prtl8188eu-dkms rtl8188eufw.bin usr/src/8188eu-$(VERSION) + dh_install -prtl8188eu-dkms control_ap usr/src/8188eu-$(VERSION) + dh_install -prtl8188eu-dkms dkms.conf usr/src/8188eu-$(VERSION) + dh_install -prtl8188eu-dkms Makefile usr/src/8188eu-$(VERSION) + + +override_dh_dkms: + dh_dkms -V + +override_dh_auto_build: + : diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/dkms.conf b/dkms.conf new file mode 100644 index 0000000..93aca5e --- /dev/null +++ b/dkms.conf @@ -0,0 +1,7 @@ +PACKAGE_NAME="rtl8188eu" +PACKAGE_VERSION="4.1.4" +BUILT_MODULE_NAME[0]="8188eu" +MAKE="'make' -j$(nproc) KVER=$kernelver" +CLEAN="'make' clean" +DEST_MODULE_LOCATION[0]="/updates/dkms" +AUTOINSTALL="YES"