[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: MTD and UBI support in d-i



On Wed, Jul 08, 2009 at 05:01:02PM +0200, Per Andersson wrote:
> I have been working on partman-ubi, which enables d-i to
> partition MTD flash with UBI (Unsorted Block Images).
> 
> UBI is sort of similar to LVM, in the sense that MTD devices
> are attached to UBI. This creates a _UBI device_, on which it
> is possible to create _UBI volumes_. These UBI volumes can
> then be formatted at the users discretion (with ubifs for
> instance).
> 
> To examplify the procedure for working with UBI:
> 
> 1) Attach a MTD to UBI (this creates an UBI device)
> 2) Create volume on an UBI device with name and size.
> 
> The issue I am now facing is that partman is tightly integrated
> with libparted. Neither of MTD and UBI is understood by
> libparted.
> 
> Questions:
> 
> Regarding the partitioning editor (partman) I wonder if the
> attachment of MTD to UBI needs to be undoable (i.e. not
> really performed until partitioning commit/finishing
> partitioning).

Many of partman-lvm's operations currently aren't undoable; it commits
at various points as it goes along, displaying a confirmation message
warning you about the consequences.

This is a hassle, but it works. It would be *better* for partman to
predict partition names and sizes and operate accordingly, but I suspect
you'll find that core support for that in partman isn't very good, so I
think it would be OK for partman-ubi not to attempt this for now.

> Since partman is tightly connected with libparted, what is the
> best way to keep track of UBI devices and volumes? I.e.
> a) should partman be made to understand MTD and UBI, or
> b) is it better to keep all of this outside parted (and let the
> shell scripts create device and id related directories and files),
> or
> c) should parted_server be altered to understand and handle
> MTD and UBI?

If in a) you meant "should parted be made ...", then I think that's
clearly the best option. Trying to get partman to handle things that
parted doesn't is problematic at various layers and best avoided.

> When creating a loop label, it seems parted writes this to
> the device. This is not really what I want. Connecting to the
> questions above, is it possible to use the infrastructure given
> by partman/parted_server but without any of it being written
> to device.

Not to my knowledge; you'd be best advised to arrange for libparted to
be smart enough not to do this for UBI devices, I think.

-- 
Colin Watson                                       [cjwatson@debian.org]


Reply to: