1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 MODULES_OPTIONAL_USE="module"
7 inherit linux-mod bash-completion-r1
9 DESCRIPTION="Driver module for Realtek 8811, 8812, 8814 and 8821 chipsets. From aircrack-ng"
10 HOMEPAGE="https://github.com/aircrack-ng/rtl8812au.git"
12 if [[ ${PV} == 9999 ]]; then
14 EGIT_REPO_URI="https://github.com/aircrack-ng/rtl8812au"
17 die "Only support building directly from git for now"
22 IUSE="+module module-src"
24 MODULE_NAMES="88XXau(kernel/drivers/net/wireless)"
25 BUILD_TARGETS="modules"
31 kernel_is -lt 3 10 0 && die "This version of ${PN} requires Linux >= 3.10"
36 BUILD_PARAMS="KERNELDIR=${KERNEL_DIR}"
37 use module && linux-mod_src_compile
41 use module && linux-mod_src_install
42 use module-src && dodir /usr/src && cp -r "${S}" "${ED}/usr/src/${PN}"
46 if use module-src && ! use module; then
48 einfo "You have enabled the module-src USE flag without the module USE"
49 einfo "flag. This means that sources are installed to"
50 einfo "${ROOT}usr/src/88XXau instead of having the"
51 einfo "kernel module compiled. You will need to compile the module"
52 einfo "yourself. Most likely, you don't want this USE flag, and should"
53 einfo "rather use USE=module"
56 use module && linux-mod_pkg_postinst
60 if [[ $(uname -r) != "${KV_FULL}" ]]; then
62 ewarn "You have just built the rtl8812AU driver for kernel ${KV_FULL}, yet the currently running"
63 ewarn "kernel is $(uname -r). If you intend to use this driver module on the currently"
64 ewarn "running machine, you will first need to reboot it into the kernel ${KV_FULL}, for"
65 ewarn "which this module was built."
67 elif [[ -f /sys/module/88XXau/version ]] && \
68 old="$(< /sys/module/88XXau/version)" && \
69 new="$(modinfo -F version "${ROOT}/lib/modules/${KV_FULL}/net/wireless/88XXau.ko" 2>/dev/null)" && \
70 [[ $old != "$new" ]]; then
72 ewarn "You appear to have just upgraded rtl8812AU from version v$old to v$new."
73 ewarn "However, the old version is still running on your system. In order to use the"
74 ewarn "new version, you will need to remove the old module and load the new one. As"
75 ewarn "root, you can accomplish this with the following commands:"
77 ewarn " # rmmod 88XXau"
78 ewarn " # modprobe 88XXau"