From 0dd5682645e46e7a1ba79ddbda440b60c0ef7924 Mon Sep 17 00:00:00 2001 From: Marc Leeman Date: Tue, 22 Dec 2020 15:00:45 +0100 Subject: [PATCH] debian: initial package --- .gitignore | 1 + Makefile | 9 +++-- debian/changelog | 5 +++ debian/compat | 1 + debian/control | 39 +++++++++++++++++++ debian/control.modules.in | 17 ++++++++ debian/copyright | 22 +++++++++++ ...rtl8821-module-_KVERS_.postinst.modules.in | 7 ++++ debian/rtl8821-module-_KVERS_.postrm | 34 ++++++++++++++++ debian/rules | 28 +++++++++++++ debian/rules.m-a | 30 ++++++++++++++ debian/source/format | 1 + 12 files changed, 190 insertions(+), 4 deletions(-) create mode 100644 .gitignore create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/control.modules.in create mode 100644 debian/copyright create mode 100644 debian/rtl8821-module-_KVERS_.postinst.modules.in create mode 100644 debian/rtl8821-module-_KVERS_.postrm create mode 100755 debian/rules create mode 100644 debian/rules.m-a create mode 100644 debian/source/format diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b25c15b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*~ diff --git a/Makefile b/Makefile index 93b82cc..00cc746 100755 --- a/Makefile +++ b/Makefile @@ -449,7 +449,7 @@ endif EXTRA_CFLAGS += -DCONFIG_RTL8821A _HAL_INTFS_FILES += hal/rtl8812a/hal8821a_fw.o - + endif ifeq ($(CONFIG_BT_COEXIST), y) @@ -903,7 +903,7 @@ _HAL_INTFS_FILES += \ hal/$(RTL871X)/$(HCI_NAME)/rtl$(MODULE_SUB_NAME)_led.o \ hal/$(RTL871X)/$(HCI_NAME)/rtl$(MODULE_SUB_NAME)_xmit.o \ hal/$(RTL871X)/$(HCI_NAME)/rtl$(MODULE_SUB_NAME)_recv.o - + ifeq ($(CONFIG_PCI_HCI), y) _HAL_INTFS_FILES += hal/$(RTL871X)/$(HCI_NAME)/$(HCI_NAME)_ops_linux.o else @@ -2027,7 +2027,7 @@ ARCH := arm CROSS_COMPILE := /home/android_sdk/Telechips/v13.05_r1-tcc-android-4.2.2_tcc893x-evm_build/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi- KSRC := /home/android_sdk/Telechips/v13.05_r1-tcc-android-4.2.2_tcc893x-evm_build/kernel MODULE_NAME := wlan -endif +endif ifeq ($(CONFIG_PLATFORM_RTL8197D), y) EXTRA_CFLAGS += -DCONFIG_BIG_ENDIAN -DCONFIG_PLATFORM_RTL8197D @@ -2177,7 +2177,7 @@ rtk_core := core/rtw_cmd.o \ core/rtw_odm.o \ core/rtw_rm.o \ core/rtw_rm_fsm.o \ - core/efuse/rtw_efuse.o + core/efuse/rtw_efuse.o ifeq ($(CONFIG_SDIO_HCI), y) rtk_core += core/rtw_sdio.o @@ -2208,6 +2208,7 @@ else export CONFIG_RTL8821CU = m +module: modules all: modules modules: diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..580a321 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +rtl8821cu (5.4.1-1) unstable; urgency=medium + + * Initial release + + -- Marc Leeman Fri, 18 Oct 2019 13:46:27 +0200 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..f599e28 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +10 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..7b58497 --- /dev/null +++ b/debian/control @@ -0,0 +1,39 @@ +Source: rtl8821cu +Section: misc +Priority: optional +Maintainer: Marc Leeman +Build-Depends: debhelper (>= 10), + dkms, + linux-kbuild-4.19 +Standards-Version: 4.3.0 +Vcs-Browser: https://github.com/brektrou/rtl8821CU +Vcs-Git: https://github.com/brektrou/rtl8821CU.git + +Package: rtl8821cu-dkms +Architecture: amd64 +Multi-Arch: foreign +Depends: ${misc:Depends} +Provides: rtl8821cu-module +Description: DKMS files to build and install rtl8821cu + The rtl8821cu driver provides the driver for Realtek RTL8811CU/RTL8821CU + USB wifi adapter. + . + This package contains the DKMS files to build and install rtl8821cu. + . + To install this package, you have to install the header files for your + current kernel manually (usually included in the "linux-headers-"). + +Package: rtl8821cu-src +Architecture: amd64 +Depends: module-assistant, + debhelper (>= 5.0.37), + xz-utils, + ${misc:Depends} +Description: Source of the compressed rtl8821cu module + The rtl8821cu driver provides the driver for Realtek RTL8811CU/RTL8821CU + USB wifi adapter. + . + You can use module-assistant or make-kpkg to build a modules package + for specific kernel. + diff --git a/debian/control.modules.in b/debian/control.modules.in new file mode 100644 index 0000000..71d54e4 --- /dev/null +++ b/debian/control.modules.in @@ -0,0 +1,17 @@ +Source: rtl8821cu +Section: misc +Priority: optional +Maintainer: Marc Leeman +Build-Depends: debhelper (>> 3.0.0), zlib1g-dev, module-assistant +Standards-Version: 3.5.8 + +Package: rtl8821cu-module-#KVERS# +Depends: debconf, initramfs-tools +Architecture: any +Provides: rtl8821cu-module +Description: rtl8821cu kernel module + The rtl8821cu driver provides the driver for Realtek RTL8811CU/RTL8821CU + USB wifi adapter. + . + This package contains the pre-compiled version for kernel #KVERS# + diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..ea2ddba --- /dev/null +++ b/debian/copyright @@ -0,0 +1,22 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: rtl8821CU +Source: https://github.com/brektrou/rtl8821CU + +Files: debian/* +Copyright: 2020 Marc Leeman +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'. diff --git a/debian/rtl8821-module-_KVERS_.postinst.modules.in b/debian/rtl8821-module-_KVERS_.postinst.modules.in new file mode 100644 index 0000000..e1f7778 --- /dev/null +++ b/debian/rtl8821-module-_KVERS_.postinst.modules.in @@ -0,0 +1,7 @@ +#!/bin/sh -e + +if [ "`uname -r`" = _KVERS_ ] ; then + depmod -a & +fi + +#DEBHELPER# diff --git a/debian/rtl8821-module-_KVERS_.postrm b/debian/rtl8821-module-_KVERS_.postrm new file mode 100644 index 0000000..a86b591 --- /dev/null +++ b/debian/rtl8821-module-_KVERS_.postrm @@ -0,0 +1,34 @@ +#!/bin/sh +# postrm script for cloop +# +# see: dh_installdeb(1) +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' overwrit>r> +# for details, see /usr/share/doc/packaging-manual/ + +case "$1" in + purge) + ;; + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + depmod -aq || true & + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 0 + +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + + diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..eb7bdff --- /dev/null +++ b/debian/rules @@ -0,0 +1,28 @@ +#!/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') +XDIR=debian/rtl8821cu-src/usr/src/modules/rtl8821cu-src + +%: + dh $@ --with dkms + +override_dh_auto_install: + dh_install -prtl8821cu-dkms -X.o -X.ko core/ usr/src/rtl8821cu-$(VERSION) + dh_install -prtl8821cu-dkms -X.o -X.ko hal/ usr/src/rtl8821cu-$(VERSION) + dh_install -prtl8821cu-dkms -X.o -X.ko os_dep/ usr/src/rtl8821cu-$(VERSION) + dh_install -prtl8821cu-dkms -X.o -X.ko platform/ usr/src/rtl8821cu-$(VERSION) + dh_install -prtl8821cu-dkms -X.o -X.ko include/ usr/src/rtl8821cu-$(VERSION) + dh_install -prtl8821cu-dkms Makefile usr/src/rtl8821cu-$(VERSION) + dh_install -prtl8821cu-dkms rtl8821c.mk usr/src/rtl8821cu-$(VERSION) + install -d $(XDIR)/debian + cd debian && install rules.m-a ../$(XDIR)/debian/rules && cp -r *modules.in* changelog copyright compat *_KVERS_* ../$(XDIR)/debian/ + cd debian/rtl8821cu-src/usr/src && cp -a ../../../rtl8821cu-dkms/usr/src/rtl8821cu-$(VERSION)/* modules/rtl8821cu-src/ && XZ_OPT=-9 tar --xz -c -f rtl8821cu.tar.xz modules && rm -rf modules + +override_dh_dkms: + dh_dkms -V diff --git a/debian/rules.m-a b/debian/rules.m-a new file mode 100644 index 0000000..c5593e8 --- /dev/null +++ b/debian/rules.m-a @@ -0,0 +1,30 @@ +#!/usr/bin/make -f + +# for m-a +SHELL=/bin/bash +PACKAGE=rtl8821cu-module +MA_DIR ?= /usr/share/modass +-include $(MA_DIR)/include/generic.mk +-include $(MA_DIR)/include/common-rules.mk +kdist_config: kdist_configure +kdist_configure: prep-deb-files + +binary-modules: kdist_configure + $(MAKE) module KERNEL_DIR=$(KSRC) KVERSION=$(KVERS) + dh_installdirs -p $(PKGNAME) lib/modules/$(KVERS)/extra + cp 8821cu.ko $(CURDIR)/debian/$(PKGNAME)/lib/modules/$(KVERS)/extra + dh_testdir -a + dh_testroot -a + dh_installdebconf -a + dh_compress -a + dh_fixperms -a + dh_installdeb -a + dh_gencontrol -a -- -v$(VERSION) + dh_md5sums -a + dh_builddeb -a --destdir=$(DEB_DESTDIR) + +kdist_clean: + rm -rf *.ko debian/$(PKGNAME) + +.PHONY: kdist kdist_image kdist_configure kdist_clean kdist +.NOTPARALLEL: diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..89ae9db --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native)