OpenWrt Forum Archive

Topic: kernel question wgt634u

The content of this topic has been archived on 23 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi guys/gals,

I have a hopefully, short question about kernels and kernel modules as it pertains to ipkg on openwrt.  I've been hacking away at my two WGT634Us for a few months now, about since Christmas actually.  I've enjoyed it a great deal and well, thanks. This project is a lot of fun for me, mostly because it challenges me so much.  Anyway, to the question...

I compiled the latest revision, or as of a few days ago.  I flashed one of my non-working WGTs and everything was working fine, until I started installing some ipkgs.  Every now and then, I get something like this:

cifs: version magic '2.6.19.2 mod_unload MIPS32_R1 32BIT ' should be '2.6.19.1 mod_unload MIPS32_R1 32BIT '

That only shows on the console connection, not my ssh window.  End result, the package in this case, kmod-fs-cifs didn't install b/c of some kernel mismatch.  Honestly, I don't know how this could have happened.  I nuked my build tree, actually did a "rm -rf trunk/" and "rm -rf packages/", which erases all of the openwrt svn data on my pc.  I did this b/c I wanted to be sure my svn pull was fresh. Overkill, I know.

So, i ran one build, building for atheros on the 2.6 kernel and half of my ipkgs it seems refer to 2.6.19.1 while the rest point to 2.6.19.2.  Frustrating to say the least. smile  ipkg creates two directories in the /lib/modules folder and well, you guessed it, the .2 modules won't load, so i'm definitely running on the .1 version. How I ended up with two versions from one make/build process, I don't know, especially considering my earlier steps.

The only thing I can think of is that I compiled wpa_supplicant on it's own several times trying to get the atheros driver to compile, which i finally did (and my router is in WPA using sta mode) smile    Anyway, I nuked my build tree again, tweaked my madwifi config.mipsel file again to get my atheros driver and i'm recompiling the whole stinking thing.  In about seven hours, i'll be able to give it another go, but in the meantime, i'm curious to see if anyone has any ideas about what I did.

Thanks in advance,

-j

You mentioned Atheros 2.6 a couple of times and I just wanted to make sure that your Target System is Broadcom BCM947xx/953xx [2.6] and Target Profile is Netgear WGT634U.

(Last edited by bradkarhu on 19 Mar 2007, 03:18)

yep, sorry.  The target is for a broadcom chipset, but the wireless card has a chip stamp of atheros ar5213a.  I guess that wasn't too clear on my part.

Ok, so i deleted my build tree and recompiled everything last night.  I'm still getting this error though, not sure why.  Can someone shed some light?  I don't know why the heck it's trying to upgrade the kernel.  I know this won't work b/c you can't upgrade the kernel through ipkg, yet it tries to.

root@OpenWrt:/# ipkg list_installed |grep -i cifs
root@OpenWrt:/# ipkg install kmod-fs-cifs
Installing kmod-fs-cifs (2.6.19.2-brcm47xx-1) to root...
Downloading http://192.168.0.103/apache2-default/op … mipsel.ipk
Upgrading kernel on root from 2.6.19.1-brcm-1 to 2.6.19.2-brcm47xx-1...
Downloading http://192.168.0.103/apache2-default/op … kernel_2.6.
19.2-brcm47xx-1_mipsel.ipk
Installing kmod-nls-base (2.6.19.2-brcm47xx-1) to root...
Downloading http://192.168.0.103/apache2-default/op … mipsel.ipk
Configuring kernel
Configuring kmod-fs-cifs
cifs: version magic '2.6.19.2 mod_unload MIPS32_R1 32BIT ' should be '2.6.19.1 mod_unload MIPS32_R1 32BIT '
Configuring kmod-nls-base
nls_base: version magic '2.6.19.2 mod_unload MIPS32_R1 32BIT ' should be '2.6.19.1 mod_unload MIPS32_R1 32BIT '
Done.

At this point, I don't know what's going on.  The linux source that is downloaded is 2.6.19.2 but some of the modules get built against 2.6.19.1.  At this point i'm reading whatever i can find and guessing on fixes, compiling while i read.  If anyone has any ideas, let me know.  I'm looking at the kmod-fs-cifs ipkg now to see if i can fix it so that it will use 2.6.19.2 instead of .1. :*(

-j

Are you completely reflashing the router with the new build too? If not I guess you can check to make sure your router is running the 2.6.19.2 kernel. Cat /proc/version.

And what other ipkgs produce this error other than cifs? If it's just cifs, I'll throw it on my wgt and see if I get the same error.

So far, the other ipkgs that I have had this problem with was the wpa-supplicant and wpa-cli, although i managed to fix those by compiling the packages individually.  For some reason, it worked after that.  (make package/wpa-supplicant-clean V=99 && make package/wpa-supplicant-compile V=99) etc.

I checked the linux version and the mystery continues.  My source bz2 file is 2.6.19.2.  Crazy.  The method i've been using to flash.... a serial cable, hyperterminal (grin), and ctrl-c to get into the cfe.  After that,

1) setup my ethernet interface
ifconfig eth0 -addr=192.168.0.101 -mask=255.255.255.0

2) go get my bin file
flash -noheader 192.168.0.103:openwrt-wgt634u-2.6-squashfs.bin flash0.os

I've been doing this for awhile, I assumed that (mistake?) that it erased the current flash doing it this way.  If not, that might explain things.  I did have an earlier build of openwrt on this router prior to this weirdness.  If it's as simple as issuing some erase command. ugh.

root@OpenWrt:/# cat /proc/version
Linux version 2.6.19.1 (root@linux) (gcc version 3.4.6 (OpenWrt-2.0)) #1 Fri Dec
22 12:36:03 CST 2006

(Last edited by sneakywombat on 19 Mar 2007, 21:18)

sneakywombat wrote:

Linux version 2.6.19.1 (root@linux) (gcc version 3.4.6 (OpenWrt-2.0)) #1 Fri Dec 22 12:36:03 CST 2006

Yep, I figured it was that. I suggest - if you don't have important stuff on your router - to just flash kamikaze fresh to the wgt (flash -noheader 192.168.0.103:openwrt-wgt634u-2.6-squashfs.bin flash0.os). Looks like the last time you did this was back on Dec 22nd, probably when kamikaze was using the 2.6.19.1 kernel. An mtd -r linux <image.trx> thing should work as well, but I'm not familiar with it yet.

i didn't even notice the date there.  Thanks for pointing that out.  Now I have something to work with.  The strange part is that i've used that flash command three times in the past three days (it takes me about 7 hours to compile openwrt from scratch, old p2, 233mhz, with mmx! haha, as if that helps.) 

I erased openwrt (mtd -r erase linux) so as soon as my kernel finishes compiling, i'll flash it again, which i think is clean now.  Why it isn't doing that all in one go, no idea.

Thanks,

-j

(Last edited by sneakywombat on 19 Mar 2007, 22:41)

Ok, so I think i'm stuck on this.  Any idea why:

flash -noheader 192.168.0.103:openwrt-wgt634u-2.6-squashfs.bin flash0.os

wouldn't erase the existing kernel and replace with a different one?  cat /proc/version still shows it was updated on Dec 22nd, even though I flashed it for the 4th time.  /lib/modules also shows 2.6.19.1.  I used mtd to erase the firmware before flashing this time but it's still stuck on the version i had on it on the 22nd of December.

One thing during the first bootup, I see a ton of these:

Physically mapped flash: block unlock error: (status timeout)

And by a ton, i mean, oh, it's prints, slowly, for a screen and a half.

(Last edited by sneakywombat on 20 Mar 2007, 04:53)

sneakywombat wrote:

Physically mapped flash: block unlock error: (status timeout)

This problem has been fixed recently, again proving that it's not actually reflashing. weird.

ahh, this is no good.  I agree that it's not flashing, even though it is destroying my filesystem, all my config files get erased, etc.  Here's what mtd says:

root@OpenWrt:/# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 000a0000 00020000 "cfe"
mtd1: 00740000 00020000 "linux"
mtd2: 0012c800 00020000 "rootfs"
mtd3: 00020000 00020000 "nvram"
mtd4: 00560000 00020000 "OpenWrt"

I'm thinking that maybe i might have to get nasty on this thing, but i'm not sure how.  I don't want to delete the CFE.  I"m thinking that last time i used mtd, it erased SOMETHING, because i couldn't boot it up anymore, it just went right to the CFE, no ctrl-c or anything.

So, if I did: mtd -r erase linux - that probably nuked mtd1: 00740000 00020000 "linux".  Is it safe to say that rootfs,nvram, and OpenWrt would have been left?  I don't want to erase the nvram.  I've already made the mistake of deleting some choice env vars in there and I don't want to fix those again, it wasn't fun.  I think mtd1, mtd2 and mdt4 need to be erased, but i'm unsure of the order, or if this is even the right thing to do.  Any ideas?

a wgt634u doesn't have nvram.

you probably want to "mtd -r write bl0b.trx linux" (hint: the -r is the reboot switch, it reboots once the flashing is done). If you just want to delete openwrt: "mtd -e linux"

Wow, i figured it out finally.  Turns out it was something very simple.  I still learned a lot along the way though.  Shesh.  For future reference, double check that your tftp server is hosting the right file. smile  Whoops.  Turns out, my tftp server wasn't pointed to the right directory.  I thought I had it pointing to my bin directory that has my images but it was pointing to a default directory that came when it was installed.  To make things worse, and give this problem a nice level of transparency, i had apparently copied in a bin file into this default tftp directory.  The name was the exact name I was using to flash the router with.  Long story short, I was pulling my file from directory A, but I needed to pull it from B.  Both A and B had the same file, one was just compiled on the 22nd of Dec, the other one, yesterday. smile

Thanks for all your help.  +5 moron points on the newbie board for me.

root@OpenWrt:/# cat /proc/version
Linux version 2.6.19.2 (root@linux) (gcc version 4.1.2) #1 Mon Mar 19 18:05:38 CDT 2007

-j

One way to prevent this from happening is to use a stage script. It will place a copy of the newly generated bin file with a date and time code.

Example of file:

wgt634u0319.20.bin

#!/bin/bash
cp ~/kamikazecurrent/trunk/bin/openwrt-wgt634u-2.6-squashfs.bin /var/lib/tftpboot/wgt634u/wgt634u`date +%m%d.%H`.bin
ls -la /var/lib/tftpboot/wgt634u
echo "Stage Directory is /var/lib/tftpboot/wgt634u"


Just and Idea.

Mmm, I like that idea better than what I did.  I changed the default path to point to my trunk/bin directory, but i like having the date in the filename.  Conceptually, I understand what a stage script is, but i'm not sure where to insert something like that into the openwrt scripts.  Where/how did you implement this?  Something like, put "x" in file "z", would be great. smile

The discussion might have continued from here.