On Fri, Dec 12, 2014 at 04:21:02PM +0100, Maxime Ripard wrote: > On boards with large page size, the rootfs we generate might end up using less > PEB than the minimum number required by UBI for a dynamic volume. > > Change the rootfs to a static volume, which removes such a requirement, and > isn't changing anything, since our rootfs is in read only anyway. > > Signed-off-by: Maxime Ripard <maxime.rip...@free-electrons.com> > --- > scripts/ubinize-image.sh | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/scripts/ubinize-image.sh b/scripts/ubinize-image.sh > index 6762c22bc4a6..11c25ecc8ee1 100755 > --- a/scripts/ubinize-image.sh > +++ b/scripts/ubinize-image.sh > @@ -25,13 +25,17 @@ ubivol() { > echo "[$name]" > echo "mode=ubi" > echo "vol_id=$volid" > - echo "vol_type=dynamic" > echo "vol_name=$name" > if [ "$image" ]; then > echo "image=$image" > else > echo "vol_size=1MiB" > fi > + if [ "$name" = "rootfs" ]; then > + echo "vol_type=static" > + else > + echo "vol_type=dynamic" > + fi
Once again, this will break read-write UBIFS rootfs, which is an option we do offer on NAND/UBI targets, just as we do offer read-write JFFS2 rootfs on NOR targets. So to make your rootfs come out as a static volume only when it's ubifs, you could do if [ "$name" = "rootfs" -a -z "$autoresize" ]; then echo "vol_type=static" else echo "vol_type=dynamic" fi However, also this didn't actually work on any of the UBIFS based boxes I got here for testing (kirkwood, oxnas, lantiq-danube), I constantly get stuff like when having rootfs a static volumes (contrary to your statement that suggests that changing to a static volume removes exactly that problem): [ 1.592535] UBIFS error (pid 1): init_constants_early: too few LEBs (16), min. is 17 [ 1.604008] UBI error: ubiblock_read_to_buf: ubiblock0_3 ubi_read error -22 [ 1.611025] end_request: I/O error, dev ubiblock0_3, sector 3860 [ 1.617093] SQUASHFS error: squashfs_read_data failed to read block 0x1e2ab3 [ 1.624107] SQUASHFS error: unable to read id index table Why do you need that quite abandonned support for static UBI volumes so badly? If there is a problem with small dynamic volumes, that is something to be adressed properly rather than being worked around at the cost of breaking other things. Cheers Daniel _______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel