OpenWrt Forum Archive

Topic: HOWTO wanted: porting openwrt to new hardware

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

hi

little intro: in the last time i had two devices in my hands which clearly run linux and which possibly could run openwrt too. the first one was a siemens se505 with a new bardware revision (see http://forum.openwrt.org/viewtopic.php?id=6678) and now i have an asus wl550ge (which was improperly listed as a wl500g in a webshop).

so, my question is now: is there somewhere a guide on how to "port" openwrt to new devices. as i understand it, the main problem is to find the right kernel, bootloader and mtd settings. i can think of different approaches to optain them from vendor distributed firmware but i have no clue which is feasable.

1. grab the sourcecode-tree and try to figure out where the different parts for the puzzle are hidden. there my problem alredy begins: i can easily grep thru the linux/.config for e.g. MTD but i just don't know which settings are relevant. second problem is the bootloader. i don't have any clue on how this thing is named, how it works, if there are several different methodes to get the kernel up and running, if openwrt uses it's own, if original firmware has it's own (perhaps proprietary).

2. grab an original-firmware image and take it appart: look at the trx header and just cut out kernel and filesystems. then just build an openwrt image with the original kernel and put it onto the device. look at dmesg, /proc, lspci, etc. and try to enable the right settings in openwrt buildroot.

i'm new to linux on embedded devices and i'm sorry if my questions/proposals are stupid. perhaps i just need some general knowledge on how booting works on this little boxes.

so. is there documentation somwhere, which is suitable for a newbie openwrt-dev to get startet with porting to new hardware? if there is nothing let's collect some strategies for firmware porting in this thread. it would be great to have some sort of checklist for important kernel-settings, tools, parameters, ...

thanks! nice presentation. if i understand right the bootloader itself does not live in the firmware image (sorry, i really have no clue)? in this case i have to figure out on how the bootloader of the device interprets the image and loads the kernel.

let's reverse this concept: if i am able to "cut" the kernel from the original firmware and "paste" it into an openwrt image, which corresponds to the format the bootloader expects (header, crc, padding, ...), is it likely that the device will boot and i can examine the system?

That's right, the bootloader is usually not in the binary image you can download but resides on a special partition in the flash. That is why you have to examine how the image is produced : crc, padding ... in order to understand how the bootloader accepts and loads it.

I recommend you first try to get a serial console on the device before flashing it smile

boot_wait was on and i flashed the router alredy to openwrt and back to original firmware. i'll try to make a cross-over-version of openwrt this weekend and see if i can get telnet working.

there is a script in the freifunk firmware buildroot which is supposed to extract the offsets. http://ff-firmware.cvs.sourceforge.net/ … hecktrx.pl

The discussion might have continued from here.