ts-7000
[Top] [All Lists]

[ts-7000] TS-7800: increasing size of ramdisk for initrd

To:
Subject: [ts-7000] TS-7800: increasing size of ramdisk for initrd
From: "Theodore A. Roth" <>
Date: Mon, 14 Jul 2008 12:04:22 -0700
I have been trying unsuccessfully to create an initrd on a 2-GB sd
card that is larger than 4-MB.

First off I setup the partition table on the sd card using fdisk (on
Ubuntu Linux) to look like this:

Disk /dev/mmcblk0: 2032 MB, 2032664576 bytes
4 heads, 16 sectors/track, 62032 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Disk identifier: 0x00000000

        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1               5        1028       32768   83  Linux
/dev/mmcblk0p2            1029        1540       16384   da  Non-FS data
/dev/mmcblk0p3            1541        2052       16384   da  Non-FS data
/dev/mmcblk0p4            2053       62032     1919360   83  Linux

I built a kernel from the linux-2.6.21-ts source and changed the
config to have a 16-MB ramdisk and modified the command line options:

CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_COUNT=1
CONFIG_BLK_DEV_RAM_SIZE=16384
CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024

CONFIG_CMDLINE="root=/dev/ram0 rw lpj=1662976 init=/linuxrc
console=ttyS0,115200n8 debug"

My kernel boots fine when installed into the 2nd partition and when I
have installed the initrd-busybox-rootfs-jun102008.dd file (downloaded
directly from TS ftp site) into partition 3. Both files are installed
using the dd utility.

Life is good up to this point.

Now I have created multiple new initrd files as such (all done as root):

======= begin  mk-initrd.sh ========
#!/bin/bash

set -e

## This one fails to run /linuxrc
#IMG="initrd-16MB.dd"
#CNT=16384

## This one works fine. [Same filesystem size as origin TS initrd file.]
#IMG="initrd-1.5MB.dd"
#CNT=1536

## This one works fine.
IMG="initrd-4MB.dd"
CNT=4096

dd if=/dev/zero of=${IMG} bs=1024 count=${CNT}
mkfs.ext2 ${IMG}
mkdir -p ts
mount -o loop initrd-busybox-rootfs-jun102008.dd ts
mkdir -p my
mount -o loop ${IMG} my
tar -C ts -cf - . | tar -C my -xf -
umount my
umount ts

echo "Now do this: dd if=${IMG} of=/dev/mmcblk0p3"
=========== end mk-initrd.sh ============

So:

* I can create a initrd image the same size as the one from TS and it
boots fine (runs /linuxrc)
* I can create a 4-MB image and it boots file.
* Any image over 4-MB fails to find the /linuxrc file, producing this
error message on the console:

... [bunch of kernel output removed]
RAMDISK: ext2 filesystem found at block 0
RAMDISK: Loading 16384KiB [1 disk] into ram disk... done.
VFS: Mounted root (ext2 filesystem).
Freeing init memory: 104K
Warning: unable to open an initial console.
Failed to execute /linuxrc.  Attempting defaults...
Kernel panic - not syncing: No init found.  Try passing init= option to kernel.

This leads me to suspect that the bootload from TS is possibly hard
coded to only load the first 4-MB from partition 3 of the SD card into
the ramdisk before starting the kernel.

So, now for my questions:

* Is my suspicion true?
* Is there a way to tell the bootloader the size of the image to load
into the ramdisk?
* Why doesn't the bootloader read the partition table and just copy
the entire partition in to the ramdisk?
* Is it even possible to use an initrd that is more than 4-MB?

Thanks.

Ted Roth

------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU