RTL8192EU driver compilation - PKGBUILD

This forum is for topics dealing with problems with software specifically in the ARMv6h repo.

RTL8192EU driver compilation - PKGBUILD

Postby capthookb » Mon May 18, 2015 3:08 pm

I recently got a usb wifi based on RTL8192EU chipset.
$this->bbcode_second_pass_code('', '
lsusb: ID 0bda:818b Realtek Semiconductor Corp.
')
In archlinux, there is no support for this chip. There is no aur package as well.
So i took the zip that came with the CD: RTL8192EU_linux_v4.2.2_7585.20130524.zip and tried to compile it. These are the steps in order to compile it in my X64_86 machine running archlinux:

$this->bbcode_second_pass_code('', '
unzip RTL8192EU_linux_v4.2.2_7585.20130524.zip
cd RTL8192EU_linux_v4.2.2_7585.20130524/driver
tar zxvf rtl8192EU_linux_v4.2.2_7585.20130524.tar.gz
cd ../
patch -p0 < os_intfs.c.patch.txt
cd driver/rtl8192EU_linux_v4.2.2_7585.20130524
')

I had to add EXTRA_CFLAGS += -Wno-error=date-time in Makefile located in driver/rtl8192EU_linux_v4.2.2_7585.20130524 folder and also change function name strnicmp to strncasecmp in file /driver/rtl8192EU_linux_v4.2.2_7585.20130524/os_dep/linux/rtw_android.c (line 227).
Finally running make inside driver/rtl8192EU_linux_v4.2.2_7585.20130524 produces the apropriate kernel modules that i load successfully with insmod ./


So there are 3 patches and one source code zip file.
How can i make a PKGBUILD in order to compile automatically the module every time i update my system?
My purpose is to put this wifi card in my raspbery pi.
But when i run make on my raspberry pi, while following the above steps i get almost nothing:

$this->bbcode_second_pass_code('', '
☁ rtl8192EU_linux_v4.2.2_7585.20130524 make
make ARCH=armv6l CROSS_COMPILE= -C /lib/modules/3.18.10-3-ARCH/build M=/home/user/download/temp/realtek/RTL8192EU_linux_v4.2.2_7585.20130524/driver/rtl8192EU_linux_v4.2.2_7585.20130524 modules
make[1]: Entering directory '/usr/lib/modules/3.18.10-3-ARCH/build'
Makefile:610: arch/armv6l/Makefile: No such file or directory
make[1]: *** No rule to make target 'arch/armv6l/Makefile'. Stop.
make[1]: Leaving directory '/usr/lib/modules/3.18.10-3-ARCH/build'
Makefile:1043: recipe for target 'modules' failed
make: *** [modules] Error 2
')

Is there a way to make a PKGBUILD for any architecture, that will take care of compiling? I don't know where to start!
Do you think that the driver supports armv architecture?
Attachments
rtw_android.patch
(561 Bytes) Downloaded 995 times
makefile.patch
(424 Bytes) Downloaded 1045 times
os_intfs.c.patch
(14.44 KiB) Downloaded 1083 times
capthookb
 
Posts: 12
Joined: Mon May 18, 2015 2:35 pm

Re: RTL8192EU driver compilation - PKGBUILD

Postby moonman » Mon May 18, 2015 6:56 pm

ARCH=armv6l should be ARCH=arm

Here's an example if you want to write a PKGBUILD
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3387
Joined: Sat Jan 15, 2011 3:36 am

Re: RTL8192EU driver compilation - PKGBUILD

Postby capthookb » Tue May 19, 2015 8:31 am

Hey, moonman, i was just looking at dkms-8188eu, that you have uploaded in aur.archlinux.org
https://aur.archlinux.org/packages/dkms-8188eu
I will try to adopt it to 8192eu and see what happens.

On raspberry pi, i don 't know how to set it up for compiling.
The Makefile that is included inside the driver package has these options:
$this->bbcode_second_pass_code('', '
CONFIG_PLATFORM_I386_PC = y
CONFIG_PLATFORM_ANDROID_X86 = n
CONFIG_PLATFORM_JB_X86 = n
CONFIG_PLATFORM_ARM_S3C2K4 = n
CONFIG_PLATFORM_ARM_PXA2XX = n
CONFIG_PLATFORM_ARM_S3C6K4 = n
CONFIG_PLATFORM_MIPS_RMI = n
CONFIG_PLATFORM_RTD2880B = n
CONFIG_PLATFORM_MIPS_AR9132 = n
CONFIG_PLATFORM_RTK_DMP = n
CONFIG_PLATFORM_MIPS_PLM = n
CONFIG_PLATFORM_MSTAR389 = n
CONFIG_PLATFORM_MT53XX = n
CONFIG_PLATFORM_ARM_MX51_241H = n
CONFIG_PLATFORM_FS_MX61 = n
CONFIG_PLATFORM_ACTIONS_ATJ227X = n
CONFIG_PLATFORM_TEGRA3_CARDHU = n
CONFIG_PLATFORM_TEGRA4_DALMORE = n
CONFIG_PLATFORM_ARM_TCC8900 = n
CONFIG_PLATFORM_ARM_TCC8920 = n
CONFIG_PLATFORM_ARM_TCC8920_JB42 = n
CONFIG_PLATFORM_ARM_RK2818 = n
CONFIG_PLATFORM_ARM_URBETTER = n
CONFIG_PLATFORM_ARM_TI_PANDA = n
CONFIG_PLATFORM_MIPS_JZ4760 = n
CONFIG_PLATFORM_DMP_PHILIPS = n
CONFIG_PLATFORM_TI_DM365 = n
CONFIG_PLATFORM_MSTAR_TITANIA12 = n
CONFIG_PLATFORM_SZEBOOK = n
CONFIG_PLATFORM_ARM_SUNxI = n
CONFIG_PLATFORM_ARM_SUN6I = n
CONFIG_PLATFORM_ACTIONS_ATM702X = n
CONFIG_PLATFORM_ACTIONS_ATV5201 = n
')
I don't see any armv6 architecture included.
How can i find if the driver is compatible with armv6?
capthookb
 
Posts: 12
Joined: Mon May 18, 2015 2:35 pm

Re: RTL8192EU driver compilation - PKGBUILD

Postby capthookb » Tue May 19, 2015 9:44 am

Success. Inside the driver zip file there is a documentation folder. There are instructions on how to add a new platform.
So i disabled platform I386 PC and added platform armv6:
$this->bbcode_second_pass_code('', '
CONFIG_PLATFORM_I386_PC = n
CONFIG_PLATFORM_ARMV6 = y
')

and this section as well further down below
$this->bbcode_second_pass_code('', '
ifeq ($(CONFIG_PLATFORM_ARMV6),y)
EXTRA_CFLAGS+=-DCONFIG_LITTLE_ENDIAN
ARCH:=arm
KVER := $(shell uname -r)
KSRC := /lib/modules/$(KVER)/build
MODDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless/
endif
')

and it compiled fine. Wifi is working :-)
I'll make a PKGBUILD and i'll reply here, in case anyone else want's to use this driver.
capthookb
 
Posts: 12
Joined: Mon May 18, 2015 2:35 pm

Re: RTL8192EU driver compilation - PKGBUILD

Postby nous » Wed May 27, 2015 1:15 pm

I would be interested in an AUR package. Could you make it please?
nous
 
Posts: 1
Joined: Wed May 27, 2015 1:12 pm

Re: RTL8192EU driver compilation - PKGBUILD

Postby capthookb » Wed May 27, 2015 8:18 pm

I haven't looked at it yet.
Maybe i'll try tomorrow. I'll keep you posted
capthookb
 
Posts: 12
Joined: Mon May 18, 2015 2:35 pm

Re: RTL8192EU driver compilation - PKGBUILD

Postby drizzle » Sat Jun 06, 2015 8:23 pm

hey, i was having the same problem while compiling this driver in arch arm (raspi 2)

so i followed your post and now confirm it works. thanks!
drizzle
 
Posts: 1
Joined: Sat Jun 06, 2015 8:11 pm

Re: RTL8192EU driver compilation - PKGBUILD

Postby capthookb » Sun Jun 14, 2015 10:10 pm

Ok, I have tried to build a package, but with no luck.
These are the files based on rtl8192ee-dkms https://aur.archlinux.org/packages/rtl8192ee-dkms

PKGBUILD:
$this->bbcode_second_pass_code('', '
_pkgbase=8192eu
pkgname=8192eu-dkms
pkgver=4.2.2
pkgrel=7585
pkgdesc="Driver for Realtek RTL8192EU chipset wireless cards (DKMS)"
arch=('i686' 'x86_64')
url="http://www.lwfinger.com/realtek_drivers"
license=('custom')
depends=('dkms' 'linux-headers')
conflicts=("${_pkgbase}")
install=${pkgname}.install

source=('makefile2.patch'
'os_intfs.c.patch'
'rtw_android.patch'
'rtl8192EU_linux_v4.2.2_7585.20130524.tar.gz'
'dkms.conf')

prepare() {
cd ${srcdir} #
#patch -f -Np1 -i os_intfs.c.patch || true
patch -p0 < makefile2.patch
patch -p0 < rtw_android.patch
patch -p0 < os_intfs.c.patch
}

package() {
# Copy sources (including Makefile)
install -dm755 "${pkgdir}/usr/src"
_destdir="${pkgdir}/usr/src/${_pkgbase}-${pkgver}"

mv "${srcdir}/rtl8192EU_linux_v4.2.2_7585.20130524" "${_destdir}"
install -m644 dkms.conf "${_destdir}/dkms.conf"
}
md5sums=('008c30221eb0c54b04e38bffe45465fc'
'e37f31578e202df9e5ed2c40c5de115b'
'f9a3dfe881b79791ec7b4f42a9065e8a'
'c955b1a9a14e137450a2ea6ff8a5242f'
'99a5227e645c9363e055294ef66ee785')
')

dkms.conf:
$this->bbcode_second_pass_code('', '
PACKAGE_NAME="8192eu"
PACKAGE_VERSION="4.2.2"
MAKE[0]="make CROSS_COMPILE= -C $kernel_source_dir M=$dkms_tree/$PACKAGE_NAME/$PACKAGE_VERSION/build modules"
BUILT_MODULE_NAME[0]="8192eu"
DEST_MODULE_LOCATION[0]="/kernel/drivers/staging"
')

8192-dkms.install:
$this->bbcode_second_pass_code('', '
# old version (without -$pkgrel): ${1%%-*}
# new version (without -$pkgrel): ${2%%-*}

post_install() {
dkms install 8192eu/${1%%-*}
}

pre_upgrade() {
pre_remove ${2%%-*}
}

post_upgrade() {
post_install ${1%%-*}
}

pre_remove() {
dkms remove 8192eu/${1%%-*} --all
}
')

makepkg works fine. I install the package with pacman -U 8192eu-dkms-4.2.2-7585-x86_64.pkg.tar.xz and i get this:
$this->bbcode_second_pass_code('', '
looking for conflicting packages...

Packages (1) 8192eu-dkms-4.2.2-7585

Total Installed Size: 6.16 MiB
Net Upgrade Size: 0.00 MiB

:: Proceed with installation? [Y/n] y
(1/1) checking keys in keyring [#######################################################################################] 100%
(1/1) checking package integrity [#######################################################################################] 100%
(1/1) loading package files [#######################################################################################] 100%
(1/1) checking for file conflicts [#######################################################################################] 100%
(1/1) checking available disk space [#######################################################################################] 100%

------------------------------
Deleting module version: 4.2.2
completely from the DKMS tree.
------------------------------
Done.
(1/1) reinstalling 8192eu-dkms [#######################################################################################] 100%

Creating symlink /var/lib/dkms/8192eu/4.2.2/source ->
/usr/src/8192eu-4.2.2

DKMS: add completed.

Kernel preparation unnecessary for this kernel. Skipping...

Building module:
cleaning build area....
make KERNELRELEASE=4.0.5-1-ARCH CROSS_COMPILE= -C /usr/lib/modules/4.0.5-1-ARCH/build M=/var/lib/dkms/8192eu/4.2.2/build modules....
Error! Build of 8192eu.ko failed for: 4.0.5-1-ARCH (x86_64)
Consult the make.log in the build directory
/var/lib/dkms/8192eu/4.2.2/build/ for more information.
error: command failed to execute correctly
')



/var/lib/dkms/8192eu/4.2.2/build/make.log contains these lines:
$this->bbcode_second_pass_code('', '
DKMS make.log for 8192eu-4.2.2 for kernel 4.0.5-1-ARCH (x86_64)
Mon Jun 15 01:05:54 EEST 2015
make: Entering directory '/usr/lib/modules/4.0.5-1-ARCH/build'
Building modules, stage 2.
MODPOST 0 modules
make: Leaving directory '/usr/lib/modules/4.0.5-1-ARCH/build'
')

I haven't quite understood how dkms is working and i don't know how to move on.
If anyone has any idea of what to correct, please write here.


P.S. I am trying first in my x86_64 machine, in order to be quick until the package is ready. I will make adjustments to PKGBUILD in order to compile in any architecture.
capthookb
 
Posts: 12
Joined: Mon May 18, 2015 2:35 pm


Return to ARMv6h

Who is online

Users browsing this forum: No registered users and 9 guests