X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;f=net-wireless%2Frtl8812au%2Frtl8812au-9999.ebuild;fp=net-wireless%2Frtl8812au%2Frtl8812au-9999.ebuild;h=e46580d2482d166c9621096e609b3f10ea67df2e;hb=a97a88694c309de1a6972c6faaee9d36d704000f;hp=0000000000000000000000000000000000000000;hpb=79ea04dbdab8f4cd18957a4ca204ba86514027e4;p=max%2Fgentoo-overlay.git diff --git a/net-wireless/rtl8812au/rtl8812au-9999.ebuild b/net-wireless/rtl8812au/rtl8812au-9999.ebuild new file mode 100644 index 0000000..e46580d --- /dev/null +++ b/net-wireless/rtl8812au/rtl8812au-9999.ebuild @@ -0,0 +1,82 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +MODULES_OPTIONAL_USE="module" +inherit linux-mod bash-completion-r1 + +DESCRIPTION="Driver module for Realtek 8811, 8812, 8814 and 8821 chipsets. From aircrack-ng" +HOMEPAGE="https://github.com/aircrack-ng/rtl8812au.git" + +if [[ ${PV} == 9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/aircrack-ng/rtl8812au" + KEYWORDS="" +else + die "Only support building directly from git for now" +fi + +LICENSE="GPL-2" +SLOT="0" +IUSE="+module module-src" + +MODULE_NAMES="88XXau(kernel/drivers/net/wireless)" +BUILD_TARGETS="modules" +CONFIG_CHECK="" + +pkg_setup() { + if use module; then + linux-mod_pkg_setup + kernel_is -lt 3 10 0 && die "This version of ${PN} requires Linux >= 3.10" + fi +} + +src_compile() { + BUILD_PARAMS="KERNELDIR=${KERNEL_DIR}" + use module && linux-mod_src_compile +} + +src_install() { + use module && linux-mod_src_install + use module-src && dodir /usr/src && cp -r "${S}" "${ED}/usr/src/${PN}" +} + +pkg_postinst() { + if use module-src && ! use module; then + einfo + einfo "You have enabled the module-src USE flag without the module USE" + einfo "flag. This means that sources are installed to" + einfo "${ROOT}usr/src/88XXau instead of having the" + einfo "kernel module compiled. You will need to compile the module" + einfo "yourself. Most likely, you don't want this USE flag, and should" + einfo "rather use USE=module" + einfo + fi + use module && linux-mod_pkg_postinst + + if use module; then + local old new + if [[ $(uname -r) != "${KV_FULL}" ]]; then + ewarn + ewarn "You have just built the rtl8812AU driver for kernel ${KV_FULL}, yet the currently running" + ewarn "kernel is $(uname -r). If you intend to use this driver module on the currently" + ewarn "running machine, you will first need to reboot it into the kernel ${KV_FULL}, for" + ewarn "which this module was built." + ewarn + elif [[ -f /sys/module/88XXau/version ]] && \ + old="$(< /sys/module/88XXau/version)" && \ + new="$(modinfo -F version "${ROOT}/lib/modules/${KV_FULL}/net/wireless/88XXau.ko" 2>/dev/null)" && \ + [[ $old != "$new" ]]; then + ewarn + ewarn "You appear to have just upgraded rtl8812AU from version v$old to v$new." + ewarn "However, the old version is still running on your system. In order to use the" + ewarn "new version, you will need to remove the old module and load the new one. As" + ewarn "root, you can accomplish this with the following commands:" + ewarn + ewarn " # rmmod 88XXau" + ewarn " # modprobe 88XXau" + ewarn + fi + fi +}