* [Buildroot] Creating JFFS2 rootfs to SPI flash, and mounting it from kernel
@ 2013-03-18 6:45 Juha Lumme
2013-03-18 7:02 ` Baruch Siach
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Juha Lumme @ 2013-03-18 6:45 UTC (permalink / raw)
To: buildroot
Hi,
Sorry for asking not directly buildroot question, but I thought this forum
would have many members who knows answer to this one.
In my project, I'm trying to migrate my file system to spi flash from
memory card, and I seem to have created filesystem image successfully. I
want my rootfs to be read-only to avoid corruption issues, and only have
application files reside on a writable file system.
(Buildroot was creating a working filesystem for memory card, and I
reconfigured it also to create JFFS2-one, and it did as told).
My question is how to move forward from here, I seem to have several gaps
in my knowledge now.
1) My board is described in dtb file, so is it correct to assume that I
should also describe my flash layout there under the SPI section for the
flash ?
My planned layout is something like this (please ignore the addresses
themselves):
0x0 - 0x9 u-boot
0x10 - 0x19 kernel
0x20 - 0x29 root fs
0x30 - 0x39 /home
2) Currently I am passing the partition info on the memory card to the
kernel from u-boot (noinitrd console=ttyAMA0,115200 root=/dev/mmcblk0p2 rw
rootwait).
Can I now change this to: "noinitrd console=ttyAMA0,115200 root=/dev/mtdblock2
rootfstype=jffs2 ro rootwait" ?
I'm thinking the block2 is since block 0 is u-boot and 1 would be kernel ?
ro instead of rw since I don't want to write to root fs.
Or does that make any sense ? What would you recommend me to do ? Is JFFS2
a good idea ? Should I consider RAMFS for root file system ?
3) Where can I tell my kernel to mount /home as a separate file system ? I
would like that one to be read write, but I only rarely need to save
configuration files there... What would be a good idea with this ?
Thank you for any suggestions, and once again, sorry for using this mailing
list for kernel configuration related question, but I thought many people
here would be well versed in this type of configuration.
Juha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20130318/4d563c9a/attachment.html>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] Creating JFFS2 rootfs to SPI flash, and mounting it from kernel
2013-03-18 6:45 [Buildroot] Creating JFFS2 rootfs to SPI flash, and mounting it from kernel Juha Lumme
@ 2013-03-18 7:02 ` Baruch Siach
2013-03-18 8:00 ` Carlo Caione
2013-03-21 17:25 ` Arnout Vandecappelle
2 siblings, 0 replies; 4+ messages in thread
From: Baruch Siach @ 2013-03-18 7:02 UTC (permalink / raw)
To: buildroot
Hi Juha,
On Mon, Mar 18, 2013 at 03:45:49PM +0900, Juha Lumme wrote:
> Or does that make any sense ? What would you recommend me to do ? Is JFFS2
> a good idea ? Should I consider RAMFS for root file system ?
You may also consider Squashfs which is a read-only filesystem, and should
give better compression ratio than JFFS2.
baruch
--
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] Creating JFFS2 rootfs to SPI flash, and mounting it from kernel
2013-03-18 6:45 [Buildroot] Creating JFFS2 rootfs to SPI flash, and mounting it from kernel Juha Lumme
2013-03-18 7:02 ` Baruch Siach
@ 2013-03-18 8:00 ` Carlo Caione
2013-03-21 17:25 ` Arnout Vandecappelle
2 siblings, 0 replies; 4+ messages in thread
From: Carlo Caione @ 2013-03-18 8:00 UTC (permalink / raw)
To: buildroot
On Mon, Mar 18, 2013 at 7:45 AM, Juha Lumme <juha.lumme@gmail.com> wrote:
> Hi,
>
> Sorry for asking not directly buildroot question, but I thought this forum
> would have many members who knows answer to this one.
> In my project, I'm trying to migrate my file system to spi flash from memory
> card, and I seem to have created filesystem image successfully. I want my
> rootfs to be read-only to avoid corruption issues, and only have application
> files reside on a writable file system.
[cut]
For this point you can take a look to overlayfs:
http://lwn.net/Articles/447650/
http://wiki.openwrt.org/doc/techref/flash.layout
Best,
--
Carlo Caione
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] Creating JFFS2 rootfs to SPI flash, and mounting it from kernel
2013-03-18 6:45 [Buildroot] Creating JFFS2 rootfs to SPI flash, and mounting it from kernel Juha Lumme
2013-03-18 7:02 ` Baruch Siach
2013-03-18 8:00 ` Carlo Caione
@ 2013-03-21 17:25 ` Arnout Vandecappelle
2 siblings, 0 replies; 4+ messages in thread
From: Arnout Vandecappelle @ 2013-03-21 17:25 UTC (permalink / raw)
To: buildroot
On 18/03/13 07:45, Juha Lumme wrote:
> 1) My board is described in dtb file, so is it correct to assume that I
> should also describe my flash layout there under the SPI section for the
> flash ?
It's either in the DTB or you can pass it along as boot arguments,
something like:
mtdparts=dataflash0:128k(u-boot),4m(kernel),12m(rootfs),-(home)
> My planned layout is something like this (please ignore the addresses
> themselves):
> 0x0 - 0x9 u-boot
> 0x10 - 0x19 kernel
> 0x20 - 0x29 root fs
> 0x30 - 0x39 /home
>
> 2) Currently I am passing the partition info on the memory card to the
> kernel from u-boot (noinitrd console=ttyAMA0,115200 root=/dev/mmcblk0p2
> rw rootwait).
> Can I now change this to: "noinitrd console=ttyAMA0,115200
> root=/dev/mtdblock2 rootfstype=jffs2 ro rootwait" ?
> I'm thinking the block2 is since block 0 is u-boot and 1 would be kernel
> ? ro instead of rw since I don't want to write to root fs.
> Or does that make any sense ? What would you recommend me to do ? Is
> JFFS2 a good idea ? Should I consider RAMFS for root file system ?
JFFS2 as a read-only rootfs works perfectly. If you want to explore
alternatives, consider UBI/UBIFS, but that's a bit more complex to set up.
> 3) Where can I tell my kernel to mount /home as a separate file system ?
> I would like that one to be read write, but I only rarely need to save
> configuration files there... What would be a good idea with this ?
In /etc/fstab. Create a target rootfs overlay with a custom fstab that
specifies to mount /dev/mtdblok3 on /home.
Note that you'll have to manually create a (supposedly empty) jffs2
filesystem on /dev/mtdblock3.
Regards,
Arnout
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-03-21 17:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-18 6:45 [Buildroot] Creating JFFS2 rootfs to SPI flash, and mounting it from kernel Juha Lumme
2013-03-18 7:02 ` Baruch Siach
2013-03-18 8:00 ` Carlo Caione
2013-03-21 17:25 ` Arnout Vandecappelle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox