OpenWrt Forum Archive

Topic: Porting OpenWRT to the Routerboard 100

The content of this topic has been archived between 31 Mar 2018 and 2 May 2018. Unfortunately there are posts – most likely complete pages – missing.

I mistakenly posted this to the White Russian forum, so I'm posting it again here.  I am working on porting Kamikaze to the Routerboard 100 series of boards by Microtik.  Using a patch from Microtik for the 2.4.31 kernel, I can get the system up and booting.  However there are still several issues I need to resolve:

1) Some of my packages are not getting adding to my filesystem tarball. Specifically ebtables is getting built and generating an ipkg, but the modules don't show in my build_mipsel/root directory.

2) I don't have any device nodes in /dev  I have created those by hand in order to get the system to boot.  Am I supposed to be using devfs to create them or is there a script that does it or do I need to write my own script?  I don't see anything in the startup scripts that would startup devfsd.

3) I don't get a serial console.  rcS seems to hang after all the startup scripts finish and the output gets passed to logger.  If I comment out the logger and start /bin/ash from rcS, I get a console.  If I don't run ash from rcS, it just hangs and never returns to inittab.

Have you tried looking into the rb532 port?  I believe that the rb1xx and rb5xx aren't too different...

At this point, I've resolved most of the issues that I mentioned above.  The RB532 port is a good suggestion, however I have to run in 2.4 to support a proprietary driver that I need.  Plus I have most of the RB1xx hardware working.

The ebtables problem was due to me selecting kmod-ebtables with 'M' instead of 'Y' so it built the package but didn't install it.  A littlle confusing, I figured that building kmod-ebtables with M meant I wanted to compile ebtables as a module vs. compiling it into the kernel.

I also fixed the dev node issues.  Turns out Microtik doesn't use devfs for RouterOS so it was turned off by default.  In addition they backported the 2.6 MTD code which uses the 2.6 API.  I hacked that out of the patch, changed my config, and devfs works.

Still having problems with the serial console, however it's not a big deal as I can just modify the startup scripts to workaround the issue.

The one thing I am noticing is that I get a lot of zombie processes.  If I start cron and then shut it down, I get a cron zombie process.  Doing this over and over again produces more zombie processes.  Has anyone seen this issue before?  I'm not sure if it's related to init not completely finishing or something else.

I am also having a problem getting lighttpd talking to php5.  When it starts up, it dies with the error:
2000-01-01 01:13:25: (mod_fastcgi.c.890) failed: Address family not supported by protocol
I'm not sure if this is because I somehow disabled support for unix sockets or broken patchiness behavior.

There is a very cheap and interesting product, RB133 @ 70 Euro that offers PoE & three (3) miniPCI slots.  I've seen a working openwrt port at some place, anyone knows if current kamikaze suport this hardware? how about performance with three (3) 802.11a cards?  can this unit push total of 50+Mbit with openwrt/madwifi-ng combo ??

(Last edited by acoul on 18 Apr 2007, 09:18)

I have working support for the 100 series now, including the NAND flash.  I am working on an install script which will download the disk image and copy it to flash after a netboot.  The code can be found in the adm5120-2.6 target.  I will also put up a wiki page for the installation.

lovely news !!

Can't wait to see this as well!  Just getting started with OpenWRT and a RouterBoard 133c, so anything that makes it easier will be hugely helpful!

Thanks!

Quoting BrainSlayer, the author of DD-wrt about the RB1xx boards:

this board is too slow, has a faked CE/ROHS compliance, doesnt support high power cards. enough reasons to "not" invest any time in it. its just wasted

still it would be interesting to see the performance of this board under the OpenWRT OS !!

acoul wrote:

Quoting BrainSlayer, the author of DD-wrt about the RB1xx boards:

this board is too slow, has a faked CE/ROHS compliance, doesnt support high power cards. enough reasons to "not" invest any time in it. its just wasted

still it would be interesting to see the performance of this board under the OpenWRT OS !!

For what I'm doing it's plenty fast, and doesn't need to support high power cards.  Not everyone is using these things for the same purposes!  Which isn't to say I'm not more than willing to try other cheap alternatives that support at least 1 mini-pci slot, ethernet, and serial.  So far as I've been able to find, this is easily the cheapest board that supports all 3.

What exactly is a "faked CE/ROHS compliance"?

(Last edited by papajin on 26 Apr 2007, 17:27)

I guess he means that the CE & RoHS certifications of the board are fake.  The RB133 does indeed have a CE stamp on it.  I still think for the price you get a lot, such as PoE, 3 miniPCI slots and 3 100MBit LAN ports along with a serial port.  The size also is very small and the quality of the board looks quite good ...  now I just need to get OpenWRT on this cute board and see what it can push through those 3 miniPCI and 3 LAN ports ... :-)

(Last edited by acoul on 26 Apr 2007, 18:16)

acoul wrote:

I guess he means that the CE & RoHS certifications of the board are fake.

Heh I know he means that they've been somehow faked, just curious what specifically BrainSlayer thinks is faked about them.  I would think that putting bogus certifications on devices would be a bad idea (i.e. illegal) if you intend to sell in markets where these certifications are mandatory.  Still companies have done dumber things, so anything is possible.

As an example, I thought RoHS specifically dealt with the restriction of certain hazardous substances often used in various electronics?  How was BrainSlayer able to determine that this had been faked?  CE compliance seems a lot more complicated, so who knows on that one.  I'm not particularly worried about it, was just curious how he came to that conclusion.

here is a picture of this little baby, there is one more miniPCI on the back.

http://gallery.ozo.com/data/scaled/AWMN/Projects/Embedded_Cooking/rb133.jpg  <-- Click to enlarge

Hello,

I am currently playing with kamikaze (from svn) on a RB112 with the latest (2.7) firmware.

