[OpenWrt-Devel] Current state of extroot, how to use it, what about ubi(fs)

2014-12-16 Thread Rafał Miłecki
I've spent few hours today trying to understand extroot. I've failed :(

Of course I was trying to use wiki pages:
http://wiki.openwrt.org/doc/howto/extroot
http://wiki.openwrt.org/doc/uci/fstab

1) Main question
Is the following sentence true at all?
 The configuration of extroot is very simple and is done entirely in 
 /etc/config/fstab.

It seems that /etc/init.d/fstab uses block umount and block mount
only. I was reading the source code (fstools-2014-12-15/block.c) and
it seems that block mount doesn't really handle extroot at all.

I think some kind of extroot support is provided in block extroot,
but I don't fully understand it. It seems to be looking for partitions
rootfs and then rootfs_data ignoring whatever is set in
/etc/config/fstab. If mount extroot is really supposed to be used,
is there any way to point some external device (without MTD
partitions) as extroot? I got confused.

2) UBI and UBIFS support

I guess it's too new to be documented and I don't understand it much
from the code. It seems that if there isn't rootfs MTD partition,
then the code will look for rootfs UBI volume. The same applies to
the rootfs_data.
But what if my serial flash contains rootfs + rootfs_data
partitions and I still want to use some UBI volume on another flash
(NAND one)?

-- 
Rafał
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Current state of extroot, how to use it, what about ubi(fs)

2014-12-16 Thread Flávio Silveira


On 16/12/2014 11:23, Gergely Kiss wrote:

Hi Rafał,

please allow me to comment on your 2nd point as I was the one who
recently published the patch to make extroot functionality work with
UBIFS.

It seems that if there isn't rootfs MTD partition,
then the code will look for rootfs UBI volume. The same applies to
the rootfs_data.

That's correct.

But what if my serial flash contains rootfs + rootfs_data
partitions and I still want to use some UBI volume on another flash
(NAND one)?

I'm not sure I understand what you mean here. Are there any devices
out there with multiple flash chips on-board? As far as I know, UBI
cannot work on top of block devices (eg. USB flashes, SD cards), only
raw flash chips so I can't really imagine what exact use-case you
mean. Could you please clarify?


Thanks,
Gergely


On 16 December 2014 at 11:00, Rafał Miłecki zaj...@gmail.com wrote:

I've spent few hours today trying to understand extroot. I've failed :(

Of course I was trying to use wiki pages:
http://wiki.openwrt.org/doc/howto/extroot
http://wiki.openwrt.org/doc/uci/fstab

1) Main question
Is the following sentence true at all?

The configuration of extroot is very simple and is done entirely in 
/etc/config/fstab.

It seems that /etc/init.d/fstab uses block umount and block mount
only. I was reading the source code (fstools-2014-12-15/block.c) and
it seems that block mount doesn't really handle extroot at all.

I think some kind of extroot support is provided in block extroot,
but I don't fully understand it. It seems to be looking for partitions
rootfs and then rootfs_data ignoring whatever is set in
/etc/config/fstab. If mount extroot is really supposed to be used,
is there any way to point some external device (without MTD
partitions) as extroot? I got confused.

2) UBI and UBIFS support

I guess it's too new to be documented and I don't understand it much
from the code. It seems that if there isn't rootfs MTD partition,
then the code will look for rootfs UBI volume. The same applies to
the rootfs_data.
But what if my serial flash contains rootfs + rootfs_data
partitions and I still want to use some UBI volume on another flash
(NAND one)?

--
Rafał

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Hi,

  I think this is where this discussion started and Rafal explains a 
bit more about the hardware: 
https://lists.openwrt.org/pipermail/openwrt-devel/2014-December/029717.html


Regards,
  Flavio
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Current state of extroot, how to use it, what about ubi(fs)

2014-12-16 Thread Gergely Kiss
Sorry, I haven't read that post earlier.

So, is this simply about mounting an additional UBIFS partition at boot time?

If so, I believe the best solution would be to extend the
functionality of fstab with a simple (shell) script, as suggested in
the fstab wiki:

BTRFS, JFS, *UBI* [...] are not supported in /etc/config/fstab. Use
manual scripting.

Would that be possible?


Regards,
Gergely

On 16 December 2014 at 14:39, Flávio Silveira f...@terra.com.br wrote:

 On 16/12/2014 11:23, Gergely Kiss wrote:

 Hi Rafał,

 please allow me to comment on your 2nd point as I was the one who
 recently published the patch to make extroot functionality work with
 UBIFS.

 It seems that if there isn't rootfs MTD partition,
 then the code will look for rootfs UBI volume. The same applies to
 the rootfs_data.

 That's correct.

 But what if my serial flash contains rootfs + rootfs_data
 partitions and I still want to use some UBI volume on another flash
 (NAND one)?

 I'm not sure I understand what you mean here. Are there any devices
 out there with multiple flash chips on-board? As far as I know, UBI
 cannot work on top of block devices (eg. USB flashes, SD cards), only
 raw flash chips so I can't really imagine what exact use-case you
 mean. Could you please clarify?


 Thanks,
 Gergely


 On 16 December 2014 at 11:00, Rafał Miłecki zaj...@gmail.com wrote:

 I've spent few hours today trying to understand extroot. I've failed :(

 Of course I was trying to use wiki pages:
 http://wiki.openwrt.org/doc/howto/extroot
 http://wiki.openwrt.org/doc/uci/fstab

 1) Main question
 Is the following sentence true at all?

 The configuration of extroot is very simple and is done entirely in
 /etc/config/fstab.

 It seems that /etc/init.d/fstab uses block umount and block mount
 only. I was reading the source code (fstools-2014-12-15/block.c) and
 it seems that block mount doesn't really handle extroot at all.

 I think some kind of extroot support is provided in block extroot,
 but I don't fully understand it. It seems to be looking for partitions
 rootfs and then rootfs_data ignoring whatever is set in
 /etc/config/fstab. If mount extroot is really supposed to be used,
 is there any way to point some external device (without MTD
 partitions) as extroot? I got confused.

 2) UBI and UBIFS support

 I guess it's too new to be documented and I don't understand it much
 from the code. It seems that if there isn't rootfs MTD partition,
 then the code will look for rootfs UBI volume. The same applies to
 the rootfs_data.
 But what if my serial flash contains rootfs + rootfs_data
 partitions and I still want to use some UBI volume on another flash
 (NAND one)?

 --
 Rafał

 ___
 openwrt-devel mailing list
 openwrt-devel@lists.openwrt.org
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


 Hi,

   I think this is where this discussion started and Rafal explains a bit
 more about the hardware:
 https://lists.openwrt.org/pipermail/openwrt-devel/2014-December/029717.html

 Regards,
   Flavio
 ___
 openwrt-devel mailing list
 openwrt-devel@lists.openwrt.org
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Current state of extroot, how to use it, what about ubi(fs)

2014-12-16 Thread Imre Kaloz

On Tue, 16 Dec 2014 16:06:27 +0100, Gergely Kiss mail.g...@gmail.com wrote:

Please don't top-post.


Sorry, I haven't read that post earlier.

So, is this simply about mounting an additional UBIFS partition at boot time?

If so, I believe the best solution would be to extend the
functionality of fstab with a simple (shell) script, as suggested in
the fstab wiki:

BTRFS, JFS, *UBI* [...] are not supported in /etc/config/fstab. Use
manual scripting.

Would that be possible?


Regards,
Gergely

On 16 December 2014 at 14:39, Flávio Silveira f...@terra.com.br wrote:


On 16/12/2014 11:23, Gergely Kiss wrote:


Hi Rafał,

please allow me to comment on your 2nd point as I was the one who
recently published the patch to make extroot functionality work with
UBIFS.

It seems that if there isn't rootfs MTD partition,
then the code will look for rootfs UBI volume. The same applies to
the rootfs_data.

That's correct.

But what if my serial flash contains rootfs + rootfs_data
partitions and I still want to use some UBI volume on another flash
(NAND one)?

I'm not sure I understand what you mean here. Are there any devices
out there with multiple flash chips on-board? As far as I know, UBI
cannot work on top of block devices (eg. USB flashes, SD cards), only
raw flash chips so I can't really imagine what exact use-case you
mean. Could you please clarify?


Thanks,
Gergely


On 16 December 2014 at 11:00, Rafał Miłecki zaj...@gmail.com wrote:


I've spent few hours today trying to understand extroot. I've failed :(

Of course I was trying to use wiki pages:
http://wiki.openwrt.org/doc/howto/extroot
http://wiki.openwrt.org/doc/uci/fstab

1) Main question
Is the following sentence true at all?


The configuration of extroot is very simple and is done entirely in
/etc/config/fstab.


It seems that /etc/init.d/fstab uses block umount and block mount
only. I was reading the source code (fstools-2014-12-15/block.c) and
it seems that block mount doesn't really handle extroot at all.

I think some kind of extroot support is provided in block extroot,
but I don't fully understand it. It seems to be looking for partitions
rootfs and then rootfs_data ignoring whatever is set in
/etc/config/fstab. If mount extroot is really supposed to be used,
is there any way to point some external device (without MTD
partitions) as extroot? I got confused.

2) UBI and UBIFS support

I guess it's too new to be documented and I don't understand it much
from the code. It seems that if there isn't rootfs MTD partition,
then the code will look for rootfs UBI volume. The same applies to
the rootfs_data.
But what if my serial flash contains rootfs + rootfs_data
partitions and I still want to use some UBI volume on another flash
(NAND one)?

--
Rafał


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



Hi,

  I think this is where this discussion started and Rafal explains a bit
more about the hardware:
https://lists.openwrt.org/pipermail/openwrt-devel/2014-December/029717.html

Regards,
  Flavio


Rafal, what about mtdconcat?


Imre
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Current state of extroot, how to use it, what about ubi(fs)

2014-12-16 Thread Rafał Miłecki
On 16 December 2014 at 16:30, Imre Kaloz ka...@openwrt.org wrote:
 On Tue, 16 Dec 2014 16:06:27 +0100, Gergely Kiss mail.g...@gmail.com
 wrote:
 On 16 December 2014 at 14:39, Flávio Silveira f...@terra.com.br wrote:

 On 16/12/2014 11:23, Gergely Kiss wrote:
 I'm not sure I understand what you mean here. Are there any devices
 out there with multiple flash chips on-board? As far as I know, UBI
 cannot work on top of block devices (eg. USB flashes, SD cards), only
 raw flash chips so I can't really imagine what exact use-case you
 mean. Could you please clarify?

   I think this is where this discussion started and Rafal explains a bit
 more about the hardware:

 https://lists.openwrt.org/pipermail/openwrt-devel/2014-December/029717.html


 Rafal, what about mtdconcat?

That would be nice because I could use space available on the serial
flash. So far I assumed to ignore that extra ~10 MiB and focus on NAND
mostly.

However I'm not sure if this will be possible without heavy changes.

I have rootfs_data (JFFS2) partition on serial flash. I would need to
concat it with my UBI partition on NAND flash.
1) I'm afraid it may be complex to change the way OpenWrt treats
rootfs_data. It's coded in many places.
2) Concanation has to be handled in the kernel. There isn't any DT
driver I could use for bcm53xx. Guess I'd need to write once
3) I have no idea if UBI can work well on concan-ated partition. In
theory yes, but in practice? UBI cares pretty much about wearing I
believe.

-- 
Rafał
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Current state of extroot, how to use it, what about ubi(fs)

2014-12-16 Thread Rafał Miłecki
On 16 December 2014 at 16:06, Gergely Kiss mail.g...@gmail.com wrote:
 So, is this simply about mounting an additional UBIFS partition at boot time?

 If so, I believe the best solution would be to extend the
 functionality of fstab with a simple (shell) script, as suggested in
 the fstab wiki:

 BTRFS, JFS, *UBI* [...] are not supported in /etc/config/fstab. Use
 manual scripting.

 Would that be possible?

I could implement that, but is it going to help? This block extroot
is really confusing for me.

Does it really look for entries in /etc/config/fstab? Or does it
hardcode to use rootfs / rootfs_data partitions? Could you explain
what's the point of all these
find_block_mtd(rootfs, fs, sizeof(fs));
find_block_ubi_RO(libubi, rootfs, fs, sizeof(fs));
find_block_mtd(rootfs_data, fs_data, sizeof(fs_data));
find_block_ubi(libubi, rootfs_data, fs_data, sizeof(fs_data));
in the main_extroot?

Also, in my case there is rootfs_data MTD partition. I could create
UBI volume rootfs_data on NAND flash, but block extroot will still
pick the MTD partition.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Current state of extroot, how to use it, what about ubi(fs)

2014-12-16 Thread Gergely Kiss
On 12/16/2014 07:35 PM, Rafał Miłecki wrote:
 Does it really look for entries in /etc/config/fstab? Or does it
 hardcode to use rootfs / rootfs_data partitions? Could you explain
 what's the point of all these
 find_block_mtd(rootfs, fs, sizeof(fs));
 find_block_ubi_RO(libubi, rootfs, fs, sizeof(fs));
 find_block_mtd(rootfs_data, fs_data, sizeof(fs_data));
 find_block_ubi(libubi, rootfs_data, fs_data, sizeof(fs_data));
 in the main_extroot?

To be the honest, I'm not very familiar with the sources, I only made some 
slight enhancements
to a patch created by a forum member, see 
https://forum.openwrt.org/viewtopic.php?pid=257518#p257518

Maybe the developer who wrote the code originally could answer that.

I suspect those functions are there so in case extroot fails, the code can 
revert
to the flash partition to avoid having an unbootable system.

Not sure of you read already but the bottom of this article might help 
understanding the logic:

http://wiki.openwrt.org/doc/howto/extroot/extroot.theory

 Also, in my case there is rootfs_data MTD partition. I could create
 UBI volume rootfs_data on NAND flash, but block extroot will still
 pick the MTD partition.

Well, that's how it works now but you can always create a patch if you want to 
change that behaviour.


Regards,
Gergely
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel