[Toybox] pull: fix modprobe, login, switch_root, improve init, reboot

Isaac Dunham ibid.ag at gmail.com
Fri Oct 2 08:00:24 PDT 2015


On Fri, Oct 02, 2015 at 06:26:09AM -0500, Rob Landley wrote:
> On 10/01/2015 10:22 PM, Rich Felker wrote:
> > On Thu, Oct 01, 2015 at 07:34:25PM -0700, Isaac Dunham wrote:
> >> Maybe (1) try to fork(); (2) if we succeed, xexec() modprobe; (3) do the
> >> whole mknod/chmod/... bit if appropriate; (4) on completion of that,
> >> call wait().
> >> Note that a forkbomb, which could temporarily result in fork() failing,
> >> should not make the hotplugger die if it's long-running. Making module
> >> loading fail temporarily seems like it would be better.
> > 
> > This will not be nommu compatible. I think this is why Rob suggested
> > xrun.
> 
> > > Agreed. But then, wouldn't xrun() also be the wrong thing?

> > Why?



> What I really need for this is _test_cases_. Preferably ones I can
> reproduce in an automated fashion under qemu.
<snip>
> There's a lot of bits to fit together here. I'll probably need a "make
> test_image" target in toybox that does a build and creates an
> appropraite squashfs to act as the build control imamge for aboriginal
> to run the test in a known root environment. And stuff on the aboriginal
> side to build a modular kernel with some modules I can have insmod and
> modprobe try to use, and maybe doing that can trigger hotplug events for
> mdev tests...

I think to have modprobe trigger hotplug events that load more modules,
you'll need to have modular drivers for controllers and hard drives/CDs.
(Note that most distro kernels already use such a config.)

In this case, if you want to have the hard drive accessible, you will also
need to load modules on coldplug.
Typically, mdev-based scripts will either look for /sys/.../modalias
or grep for MODALIAS= in uevent.


[in the context of long running processes]
> Rich Felker wrote:
> > Isaac Dunham wrote:
> > > Agreed. But then, wouldn't xrun() also be the wrong thing?
> > Why?
If I'm not mistaken, xfork() and XVFORK() will perror_exit on failure.
This results in a fork-bomb killing a long-running hotplug helper.

Thanks,
Isaac Dunham


 1443798024.0


More information about the Toybox mailing list