Hi James,
To apply a static configuration using 'ip=', you need to specify the
following (as documented in the kernel Documentation/nfsroot.txt file)....
ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>
...any missing items must be replaced with 'blanks'. To turn off
autoconf (the DHCP request) whilst setting the interface up statically,
you need a command like the following..
(Assume target is 10.0.0.100, server is 10.0.0.1, netmask is 255.0.0.0
and gateway is 10.0.0.254)
ip=10.0.0.100:10.0.0.1:10.0.0.254:255.0.0.0:::off
The above is not setting 'hostname' or 'device' - the 'blanks' cause the
three ':' chars between the 'netmask' and 'autoconf' value.
If you miss the 'off' or get it in the wrong place...you will get a
delay whilst the kernel does the DHCP. You can specify 'ip=off' which
prevents the DHCP request and does not configure the interface at all.
You would normally do this if not using NFS root filesystem since this
kernel DHCP is not managed via a 'proper' client. It is a waste of time
for the kernel to DHCP an address and then a DHCP client running as a
system service doing the same thing later. In the case of a root
filesystem over NFS, the interface must be configured for it to work at
all (which is kind of obvious when you think about it).
For your second point, if you unpack the 'ramdisk.gz' you have
effectively got a small root filesystem. These typically use 'busybox'
to provide a large number of system commands (cut down versions) in a
single binary. This is one of the few examples where the program makes
use of the 'argv[0]' value. Basically symbolic links are set up to point
to the busybox binary, for example 'ls' may be a symbolic link to
/bin/busybox. When the user types 'ls', /bin/busybox is executed and by
checking argv[0] it knows it was called as 'ls' and jumps internally to
the code to handle this. You can also type '/bin/busybox -c ls' (or
something like that) which is the same.
The busybox package is one of the prebuilt packages installed in the
LSP. If you have a licensed MV Pro you can also get the source RPM
package so you can build a custom busybox that would be the same apart
from your changes to its configuration. You can always download busybox
for yourself and build it from scratch - the RPM has sorted out the
cross compilation for you though and it fits in with other system packages.
Regards
Phil Q
James T Long wrote:
Good morning, all.
Thanks, Josh and Phil for your replies. Turns out that when I was
given the Linux PC a few months ago, several things were not properly
installed. There wasn't a ramdisk in my directory structure, but when
I went back and searched for it (amazing what you can find when you
know to look for them!), I found a ramdisk.gz file. I'm now booting
the linux kernel. YAYAY.
A couple of things, as a follow-on.
Josh,
I didn't want to remove the DHCP from the compilation, totally,
because when I'm troubleshooting boards in the lab, I will want it,
and I didn't want to change the compiler, just the environment vars.
I got the bootarg setting (to disable the DHCP) directly from an
e-mail from my Texas Instruments contact. It works, but I think there
is still a minor syntax error. If you can remember about the command
line args, please let me know. Thanks.
Phil,
I knew when I was typing it, that gzip followed by zip wasn't needed,
but I was doing a cut&paste from a wiki page. I'm guessing, but it
appears to be there mostly as a logic break, so that you can make
mulitple rep's of the unzip-mount-mkdir-unmount-zip, as needed in the
future. Anyway, real follow-up question is: If for whatever reason I
want to do the whole "build ramdisk" in the future, what files do I
need to add? The same wiki page that said "Create whatever
directories you want" also made a reference to 'busybox' (but not
being a unix/linus type, I've never used it). Would that be
sufficient? It's not on my Linux PC, so I would assume from the Net?
Hidden on one of the DVEVM install disks?
Again, thank you both for you help. Major progress in a single
afternoon!!!
Regards,
James Long
When I wanted to remove the very long time delay from DHCP (because
I’m using a static IP address) I only removed DHCP from the kernel
compilation and not the entire Ethernet. There is also a way I’ve seen
mentioned on this list on how to not have it check DHCP from the
command line arguments to the kernel but I have forgotten it.
I know that doesn’t answer your question at hand but it’s something
you can try later.
Josh
*Phil Quiney <[email protected]>*
12/18/2008 12:52 PM
To
James T Long <[email protected]>
cc
[email protected]
Subject
Re: Trying to boot with a RAMDISK
Hi
This step was pretty pointless...
host > dd if=/dev/ram0 bs=1k count=8192 | gzip -v9 > ramdisk.gz
the next thing you do is unpack it again.
host > gunzip ramdisk.gz
host > mount -o loop ramdisk mnt/
host > mkdir mnt/usr ; mkdir mnt/home ; mkdir mnt/home/jlong ;
mkdir mnt/dev ; mkdir mnt/etc
host > umount mnt
You have no root filesystem merely usr home dev & etc directories. How
exactly is the system supposed to boot as there are no executables! Can
you try the ramdisk image that ships with the LSP. I forget exactly
where it is located.
Did you make sure the kernel understands ext2? Can you boot your kernel
& check by looking for ext2 in the /proc/filesystems file.
Regards
Phil Q
James T Long wrote:
>
>
> Morning all,
>
> I am having trouble getting Linux (MonteVista 2.6.10) to boot. It's
> failing to create a file-system.
> My target board is a stand-alone DaVinci 6446, with only RS-232,
> NAND-Flash, DDR-2 and Ethernet.
> I can get Ethernet running while in U-Boot so I can load the kernel,
> but Ethernet won't work
> while Linux is trying to boot. (I had to disable the ethernet in
> Linux, because DHCP would
> timeout and fail.)
>
> I'm trying to create a RAMDISK, but Linux is rejecting it. See end of
> page for the error message.
> Please help on what I'm doing wrong. If there is a better strategy,
> please let me know.
>
> Thank you for your help.
> James Long
>
>
> I've done the following, based mostly on Wiki pages.
>
> On my Linux PC, I modified menuconfig, like so, and then did a clean
> build:
>
> CONFIG_MTD=y
> CONFIG_MTD_PARTITIONS=y
>
> CONFIG_MTD_CHAR=y
> CONFIG_MTD_BLKDEVS=y
> CONFIG_MTD_BLOCK=y
>
> CONFIG_MTD_NAND=y
> CONFIG_MTD_NAND_VERIFY_WRITE=y
> CONFIG_MTD_NAND_IDS=y
> CONFIG_MTD_NAND_DAVINCI=y
>
> CONFIG_YAFFS_FS=y
> CONFIG_YAFFS_YAFFS1=y
> CONFIG_YAFFS_YAFFS2=y
> CONFIG_YAFFS_AUTO_YAFFS2=y
> CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
>
> On my Linux PC, logged in as superuser, I created a 8Meg RAMDISK, like
> so:
>
> host > cd /tftpboot
> host > dd if=/dev/zero of=/dev/ram0 bs=1k count=8192
> host > mke2fs -vm0 /dev/ram0 8192
> host > tune2fs -c 0 /dev/ram0
> host > dd if=/dev/ram0 bs=1k count=8192 | gzip -v9 > ramdisk.gz
> host > mkdir mnt
> host > gunzip ramdisk.gz
> host > mount -o loop ramdisk mnt/
> host > mkdir mnt/usr ; mkdir mnt/home ; mkdir mnt/home/jlong ;
> mkdir mnt/dev ; mkdir mnt/etc
> host > umount mnt
> host > gzip -v9 ramdisk
>
> Then, from U-Boot, I load and burn the kernel and ramdisk.gz.
>
> UBOOT # dhcp 0x80700000 192.186.0.100:/tftpboot/uImage
> UBOOT # nand erase 0x100000 0x150000
> UBOOT # nand write 0x80700000 0x100000 0x150000
>
> UBOOT # tftp 0x87000000 ramdisk.gz
> UBOOT # nand erase 0x280000 0x20000
> UBOOT # nand write 0x87000000 0x280000 0x20000
>
> UBOOT # setenv bootcmd 'nand read 0x87000000 0x280000 0x20000;
> nboot 80700000 0 100000; bootm'
> UBOOT # setenv bootargs console=ttyS0,115200n8 root=/dev/ram0 rw
> initrd=0x87000000,8M
>
ip=192.168.0.103:255.255.255.0:192.168.0.1:192.168.0.1:192.168.0.100:off
> mem=120M
> UBOOT # saveenv
>
> When I power-cycle, I get the following (On the second line, I added a
> printf of the two magic numbers being compared):
>
> RAMDISK: Compressed image found at block 0
> EXT3-fs: Magic mismatch, very weird ! <00000000 0000ef53>
> yaffs: dev is 1048576 name is "ram0"
> yaffs: Attempting MTD mount on 1.0, "ram0"
> yaffs: dev is 1048576 name is "ram0"
> yaffs: Attempting MTD mount on 1.0, "ram0"
> Kernel panic - not syncing: VFS: Unable to mount root fs on
> unknown-block(1,0)
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Davinci-linux-open-source mailing list
>[email protected]
>http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
>
>
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source