Discussion:
[uClinux-dev] compressed ROMFS as root filesystem?
Rene W
2004-06-29 20:32:29 UTC
Permalink
Hello,



I would like to know if it is possible to use a compressed filesystem (like
CRAMFS) as root filesystem?



If it is possible, what do I have to do?



I tried it on my own, but without success.

I built a CRAMFS with "mkcramfs" from the romfs-directory of my
uClinux-distribution and loaded it in the flash of my ARM-based board.

The linux kernel should access the compressed root FS via MTD driver.
Therefore I enabled the "Support FLAT format compressed binaries" and
"Compressed ROM file system support" options in menuconfig. Additionally I
expanded the kernel command line to "root=/dev/mtdblock1 rootfstype=cramfs
init=/bin/init".

Unfortunately it does not work. Here is what uClinux puts out:



Linux version 2.4.24-uc0 (rene at localhost) (gcc version 2.95.3 20010315
(release)(ColdFire patches - 20010318 from
http://fiddes.net/coldfire/)(uClinux XIP and shared lib patches from
http://www.snapgear.com/)) #269 Die Jun 29 21:36:42 CEST 2004

Processor: Agere T8302 Arm940 revision 1

Architecture: Oregano VoIP

On node 0 totalpages: 2048

zone(0): 0 pages.

zone(1): 2048 pages.

zone(2): 0 pages.

Kernel command line: root=/dev/mtdblock1 rootfstype=cramfs init=/bin/init

Calibrating delay loop... 1.60 BogoMIPS

Memory: 8MB = 8MB total

Memory: 6996KB available (836K code, 212K data, 40K init)

Dentry cache hash table entries: 1024 (order: 1, 8192 bytes)

Inode cache hash table entries: 512 (order: 0, 4096 bytes)

Mount cache hash table entries: 512 (order: 0, 4096 bytes)

Buffer cache hash table entries: 1024 (order: 0, 4096 bytes)

Page-cache hash table entries: 2048 (order: 1, 8192 bytes)

POSIX conformance testing by UNIFIX

Linux NET4.0 for Linux 2.4

Based upon Swansea University Computer Society NET3.039

Initializing RT netlink socket

Starting kswapd

Oregano USART driver version 0.01

ttyS0 at 0xe0009000 (irq = 9) is a builtin Oregano Agere T8302 USART

RAMDISK driver initialized: 16 RAM disks of 512K size 1024 blocksize

Oregano VoIP: MTD flash setup

OREGANO MTD DEBUG: cfi_probe_chip(): Base-Fix for OREGANO VoIP Board

Amd/Fujitsu Extended Query Table v1.0 at 0x0040

number of CFI chips: 1

cfi_cmdset_0002: Disabling fast programming due to code brokenness.

Oregano VoIP: Oregano VoIP Flash 2MB device size = 2048K

Creating 2 MTD partitions on "Oregano VoIP Flash 2MB":

0x00000000-0x00200000 : "VoIP Flash"

0x00100000-0x00200000 : "VoIP Image"

Oregano VoIP: Set Partition 'VoIP Image' as Root FS

Oregano VoIP: Root FS set.

NET4: Linux TCP/IP 1.0 for NET4.0

IP Protocols: ICMP, UDP, TCP

IP: routing cache hash table of 512 buckets, 4Kbytes

TCP: Hash tables configured (established 512 bind 512)

VFS: Mounted root (cramfs filesystem) readonly.

Warning: unable to open an initial console.

Kernel panic: Attempted to kill init!



Has anyone an idea what the problem is?



Thanks in advance,

Rene.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.uclinux.org/pipermail/uclinux-dev/attachments/20040629/15be47bc/attachment.html>
David McCullough
2004-06-29 23:15:01 UTC
Permalink
Hi Rene,
from what you say below you have it all working, you just didn't notice
it :-) The problem you have is with your device nodes. You haven't
used a version of mkcramfs that understands the special device nodes
in the romfs dir.

If you compile your own mkcramfs from user/cramfs/mkcramfs.c in the dist
you will get a good version. For an example of how this is done in your
build look at:

vendors/SnapGear/SME575/Makefile

or just run:

gcc -o mkcramfs -Ilinux-2.4.x/include user/cramfs/mkcramfs.c -lz

The give aways were:

VFS: Mounted root (cramfs filesystem) readonly.

means the root fs was mounted ok. And:

Warning: unable to open an initial console.

means you device nodes are probably wrong. You do not need the
rootfstype command line arg either, it should be worked out
automatically,

Cheers,
Davidm


Jivin Rene W lays it down ...
Hello,
I would like to know if it is possible to use a compressed filesystem (like
CRAMFS) as root filesystem?
If it is possible, what do I have to do?
I tried it on my own, but without success.
I built a CRAMFS with "mkcramfs" from the romfs-directory of my
uClinux-distribution and loaded it in the flash of my ARM-based board.
The linux kernel should access the compressed root FS via MTD driver.
Therefore I enabled the "Support FLAT format compressed binaries" and
"Compressed ROM file system support" options in menuconfig. Additionally I
expanded the kernel command line to "root=/dev/mtdblock1 rootfstype=cramfs
init=/bin/init".
Linux version 2.4.24-uc0 (rene at localhost) (gcc version 2.95.3 20010315
(release)(ColdFire patches - 20010318 from
http://fiddes.net/coldfire/)(uClinux XIP and shared lib patches from
http://www.snapgear.com/)) #269 Die Jun 29 21:36:42 CEST 2004
Processor: Agere T8302 Arm940 revision 1
Architecture: Oregano VoIP
On node 0 totalpages: 2048
zone(0): 0 pages.
zone(1): 2048 pages.
zone(2): 0 pages.
Kernel command line: root=/dev/mtdblock1 rootfstype=cramfs init=/bin/init
Calibrating delay loop... 1.60 BogoMIPS
Memory: 8MB = 8MB total
Memory: 6996KB available (836K code, 212K data, 40K init)
Dentry cache hash table entries: 1024 (order: 1, 8192 bytes)
Inode cache hash table entries: 512 (order: 0, 4096 bytes)
Mount cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 2048 (order: 1, 8192 bytes)
POSIX conformance testing by UNIFIX
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
Oregano USART driver version 0.01
ttyS0 at 0xe0009000 (irq = 9) is a builtin Oregano Agere T8302 USART
RAMDISK driver initialized: 16 RAM disks of 512K size 1024 blocksize
Oregano VoIP: MTD flash setup
OREGANO MTD DEBUG: cfi_probe_chip(): Base-Fix for OREGANO VoIP Board
Amd/Fujitsu Extended Query Table v1.0 at 0x0040
number of CFI chips: 1
cfi_cmdset_0002: Disabling fast programming due to code brokenness.
Oregano VoIP: Oregano VoIP Flash 2MB device size = 2048K
0x00000000-0x00200000 : "VoIP Flash"
0x00100000-0x00200000 : "VoIP Image"
Oregano VoIP: Set Partition 'VoIP Image' as Root FS
Oregano VoIP: Root FS set.
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 512 bind 512)
VFS: Mounted root (cramfs filesystem) readonly.
Warning: unable to open an initial console.
Kernel panic: Attempted to kill init!
Has anyone an idea what the problem is?
Thanks in advance,
Rene.
_______________________________________________
uClinux-dev mailing list
uClinux-dev at uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev at uclinux.org
--
David McCullough, davidm at snapgear.com Ph:+61 7 34352815 http://www.SnapGear.com
Custom Embedded Solutions + Security Fx:+61 7 38913630 http://www.uCdot.org
Rene W
2004-06-30 19:24:13 UTC
Permalink
Hello David,

thanks a lot!
I built my own mkcramfs and now it works fine!

Rene.
Post by David McCullough
Hi Rene,
from what you say below you have it all working, you just didn't notice
it :-) The problem you have is with your device nodes. You haven't
used a version of mkcramfs that understands the special device nodes
in the romfs dir.
If you compile your own mkcramfs from user/cramfs/mkcramfs.c in the dist
you will get a good version. For an example of how this is done in your
vendors/SnapGear/SME575/Makefile
gcc -o mkcramfs -Ilinux-2.4.x/include user/cramfs/mkcramfs.c -lz
VFS: Mounted root (cramfs filesystem) readonly.
Warning: unable to open an initial console.
means you device nodes are probably wrong. You do not need the
rootfstype command line arg either, it should be worked out
automatically,
Cheers,
Davidm
____________
Virus checked by G DATA AntiVirusKit
Version: AVK 14.0.1242 from 23.06.2004
Virus news: www.antiviruslab.com

Loading...