[PATCH/RFC 0/3] UBI: unify mouting rootfs based on cmdline parameter

Ezequiel Garcia ezequiel at vanguardiasur.com.ar
Sun Aug 28 07:54:47 PDT 2016


On 28 August 2016 at 11:27, Daniel Golle <daniel at makrotopia.org> wrote:
> Hi Ezequiel,
>
> On Sun, Aug 28, 2016 at 11:12:50AM -0300, Ezequiel Garcia wrote:
>> Daniel,
>>
>> Let's try to tackle this from a different angle.
>>
>> On 27 August 2016 at 16:43, Daniel Golle <daniel at makrotopia.org> wrote:
>> > Hi!
>> >
>> > In an attempts to fix the flaws of the current set of UBI-related
>> > patches we are carrying in OpenWrt, I re-wrote the way mounting the
>> > rootfs from UBI in OpenWrt/LEDE works. The main requirement I face
>> > which cannot be easily addressed using other means which are already
>> > available in the kernel is the fact that UBIFS and squashfs-on-UBI
>> > require different parameters to be set on the cmdline, e.g.
>> > for UBIFS: ubi.mtd=ubi root=ubi0:rootfs rootfstype=ubifs
>> > for squashfs: ubi.mtd=ubi ubiblock=0,1 root=/dev/ubiblock0_1 rootfstype=squashfs
>> >
>>
>> Can you help me understand the problem you are solving here?
>>
>> So you currently need to do:
>>
>> * for UBIFS: ubi.mtd=ubi root=ubi0:rootfs rootfstype=ubifs
>> * for squashfs: ubi.mtd=ubi ubi.block=0,1 root=/dev/ubiblock0_1
>> rootfstype=squashfs
>>
>> [..]
>> >
>> > With those changes, a single set of cmdline parameters is
>> > sufficient to mount either UBIFS or any other block filesystem
>> > by creating a ubiblock device:
>> > ubi.mtd=ubi root=ubi0:rootfs rootfstype=ubifs,squashfs
>     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>      this is the goal state :)
>
>> >
>>
>> And you would like to do:
>>
>> * for UBIFS: ubi.mtd=ubi root=ubi0:rootfs rootfstype=ubifs
>> * for squashfs: ubi.mtd=ubi root=/dev/ubiblock0_1 rootfstype=squashfs
>
> I do NOT want to pass different cmdlines depending on the filesystem
> type. The lines quote above were to illustrate the current
> inconsistency of cmdline parameters.
>
>>
>> So the only thing you are trying to acomplish, is removal
>> of the ubi.block parameter needed to create ubi block devices.
>>
>> Is that correct?
>
> Almost. I want a single syntax for rootfs= to refer to the rootfs
> volume, no matter what the filesystem type is. Hence, in case of
> non-UBIFS filesystem, a ubiblock needs to be created and mounted.
>

Hm, OK. So, if you _actually_ want to do something like:

ubi.mtd=ubi root=ubi0:rootfs rootfstype=squashfs

Then you are ** doomed **

I guess you already understand this, but just for the
sake of it, bare with me going through the obvious:

The squashfs works on top of a block device, and so it has
absolutely NO idea about the block device belonging
to a given volume.

The "root=ubi0:rootfs" is understood by the filesystem,
in this case ubifs, so it can't be understood by squashfs.

And you can add any amount of pretty hacks to squashfs
or to init/do_mounts.c, but as far as I can see, they will
always be hacks and they will always be rejected.

The reason for this is that kenel code would be very
hard to maintain if each $user that wanted some
special thing to work for a given use case would be
allowed to hack its own special rule.

The kernel is already hard to maintain as it is.
I don't even want to think what it would look like
if maintainers would accept proposals like this one.

Sorry,
-- 
Ezequiel García, VanguardiaSur
www.vanguardiasur.com.ar



More information about the linux-mtd mailing list