Thanks to your work I was able to compile a working kernel for this board with almost no effort; if I build openwrt with the root filesystem on initramfs I can netboot from the image and all is well (apart from having almost no free ram, but that's hardly a surprise).

Now I'd like to try booting from the onboard flash, so I skimmed through the Mikrotik docs and took a look at the cf2nand script in the rb532 target: it looks like all I need to do is to mount the first NAND partition (/dev/mtdblock0) as a yaffs filesystem and copy the kernel (that is, the 'vmlinux.elf' loader+image combo) to it as a file named 'kernel'.

Evidently I missed something, because the bootloader keeps saying "kernel not found"...

I can netboot the board again, mount the same partition and verify that the file is there with the proper contents.

What am I doing wrong?

thanks,
Andrea

I am the one who has been doing most of the work on the NAND driver, and I am having exactly the same problem.  I had tried to upgrade the firmware on mine to see if it was a firmware problem (it is 1.9 at the moment) but it refuses to upgrade to 2.7.  So it is good to know that it is not a BIOS problem and that I can stop following that line.

My next target is the designation on the rb100.html page that only the 153 supports Linux as well as RouterOS.  It is I suppose possible that they have put something in there that notices that this is not a RouterOS kernel.  But I do not have a 153 to work with.  If anyone does have one and could do what is described above and see if you get the same result that would be great.  Alternatively if anyone has a 153 they could lend me I can do the experiment.

It is a great shame that Microtik take such a head in the sand position with regard to getting Linux to work on their boards.  If only there were some way to persuade them that if they help (just a bit) they would increase their sales I am sure that life would be easier on all of us.

David

Another useful experiment (which I can not do here as I have already overwritten the NAND on my 112) is to copy the RouterOS kernel off the board onto a PC, erase the first partition, and copy it back again.  All of this needs to be done using the netbooted kernel and the NAND and Yaffs support that that has so that we can verify that they are both working properly.  If it works then either the kernel has something in it that the loader does not like, or there something about the RouterOS kernel that the BIOS is looking for.

David

David Goodenough wrote:

copy the RouterOS kernel off the board onto a PC, erase the first partition, and copy it back again.  All of this needs to be done using the netbooted kernel and the NAND and Yaffs support

Been there, tried that. The openwrt kernel starts to puke as soon as you do the mount (I get a long list of yaffs errors, after which the whole boot partition is marked bad).

My guess is that the yaffs support in the mikrotik kernel (and/or bootloader) was compiled with different options from those we're using in openwrt (there is a mention about using the same options in the 530 linux installation docs), so the bootloader cannot mount the filesystem.
I took a look at the 2.4.30 Mikrotik patch and their yaffs stuff looks slightly different (I don't know if it's an older version or if it's because they ported it to 2.4); there are less options in the kernel config but as far as I can tell by browsing through the code the defaults in adm5120-2.6 should yield the same results.

Or maybe Mikrotik did something dirty on purpose (like routerOS not using yaffs for the boot partition), but I doubt it...

Andrea

I am not the person who commits to the svn server, so my builds are not quite the same as yours.  In your
target/linux/adm5120-2.6/config/default do you have CONFIG_YAFFS_DOES_ECC turned on, if so turn it off as the mtd layer does the ECC and you will get errors for each page.

Someone sent me a hexdump of the begining of the /dev/mtd0 page in its shipped form (i.e. with the routeros stuff on it) and it is definitely yaffs.

David

root@(none):/# zcat /proc/config.gz
[...]
CONFIG_YAFFS_FS=y
CONFIG_YAFFS_YAFFS1=y
# CONFIG_YAFFS_DOES_ECC is not set
CONFIG_YAFFS_YAFFS2=y
CONFIG_YAFFS_AUTO_YAFFS2=y
# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set
# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
[...]

And yet:

root@(none):/# mount -t yaffs -o ro /dev/mtdblock0 /mnt
yaffs: dev is 32505856 name is "mtdblock0"
yaffs: Attempting MTD mount on 31.0, "mtdblock0"
block 3 is bad
block 4 is bad
block 5 is bad
[...]
block 127 is bad
block 128 is bad
root@(none):/# df
Filesystem           1k-blocks      Used Available Use% Mounted on
tmpfs                      512         0       512   0% /dev
/dev/mtdblock0            4096      1876      2220  46% /mnt
root@(none):/# ls -al /mnt
drw-rw-rw-    1 root     root          512 Jan  1 00:05 .
drwxr-xr-x   15 root     root            0 Jan  1 00:00 ..
drw-rw-rw-    1 root     root          512 Jan  1 00:05 lost+found

I am mounting the partition readonly to avoid destroying its contents, but mounting rw has the same effect.

Ideas? Thoughts?

Edit: I forgot to mention that I'm doing this on a board that has had its flash erased; I then reinstalled routerOS with mikrotik's netinstall utility. It shouldn't make a difference, however, since the firmware is now happily booting rOS from the NAND...

Andrea

(Last edited by alyf on 30 Apr 2007, 21:54)

Great feedback !!  I have a RB133 and I am ready to join your efforts on getting openwrt on this nice board.  I 've put up a wiki site for this.  Feel free to pass any information that can help on this task.

(Last edited by acoul on 1 May 2007, 09:48)

I suspect that the problem is in the combination of options for the MTD-NAND layer and YAFFS.  Part of the problem is that Microtik only produce patches for 2.4, and the options for MTD have changed since then, and a newer version of Yaffs is also available ( and necessary for the larger NAND chips but as far as I know not reflected in any Microtik patches. 

The patches are derived from the 2.4 patch for the RB532, which contains references to the 100 (and 400 - whatever that might be) series.  I have looked at them but can not see the problem (maybe I am too close to the problem).  If anyone wants to have a look and can spot anything that would be very useful.  The acid test is whether it boots, but a simpler test may be to make sure it mounts cleanly.  Note that when you do the mount although it things of the blocks as bad it does not appear to write this to disk as you get exactly the same if you reboot and remount.

David

Did anyone try mounting the rOS boot partition from a 2.4 kernel with the mikrotik patch? If that worked, we'd narrow the problem down quite a bit.

By the way, does this work on the rb532? Since they use the same bootloader I think they should have the same boot partition layout...

Note that when you do the mount although it things of the blocks as bad it does not appear to write this to disk as you get exactly the same if you reboot and remount.

It does write something, since at the following boot from flash the thing croaks with a "corrupted data" error while loading the kernel. That's why I was mounting read-only... saves me from having to reinstall routerOS every time.

Andrea

Well yes it does, but there are several versions of the 532 and depending on the version (I think the difference is the type of NAND chip) we had to go to a later version of the yaffs code than microtik suggest (as I mentioned they have not updated the 532 patch).

David

acoul wrote:

...  now I just need to get OpenWRT on this cute board and see what it can push through those 3 miniPCI and 3 LAN ports ... :-)

There is a nice howto that juhosg was kind enough to post on the openwrt wiki. I have also updated the rb1xx wiki with some links to relative reading.

(Last edited by acoul on 2 May 2007, 09:02)

Sorry, David is who posted the howto.

Gabor

Sorry, posts 26 to 25 are missing from our archive.