From: Daniel Janzon <dj@hu...> - 2008-02-27 15:08:46
I enabled initramfs under General Setup in the kernel configuration. I
pointed the initramfs source to a cpio archive containing a simple init
int main(int argc, char *argv)
When I run the linux executable, the "Hello world!" is never printed. I
checked with gdb that most of the functions in init/initramfs.c are
called, but I did not succeed to track the execution to the point where
init in the ramfs is called.
Are there any known issues with initramfs and UML?
From: Jeff Dike <jdike@ad...> - 2008-03-07 18:04:28
On Wed, Feb 27, 2008 at 04:08:27PM +0100, Daniel Janzon wrote:
> When I run the linux executable, the "Hello world!" is never printed. I
> checked with gdb that most of the functions in init/initramfs.c are
> called, but I did not succeed to track the execution to the point where
> init in the ramfs is called.
> Are there any known issues with initramfs and UML?
Not that I know of. I played with this a bit, and I think the reason
there's no output is that the kernel isn't finding a /dev/console.
Here's what I found out (much of which you probably already know):
You need to run cpio -c
init needs to be /init, and statically linked
You need /dev/console (although I made one) and I still get "Warning:
unable to open an initial console."
My cpio directory looks like this:
$ ls -Rl .
drwxrwxr-x 2 jdike jdike 4096 2008-03-07 12:49 dev
-rwxrwxr-x 1 jdike jdike 537826 2008-03-07 12:58 init
crw-r--r-- 1 root root 5, 1 2008-03-07 12:49 console
I removed the sleep from your init, and the thing seemed to exit, as
UML paniced with "Attempted to kill init!", so I think it ran.
There's just going to be no output until you figure out how to give a
Work email - jdike at linux dot intel dot com