* ram root filesystem
@ 2003-12-03 17:48 AlessandroPPC
2003-12-03 18:16 ` Wolfgang Denk
0 siblings, 1 reply; 3+ messages in thread
From: AlessandroPPC @ 2003-12-03 17:48 UTC (permalink / raw)
To: linuxppc-embedded
Hi to all,
I'm developing a custom application on 8260 based board. I have first used
the ELDK package version 2.0.2 with Kernel 2.4.4
and nfs root filesystem. Now I want migrate my application on the system
using ram fs instead of nfs.
To do this I have generated a ramdisk image derived from ELDK fs eliminating
superfluous packages and using a makefile with
this instructions:
@echo "********************************************"
@echo "create root files system"
@echo "********************************************"
rm -rf $(BUILD)/var/log/tegated
mkdir $(BUILD)/var/log/tegated
rm -rf $(RAMFS)/tmp/
mkdir $(RAMFS)/tmp
dd if=/dev/zero of=$(RAMFS)/ramrootfs bs=1k count=36864
mke2fs -F -m0 $(RAMFS)/ramrootfs
mount -o loop -t ext2 $(RAMFS)/ramrootfs $(RAMFS)/tmp
cp -av $(BUILD)/* $(RAMFS)/tmp
umount $(RAMFS)/tmp
cat $(RAMFS)/ramrootfs | gzip -9 > $(IMGTGZ)
/opt/eldk/usr/bin/mkimage -T ramdisk -C gzip -n "DexGate filesystem
image" -d $(IMGTGZ) $(RAMDSK)
rm -rf $(RAMFS)/tmp/
@echo "********************************************"
@echo "Ramdisk image now in /tftpboot/ramdisk"
@echo "********************************************"
In this way I'm able obtain a valid ramdisk image to download on my board
using ppcboot. giving the commands
bootp 0x2500000 /tftpboot/image
BOOTP broadcast 1
ARP broadcast 1
TFTP from server 10.0.0.4; our IP address is 10.0.0.20
Filename '/tftpboot/image'.
Load address: 0x2500000
Loading: #################################################################
#######################################################
done
Bytes transferred = 610742 (951b6 hex)
fec001> bootp 0x2600000 /tftpboot/ramdisk
BOOTP broadcast 1
ARP broadcast 2
TFTP from server 10.0.0.4; our IP address is 10.0.0.20
Filename '/tftpboot/ramdisk'.
Load address: 0x2600000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
done
Bytes transferred = 11645509 (b1b245 hex)
fec001> setenv bootargs root=/dev/ram rw
fec001> bootm 0x2500000 0x2600000
At this point the system boots and the kernel mounts the ram disk but at
time of rc.sysint script I have this error :
VFS: Mounted root (ext2 filesystem).
Freeing unused kernel memory: 60k init
INIT: version 2.78 booting
Mounting proc filesystem : [ OK ]
Configuring kernel parameters : [ OK ]
Setting clock : Wed Dec 31 19:00:15 EST 1969 [ OK ]
Activating swap partitions : [ OK ]
Setting hostname 10.0.0.20 : [ OK ]
Checking root filesystem
/dev/ram:
The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
[/sbin/fsck.ext2 (1) -- /] fsck.ext2 -a /dev/ram
fsck.ext2: Bad magic number in super-block while trying to open /dev/ram
[FAILED]
*** An error occurred during the file system check.
*** Dropping you to a shell; the system will reboot
*** when you leave the shell.
Give root password for maintenance
(or type Control-D for normal startup):
Notice that if I write rc.sysinit script to skip "Checking root
filesystem" I obtain the prompt but the syslogd deamon fails the startup.
>From ELDK distribution I have changed /etc/fstab file in
/dev/ram / ext2 defaults 0 0
none /proc proc defaults 0 0
and /etc/mtab file in
/dev/ram / ext2 rw 0 0
none /proc proc rw 0 0
Someone can say why fsck is not able to check ram fs and if the syslogd
problem is related to ram fs?
thanks to all,
Regards,
Alessandro.
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: ram root filesystem
@ 2003-12-03 17:52 Steven Blakeslee
0 siblings, 0 replies; 3+ messages in thread
From: Steven Blakeslee @ 2003-12-03 17:52 UTC (permalink / raw)
To: 'AlessandroPPC', linuxppc-embedded
Try the ram disk at
ftp://ftp.denx.de/pub/LinuxPPC/usr/src/SELF/images/ppc_82xx/
-----Original Message-----
From: AlessandroPPC [mailto:aleppcrossi@libero.it]
Sent: Wednesday, December 03, 2003 12:49 PM
To: linuxppc-embedded@lists.linuxppc.org
Subject: ram root filesystem
Hi to all,
I'm developing a custom application on 8260 based board. I have first used
the ELDK package version 2.0.2 with Kernel 2.4.4
and nfs root filesystem. Now I want migrate my application on the system
using ram fs instead of nfs.
To do this I have generated a ramdisk image derived from ELDK fs eliminating
superfluous packages and using a makefile with
this instructions:
@echo "********************************************"
@echo "create root files system"
@echo "********************************************"
rm -rf $(BUILD)/var/log/tegated
mkdir $(BUILD)/var/log/tegated
rm -rf $(RAMFS)/tmp/
mkdir $(RAMFS)/tmp
dd if=/dev/zero of=$(RAMFS)/ramrootfs bs=1k count=36864
mke2fs -F -m0 $(RAMFS)/ramrootfs
mount -o loop -t ext2 $(RAMFS)/ramrootfs $(RAMFS)/tmp
cp -av $(BUILD)/* $(RAMFS)/tmp
umount $(RAMFS)/tmp
cat $(RAMFS)/ramrootfs | gzip -9 > $(IMGTGZ)
/opt/eldk/usr/bin/mkimage -T ramdisk -C gzip -n "DexGate filesystem
image" -d $(IMGTGZ) $(RAMDSK)
rm -rf $(RAMFS)/tmp/
@echo "********************************************"
@echo "Ramdisk image now in /tftpboot/ramdisk"
@echo "********************************************"
In this way I'm able obtain a valid ramdisk image to download on my board
using ppcboot. giving the commands
bootp 0x2500000 /tftpboot/image
BOOTP broadcast 1
ARP broadcast 1
TFTP from server 10.0.0.4; our IP address is 10.0.0.20
Filename '/tftpboot/image'.
Load address: 0x2500000
Loading: #################################################################
#######################################################
done
Bytes transferred = 610742 (951b6 hex)
fec001> bootp 0x2600000 /tftpboot/ramdisk
BOOTP broadcast 1
ARP broadcast 2
TFTP from server 10.0.0.4; our IP address is 10.0.0.20
Filename '/tftpboot/ramdisk'.
Load address: 0x2600000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
done
Bytes transferred = 11645509 (b1b245 hex)
fec001> setenv bootargs root=/dev/ram rw
fec001> bootm 0x2500000 0x2600000
At this point the system boots and the kernel mounts the ram disk but at
time of rc.sysint script I have this error :
VFS: Mounted root (ext2 filesystem).
Freeing unused kernel memory: 60k init
INIT: version 2.78 booting
Mounting proc filesystem : [ OK ]
Configuring kernel parameters : [ OK ]
Setting clock : Wed Dec 31 19:00:15 EST 1969 [ OK ]
Activating swap partitions : [ OK ]
Setting hostname 10.0.0.20 : [ OK ]
Checking root filesystem
/dev/ram:
The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
[/sbin/fsck.ext2 (1) -- /] fsck.ext2 -a /dev/ram
fsck.ext2: Bad magic number in super-block while trying to open /dev/ram
[FAILED]
*** An error occurred during the file system check.
*** Dropping you to a shell; the system will reboot
*** when you leave the shell.
Give root password for maintenance
(or type Control-D for normal startup):
Notice that if I write rc.sysinit script to skip "Checking root
filesystem" I obtain the prompt but the syslogd deamon fails the startup.
>From ELDK distribution I have changed /etc/fstab file in
/dev/ram / ext2 defaults 0 0
none /proc proc defaults 0 0
and /etc/mtab file in
/dev/ram / ext2 rw 0 0
none /proc proc rw 0 0
Someone can say why fsck is not able to check ram fs and if the syslogd
problem is related to ram fs?
thanks to all,
Regards,
Alessandro.
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: ram root filesystem
2003-12-03 17:48 AlessandroPPC
@ 2003-12-03 18:16 ` Wolfgang Denk
0 siblings, 0 replies; 3+ messages in thread
From: Wolfgang Denk @ 2003-12-03 18:16 UTC (permalink / raw)
To: AlessandroPPC; +Cc: linuxppc-embedded
Dear Alessandro,
in message <019501c3b9c5$b339a060$0400a8c0@eurostudio.local> you wrote:
>
> To do this I have generated a ramdisk image derived from ELDK fs eliminating
> superfluous packages and using a makefile with
Question 1: why don't you use the much simpler and smaller setup
based on the SELF ramdisk example image included with the ELDK?
Please see http://www.denx.de/twiki/bin/view/DULG/HowToAddFiles
> dd if=/dev/zero of=$(RAMFS)/ramrootfs bs=1k count=36864
> mke2fs -F -m0 $(RAMFS)/ramrootfs
> mount -o loop -t ext2 $(RAMFS)/ramrootfs $(RAMFS)/tmp
Question 2: Why don't you simply use the genext2fs tool that comes
included with the ELDK? It is much simpler, and requires no root
permissions to create a ramdisk image.
> At this point the system boots and the kernel mounts the ram disk but at
> time of rc.sysint script I have this error :
...
> Notice that if I write rc.sysinit script to skip "Checking root
> filesystem" I obtain the prompt but the syslogd deamon fails the startup.
The "rc.sysint" was never meant to be used from a ramdisk based root
filesystem. If you change your configuration, you are expected to
adapt all related config files and init scripts, too.
> Someone can say why fsck is not able to check ram fs and if the syslogd
> problem is related to ram fs?
It makes no sense to run fsck on a ramdisk image which was just
unpacked. Also, IMHO it makes littlee sense to use the full-blown
SysV init style scripts in an embedded system which is running from a
ramdisk image.
Have a look at the ELF image thatis included with the ELDK, and use
this as a base.
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: wd@denx.de
When all is said and done, more is said than done.
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-12-03 18:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-03 17:52 ram root filesystem Steven Blakeslee
-- strict thread matches above, loose matches on Subject: below --
2003-12-03 17:48 AlessandroPPC
2003-12-03 18:16 ` Wolfgang Denk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox