how to add module to kernel


27 posts   Page 1 of 2   1, 2
by lesto » Sat Jun 16, 2012 7:48 pm
Hi,
i have to add 8712u module to kernel for my usb wifi key.
i'm not really used at this( just done it on a gentoo), but as far as i know i have to recompile the kernel adding to module.
i don't want to cross-compile because actually on main system i have a chain for cortex4, so i want to recompile it directly on rasp (this also will remove some complication), probably it will take ages :mrgreen:

i've seen some arch guide, with suggest the use of "abs", but anyway i need the configuration file. I'm doing right? where i can download the configuration file used for the image, so i'm sure i won't forgot some module/patch/whatever?

a confused bye
Posts: 30
Joined: Mon Sep 12, 2011 4:12 pm
by pepedog » Sat Jun 16, 2012 9:04 pm
Code: Select all
git clone git://github.com/archlinuxarm/PKGBUILDs.git
cd PKGBUILDs/core/linux-raspberrypi
nano PKGBUILD
Uncomment make menuconfig
makepkg --Acs --asroot
When built
pacman -U thefilenamesofthe2packagesbuilt
Make sure you are updated before you try any of this
Posts: 968
Joined: Fri Oct 07, 2011 9:55 am
by lesto » Sun Jun 17, 2012 9:45 pm
i've had some connection problem, but also with PKG.
had to modify http://github.com/raspberrypi/linux.git
into
git:// or http://
Posts: 30
Joined: Mon Sep 12, 2011 4:12 pm
by pepedog » Sun Jun 17, 2012 11:02 pm
Ah, yes, the build system has certs setup
Posts: 968
Joined: Fri Oct 07, 2011 9:55 am
by lesto » Mon Jun 18, 2012 7:39 pm
2 good and 2 bed news.
good news: for a couple of hour my internet worked fine and i've downloaded updates and git repo.
also i've found that r8712u module is already here. dunno if i'm luck or simply stupid (because haven't seen it)

bad news: i've tried to compile the kernel "just for fun", but i've got an error because of some parameter. I think because of gcc4.7, it has break many makefile also with 8086 package. me stupid haven't saved the error, now i'm gonna try to reproduce.

other bad news is that "modinfo r8712u" doesn't show my usb ID! it is there in my 64bit arch linux, but not in the rasp's one!
fuuuuuu :mrgreen:
now i'm looking for a way to add alias without have to modify and recompile modules source (at this point i think i can mod the module source and just use "make module", right? but where? witch is the right folder! and i think i'll have to move the .ko from actual git folder to real one...)

sorry i'm a little noob with module and kernel, i feel better with java (where everything is done by someone else) or with micro-controller (where YOU do everything :mrgreen: )
Posts: 30
Joined: Mon Sep 12, 2011 4:12 pm
by lesto » Fri Jun 29, 2012 11:38 pm
hi, i'm back again, with full internet, and rebuild started.
find out i don't have to recompile the kernel but just the module... anyway i need the kernel source, so i'm also tring to recompile the kernel without mod (just for fun) and i still have error, now i'm applying the solution:
http://archlinuxarm.org/forum/viewtopic.php?f=9&t=3058

hope it will work this time.

log of my mod to PKGBUILD:

* changed HTTPS into GIT (also HTTP works fine) (issued this but they say it is my fault, probabily bad openSsh configuration but i'll think about this later)
* eliminated md5sum for file config (it fails form the last update, probably haven't been update, opened a issue)
* removed -Wl from /etc/makepkg.conf (see link)

now i'm compiling, i'll keep you updated.
thanks to mother nature it is not the first time i'm compiling a kernel (time ago also helped to make a LFS) hope this will help some noob and find out some error (or at least some dependence) in pkg
Posts: 30
Joined: Mon Sep 12, 2011 4:12 pm
by lesto » Mon Jul 02, 2012 12:09 am
after about 11 hour of compilation. i've get a insufficient space error.
FUUUUUUUUU

tomorrow i'll try again.


for the recompilation of the module alone i've the error:

Code: Select all
make ARCH=arm CROSS_COMPILE= -C /root/PKGBUILDs/core/linux-raspberrypi/src/linux/ M=/root/rtlmod/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405  modules
make[1]: Entering directory `/root/PKGBUILDs/core/linux-raspberrypi/src/linux'

  WARNING: Symbol version dump /root/PKGBUILDs/core/linux-raspberrypi/src/linux/Module.symvers
           is missing; modules will have no dependencies and modversions.

  CC [M]  /root/rtlmod/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/cmd/rtl871x_cmd.o
In file included from /root/rtlmod/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/include/drv_types.h:70:0,
                 from /root/rtlmod/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/cmd/rtl871x_cmd.c:24:
/root/rtlmod/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/include/rtl871x_cmd.h:107:25: error: field ‘event_tasklet’ has incomplete type
In file included from /root/rtlmod/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/include/drv_types.h:72:0,
                 from /root/rtlmod/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/cmd/rtl871x_cmd.c:24:
/root/rtlmod/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/include/rtl871x_xmit.h:355:24: error: field ‘xmit_tasklet’ has incomplete type
In file included from /root/rtlmod/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/include/drv_types.h:73:0,
                 from /root/rtlmod/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/cmd/rtl871x_cmd.c:24:
/root/rtlmod/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/include/rtl871x_recv.h:205:24: error: field ‘recv_tasklet’ has incomplete type
make[2]: *** [/root/rtlmod/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/cmd/rtl871x_cmd.o] Errore 1
make[1]: *** [_module_/root/rtlmod/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405] Errore 2
make[1]: Leaving directory `/root/PKGBUILDs/core/linux-raspberrypi/src/linux'
make: *** [modules] Errore 2


help?
Posts: 30
Joined: Mon Sep 12, 2011 4:12 pm
by lesto » Tue Jul 03, 2012 9:51 pm
solved! they have forgotten
#include <linux/kernel.h>
into
driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20120405/include/rtl871x_recv.h

olè! now i have to test the driver!
Posts: 30
Joined: Mon Sep 12, 2011 4:12 pm
by Wilson-nunn » Mon Jul 09, 2012 7:00 pm
Sorry to sound very silly, but I am very new to all of this, and know very very little about programming. Is this a way to get a rtl8191SU to work with a RPi?

Wilson-Nunn
Posts: 1
Joined: Mon Jul 09, 2012 11:52 am
by eix » Sat Sep 15, 2012 9:34 am
I am compiling r8712u from Realtek sources, against the current raspberry-pi kernel (arch linux).

Will provide the compiled module as soon as possible :)

I currently had to recompile all the kernel modules because the arch linux kernel headers package did not ship with Module.symvers :evil:
User avatar
Posts: 82
Joined: Sat Sep 15, 2012 8:09 am
by eix » Sat Sep 15, 2012 9:04 pm
The RTL8191S works OUT OF THE BOX with raspbian.

I have spent about 46 hours trying to compile the module from sources, finally got stuck on a distcc issue.

Suggestion for newbies and experts: give up arch linux arm, it is a bad quality distro
User avatar
Posts: 82
Joined: Sat Sep 15, 2012 8:09 am
by MaxG » Fri Jan 04, 2013 1:50 am
Hi, EIX. I've been trying to use the D-Link DWA-131 nano wireless adapter in Arch. When i start netcfg i receive this response on RFKILL:
Code: Select all
rfkill: Cannot open RFKILL control device

To eliminate the problem I have to install the driver 8192su and so I decided to compile driver.
Can you provide compiled driver or help me to compile it?
Posts: 11
Joined: Fri Jan 04, 2013 1:28 am
by pepedog » Fri Jan 04, 2013 9:41 am
Are you sure the driver isn't loaded, dmesg might give a clue
In the event that it was loaded, methods you are using and config files would help
Or if you want an easy way of connecting to known ssid, and wired to work as well if there, ask here
Posts: 968
Joined: Fri Oct 07, 2011 9:55 am
by MaxG » Fri Jan 04, 2013 11:35 am
pepedog wrote:Are you sure the driver isn't loaded, dmesg might give a clue
In the event that it was loaded, methods you are using and config files would help
Or if you want an easy way of connecting to known ssid, and wired to work as well if there, ask here


From dmesg the driver for 8172 is loaded:
Code: Select all
[   16.783642] r8712u: DriverVersion: v7_0.20100831
[   16.792196] r8712u: register rtl8712_netdev_ops to netdev_ops
[   16.792231] r8712u: USB_SPEED_HIGH with 4 endpoints
[   16.822630] r8712u: Boot from EFUSE: Autoload OK

and:
Code: Select all
[   18.649524] r8712u: CustomerID = 0x0000
[   18.649554] r8712u: MAC Address from efuse = 90:94:e4:d9:2d:f5
[   18.649586] r8712u: Loading firmware from "rtlwifi/rtl8712u.bin"
[   18.703721] usbcore: registered new interface driver r8712u

Is it right driver? What is RFKill problem?
Posts: 11
Joined: Fri Jan 04, 2013 1:28 am
by Joe Schmoe » Fri Jan 04, 2013 1:05 pm
Regarding "RFKILL":

Google says things like:

Code: Select all
rfkill - Linux Wireless
wireless.kernel.org/en/users/Documentation/rfkill
rfkill is a small tool to query the state of the rfkill switches, buttons and ... Release tarballs of rfkill are available from http://wireless.kernel.org/download/rfkill/.
3.10. RFKill - Red Hat Customer Portal
access.redhat.com › ... › Power Management Guide
The RFKill core provides the application programming interface (API) for the subsystem. Kernel drivers that have been designed to support RFkill use this API to ...
rfkill(1) - Linux man page
linux.die.net/man/1/rfkill
rfkill - tool for enabling and disabling wireless devices ... help: Show rfkill's built-in help text. event: Listen for rfkill events and display them on stdout. list: List the ...
How to fix rfkill Issues « lkubuntu
lkubuntu.wordpress.com/2011/09/07/how-to-fix-rfkill-issues/
Sep 7, 2011 – I recently tried making wireless work on a laptop, but I got problems with rfkill showing that it was hard blocked. In fact, the wireless switch was ...
11.10 - What is RF-Kill? - Ask Ubuntu
askubuntu.com/questions/83657/what-is-rf-kill
Nov 29, 2011 – Possible Duplicate: “SIOCSIFFLAGS: Operation not possible due to RF-kill”? what is RF Kill. & how do i fix it. enter image description here ...


(But I digress...)

Anyway, whenever I startup "wpa_supplicant", I get the following error messages (both on the screen and in syslog), but after that, everything seems to work fine, so I am inclined to just ignore these:

Code: Select all
Jan  1 15:22:16 raspberrypi wpa_supplicant[7253]: rfkill: Cannot open RFKILL control deviceJan  1 15:22:16 raspberrypi ifplugd(wlan0)[2899]: client: ioctl[SIOCSIWAP]: Operation not permittedJan  1 15:22:16 raspberrypi ifplugd(wlan0)[2899]: client: ioctl[SIOCSIWENCODEEXT]: Invalid argumentJan  1 15:22:16 raspberrypi ifplugd(wlan0)[2899]: client: ioctl[SIOCSIWENCODEEXT]: Invalid argument
Never answer the question you are asked. Rather, answer the question you wish you had been asked.

- Robert S. McNamara - quoted in "Fog of War" -
Posts: 2669
Joined: Sun Jan 15, 2012 1:11 pm
by pepedog » Fri Jan 04, 2013 2:35 pm
I am going to ask you to try a totally different method, it's simple and works

I assume you want wired and wireless to be dhcpcd
Install netcfg, when it installs it will talk about optional dependancies, install them too, probably all in one go-
pacman -Sy wpa_supplicant iw wpa_actiond netcfg dialog ifplugd
Code: Select all
cp /etc/network.d/examples/ethernet-dhcp /etc/network.d/
cp /etc/network.d/examples/wireless-wpa /etc/network.d/

nano /etc/network.d/wireless-wpa
#edit to your liking your ssid and passkey
#Also put this into that file PRE_UP="sleep 5"
#If network comes up before hardware detected, that sleep will help

nano /etc/conf.d/netcfg
#edit line NETWORKS=(last) so it reads NETWORKS=(ethernet-dhcp wireless-wpa)

systemctl enable netcfg
#if message tells you symlink created, then do this
rm /etc/systemd/system/multi-user.target.wants/dh*
Posts: 968
Joined: Fri Oct 07, 2011 9:55 am
by MaxG » Fri Jan 04, 2013 5:00 pm
I have already installed and configured everything you say. The problem is that I get this error:
Code: Select all
[root@ALARMPI ~]# netcfg wlan0
:: wlan0 up                                                            [ BUSY ]
rfkill: Cannot open RFKILL control device
                                                                       [ DONE ]
[root@ALARMPI ~]# netcfg wlan0

How to resolve?
Posts: 11
Joined: Fri Jan 04, 2013 1:28 am
by sdjf » Fri Jan 04, 2013 5:36 pm
I have not learned netcfg yet, but with other networking devices, often there has been a lock placed on the device that has to be removed.

Is anything you see in /var/log possibly relevant?
FORUM TIP: To view just one person's posting history, sign in, click on their user name, then click on "Search User's Posts." || This Pi owner is running Arch on 512MB Model B.
Posts: 1294
Joined: Fri Mar 16, 2012 5:20 am
Location: California
by pepedog » Fri Jan 04, 2013 8:37 pm
MaxG
Do you have password in quotes?
Put in quotes if clear, not in quotes if generated hex
Code: Select all
wpa_passphrase myssid mypassphrase
ssid="myssid"
#psk="mypassphrase"
psk=c22c1e6febc7875af85d033bbf15f5ca836633bac8eb16693fd58bff66fcb66c
Posts: 968
Joined: Fri Oct 07, 2011 9:55 am
by MaxG » Sat Jan 05, 2013 12:32 am
My password is without quotes because is HEX.
The problem is only RFKill:
Code: Select all
rfkill: Cannot open RFKILL control device

It seems:
Code: Select all
# gunzip -c /proc/config.gz  | grep RFKILL
# CONFIG_RFKILL is not set

How to set RFKill?
Posts: 11
Joined: Fri Jan 04, 2013 1:28 am
by pepedog » Sat Jan 05, 2013 1:38 am
I looked at kernel config first port of call.
Latest kernel has it, so-
Code: Select all
pacman -Syu
Posts: 968
Joined: Fri Oct 07, 2011 9:55 am
by MaxG » Sat Jan 05, 2013 9:45 am
pepedog wrote:I looked at kernel config first port of call.
Latest kernel has it, so-
Code: Select all
pacman -Syu


I've done these steps... RFKill is not in Kernel...
Posts: 11
Joined: Fri Jan 04, 2013 1:28 am
by pepedog » Sat Jan 05, 2013 12:26 pm
It is
Code: Select all
gunzip -c /proc/config.gz  | grep RFKILL
CONFIG_RFKILL=y
CONFIG_RFKILL_LEDS=y
CONFIG_RFKILL_INPUT=y
CONFIG_RFKILL_GPIO=m
[root@alarmpi ~]# uname -a
Linux alarmpi 3.6.11-2-ARCH+ #1 PREEMPT Mon Dec 31 23:00:25 UTC 2012 armv6l GNU/Linux

https://github.com/archlinuxarm/PKGBUILDs/blob/master/core/linux-raspberrypi/config
Did you sync and reboot after updates?
Posts: 968
Joined: Fri Oct 07, 2011 9:55 am
by MaxG » Sat Jan 05, 2013 8:14 pm
I formatted the sdcard and installed it all over again. Now it works! :D
If I enable netcfg with systemctl then dhcpcd will be automatically disabled?
Posts: 11
Joined: Fri Jan 04, 2013 1:28 am
by pepedog » Sat Jan 05, 2013 8:24 pm
MaxG wrote:I formatted the sdcard and installed it all over again. Now it works! :D
If I enable netcfg with systemctl then dhcpcd will be automatically disabled?

No, but in the instructions this disables it
rm /etc/systemd/system/multi-user.target.wants/dh*
I wonder if your fstab file was mucked up before?
Posts: 968
Joined: Fri Oct 07, 2011 9:55 am