about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2020-12-24 14:05:47 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2020-12-24 14:05:47 +0000
commitaab9231aeeec1f18b89163e06fe16c3718c2abba (patch)
treeb0df80a5b7e0eae9acbecd78c0b7fa35f9200518
parentf982dc64bfa4c6c42652f30af4d1389ca8fbc3e9 (diff)
downloadmdevd-aab9231aeeec1f18b89163e06fe16c3718c2abba.tar.gz
mdevd-aab9231aeeec1f18b89163e06fe16c3718c2abba.tar.xz
mdevd-aab9231aeeec1f18b89163e06fe16c3718c2abba.zip
Prepare for 0.1.3.0; add -C option for autocoldplug
-rw-r--r--INSTALL2
-rw-r--r--NEWS7
-rw-r--r--doc/index.html4
-rw-r--r--doc/mdevd.html13
-rw-r--r--doc/upgrade.html10
-rw-r--r--examples/s6-rc/mdevd-coldplug/dependencies1
-rw-r--r--examples/s6-rc/mdevd-coldplug/type1
-rw-r--r--examples/s6-rc/mdevd-coldplug/up1
-rw-r--r--package/deps.mak2
-rw-r--r--package/info2
-rw-r--r--src/mdevd/mdevd.c16
11 files changed, 51 insertions, 8 deletions
diff --git a/INSTALL b/INSTALL
index fd81250..74a5355 100644
--- a/INSTALL
+++ b/INSTALL
@@ -6,7 +6,7 @@ Build Instructions
 
   - A Linux-based system with a standard C development environment
   - GNU make version 3.81 or later
-  - skalibs version 2.9.3.0 or later: http://skarnet.org/software/skalibs/
+  - skalibs version 2.10.0.0 or later: http://skarnet.org/software/skalibs/
 
  This software is Linux-specific. It will run on a Linux kernel,
 version 2.6.10 or later.
diff --git a/NEWS b/NEWS
index 92add91..4954108 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,12 @@
 Changelog for mdevd.
 
+In 0.1.3.0
+----------
+
+ - Bugfixes.
+ - New -C option for mdevd to trigger a coldplug when ready.
+
+
 In 0.1.2.0
 ----------
 
diff --git a/doc/index.html b/doc/index.html
index 594196b..0f03ac9 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -98,7 +98,7 @@ and does not pull in any unnecessary code. </li>
 The Linux kernel must be 2.6.10 or later. </li>
  <li> GNU make, version 3.81 or later </li>
  <li> <a href="//skarnet.org/software/skalibs/">skalibs</a> version
-2.9.3.0 or later. It's a build-time requirement. It's also a run-time
+2.10.0.0 or later. It's a build-time requirement. It's also a run-time
 requirement if you link against the shared version of the skalibs
 library. </li>
 </ul>
@@ -114,7 +114,7 @@ library. </li>
 
 <ul>
  <li> The current released version of mdevd is
-<a href="mdevd-0.1.2.0.tar.gz">0.1.2.0</a>. </li>
+<a href="mdevd-0.1.3.0.tar.gz">0.1.3.0</a>. </li>
  <li> Alternatively, you can checkout a copy of the
 <a href="//git.skarnet.org/cgi-bin/cgit.cgi/mdevd/">mdevd
 git repository</a>:
diff --git a/doc/mdevd.html b/doc/mdevd.html
index 2ef2dfb..3412253 100644
--- a/doc/mdevd.html
+++ b/doc/mdevd.html
@@ -49,7 +49,7 @@ to running mdevd over mdev. </li>
 <h2> Interface </h2>
 
 <pre>
-     mdevd [ -v <em>verbosity</em> ] [ -D <em>notif</em> ] [ -o <em>outputfd</em> ] [ -b <em>kbufsz</em> ] [ -f <em>conffile</em> ] [ -n ] [ -s <em>slashsys</em> ] [ -d <em>slashdev</em> ] [ -F <em>fwbase</em> ]
+     mdevd [ -v <em>verbosity</em> ] [ -D <em>notif</em> ] [ -o <em>outputfd</em> ] [ -b <em>kbufsz</em> ] [ -f <em>conffile</em> ] [ -n ] [ -s <em>slashsys</em> ] [ -d <em>slashdev</em> ] [ -F <em>fwbase</em> ] [ -C ]
 </pre>
 
 <ul>
@@ -124,6 +124,17 @@ are to be found in  <em>slashdev</em>. Default is <tt>/dev</tt>.
  <li> <tt>-F</tt>&nbsp;<em>fwbase</em>&nbsp;: assume the firmware files, if any,
 are to be found in  <em>fwbase</em>. Default is <tt>/lib/firmware</tt>.
 <em>fwbase</em> must be an absolute path. </li>
+ <li> <tt>-C</tt>&nbsp;: after initialization (when mdevd is ready), invoke
+<a href="mdevd-coldplug.html">mdevd-coldplug</a>, so that a coldplug is
+automatically performed when mdevd starts. This option should only be used
+in situations where a drop-in replacement for <tt>mdev -d</tt> is needed, because
+it has the drawback of performing a coldplug every time mdevd is started &mdash;
+including when mdevd is killed and restarted. By default, mdevd does not perform
+a coldplug when it starts, and it is up to the administrator to properly organize
+their boot scripts to run <a href="mdevd-coldplug.html">mdevd-coldplug</a> once,
+at boot time, when mdevd is ready. The <tt>examples/s6-rc</tt> subdirectory of
+the mdevd package shows a way to do this with the
+<a href="//skarnet.org/softwre/s6-rc/">s6-rc</a> service manager. </li>
 </ul>
 
 <h2> Configuration file </h2>
diff --git a/doc/upgrade.html b/doc/upgrade.html
index 2725faf..7775575 100644
--- a/doc/upgrade.html
+++ b/doc/upgrade.html
@@ -18,6 +18,16 @@
 
 <h1> What has changed in mdevd </h1>
 
+<h2> in 0.1.3.0 </h2>
+
+<ul>
+ <li> <a href="//skarnet.org/software/skalibs/">skalibs</a>
+dependency bumped to 2.10.0.0. </li>
+ <li> A <tt>-C</tt> option has been added to
+<a href="mdevd.html">mdevd</a>. This triggers a coldplug when
+mdevd is ready, for faithful <tt>mdev -d</tt> emulation. </li>
+</ul>
+
 <h2> in 0.1.2.0 </h2>
 
 <ul>
diff --git a/examples/s6-rc/mdevd-coldplug/dependencies b/examples/s6-rc/mdevd-coldplug/dependencies
new file mode 100644
index 0000000..3252ded
--- /dev/null
+++ b/examples/s6-rc/mdevd-coldplug/dependencies
@@ -0,0 +1 @@
+mdevd
diff --git a/examples/s6-rc/mdevd-coldplug/type b/examples/s6-rc/mdevd-coldplug/type
new file mode 100644
index 0000000..bdd22a1
--- /dev/null
+++ b/examples/s6-rc/mdevd-coldplug/type
@@ -0,0 +1 @@
+oneshot
diff --git a/examples/s6-rc/mdevd-coldplug/up b/examples/s6-rc/mdevd-coldplug/up
new file mode 100644
index 0000000..edc5c1b
--- /dev/null
+++ b/examples/s6-rc/mdevd-coldplug/up
@@ -0,0 +1 @@
+mdevd-coldplug
diff --git a/package/deps.mak b/package/deps.mak
index 73d84da..a6e8248 100644
--- a/package/deps.mak
+++ b/package/deps.mak
@@ -3,7 +3,7 @@
 #
 
 src/mdevd/mdevd-coldplug.o src/mdevd/mdevd-coldplug.lo: src/mdevd/mdevd-coldplug.c
-src/mdevd/mdevd.o src/mdevd/mdevd.lo: src/mdevd/mdevd.c
+src/mdevd/mdevd.o src/mdevd/mdevd.lo: src/mdevd/mdevd.c src/include/mdevd/config.h
 
 mdevd: EXTRA_LIBS := -lskarnet ${MAYBEPTHREAD_LIB}
 mdevd: src/mdevd/mdevd.o ${LIBNSSS}
diff --git a/package/info b/package/info
index a7500f8..1020df4 100644
--- a/package/info
+++ b/package/info
@@ -1,4 +1,4 @@
 package=mdevd
-version=0.1.2.0
+version=0.1.3.0
 category=admin
 package_macro_name=MDEVD
diff --git a/src/mdevd/mdevd.c b/src/mdevd/mdevd.c
index 91de3d5..f77fa60 100644
--- a/src/mdevd/mdevd.c
+++ b/src/mdevd/mdevd.c
@@ -41,7 +41,9 @@
 #include <skalibs/surf.h>
 #include <skalibs/random.h>
 
-#define USAGE "mdevd [ -v verbosity ] [ -D notif ] [ -o outputfd ] [ -b kbufsz ] [ -f conffile ] [ -n ] [ -s slashsys ] [ -d slashdev ]"
+#include <mdevd/config.h>
+
+#define USAGE "mdevd [ -v verbosity ] [ -D notif ] [ -o outputfd ] [ -b kbufsz ] [ -f conffile ] [ -n ] [ -s slashsys ] [ -d slashdev ] [ -F fwbase ] [ -C ]"
 #define dieusage() strerr_dieusage(100, USAGE)
 
 #define CONFBUFSIZE 8192
@@ -1012,12 +1014,13 @@ int main (int argc, char const *const *argv)
   unsigned int notif = 0 ;
   unsigned int kbufsz = 512288 ;
   char const *slashdev = "/dev" ;
+  int docoldplug = 0 ;
   PROG = "mdevd" ;
   {
     subgetopt_t l = SUBGETOPT_ZERO ;
     for (;;)
     {
-      int opt = subgetopt_r(argc, argv, "nv:D:o:b:f:s:d:F:", &l) ;
+      int opt = subgetopt_r(argc, argv, "nv:D:o:b:f:s:d:F:C", &l) ;
       if (opt == -1) break ;
       switch (opt)
       {
@@ -1030,6 +1033,7 @@ int main (int argc, char const *const *argv)
         case 's' : slashsys = l.arg ; break ;
         case 'd' : slashdev = l.arg ; break ;
         case 'F' : fwbase = l.arg ; break ;
+        case 'C' : docoldplug = 1 ; break ;
         default : dieusage() ;
       }
     }
@@ -1107,6 +1111,14 @@ int main (int argc, char const *const *argv)
       script[scriptlen++] = scriptelem_catchall ;
       script_secondpass(storage, script, envmatch) ;
       cont = 2 ;
+      if (docoldplug)
+      {
+        char const *cargv[2] = { MDEVD_BINPREFIX "mdevd-coldplug", 0 } ;
+        char const *cenv = 0 ;
+        if (!child_spawn0(cargv[0], cargv, &cenv))
+          strerr_warnwu2sys("spawn ", cargv[0]) ;
+        docoldplug = 0 ;
+      }
       if (notif)
       {
         fd_write(notif, "\n", 1) ;