Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to choose target and other features in OpenWRT buildroot?

Tags:

openwrt

I have successfully cloned the OpenWRT buildroot from the subversion repository and I've been using it to build images that I run on Qemu. I can run the images in Qemu just fine.

Now I have tried to build an image for a router -- a Linksys WRT54GL -- but I couldn't find in the documentation how I should choose the target.

I guess that these are the correct options:

  • I have chosen Broadcom BCM947xx/953xx

  • In "Target images", I have chosen jffs2 and squashfs

Then, after compiling, I went to the directory bin/brcm47xx, and found a large number of images:

openwrt-brcm47xx-jffs2-128k.trx
openwrt-brcm47xx-jffs2-64k.trx
openwrt-brcm47xx-squashfs.trx
.
.
.
openwrt-wrt54g3g-em-jffs2.bin
openwrt-wrt54g3g-em-squashfs.bin
openwrt-wrt54g3g-jffs2.bin
openwrt-wrt54g3g-squashfs.bin
openwrt-wrt54g3gv2-vf-jffs2.bin
openwrt-wrt54g3gv2-vf-jffs2.noheader.bin
openwrt-wrt54g3gv2-vf-squashfs.bin
openwrt-wrt54g3gv2-vf-squashfs.noheader.bin
openwrt-wrt54g-jffs2.bin
openwrt-wrt54gs-jffs2.bin
openwrt-wrt54g-squashfs.bin
openwrt-wrt54gs-squashfs.bin
openwrt-wrt54gs_v4-jffs2.bin
openwrt-wrt54gs_v4-squashfs.bin
openwrt-wrt610n_v1-jffs2.bin
openwrt-wrt610n_v1-squashfs.bin
openwrt-wrtsl54gs-jffs2.bin
openwrt-wrtsl54gs-squashfs.bin

So my question is:

  • How do I tell what to choose in target system and target images?

  • From all the images generated, how do I know which one I should use (for example, the WRT54GL is not in the list above; how to tell if it's OK to use "openwrt-wrt54g-jffs2.bin"?

  • What criteria can I use to decide if I'll use a jffs or a squashfs image?

Thank you!

like image 479
Jay Avatar asked May 30 '12 10:05

Jay


1 Answers

How do I tell what to choose in target system and target images?

Target system you can infer from the Target/Platform columns in the Table of Hardware:

http://wiki.openwrt.org/toh/start

Target images depend on the intended use of the build but in most common cases (ie. image to put on a router) you want either squashfs or jffs2. See the filesystems link below.


From all the images generated, how do I know which one I should use (for example, the WRT54GL is not in the list above; how to tell if it's OK to use "openwrt-wrt54g-jffs2.bin"?

If your router is not listed amongst the custom images you should probably use the generic image, eg: openwrt-brcm47xx-squashfs.trx


What criteria can I use to decide if I'll use a jffs or a squashfs image?

From http://wiki.openwrt.org/doc/techref/filesystems:

SquashFS

+ taking up as little space as possible

+ allowing the implementation of an idiot proof FailSafe for recovery, since it is not possible to write to it

- read only

- waste space, since each time a file contained on it is modified, actually a copy of it is being copied to the second (JFFS2) partition

JFFS

+ is writable, has journaling and wear leveling

+ is cool

- is compressed, so a program (opkg in particularly) cannot know in advance how much space a package will occupy

Don't be mislead about the read-only part tho

All of the OpenWrt firmwares include a fully writable root filesystem that will remain intact across a power outage. The confusion is due to the fact that squashfs is a readonly filesystem; all OpenWrt firmwares also include a jffs2 partition -- the squashfs part of the filename refers only to the filesystem included in the firmware image; additional files or changes are stored on jffs2.

  • The squashfs partition will always contain all of the files exactly as they came with the firmware; you cannot change these without reflashing. (see #6)
  • The jffs2 partition contains only your changes to the filesystem; since squashfs still contains the original version, you can easily revert files back to their original state.

It is possible to remove the squashfs partition by installing the jffs2 version of the firmware, but this isn't recommended -- it uses more space and lacks the above failsafe features.

Source: https://forum.openwrt.org/viewtopic.php?pid=36636#p36636

If in doubt use squashfs as per http://wiki.openwrt.org/doc/howto/obtain.firmware.download#filesystem

like image 77
koniu Avatar answered Sep 17 '22 13:09

koniu