PDA

View Full Version : Development Asking Questions


ogry
02-13-2009, 02:20 AM
Hello,

This week I learned a bit more about OpenWRT and RS, but a lot remain to be discovered. As result, a lot of questions arises. I promises a nice FAQ with the answers ;-)

I set-up a development environment as explained here (http://forum.openwrt.org/viewtopic.php?id=8410).

I download the tar file (http://www.ubnt.com/downloads/RS/openwrt-routerstation.tgz) from the post (http://forum.ubnt.com/forum/viewtopic.php?t=8014), unpacked it and run make.
Wait more than 6 hours, and I get some files in the openwrt-trunk/bin directory that this script make.


-rw-r--r-- 1 ogry ogry 793 2009-02-12 21:00 md5sums
-rw-r--r-- 1 ogry ogry 4660017 2009-02-12 21:00 openwrt-ar71xx-rootfs.tgz
-rw-r--r-- 1 ogry ogry 3801088 2009-02-12 21:00 openwrt-ar71xx-root.squashfs
-rw-r--r-- 1 ogry ogry 6946816 2009-02-12 21:00 openwrt-ar71xx-tew-632brp-squashfs.bin
-rw-r--r-- 1 ogry ogry 6946840 2009-02-12 21:00 openwrt-ar71xx-tew-632brp-squashfs.webui
-rw-r--r-- 1 ogry ogry 6946816 2009-02-12 21:00 openwrt-ar71xx-tew-652brp-squashfs.bin
-rw-r--r-- 1 ogry ogry 6946840 2009-02-12 21:00 openwrt-ar71xx-tew-652brp-squashfs.webui
-rw-r--r-- 1 ogry ogry 1053780 2009-02-12 21:00 openwrt-ar71xx-uImage-gzip.bin
-rw-r--r-- 1 ogry ogry 764243 2009-02-12 21:00 openwrt-ar71xx-uImage-lzma.bin
-rwxr-xr-x 1 ogry ogry 2322566 2009-02-12 21:00 openwrt-ar71xx-vmlinux.bin
-rwxr-xr-x 1 ogry ogry 2331824 2009-02-12 21:00 openwrt-ar71xx-vmlinux.elf
-rw-r--r-- 1 ogry ogry 1114112 2009-02-12 21:00 openwrt-ar71xx-vmlinux.gz
-rw-r--r-- 1 ogry ogry 786432 2009-02-12 21:00 openwrt-ar71xx-vmlinux.lzma
drwxr-xr-x 3 ogry ogry 4096 2009-02-12 19:59 packages




What of this bunch is supposed to be the flushed in the RS?
It's safe to flush any? (I'm afraid to broke somehow the RedBoot loader!)
Is there a simply safe way, like a command line that update kernel and rootfs partitions?
I want to use an ACX111 miniPCI wifi card on th RS. Is there any way to compile the .ko file needed to use the 'insmod' command?
Can I use 'make menuconfig' from the openwrt-trunk directory to 'personalize' my distro, adding LUA and some other widgets, like print servers, wx200d, USB webcams, GPIO management...?
If yes, can I use any option or there are unsafe options? (I show that some don't works, like theses latest USB's radios, from my firsts trials to build all)
Where on the RS file system must I put theses 'packages'?
I must 'tftpd' the packages files to the RS on the bootloader or I can 'scp' them anytime?

I think that it could be nice to have a VMware appliance were to test safely theses things...


Saludos, OSCAR.

UBNT-Mike.Taylor
02-13-2009, 10:02 AM
Ogry,

Read the Wiki page we put together and let me know what is missing. RS is supported in Kamikaze (WhiteRussian is unknown). Most people here are developing with Kamikaze RC2. I think you will have much better luck with that version.

1) Use serial port to change boot script so that the board ID expected by RC2 is passed (not our default which predates their change)

2) Build with a variant of the config file we posted in the .tgz file (to get AR71xx build).

3) Use serial port and bootloader with TFTP to upload the image for ubnt. Your build does not have the right file for uploading to RS.

The file you need is "openwrt-ar71xx-ubnt-squashfs.bin"

Cheers,

Mike

ogry
02-13-2009, 11:44 AM
ooops

ogry
02-13-2009, 11:57 AM
Mike,

Please excuse me, may be I'm too newby to pose the right quetions, or may be I don't explain myself. I have a running board, with webif and all needed to make it minimally work (at least as webserver ;))

Using username "root".


BusyBox v1.11.3 (2008-12-17 13:03:27 EET) built-in shell (ash)
Enter 'help' for a list of built-in commands.

_______ ________ __
| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -__| || | | || _|| _|
|_______|| __|_____|__|__||________||__| |____|
|__| W I R E L E S S F R E E D O M
KAMIKAZE (bleeding edge, r14397) -------------------
* 10 oz Vodka Shake well with ice and strain
* 10 oz Triple sec mixture into 10 shot glasses.
* 10 oz lime juice Salute!
---------------------------------------------------
root@LaHitaMC:~#


As you can see this splash is a bit diverse from the showed in the wiki, there is r13677.

