On Fri Feb 15, 2002 at 11:52:47AM +0100, Stephan Linz wrote: > Hi Folks, > > since the last two days I've tried to make a so named "change_root" mechanism > with support of kernels sysctrl (/proc/sys/kernel/real-root-dev) inside of a > minimal initrd image. I use kernel 2.2.19 so I can't use the newer > "pivot_root" mechanism. In kernel documentation initrd.txt says I have to > write the major-minor code of the new root FS into the virtuell file > /proc/sys/kernel/real-root-dev, but nothing is going on. Here my boot > strategy (all things at x86 plattform): > > BIOS boots from first master IDE device (LILO). LILO loads kernel and initrd > image. Kernel mounts initrd image as first root FS in ramdisk(/dev/ram0); in > lilo.conf is standing: append="root=/dev/ram init=/linuxrc rw". Initrd image
Lose the root=/dev/ram init=/linuxrc stuff. The initrd will do what you want without that... > covers a small busybox, /linuxrc is a shellscript and has to mount /dev/hda1, > extract the real root FS from a tarball to /dev/ram1, unmount /dev/hda1 and > mount /dev/ram1 as new root FS. So at the end of /linuxrc I write: > > mount -t proc /proc /proc > echo 0x101 >/proc/sys/kernel/real-root-dev > exec /sbin/init Drop the mount /proc and the exec. Just leave the echo, and let the /linuxrc script exit, at which point the kernel will mount /dev/ram1 as root, remount your initrd as /initrd in your new root (if you have that directory), and exec /sbin/init on /dev/ram1 (which is now your root device) -Erik -- Erik B. Andersen http://codepoet-consulting.com/ --This message was written using 73% post-consumer electrons-- -- To unsubscribe from this list, send a message to [EMAIL PROTECTED] with the command "unsubscribe linux-embedded" in the message body. For more information, see <http://waste.org/mail/linux-embedded>.