summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2019-04-29 00:06:26 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2019-04-29 00:06:26 +0000
commit6a57daba8c0ebf143cec2dd4b133c8c662f86857 (patch)
tree905f670f275c9cf0d016d3de9eea0fcecc511aba
parent26f83a95417ff2e5866d6fefab4d737509761622 (diff)
downloads6-linux-init-6a57daba8c0ebf143cec2dd4b133c8c662f86857.tar.xz
-d slashdev, not -d dev_type! Fix and update the doc.
-rw-r--r--doc/s6-linux-init-maker.html14
-rw-r--r--src/init/s6-linux-init-maker.c9
2 files changed, 11 insertions, 12 deletions
diff --git a/doc/s6-linux-init-maker.html b/doc/s6-linux-init-maker.html
index 27b02c5..6c52d32 100644
--- a/doc/s6-linux-init-maker.html
+++ b/doc/s6-linux-init-maker.html
@@ -54,7 +54,7 @@ machine</em>. If it is not the case, the system will fail to boot.
[ -p <em>initial_path</em> ] \
[ -m <em>initial_umask</em> ] \
[ -t <em>timestamp_style</em> ] \
- [ -d <em>dev_style</em> ] \
+ [ -d <em>slashdev</em> ] \
[ -s <em>env_store</em> ] \
[ -e <em>initial_envvar</em> ] ... \
[ -q <em>finalsleeptime</em> ] \
@@ -206,11 +206,13 @@ timestamp, 1 means
and 3 means both. Default is
<strong><tt>1</tt></strong>. </li> <p />
- <li> <tt>-d</tt>&nbsp;<em>dev_style</em>&nbsp;: how <tt>/dev</tt> is
-handled on this system. 0 means a static <tt>/dev</tt>, 1 means
-devtmpfs but not automounted by the kernel at boot time, and 2 means
-devtmpfs automounted by the kernel at boot time. Default is
-<strong><tt>2</tt></strong>. </li> <p />
+ <li> <tt>-d</tt>&nbsp;<em>slashdev</em>&nbsp;: mount a devtmpfs.
+If this option is given, <a href="s6-linux-init.html">s6-linux-init</a>
+will mount a devtmpfs pseudo-filesystem on <em>slashdev</em>. This
+is useful if the kernel has not been configured to mount
+the devtmpfs at boot time and there is no static <tt>/dev</tt>.
+By default, it is assumed that there is a suitable <tt>/dev</tt>
+at boot time, and no additional devtmpfs is mounted. </li> <p />
<li> <tt>-s</tt>&nbsp;<em>env_store</em>&nbsp;: stage 1 init sometimes
inherits a few environment variables from the kernel. (These variables
diff --git a/src/init/s6-linux-init-maker.c b/src/init/s6-linux-init-maker.c
index 1326583..4b0d4af 100644
--- a/src/init/s6-linux-init-maker.c
+++ b/src/init/s6-linux-init-maker.c
@@ -45,7 +45,7 @@ static char const *robase = BASEDIR ;
static char const *initial_path = INITPATH ;
static char const *env_store = 0 ;
static char const *early_getty = 0 ;
-static char const *slashdev = "2" ;
+static char const *slashdev = 0 ;
static char const *log_user = "root" ;
static char const *initdefault = 0 ;
static unsigned int initial_umask = 0022 ;
@@ -587,6 +587,8 @@ int main (int argc, char const *const *argv, char const *const *envp)
if (robase[0] != '/')
strerr_dief3x(100, "base directory ", robase, " is not absolute") ;
+ if (slashdev && slashdev[0] != '/')
+ strerr_dief3x(100, "devtmpfs directory ", slashdev, " is not absolute") ;
if (env_store)
{
if (env_store[0] != '/')
@@ -596,11 +598,6 @@ int main (int argc, char const *const *argv, char const *const *envp)
}
if (timestamp_style > 3)
strerr_dief1x(100, "-t timestamp_style must be 0, 1, 2 or 3") ;
- {
- unsigned int u ;
- if (!uint0_scan(slashdev, &u) || u > 2)
- strerr_dief1x(100, "-d dev_style must be 0, 1 or 2") ;
- }
umask(0) ;
if (mkdir(argv[0], 0755) < 0)