Re: Broken Initial RAM Disk support

From: Richard B. Johnson (root@chaos.analogic.com)
Date: Fri Jan 14 2000 - 15:05:20 EST


On Fri, 14 Jan 2000, Mr. James W. Laferriere wrote:

>
> Hello Richard,
>
> On Thu, 13 Jan 2000, Richard B. Johnson wrote:
> > I finally got my main machine back up after Linux-2.3.39 trashed
> > all file-systems as previously reported.
> >
> > The last 3 kernels have problems with initial ramdisk support. I
> > read that those who are capable of testing this sort of thing do
> > not want to go through all the trouble of creating an initial
> > ram-disk for testing.
> >
> > The following script will make an initial ramdisk to boot from
> > a floppy "/dev/fd0". It does not touch your hard disk nor in any
> > way mess up your present configuration.
> >
> > If this was called "make_ramdisk", you would put a floppy into the first
> > drive and execute `make_ramdisk 2.3.39`
> > |_________ Kernel version number.
> >
> > This script presumes that you have initial ramdisk support compiled into
> > your kernel and that the loop device is either installed as a module, or
> > otherwise working. It also presumes that the kernel you want to use
> > is /usr/src/linux-VERSION/arch/i386/boot/bzImage, where you enter
> > the version number. Additionally, it presumes that your /boot/boot.b
> > exists.
> >
> > Once a boot-floppy is created, reboot from the floppy. Once initial
> > ramdisk support is again working, it will print a moving message on
> > the screen. If it doesn't work (currently), you will see the panic
> > and resulting crash. I don't presently have any way of capturing
> > this crash data.
> ... snip ...
> > # Set some compatibility links.
> > #
> > ln -s /dev/tty0 ${RAMDISK}/dev/systty
> > ln -s /dev/tty0 ${RAMDISK}/dev/console
> > ln -s /dev/ram1 ${RAMDISK}/dev/ram
> > ln -s /lib ${RAMDISK}/usr/lib
> > ln -s /lib ${RAMDISK}/usr/local/lib
> > #
> ... snip ...
> Are you sure of these links ? I didn't see a chroot above
> to change the location of / to the ${RAMDISK} . JimL
>

Absolutely. The initial ramdisk is mounted as '/'. There is no
'change_root()' nor any attempted access to any other device.

When root is '/'. The symbolic links refer to _that_ root, not
any other. No other is known. You certainly don't want them
to refer to a non-existant mount-point that existed only when
the ramdisk was created.

Note that the usual ramdisk executes 'ash', a very small shell, which
executes an initrd script to load modules, etc. Then a change-root
is executed and the real /sbin/init on the final root mount-point
is started.

In this test ram-disk, I stay with the initial ram-disk and never
change roots. Instead, I execute a small statically-linked program
that I call /sbin/init. It writes a moving message to the screen.

If you got this far, it works. If you get a NULL-pointer crash
when the ram-disk is being uncompressed, you have the current
behavior of the last three versions.

This method of staying with a ram-disk is also how myself and others
make embeded systems that don't have any real disks. In this case,
'init' is the first application program. It can execute other
programs, etc., but it must never call exit() or "return".

Cheers,
Dick Johnson

Penguin : Linux version 2.3.36 on an i686 machine (800.63 BogoMips).

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Jan 15 2000 - 21:00:25 EST