Hi, Using this patch one can build an factory image "openwrt-ar71xx-nand-wndr4300-ubifs-factory.img" for WNDR4300 which is 25MiB in size (exactly the firmware partition size). The image contains only one UBIFS filesystem, so there is no recovery possible currently. Its implemented in the nand subtarget, the old nand subtarget was renamed to nand-yaffs2.
I published a branch on Github as well: https://github.com/falstaff84/openwrt Since UBIFS needs a clean NAND, the image consist mostly of 0xff. U-Boot doesn't clean the whole firmware partition by itself, so its done by using a "full sized" image. I tried using two UBIFS, overlaying each other (one read-only mounted, the other read-write). Some test showed that it worked, but the rootfs needs a lot more space than a squashfs filesystem. UBIFS has a weaker compressing algorithm and needs space for its journal. Here is where I ask myself what the goal is, which way should OpenWRT's NAND/UBI support take...? If we want to fit the image in those 25MiB Netgear uses, squashfs looks like the way to go: A squashfs ontop of UBI. Gluebi is probably most appropriate at the moment since its already supported in the kernel. Then create a script/program which creates a second UBI volume and the rootfs_data filesystem using UBIFS. On the other hand, this router has a lot of free space (96MiB) at the end (partition is called "reserved", maybe we should just use this. Since 25MiB for rootfs would be enough even with UBI, a UBI only solution would work too. To provide easy factory reset, the startscript just have to explicitly mount the rootfs ("rom") ro.... However, U-Boot can only write those 25MiB Netgear uses. So the image has to be below that line in any case (actual usable size is a lot smaller)... My preferred solution: Use the "reserved" partition as rootfs_data: Rename that partition in the mtdpart list. Create a script which creates a new UBI partition, create a volume and a UBIFS on it. (a second volume is needed since the partition "caldata_backup" is in between). The rootfs could be UBIFS ro or squashfs on UBI. Comments welcome :-) See also http://wiki.openwrt.org/toh/netgear/wndr4300 -- Stefan Stefan Agner (5): ar71xx: create new subtarget nand-yaffs2 ar71xx: altered subtarget nand for UBI/UBIFS ar71xx: Added ubinize.cfg and UBI flags to image Makefile ar71xx: factory image generation for WNDR4300 ar71xx: Empty whole rootfs partition on WNDR4300 target/linux/ar71xx/Makefile | 6 +- target/linux/ar71xx/image/Makefile | 72 +++++++++++++++++++++- target/linux/ar71xx/image/ubinize.cfg | 14 +++++ target/linux/ar71xx/nand-yaffs2/config-default | 34 ++++++++++ .../ar71xx/nand-yaffs2/profiles/01-minimal.mk | 16 +++++ .../linux/ar71xx/nand-yaffs2/profiles/02-ath5k.mk | 16 +++++ target/linux/ar71xx/nand-yaffs2/target.mk | 8 +++ target/linux/ar71xx/nand/config-default | 53 ++++++++-------- target/linux/ar71xx/nand/target.mk | 5 +- 9 files changed, 188 insertions(+), 36 deletions(-) create mode 100644 target/linux/ar71xx/image/ubinize.cfg create mode 100644 target/linux/ar71xx/nand-yaffs2/config-default create mode 100644 target/linux/ar71xx/nand-yaffs2/profiles/01-minimal.mk create mode 100644 target/linux/ar71xx/nand-yaffs2/profiles/02-ath5k.mk create mode 100644 target/linux/ar71xx/nand-yaffs2/target.mk -- 1.8.4 _______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel