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

Isaac Dunham ibid.ag at gmail.com
Sat Aug 8 22:24:43 PDT 2015


On Sat, Aug 08, 2015 at 05:44:07PM -0500, Rob Landley wrote:
> On 08/06/2015 12:04 AM, Isaac Dunham wrote:
> > On Wed, Aug 05, 2015 at 08:03:01PM -0700, Isaac Dunham wrote:
> >> The following changes since commit ea75e752f930df7b740a773294b997f46927c716:
> >>
> >>   Factor out xconnect(), plus some other small cleanups to telnet.c. (2015-08-03 14:34:01 -0500)
> >>
> >> are available in the git repository at:
> >>
> >>   git://github.com/idunham/toybox up
> >>
> >> for you to fetch changes up to 991b570a02ce8754bba921e46d953858ed28268c:
> >>
> >>   Increase compatability of reboot and init (2015-08-05 18:04:34 -0700)
> 
> Ooh, "git export-patch first..last" followed by "git am path/0001*" and
> so on works quite nicely for pull series.
> 
> What's up with 0005? Adding two headers to mkflags.c: I applied it but
> dunno what build context requires it?

Shuts up some warnings about implicit definitions on Alpine Linux
(musl-based).


> > I guess this commit was a crossed wire. Everything before that should be fine.
> 
> I removed the second (wrong) SIGINT handler, applied the rest of the series.
> 
> And _then_ I figured out I need to have the start by _before_ the first
> patch (start^1) because it doesn't include the starting endpoint in the
> range for no readily apparently reason. (Git!)

I think the point was so that you could use a reference to a previous
known state; my standard approach for preparing patch series is:
 git export-patch master..HEAD 
(or master..<branch>).

> So, applied out of order, but I think they're all there now.
> 
> > For what it's worth, I just set up a small toybox+pdksh system where
> > toybox had these patches and one other (making mdev autoload modules);
> > it can now boot to a working system with only pdksh and toybox for
> > initrd and userland.
> 
> Cool. :)

Well, at least I have a "working system" in the sense of "I can login via
getty and run commands".
There's no editor, and I haven't tested cron{d,tab} or syslogd/klogd.

> > If hard-coding "modprobe -bq $MODALIAS" int mdev is desireable, I can send
> > that; but I suspect it's not quite fit for inclusion.
> 
> I'd be interested in seeing the patch.

Attached!

Thanks,
Isaac Dunham

-------------- next part --------------
>From 0acde7ff07603e7b485bc19ec4a49b3010c49966 Mon Sep 17 00:00:00 2001
From: Isaac Dunham <ibid.ag at gmail.com>
Date: Mon, 3 Aug 2015 13:28:36 -0700
Subject: [PATCH] mdev: autoload modules on hotplug.

---
 toys/pending/mdev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/toys/pending/mdev.c b/toys/pending/mdev.c
index a13a53d..b273d4a 100644
--- a/toys/pending/mdev.c
+++ b/toys/pending/mdev.c
@@ -58,6 +58,8 @@ static void make_device(char *path)
   } else {
     // if (!path), do hotplug
 
+    if ((temp = getenv("MODALIAS")))
+      xexec((char *[]){"modprobe", temp, 0});
     if (!(temp = getenv("SUBSYSTEM")))
       return;
     type = strcmp(temp, "block") ? S_IFCHR : S_IFBLK;
-- 
2.5.0



More information about the Toybox mailing list