But I need some things (packages, mainly, but also some others apps), that I realized that aren't in the flashed file, so I'm looking for a way to 'extend' the original distro with more applications, also with my owns humble addings. I found this http://wiki.openwrt.org/OpenWrtDocs/Packages and http://wiki.openwrt.org/BuildingPackagesHowTo that explain the basic procedure, but is unclear how to merge them in a buiding firmware.

I think that might be interesting (also for other) to know:

- How to build a flashable firmware from the most actual OpenWRT trunk. IMSU, this might be done with the makefile in the tar file, but I might be wrong.
- How to flash it safely on the RS, better from command line. This is not explained in the wiki, and I think that is a basic procedure.
- How to configure and install kernel-linked drivers, for wifi cards diverses of thoses from Ubuquiti or for other drivers (I think now about SD over GPIO), while building the firm.
- How to add other widgets, mainly daemon like applications, as print servers, USB webcams managers, and so, ever while building the firm with menuconfig.

It's a way to get a flashable .bin file from a updated/upgraded filesystem? I mean somehow like a backup from a running RS board.



Saludos, OSCAR.

UBNT-Mike.Taylor
02-19-2009, 10:59 AM
But I need some things (packages, mainly, but also some others apps), that I realized that aren't in the flashed file, so I'm looking for a way to 'extend' the original distro with more applications, also with my owns humble addings. I found this http://wiki.openwrt.org/OpenWrtDocs/Packages and http://wiki.openwrt.org/BuildingPackagesHowTo that explain the basic procedure, but is unclear how to merge them in a buiding firmware.


The OpenWRT wiki/docs explain these things very well.

I think that might be interesting (also for other) to know:

- How to build a flashable firmware from the most actual OpenWRT trunk. IMSU, this might be done with the makefile in the tar file, but I might be wrong.

You can build OpenWRT trunk without any patches and it will run on RouterStation. GUI based package selection when building OpenWRT is provided with "make menuconfig". Start with our configuration file conf/rs in the tarball we posted. Copy this to openwrt directory as .config and then start customizing with "make menuconfig".

- How to flash it safely on the RS, better from command line. This is not explained in the wiki, and I think that is a basic procedure.


Well, we do cover flashing via the TFTP recovery mechanism and that is what OpenWRT will spit out for you. Look in the bin/ directory for the file with ubnt in the name, and send that to the unit while in recovery mode.

If you want to do an upgrade from Linux command line, the mtdblock devices are all there and writes to them will be stored in flash. Look at documentation for Linux memory technology devices (http://www.linux-mtd.infradead.org/) and maybe dd command http://www.manpagez.com/man/1/dd/

The flash works like any other filesystem/block driver so no special utilities are required. Here is an example you might use for a pretend 3-block partition. You would have to change the TFTP host IP, the filenames, length, and mtd block device name for what you are trying to flash.

cd /tmp && tftp -g -l xyz.bin -r xyz.bin 192.168.1.42
dd if=/dev/zero of=/dev/mtdblock10 count=3 bs=$((0x10000))
dd if=/tmp/xyz.bin of=/dev/mtdblock10 bs=$((0x10000)) count=3


- How to configure and install kernel-linked drivers, for wifi cards diverses of thoses from Ubuquiti or for other drivers (I think now about SD over GPIO), while building the firm.

There is nothing specific to UBNT hardware in those questions. These are general Linux driver development questions and there are a lot of good books on the subject.

Start here: http://lwn.net/Kernel/LDD3/

- How to add other widgets, mainly daemon like applications, as print servers, USB webcams managers, and so, ever while building the firm with menuconfig.

Not sure what you mean here... for existing packages you can either choose them from menuconfig or you can install them from the running system using opkg package manager and package feeds. I could not advise you on how to build your own software without some clue about what you want to do.

It's a way to get a flashable .bin file from a updated/upgraded filesystem? I mean somehow like a backup from a running RS board

Just like any other block device in Linux, you can duplicate your flash to the filesystem and then cart it off using whatever means you like. See dd reference above. You just use dd to copy the bytes from the mtdblock device to a file - possibly network filesystem or USB filesystem, whatever you want.

Here's a nasty one-liner that will dump all partitions to /tmp in RAM as mtdblockX-partname:

for partition in /dev/mtdblock*; do if grep -q "$(echo "mtd${partition#/dev/mtdblock}:")" /proc/mtd; then name="$(cat /proc/mtd | sed -n -r -e "/$(echo "mtd${partition#/dev/mtdblock}:")/ { s/.*[:] [0-9a-fA-F]{8} [0-9a-fA-F]{8} //;s/\"//g; p }")"; echo "Dumping mtd partition ${name} [${partition}]..."; dd if=${partition} of="/tmp/$(echo ${partition#/dev/})-${name}" bs=$((0x10000)); fi; done;



Cheers,

Mike

slthomason
06-25-2009, 01:59 PM
This may seem like a dumb question, but how would I take a dump like that and write it back to another board? I am looking at being able to configure a board, and then "image" it to other boards.

Thanks in advance!

Spencer

CzechEnglishFrenchGermanItalianPolishPortugueseRussianSpanish
Translated to other languages thanks to vB Enterprise Translator 3.5.4