Hi,

On Wed, Mar 07, 2012 at 03:50:32PM +0000, Christian Gagneraud wrote:
> I would like to know how people do to generate their kernel config
> file (which are usually very small).

Did you look at 'make kernel_menuconfig' ?

> Should I do a kernel_menuconfig manually and select the very minimum
> that allow to boot the board, or is there any "magic script" that
> could extract this file for me given a "generic" config?

I think that the goal is to keep config-default as small as possible...

> I would like to know as well, what is the strategy concerning the
> partitioning of the (NAND) flash. Should I try to get OpenWRT to
> reuse the existing partioning or is it common to redefine a new
> partioning that fits the OpenWRT requirements (especially concerning
> the squahfs over jffs2).
> 
> This is the out-of-factory layout of my NAND flash (32MB):
> mtd0: "at91bootstrap"
> mtd1: "uboot"
> mtd2: "env1"
> mtd3: "env2"
> mtd4: "Linux"
> mtd5: "rootfs" (JFFS2)
> 
> And I was thinking of going for something like this:
> mtd0: "at91bootstrap"

Ok.

> mtd1: "uboot"

Ok.

> mtd2: "env"

I would suggest uboot_env.

> mtd6: "firmware"

No need for this.

> mtd3:  +- "kernel"

Ok.

> mtd4   +- "rootfs"           mounted as /         type mini_fo

Ok.

>            +-                mounted as /rom      type squasfs
> mtd5:      +- "rootfs_data"  mounted as /overlay  type jffs2

No. Because that is created on the fly. Look at:

target/linux/generic/patches-3.2/400-rootfs_split.patchtarget/linux/generic/patches-3.2/400-rootfs_split.patch

You could also merge kernel and rootfs into linux (only lantiq target):

target/linux/lantiq/patches/201-owrt-mtd_uimage_split.patch
target/linux/lantiq/files-3.1/arch/mips/lantiq/xway/mach-gigasx76x.c

Example of booting lantiq board:

Creating 4 MTD partitions on "ltq_nor":
0x000000000000-0x000000010000 : "uboot"
0x000000010000-0x000000020000 : "uboot_env"
0x000000020000-0x0000007f0000 : "linux"
Creating 2 MTD partitions on "ltq_nor":
0x000000020000-0x0000001066af : "kernel"
mtd: partition "kernel" must either start or end on erase block boundary or be 
smaller than an erase block -- forcing read-only
0x0000001066af-0x0000007f0000 : "rootfs"
mtd: partition "rootfs" must either start or end on erase block boundary or be 
smaller than an erase block -- forcing read-only
mtd: partition "rootfs" set to be root filesystem
mtd: partition "rootfs_data" created automatically, ofs=440000, len=3B0000
0x000000440000-0x0000007f0000 : "rootfs_data"
0x0000007f0000-0x000000800000 : "board_config" 

> I like this idea of having a firmware.bin for kernel+rootfs on one
> hand and then having the /rom ro and /overlay rw. Thought I'm
> surprised that /etc/config doesn't have it's own partition

There is no need for that.

> Still concerning a bit the partitioning, I'm now moving to the image
> format of the final "firmware.bin". Especially concerning the
> splitting of rootfs into /rom and /overlay. For what I understood,
> there's a magic value "0xdeadc0de" that needs to be placed at "the
> right place". Is it something handled by OpenWRT or do I have to
> write the boiler plate myself in the target/at91 directory?

It's handled by OpenWrt:

target/linux/generic/patches-3.2/400-rootfs_split.patchtarget/linux/generic/patches-3.2/400-rootfs_split.patch

> Last but not least, I had a look at the target/linux subdirectory
> and I'm having difficulties to find several "good" candidates to
> mimic.

IMHO the at91 is not bad. A quick look at it:

 * remove execute flag on 
target/linux/at91/patches/805-free_some_portc_pins.patch
 * probably move dfboot and u-boot to package:
   * target/linux/at91/image/dfboot/
   * target/linux/at91/image/u-boot/

Hope that helps.

Luka
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to