initrd

2 messages, 2 authors, 2000-02-04 · open the first message on its own page

initrd

From: <hidden>
Date: 2000-02-03 15:18:33

Hi


I now try to add an initrd in order to generate a standalone system.

I encounter the following problem:

--------

If I generate a ramdisk.image.gz myself according to the initrd.txt kernel documentation

<
We'll describe the RAM disk method:

 1) make sure you have a RAM disk device /dev/ram (block, major 1, minor
0)
 2) create an empty file system of the appropriate size, e.g.
    # mke2fs -m0 /dev/ram 300
    (if space is critical, you may want to use the Minix FS instead of
Ext2)
 3) mount the file system on an appropriate directory, e.g.
    # mount -t ext2 /dev/ram /mnt
 5) copy all the files that are needed to properly use the initrd
    environment. Don't forget the most important file, /linuxrc
    Note that /linuxrc's permissions must include "x" (execute).
 6) unmount the RAM disk
    # umount /dev/ram
 7) copy the image to a file
    # dd if=/dev/ram bs=1k count=300 of=/boot/initrd
 8) deallocate the RAM disk
    # freeramdisk /dev/ram
<

.. then the kernel doesn't start.

entry 0x100000, phoff 0x34, shoff 0xf2864
phnum 0x1, shnum 0xa
p_offset 0x10000, p_vaddr 0x100000, p_paddr 0x100000
p_filesz 0x532c, p_memsz 0xb1bc
Loading at 0x10c000
Starting 0x11c000
loaded at:     0011C000 001271BC
relocated to:  00100000 0010B1BC
board data at: 00FF0000 00FF001C
relocated to:  00200100 0020011C
zimage at:     00122000 00182FEC
initrd at:     00182FEC 001FE822
avail ram:     001FF000 01000000

Linux/PPC load:
Uncompressing Linux...done.
Now booting the kernel
<hang hang hang..... forever>

--------

If I take a prebuilt ramdisk.image.gz then the kernel
starts up and crashes with the following output:

.....
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP, IGMP
TCP: Hash tables configured (ehash 16384 bhash 16384)
Starting kswapd v 1.5
CPM UART driver version 0.02
ttyS00 at 0x0280 is a SMC
ttyS01 at 0x0100 is a SCC
ttyS02 at 0x0200 is a SCC
RAM disk driver initialized:  16 RAM disks of 4096K size
eth0: CPM ENET Version 0.2, 08:00:3e:26:15:59
Sending BOOTP and RARP requests.... OK
IP-Config: Got BOOTP answer from 10.1.20.2, my address is 10.1.20.1
RAMDISK: Compressed image found at block 0
crc errorEXT2-fs warning: checktime reached, running e2fsck is recommended
VFS: Mounted root (ext2 filesystem).
attempt to access beyond end of device
01:00: rw=0, want=127205377, limit=4096
dev 01:00 blksize=1024 blocknr=127205376 sector=254410752 size=1024 count=1
attempt to access beyond end of device
01:00: rw=0, want=127270913, limit=4096
dev 01:00 blksize=1024 blocknr=127270912 sector=254541824 size=1024 count=1
attempt to access beyond end of device
01:00: rw=0, want=127336449, limit=4096
dev 01:00 blksize=1024 blocknr=127336448 sector=254672896 size=1024 count=1
attempt to access beyond end of device
01:00: rw=0, want=127401985, limit=4096
dev 01:00 blksize=1024 blocknr=127401984 sector=254803968 size=1024 count=1
attempt to access beyond end of device
01:00: rw=0, want=127467521, limit=4096
dev 01:00 blksize=1024 blocknr=127467520 sector=254935040 size=1024 count=1
attempt to access beyond end of device
01:00: rw=0, want=127533057, limit=4096
dev 01:00 blksize=1024 blocknr=127533056 sector=255066112 size=1024 count=1
attempt to access beyond end of device
01:00: rw=0, want=127598593, limit=4096
dev 01:00 blksize=1024 blocknr=127598592 sector=255197184 size=1024 count=1
attempt to access beyond end of device
01:00: rw=0, want=127664129, limit=4096
dev 01:00 blksize=1024 blocknr=127664128 sector=255328256 size=1024 count=1
attempt to access beyond end of device
01:00: rw=0, want=127729665, limit=4096
dev 01:00 blksize=1024 blocknr=127729664 sector=255459328 size=1024 count=1
attempt to access beyond end of device
01:00: rw=0, want=127795201, limit=4096
dev 01:00 blksize=1024 blocknr=127795200 sector=255590400 size=1024 count=1
attempt to access beyond end of device
01:00: rw=0, want=127860737, limit=4096
dev 01:00 blksize=1024 blocknr=127860736 sector=255721472 size=1024 count=1
attempt to access beyond end of device
01:00: rw=0, want=127926273, limit=4096
dev 01:00 blksize=1024 blocknr=127926272 sector=255852544 size=1024 count=1
init: error in loading shared libraries
libtermcap.so.2: invalid ELF header



Any ideas?

TIA
\Ruedi






Re: initrd

From: Dan Malek <hidden>
Date: 2000-02-04 06:41:11

Ruedi.Hofer@ascom.ch wrote:

 2) create an empty file system of the appropriate size, e.g.
    # mke2fs -m0 /dev/ram 300
From experience, I know a 300 block size ramdisk can't possibly
hold enough files to get a system started.  You need at least
2 Meg (2048), and I build at least 4000 block ramdisks.  Make
sure you get all of the minimal shared libraries in there.....

 7) copy the image to a file
    # dd if=/dev/ram bs=1k count=300 of=/boot/initrd
 8) deallocate the RAM disk
    # freeramdisk /dev/ram

....I am assuming you gzip'ped the ramdisk......

entry 0x100000, phoff 0x34, shoff 0xf2864
phnum 0x1, shnum 0xa
p_offset 0x10000, p_vaddr 0x100000, p_paddr 0x100000
p_filesz 0x532c, p_memsz 0xb1bc

Oh oh....you are using a FADS board or something custom......

If I take a prebuilt ramdisk.image.gz then the kernel
starts up and crashes with the following output:
RAMDISK: Compressed image found at block 0
crc error
Ummm....doesn't this mean something to you?  When something is
uncompressed and you get a CRC error, the file is usually
truncated or corrputed.....

Since it appears this is a board that isn't known to be able
to download something properly that is this large, you should
probably verify the download with some kind of standard test
pattern and test software.


	-- Dan

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help