All of lore.kernel.org
 help / color / mirror / Atom feed
* mkfs.ubifs problem when output file really isn't in the UBIFS root directory
@ 2012-09-21 15:41 Marcus Prebble
  2012-10-04 16:16 ` Artem Bityutskiy
  0 siblings, 1 reply; 11+ messages in thread
From: Marcus Prebble @ 2012-09-21 15:41 UTC (permalink / raw)
  To: linux-mtd; +Cc: Ricard Wanderlof

Hi,

We are working on a project using UBI/UBIFS and I have run into a
problem with mkfs.ubifs which I am hoping someone can advise on.
Apologies if I have already missed the answer to this in the archives
somewhere.

A requirement of the project is to take an image of the root filesystem
(/) which is implemented as a static UBI read only volume. Obviously its
not possible to unmount /, but it seems to be possible to re-mount the
UBI volume, read only, onto another location e.g. /tmp/mnt/new_rootfs.

The problem arises when running mkfs.ubifs is that it fails saying that
the output file cannot be in the UBIFS root directory.
This sounds like a reasonable constraint if the output file really was
in the root, but this is not the case for us seeing root is mounted
somewhere belowtmp. To give a concrete example of the command we are
running:

mkfs.ubifs --output=/tmp/rootfs.img  --leb-size=129024
--root=/tmp/rootfs_mnt --min-io-size=2048 --max-leb-cnt=147 

Where /dev/ubi0_11 is mounted read-only on both / and /tmp/rootfs_mnt/.

Having a look at the source for mkfs.ubifs it seems that the function
in_path(..) is the problem - it works up the directory tree using ../
until it either reaches the top_dir (/) or the inode number/dev match in
which case it fails. It doesn't seem that this section of code has
changed in the latest version of mtd-utils (we are running 1.4.3-2) and
I wonder if this is a bug in in_path(..) or a genuine safeguard against
screwing something up? I suspect the former for when I disabled this
check in mkfs.ubifs.c the resulting image was completely OK.

Kind regards,

Marcus Prebble
Axis Communications AB

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-10-11  7:56 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-21 15:41 mkfs.ubifs problem when output file really isn't in the UBIFS root directory Marcus Prebble
2012-10-04 16:16 ` Artem Bityutskiy
2012-10-08 15:04   ` Marcus Prebble
2012-10-10  6:47     ` Artem Bityutskiy
2012-10-10  9:04       ` Marcus Prebble
2012-10-10  9:30         ` Artem Bityutskiy
2012-10-10 10:34           ` Marcus Prebble
2012-10-10 11:30             ` Artem Bityutskiy
2012-10-10 15:26               ` Marcus Prebble
2012-10-11  7:54                 ` Artem Bityutskiy
2012-10-11  7:56                 ` Artem Bityutskiy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.