Does the kernel support Wifi? Or how to re compile kernel?

362 views
Skip to first unread message

ope...@gmail.com

unread,
Jan 20, 2013, 7:19:06 AM1/20/13
to al...@googlegroups.com
Hello JC, 

Thanks for all your help - I was trying a micro Wifi Dongle -  based on RTL8188CU chipset. I tried to compile the drivers from Realtek site, and actually succeeded with a module ( 8192CU ). But Kernel doesnot seem to be built with CONFIG_WLAN or CONFIG_WIRELESS or CONFIG_WIRELESS_EXT. Particuarly the first one needs to be built in the kernel, I suppose? 

Does the kernel supports WLAN? If not any pointers on how do i compile my own kernel and implement it? Please , any help would be highly appreciated. 

[root@GNAS ~ linux-2.6.35.14 ] # cat linux-2.6.35.14-km.config | grep WIRELESS
# CONFIG_WIRELESS is not set
CONFIG_USB_SERIAL_SIERRAWIRELESS
=m


[root@GNAS ~ linux-2.6.35.14 ] # cat linux-2.6.35.14-km.config | grep WLAN
# CONFIG_WLAN is not set

Also - I have your Alt-F buildroot package compiled and set. 

Joao Cardoso

unread,
Jan 20, 2013, 3:59:09 PM1/20/13
to al...@googlegroups.com


On Sunday, January 20, 2013 12:19:06 PM UTC, ope...@gmail.com wrote:
Hello JC, 

Thanks for all your help - I was trying a micro Wifi Dongle -  based on RTL8188CU chipset. I tried to compile the drivers from Realtek site, and actually succeeded with a module ( 8192CU ). But Kernel doesnot seem to be built with CONFIG_WLAN or CONFIG_WIRELESS or CONFIG_WIRELESS_EXT. Particuarly the first one needs to be built in the kernel, I suppose? 

Yes, no wifi, no sound, nor anything else that the box doesn't has.
KISS, Keep It Simple and Small, is my lemma :-)
 
Does the kernel supports WLAN? If not any pointers on how do i compile my own kernel and implement it? Please , any help would be highly appreciated. 

[root@GNAS ~ linux-2.6.35.14 ] # cat linux-2.6.35.14-km.config | grep WIRELESS
# CONFIG_WIRELESS is not set
CONFIG_USB_SERIAL_SIERRAWIRELESS
=m


[root@GNAS ~ linux-2.6.35.14 ] # cat linux-2.6.35.14-km.config | grep WLAN
# CONFIG_WLAN is not set

Also - I have your Alt-F buildroot package compiled and set. 

OK, so it's easy.

So you have read the HowToBuild wiki. Some difficulty? less clear instructions? How can it be improved? Anything worth reporting?
Now you should also read the HowToCreatePackages wiki.

There are two configurations files available, the default one, '.config' which is identical to '.config-base', and '.config-pkgs'.
The first one build the base system for flashing, with a small set of packages, the ones I think are most useful to everybody (and that fits the scarce flash memory space). The second builds all Alt-F available packages, and I use it to generate the Alt-F packages.

To create the kernel modules, adding more modules to the kernel, I have to use the '.config-pkgs' configuration, so I do

cp .config-pkgs .config # use the package configuration file
export BLDDIR=... # where will the build binaries be
make O=$BLDDIR menuconfig # update to the new config, but don't change anything
make O=$BLDDIR # build
make O=$BLDDIR # again, I'm paranoic
./mkpkgs.sh -rm kernel-modules # remove the current kernel modules files from the build tree
./mkpkgs.sh -set # record the current build tree files
make O=$BLDDIR linux26-menuconfig # configure linux, adding the new needed modules
make O=$BLDDIR # make again, with the new modules
make O=$BLDDIR # paranoic?
./mkpkgs.sh -diff > foo # what files are new? Remember, I have removed all kernel modules files before the build.
diff ipkgfiles/kernel-moules.lst foo # what new modules have I built? Everything OK?
cp foo ipkgfiles/kernel-modules.lst # make the new list the default 
./mkpkgs.sh kernel-modules # build the kernel modules package with the new files
./mkpkgs.sh -index pkgs # generate an index of the pkgs directory, ready to be a package feed

And that's it, in the 'pkgs' directory the new kernel-module is available
As I have a link from 'pkgs' to '~jcard/public_html/pkgs' and setup 'myhost://~jcard/pkgs' as the Alt-F package feeder, I can install it right from the Alt-F Package Manager.

But the above will download and compile all 174 Alt-F packages, and some issues might arise, see issue Issue 87

So, what are your options? Build only the base package, using the default .config (or .config-base) first, then make O=... linux26-menuconfig and specify the new kernel modules, then do a new plain make O=...

BTW, I use the following:
export ROOTFS=$BLDDIR/project_build_arm/dns323/root/
export STAGING=$BLDDIR//build_arm/staging_dir/
export BINARIES=$BLDDIR/binaries/dns323;

But at the build end you will not find the new modules in the rootfs ($ROOTFS)! Why not?

Because the 'configfs' script runs as part of the build, and all modules not specified in the KMOD variable are removed.
Why is this? In order to load some modules, the kernel must support them. See the following comment in 'configfs':

# if BRIDGE is not set as a kernel module in the base firmware kernel, it will not load
# the bridge module from kernel-modules.
# So, build the kernel with BRIDGE module enabled, then remove the aditional modules.
# to diferentiate between the base kernel and the pkg kernel, use BR2_PACKAGE_KERNEL_MODULES
# The same as above applies to IPV6 and other modules

So, in order to have wifi or sound, even they are compiled as modules, the kernel must support them, having some code compiled not as a module, and a similar mechanism must be used as it is now used for the BRIDGE or IPv6.

If you find that the new modules that you build does not works or loads correctly with the default kernel, you should experiment them using your own built kernel, look at $BINARIES, and please see this topic regarding  how to do it (the TryIt, reboot/kexec stuff)

Anyone who does this kind of experience should also do a ./mkinitramfs.sh <arg>, followed by a ./mkfw.sh <arg>, in order to see if the kernel size is small enough to fit the available flash memory capacity. If yes, then please send me the kernel configuration, so I will include them in the kernel-modules package.

Joao

Norbert Horváth

unread,
Jul 29, 2016, 3:55:49 PM7/29/16
to al...@googlegroups.com
I wanted to experiment with kernel compilation, but I kind of failed my mission, maybe somebody can help. My goal would be to compile a kernel and modules with wifi support. I have many years of Linux experience, but only ordinary harddisk-based Debian...

Here is what I did:

- I downloaded the source code onto an i386 Debian Linux (root user) with the command "svn checkout svn://svn.code.sf.net/p/alt-f/code/trunk alt-f-code"
- . exports dns325 (for DNS-320-A1)
- make
(here came very much waiting and some errors that were corrected by me by hacking into Makefiles, .la files or commenting out unnecessary packages that are not going to compile anyway - some files were generated with wrong paths)

In the end I got a zImage, bin+sha pairs and rootfs* files. I tried to kexec my new kernel on my NAS, but when it boots, the system does not give any lifesign, except that it can be pinged. No telnet, no ssh, no any other network services, but responds to ping. I'm not sure which files should be placed and where (/boot or /root?) and what should I do afterwards (reboot or rcE directly?). I haven't changed anything in the kernel config at first, so I don't know why it does not boot (kexec).
The TryIT button is grey in RC5, so could not use it with the newly generated bin+shas.

EDIT: I read somewhere that kexec (and so TryIt) does not work for the 320/325, so if I'm right I can try my own kernel by flashing it as a new firmware and pray, or uploading it with a serial cable at boot time. Either way, I should be going soldering.

João Cardoso

unread,
Sep 22, 2016, 1:42:19 PM9/22/16
to Alt-F


On Friday, 29 July 2016 20:55:49 UTC+1, Norbert Horváth wrote:
I wanted to experiment with kernel compilation, but I kind of failed my mission, maybe somebody can help. My goal would be to compile a kernel and modules with wifi support. I have many years of Linux experience, but only ordinary harddisk-based Debian...

Here is what I did:

- I downloaded the source code onto an i386 Debian Linux (root user) with the command "svn checkout svn://svn.code.sf.net/p/alt-f/code/trunk alt-f-code"
- . exports dns325 (for DNS-320-A1)
- make
(here came very much waiting and some errors that were corrected by me by hacking into Makefiles, .la files or commenting out unnecessary packages that are not going to compile anyway - some files were generated with wrong paths)

Reporting the errors and fixes could be helpful. I build Alt-F on openSuse, and a few releases ago compiled it also on debian and ... can't remember...
 

In the end I got a zImage, bin+sha pairs and rootfs* files. I tried to kexec my new kernel on my NAS, but when it boots, the system does not give any lifesign, except that it can be pinged. No telnet, no ssh, no any other network services, but responds to ping. I'm not sure which files should be placed and where (/boot or /root?) and what should I do afterwards (reboot or rcE directly?). I haven't changed anything in the kernel config at first, so I don't know why it does not boot (kexec).
The TryIT button is grey in RC5, so could not use it with the newly generated bin+shas.

EDIT: I read somewhere that kexec (and so TryIt) does not work for the 320/325,

Right. And it doesn't' works on the 320L also. Don't know why, and I've spent a lot of time researching that.
It's peculiar to the kirkwood SoC, and it is related with the L2 processor cache. If I build a kernel with L2 support disabled then I can use it to kexec. But disabling L2 cache has negative performance effects, so I opted to keep it on and live without kexec.
 
so if I'm right I can try my own kernel by flashing it as a new firmware and pray, or uploading it with a serial cable at boot time. Either way, I should be going soldering.

Made any progress meanwhile? You might want to execute 'mkfw.sh' first, it will made some checks on the kernel/rootfs size -- the boot loader has issues with larger files, even if they fit into the flash.

Norbert Horváth

unread,
Sep 29, 2016, 12:33:46 AM9/29/16
to Alt-F

- I downloaded the source code onto an i386 Debian Linux (root user) with the command "svn checkout svn://svn.code.sf.net/p/alt-f/code/trunk alt-f-code"
- . exports dns325 (for DNS-320-A1)
- make
(here came very much waiting and some errors that were corrected by me by hacking into Makefiles, .la files or commenting out unnecessary packages that are not going to compile anyway - some files were generated with wrong paths)

Reporting the errors and fixes could be helpful. I build Alt-F on openSuse, and a few releases ago compiled it also on debian and ... can't remember...

I will try it again and report the errors. My fixes were not elegant: manually fixing the generated files and commenting out unneeded packages.

 
so if I'm right I can try my own kernel by flashing it as a new firmware and pray, or uploading it with a serial cable at boot time. Either way, I should be going soldering.

Made any progress meanwhile? You might want to execute 'mkfw.sh' first, it will made some checks on the kernel/rootfs size -- the boot loader has issues with larger files, even if they fit into the flash.


I managed to boot my own kernel from tftp with rootfs on usb drive, plugged in the usb wifi dongle (using usb hub), dongle detected, firmware loaded, and then it froze, had to pull the plug to reboot :) The project is on hold for a few weeks, summer ended (I am a teacher).
Reply all
Reply to author
Forward
0 new messages