mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* Boot linux from cramfs on USB
@ 2012-04-02 13:58 Jakob Malm
  2012-04-02 14:29 ` Sascha Hauer
  0 siblings, 1 reply; 4+ messages in thread
From: Jakob Malm @ 2012-04-02 13:58 UTC (permalink / raw)
  To: barebox

Hi,

How would I boot a linux system in a cramfs image on USB? I don't seem
to be able to mount such an image:

barebox:/ usb
USB: scanning bus for devices...
Bus 001 Device 002: ID 0dd8:1728 Flash Drive
Using index 1 for the new disk
Bus 001 Device 001: ID 0000:0000 EHCI Host Controller
2 USB Device(s) found
barebox:/ mkdir /usb
barebox:/ mount /dev/disk1.0 fat /usb
barebox:/ mkdir /cramfs
barebox:/ mount /usb/rootfs.cramfs cramfs /cramfs
mount: Invalid argument

Is it not possible to mount a cramfs image file?

This is on a Freescale MX-23 EVK board.

Thanks,
Jakob Malm

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: Boot linux from cramfs on USB
  2012-04-02 13:58 Boot linux from cramfs on USB Jakob Malm
@ 2012-04-02 14:29 ` Sascha Hauer
  2012-04-02 15:33   ` Jakob Malm
  0 siblings, 1 reply; 4+ messages in thread
From: Sascha Hauer @ 2012-04-02 14:29 UTC (permalink / raw)
  To: Jakob Malm; +Cc: barebox

On Mon, Apr 02, 2012 at 03:58:49PM +0200, Jakob Malm wrote:
> Hi,
> 
> How would I boot a linux system in a cramfs image on USB? I don't seem
> to be able to mount such an image:
> 
> barebox:/ usb
> USB: scanning bus for devices...
> Bus 001 Device 002: ID 0dd8:1728 Flash Drive
> Using index 1 for the new disk
> Bus 001 Device 001: ID 0000:0000 EHCI Host Controller
> 2 USB Device(s) found
> barebox:/ mkdir /usb
> barebox:/ mount /dev/disk1.0 fat /usb
> barebox:/ mkdir /cramfs
> barebox:/ mount /usb/rootfs.cramfs cramfs /cramfs
> mount: Invalid argument
> 
> Is it not possible to mount a cramfs image file?

cramfs currently has the limitation that it can only mount
files which are memory mappable (that is for example nor flash).
I never fixed this due to the lack of interest for cramfs.

That said, your setup seems a bit crazy. What is inside your cramfs? The
kernel? You should rather put your kernel into a plain partition on the
USB disk. Or do you only have your rootfs inside the cramfs? I rather
recommend ext2 or ext3 for this.

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: Boot linux from cramfs on USB
  2012-04-02 14:29 ` Sascha Hauer
@ 2012-04-02 15:33   ` Jakob Malm
  2012-04-02 17:47     ` Sascha Hauer
  0 siblings, 1 reply; 4+ messages in thread
From: Jakob Malm @ 2012-04-02 15:33 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

Hi,

Thanks for your prompt reply!

Den 2 april 2012 16:29 skrev Sascha Hauer <s.hauer@pengutronix.de>:
> On Mon, Apr 02, 2012 at 03:58:49PM +0200, Jakob Malm wrote:
>> Hi,
>>
>> How would I boot a linux system in a cramfs image on USB? I don't seem
>> to be able to mount such an image:
>>
>> ...
>>
>> Is it not possible to mount a cramfs image file?
>
> cramfs currently has the limitation that it can only mount
> files which are memory mappable (that is for example nor flash).
> I never fixed this due to the lack of interest for cramfs.

Ok.

>
> That said, your setup seems a bit crazy. What is inside your cramfs? The
> kernel? You should rather put your kernel into a plain partition on the
> USB disk. Or do you only have your rootfs inside the cramfs? I rather
> recommend ext2 or ext3 for this.

The cramfs would contain the rootfs, including kernel.

I want to be able to have FAT on the disk, preferably with a single
file (possibly two), containing the kernel and rootfs, and then load
up the rootfs into memory and start the kernel with that rootfs. I
suppose I could create a command specific for our case, but it seems
like a common enough scenario to me that someone else should have done
something similar...

/Jakob

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: Boot linux from cramfs on USB
  2012-04-02 15:33   ` Jakob Malm
@ 2012-04-02 17:47     ` Sascha Hauer
  0 siblings, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2012-04-02 17:47 UTC (permalink / raw)
  To: Jakob Malm; +Cc: barebox

On Mon, Apr 02, 2012 at 05:33:11PM +0200, Jakob Malm wrote:
> Hi,
> 
> Thanks for your prompt reply!
> 
> Den 2 april 2012 16:29 skrev Sascha Hauer <s.hauer@pengutronix.de>:
> > That said, your setup seems a bit crazy. What is inside your cramfs? The
> > kernel? You should rather put your kernel into a plain partition on the
> > USB disk. Or do you only have your rootfs inside the cramfs? I rather
> > recommend ext2 or ext3 for this.
> 
> The cramfs would contain the rootfs, including kernel.
> 
> I want to be able to have FAT on the disk, preferably with a single
> file (possibly two), containing the kernel and rootfs, and then load
> up the rootfs into memory and start the kernel with that rootfs. I
> suppose I could create a command specific for our case, but it seems
> like a common enough scenario to me that someone else should have done
> something similar...

You can extract the kernel from your cramfs image by fixing the cramfs
support. I just saw that cramfs expects a /dev/ file, that is it expects
a devfs file. This could be changed by using regular open/read/write
functions.
It would be easier though if you live with two files, one cramfs image
and one kernel image.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2012-04-02 17:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-02 13:58 Boot linux from cramfs on USB Jakob Malm
2012-04-02 14:29 ` Sascha Hauer
2012-04-02 15:33   ` Jakob Malm
2012-04-02 17:47     ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox