* UBI: Can I boot with an UBI volume holding a root file system?
@ 2007-05-04 22:42 John Smith
2007-05-05 11:51 ` Artem Bityutskiy
2007-05-05 14:08 ` Artem Bityutskiy
0 siblings, 2 replies; 5+ messages in thread
From: John Smith @ 2007-05-04 22:42 UTC (permalink / raw)
To: linux-mtd
Hello,
I am hoping to build a root file system and store it as a squashfs
image in a static UBI volume. What command line should I should pass
to the kernel at boot time?
There are likely to be other UBI volumes in the UBI partition which
will each get mapped to a /dev/mtdblock device. Is it going to be
difficult to identify the major/minor numbers of the device which will
mapped to my squashfs image?
I think that I need to add some initramfs logic, but I am very
uncertain of the details. I will be grateful for any ideas,
Regards,
John
John Smith
Blackburn
England
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: UBI: Can I boot with an UBI volume holding a root file system?
2007-05-04 22:42 UBI: Can I boot with an UBI volume holding a root file system? John Smith
@ 2007-05-05 11:51 ` Artem Bityutskiy
2007-05-05 14:08 ` Artem Bityutskiy
1 sibling, 0 replies; 5+ messages in thread
From: Artem Bityutskiy @ 2007-05-05 11:51 UTC (permalink / raw)
To: John Smith; +Cc: linux-mtd
On Fri, 2007-05-04 at 23:42 +0100, John Smith wrote:
> I am hoping to build a root file system and store it as a squashfs
> image in a static UBI volume. What command line should I should pass
> to the kernel at boot time?
I am not sure which kernel line to use.
If you have a mtd device mtd0, and want to feed it to ubi, use ubi.mtd=0
command. See modinfo ubi. For kernel command line it is the same, but
you should use 'ubi.mtd=' instead of 'mtd='.
After the mtd is attached, and if mtd device emulation is enabled, ubi
will create MTD devices corresponding to your volumes.
> There are likely to be other UBI volumes in the UBI partition which
> will each get mapped to a /dev/mtdblock device. Is it going to be
> difficult to identify the major/minor numbers of the device which will
> mapped to my squashfs image?
You may use device names. Majors are dynamic and may change.
--
Best regards,
Artem Bityutskiy (Битюцкий Артём)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: UBI: Can I boot with an UBI volume holding a root file system?
2007-05-04 22:42 UBI: Can I boot with an UBI volume holding a root file system? John Smith
2007-05-05 11:51 ` Artem Bityutskiy
@ 2007-05-05 14:08 ` Artem Bityutskiy
2007-05-06 11:25 ` John Smith
1 sibling, 1 reply; 5+ messages in thread
From: Artem Bityutskiy @ 2007-05-05 14:08 UTC (permalink / raw)
To: John Smith; +Cc: linux-mtd
On Fri, 2007-05-04 at 23:42 +0100, John Smith wrote:
> I am hoping to build a root file system and store it as a squashfs
> image in a static UBI volume. What command line should I should pass
> to the kernel at boot time?
>
> There are likely to be other UBI volumes in the UBI partition which
> will each get mapped to a /dev/mtdblock device. Is it going to be
> difficult to identify the major/minor numbers of the device which will
> mapped to my squashfs image?
>
> I think that I need to add some initramfs logic, but I am very
> uncertain of the details. I will be grateful for any ideas,
I have never tried this and I guess nobody did. But you may try and send
us a text to add to faq on MTD site :-)
One thing for you to keep in mind: use proper volume alignment. I am not
sure what is squashfs block size probably 512 bytes, then use alignment
512. In this case you will end up with 512-byte aligned logical
eraseblocks. this will make your life easier.
--
Best regards,
Artem Bityutskiy (Битюцкий Артём)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: UBI: Can I boot with an UBI volume holding a root file system?
2007-05-05 14:08 ` Artem Bityutskiy
@ 2007-05-06 11:25 ` John Smith
2007-05-06 11:55 ` Artem Bityutskiy
0 siblings, 1 reply; 5+ messages in thread
From: John Smith @ 2007-05-06 11:25 UTC (permalink / raw)
To: linux-mtd
Artem Bityutskiy <dedekind <at> infradead.org> writes:
>
> On Fri, 2007-05-04 at 23:42 +0100, John Smith wrote:
> > I am hoping to build a root file system and store it as a squashfs
> > image in a static UBI volume. What command line should I should pass
> > to the kernel at boot time?
> >
> > There are likely to be other UBI volumes in the UBI partition which
> > will each get mapped to a /dev/mtdblock device. Is it going to be
> > difficult to identify the major/minor numbers of the device which will
> > mapped to my squashfs image?
> >
> > I think that I need to add some initramfs logic, but I am very
> > uncertain of the details. I will be grateful for any ideas,
>
> I have never tried this and I guess nobody did. But you may try and send
> us a text to add to faq on MTD site
>
I can make some progress. With a boot line
boot vmlinux "root=31:4 rootfstype=squashfs ubi.mtd=0 ubi.mtd=3"
I can boot the kernel and mount /dev/mtdblock4 as the root file system.
(31,4 are the major and minor numbers of /dev/mtdblock4, which is the mtd
block device mapped to the UBI volume which holds my squashfs image.)
The kernel has logic in the function name_to_dev_t() in file
init/do_mounts.c to convert the string "root=31:4" to the block device.
There is already logic in name_to_dev_t() for handling disks by name.
name_to_dev_t() could be extended to identify mtd partitions by name
so that
root=mtd:my_squashfs_image
returns the mtd block device containing mtd image "my_squashfs_image"
> One thing for you to keep in mind: use proper volume alignment. I am not
> sure what is squashfs block size probably 512 bytes, then use alignment
> 512. In this case you will end up with 512-byte aligned logical
> eraseblocks. this will make your life easier.
I have not done anything explicit about alignment. Have I just been lucky
because my NAND device works in pages of 512 bytes? The squashfs block size is
currently 65536 bytes, though may be the word block is describing a different
concept. Perhaps it would be best to make the squashfs block size the same size
as the UBI logical erase block size.
John
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: UBI: Can I boot with an UBI volume holding a root file system?
2007-05-06 11:25 ` John Smith
@ 2007-05-06 11:55 ` Artem Bityutskiy
0 siblings, 0 replies; 5+ messages in thread
From: Artem Bityutskiy @ 2007-05-06 11:55 UTC (permalink / raw)
To: John Smith; +Cc: linux-mtd
On Sun, 2007-05-06 at 11:25 +0000, John Smith wrote:
> I have not done anything explicit about alignment. Have I just been lucky
> because my NAND device works in pages of 512 bytes? The squashfs block size is
> currently 65536 bytes, though may be the word block is describing a different
> concept. Perhaps it would be best to make the squashfs block size the same size
> as the UBI logical erase block size.
Yeah, you probably do not need alignment. mtdblock emulates 512-byte
block device, and since you have NAND, you have 512-bytes-aligned
logical eraseblocks, so everything is fine. But you would need to
specify 512-byte alignment if you had NOR flash, for example.
--
Best regards,
Artem Bityutskiy (Битюцкий Артём)
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-05-06 11:55 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-04 22:42 UBI: Can I boot with an UBI volume holding a root file system? John Smith
2007-05-05 11:51 ` Artem Bityutskiy
2007-05-05 14:08 ` Artem Bityutskiy
2007-05-06 11:25 ` John Smith
2007-05-06 11:55 ` Artem Bityutskiy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox