FakeInit Applet

Lombard, David N dnlombar at ichips.intel.com
Tue Nov 18 21:52:50 UTC 2008


On Tue, Nov 18, 2008 at 10:21:13AM -0700, Bernhard Reutner-Fischer wrote:
> On Tue, Nov 18, 2008 at 06:08:21PM +0100, Alexander Surma wrote:
> >Hi list,
> >
> >I'm debugging my own little distribution (if you can call it that already)
> >- the initramfs to be specific.
> >My script for the creation of a initramfs uses busybox, and I want a add a
> >certain FakeInit (as I call it), which is nothing else as a mapping of the
> >init-call to the default shell, so that instead of running init you are
> >being dropped to a shell.
> 
> I don't think that you need such a thing in the first place.
> Short of booting with init=/bin/sh, just ln -s /bin/busybox /linuxrc
> Let me refer you to the web for additional information about it.

Be careful there.  I run only kernel and initrd. When /linuxrc exists,
the kernel inists on mounting a root device despite my specification of
root=/dev/ram.  In my initrd, the only pre-defined device, /dev/null,
is created via the kernel's gen_initramfs_list.sh; mdev handles the
serial console and other devices, so I have no need to build anything
as root.

I run busybox init (/init -> bin/busybox), with an /etc/inittab that
runs /etc/init.d/rcS for runtime init stuff then starts /bin/sh, i.e.,
drops directly into a shell.

The only other stuff in inittab is starting a dirt-simple ACPI daemon, 
a spec for three-finger salute, and "umount -a -r" for shutdown
rcS mounts /proc and /sys, sets /proc/sys/kernel/hotplug, and then starts
"mdev -s" before doing its task-specific initializations.

-- 
David N. Lombard, Intel, Irvine, CA
I do not speak for Intel Corporation; all comments are strictly my own.



More information about the busybox mailing list