summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Karbowski <slashbeast@gentoo.org>2021-01-03 21:12:11 +0100
committerPiotr Karbowski <slashbeast@gentoo.org>2021-01-03 21:13:55 +0100
commit1f779cd4a3e7767a89ee7c19b7cf030ce53beb79 (patch)
tree8c88fb582a70d70758377527cab73bd62419cab4 /net-misc
parentprofiles/ia64: Remove dev-libs/libwacom[test] mask (diff)
downloadgentoo-1f779cd4a3e7767a89ee7c19b7cf030ce53beb79.tar.gz
gentoo-1f779cd4a3e7767a89ee7c19b7cf030ce53beb79.tar.bz2
gentoo-1f779cd4a3e7767a89ee7c19b7cf030ce53beb79.zip
net-misc/realtek-r8152: new package.
Signed-off-by: Piotr Karbowski <slashbeast@gentoo.org>
Diffstat (limited to 'net-misc')
-rw-r--r--net-misc/realtek-r8152/Manifest1
-rw-r--r--net-misc/realtek-r8152/metadata.xml8
-rw-r--r--net-misc/realtek-r8152/realtek-r8152-2.14.0.ebuild58
3 files changed, 67 insertions, 0 deletions
diff --git a/net-misc/realtek-r8152/Manifest b/net-misc/realtek-r8152/Manifest
new file mode 100644
index 000000000000..b29e20ede111
--- /dev/null
+++ b/net-misc/realtek-r8152/Manifest
@@ -0,0 +1 @@
+DIST realtek-r8152-2.14.0.tar.gz 88356 BLAKE2B c530080cab5e6f7433aa6452e3c5f1f19f14c2ac473751958d85efa5553d2b2889d80cc47c2ad4064ad5673008df97dce197254f445c5fc7ae3905c7833e1641 SHA512 2908e9963b6bec9d638514e6a54ab8bca0b56c4866245f476889e4c8462c36f2bece86abac2e5ece9aee1776f00f7d4a67fd5561d830a67e02e386d79aba07dd
diff --git a/net-misc/realtek-r8152/metadata.xml b/net-misc/realtek-r8152/metadata.xml
new file mode 100644
index 000000000000..6c5d3e79d48d
--- /dev/null
+++ b/net-misc/realtek-r8152/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>slashbeast@gentoo.org</email>
+ <name>Piotr Karbowski</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/net-misc/realtek-r8152/realtek-r8152-2.14.0.ebuild b/net-misc/realtek-r8152/realtek-r8152-2.14.0.ebuild
new file mode 100644
index 000000000000..5102a32a5e5e
--- /dev/null
+++ b/net-misc/realtek-r8152/realtek-r8152-2.14.0.ebuild
@@ -0,0 +1,58 @@
+# Copyright 2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit linux-mod linux-info udev
+
+SRC_URI="https://github.com/slashbeast/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+KEYWORDS="~amd64 ~x86"
+
+DESCRIPTION="Out-of-tree driver for Realtek's 2.5 GbE USB NICs."
+HOMEPAGE="https://www.realtek.com/en/component/zoo/category/network-interface-controllers-10-100-1000m-gigabit-ethernet-usb-3-0-software"
+
+SLOT="0"
+LICENSE="GPL-2"
+IUSE=""
+
+DEPEND="
+ virtual/linux-sources
+ sys-kernel/linux-headers
+"
+RDEPEND=""
+
+MODULE_NAMES="r8152(net/usb)"
+
+pkg_setup() {
+ linux_config_exists
+
+ for module in USB_USBNET USB_NET_CDC_NCM USB_NET_CDCETHER; do
+ linux_chkconfig_module "${module}" || ewarn "CONFIG_${module} needs to be built as module (builtin doesn't work)"
+ done
+
+ linux_chkconfig_present MII || ewarn "CONFIG_MII needs to be built as module or builtin into the kernel"
+
+ linux_chkconfig_present USB_RTL8152 && ewarn "CONFIG_USB_RTL8152 must NOT be enabled in the kernel!"
+
+ linux-mod_pkg_setup
+
+ BUILD_TARGETS="modules"
+ BUILD_PARAMS="KERNELDIR=${KERNEL_DIR}"
+}
+
+src_install() {
+ linux-mod_src_install
+
+ udev_newrules 50-usb-realtek-net.rules 50-usb-realtek-net.rules
+}
+
+pkg_postinst() {
+ udev_reload
+
+ echo
+ elog "If the cdc_ncm was loaded before this r8152 driver, one might get a flood"
+ elog "of 'usbN: network connection: disconnected' in kernel log."
+ elog "In that case one needs to unload r8152, cdc_ether and cdc_ncm modules and"
+ elog "let udev load them in right order or manually load r8152."
+ echo
+}