[LEDE-DEV] mission impossible!! add ubifs

Daniel Golle daniel at makrotopia.org
Mon Aug 22 13:12:28 PDT 2016


Hi Kenneth,

On Mon, Aug 22, 2016 at 09:54:46PM +0200, Kenneth Johansson wrote:
> so I'm on commit 2a170e40860034a9a5157306547c1a333be3845b and moving up to
> head is not really an option right now.
> 
> what I want to do is change target mt7621 to generate a rootfs in ubifs, not
> ubi so no ubinize needed. In addition to this I want the kernel in uImage
> format included in the rootfs in /boot/. and same for the device tree. and
> it would be nice to have kernel uImage and dtb  also in
> $(TOPDIR)/bin/ramips/.

Can you elaborate why you need/want uImage and DTB to be inside a
filesystem instead of appending the DTB to the Kernel and storing it
inside a UBI volume?

> 
> sound like a 5 minute job but oh no I see no end in sight. Problem is that I
> do not understand what I need to do. To many macro expansions involved in
> the makefile.
> 
> so far I changed.
> change the kernel code so that it takes the dtb from u-boot if it passes in
> the dtb to the kernel. Before it only used the dtb that is patched in. this
> works fine with the ramdisk image.

Great. Having U-Boot pass the DTB is a desirable feature indeed. And
parting ramips/mt7621 support to vanilla U-Boot would be amazing (but
supposedly also quite a lot of work).

If you already build U-Boot from source yourself, you could also use
a FIT image containing both, DTB and Kernel which is already much
cleaner than patching it into the kernel.
This then allows U-Boot to e.g. pass the MAC address appropriately via
device-tree instead of the kernel reading it from the environment or
EEPROM partition.

> 
> I added ubifs to FEATURES in target/linux/ramips/Makefile so that "make
> menuconfig" can select ubifs image. I also select the option that should
> include uImage and dtb in rootfs. this do not work. so I tried to fix it in

The option to include dtb and uimage in rootfs is fundamentally flawed
and broken. It was added at a time when proper support for generating
UBI images wasn't yet implemented in OpenWrt.
Maybe we should mark it as deprecated?


> target/linux/ramips/image/Makefile. But what changes should I do ? It is
> really hard to understand what the correct change really is and so far all
> my testing results in more or less no change or some other error showing up.
> 
> any suggestiongs ?? its fine to do it for master I'm sure I can backport it
> once I have the correct changes to target/linux/ramips/image/Makefile.

If you really, really need a boot-filesystem instead of a volume for
any reason which cannot be addressed otherwise (eg. Buffalo uses a
JFFS2-NAND boot partition in their bootloader which doesn't support
UBI at all), please explain and we shall find a solution.
Apart from that, just use UBI/NAND support in the way intended (ie.
have a plain volume for the kernel) and you won't have any problems,
I suppose...


Cheers


Daniel



More information about the Lede-dev mailing list