Re: /sbin/init
- From: phil-news-nospam@xxxxxxxx
- Date: 23 Nov 2006 01:01:46 GMT
On Wed, 22 Nov 2006 12:30:28 +0100 Pascal Bourguignon <pjb@xxxxxxxxxxxxxxxxx> wrote:
| Perianayagam Somasundaram <somu@xxxxxxxxxxxxxx> writes:
|> Does anybody have an idea how to make /sbin/init print out
|> debug messages?
|
| /sbin/init has no bug.
|
| Otherwise, /sbin/init is run from the kernel, and without a terminal
| (perhaps it's stdout and stderr are hooked to the console?).
|
| From within the sources of init, you could open a file and dup it to
| the stdout and stderr to write messages to this file, or to the
| console if it is not already done. But the question is what file?
| When init is run, no file system has been mounted yet (but of course
| the root file system where /sbin/init is, but it may be mounted
| read-only). And no service, like syslog is running yet either.
|
| Otherwise you'll have to modify the kernel.
It might be possible to use the "qemu" emulator in per-process emulation
mode to run the init program, and turn on debugging. Unlike strace,
which would run the target program in another process (and it wouldn't
be process ID 1 as needed), what qemu does is emulate within the same
process. In the per-process emulation, it just runs a program instead
of a whole system, so all the kernel syscalls would have to go to the
real host system from the emulator. If it's running in PID 1, it _may_
work. I've never tried this. I never even thought of it before I just
saw this thread. But it has piqued my interest. Maybe I'll give it a
try later on.
--
|---------------------------------------/----------------------------------|
| Phil Howard KA9WGN (ka9wgn.ham.org) / Do not send to the address below |
| first name lower case at ipal.net / spamtrap-2006-11-22-1856@xxxxxxxx |
|------------------------------------/-------------------------------------|
.
- References:
- /sbin/init
- From: Perianayagam Somasundaram
- Re: /sbin/init
- From: Pascal Bourguignon
- /sbin/init
- Prev by Date: Dumb USB serial driver?
- Next by Date: How to use USB mouse?
- Previous by thread: Re: /sbin/init
- Next by thread: Dumb USB serial driver?
- Index(es):
Relevant Pages
|
|