Rachita Kothiyal
2005-Apr-06 03:49 UTC
[klibc] Query on Initramfs' and Initrd's coexistence
Hi I am trying to have a built in initramfs along with the traditional initrd. So I mount the initrd from the initramfs, but am facing problems in trying to run the 'linuxrc'. Following are the issues: 1. I mount the initrd from the initramfs and exceve 'linuxrc'. It starts executing linuxrc, but gives the following errors and panics: Red hat nash version 3.4.42 starting Loading jbd.o modules insmod: QM_MODULES ERROR: /bin/insmod exited abnormally! Loading ext3.o module insmod: QM_MODULES: ERROR: /bin/insmod exited abnormally! Mounting /proc filesystem Creating block devices failed to create /dev/hda failed to create /dev/hda1 failed to create /dev/hda2 Creating root device mkrootdev: mknod failed: 30 Mounting root filesystem mount: error 2 mounting ext3 pivotroot: pivot_root(/sysroot,/sysroot/initrd) failed: 2 umount /initrd/proc failed: 2 Kernel panic - not syscing: Attempted to kill init! 2. This issue is irrespective of issue 1. I was wondering how I would be spawning the real init after the real_root_dev has been mounted.... In the normal booting case(i.e. without initramfs) prepare_namespace() returns and /sbin/init is executed in init/main.c:init(). But, in the initramfs case, since prepare_namespace is not called, this needs to be done in my init application on initramfs. Klibc does not support threads. Am i right here? So when I 'exec' linuxrc after mounting initrd, it will never return to the calling function, and all that linuxrc does is to pivot_root to the real_root_dev. How do I execute the real init in this case? Please tell me if I am missing something. Thanks Rachita.
On Wed Apr 6 03:46:28 PDT 2005 Rachita Kothiyal wrote:> 2. This issue is irrespective of issue 1. I was wondering how I would > be > spawning the real init after the real_root_dev has been mounted.... > In the normal booting case(i.e. without initramfs) prepare_namespace() > returns and /sbin/init is executed > in init/main.c:init(). But, in the initramfs case, since > prepare_namespace > is not called, this needs to be done in my init application on > initramfs. > Klibc does not support threads. Am i right here? So when I 'exec' > linuxrc > after mounting initrd, it will never return to the calling function, > and > all that linuxrc does is to pivot_root to the real_root_dev. How do I > execute the real init in this case? > > > Please tell me if I am missing something.If you look closer you will notice that do_linuxrc is run in a seperate process. You should fork before execing linuxrc. milton
Rachita Kothiyal wrote:> > I am trying to have a built in initramfs along with the traditional initrd. > So I mount the initrd from the initramfs, but am facing problems in trying > to run the 'linuxrc'. >Are you trying to support an arbitrary initrd, or a particular one? Supporting an arbitrary initrd requires duplicating all the conditions under which a legacy initrd is run. -hpa
Rachita Kothiyal
2005-Apr-06 23:33 UTC
[klibc] Query on Initramfs' and Initrd's coexistence
> Are you trying to support an arbitrary initrd, or a particular one? > Supporting an arbitrary initrd requires duplicating all the conditions > under which a legacy initrd is run.I am using initrd-2.4.20-18.9, which was being used by the default kernel(2.4) on the RedHat installation on my machine. I am right now working on 2.6.11-rc2 kernel. Is this version mismatch a problem? I fail to understand why the linuxrc is erroring..What all does it expect at this stage? I want to make sure that I have them all included... Thanks Rachita.
Rachita Kothiyal
2005-Apr-12 23:29 UTC
[klibc] Query on Initramfs' and Initrd's coexistence
Hi Has anyone tried hands on getting initramfs working along with the traditional initrd(for loading modules etc.) ? I was trying to, but get stuck towards the end of linuxrc, where it is mounting the real root device.. It works fine if I use the real_root_dev(hard coded) instead of /dev/root in the following line in linuxrc:>>>mount -o defaults --ro -t ext3 /dev/root /sysrootBut with using /dev/root in the above, I get the following error: "mount: error 6 mounting ext3" I suppose it is unable to resolve /dev/root as the real_root_dev..Any help on this would be great.. Thanks in advance Rachita