diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2016-04-14 13:21:19 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2016-04-14 13:21:19 +0000 |
commit | 4448842bb141430e23498d5a969b5cefe8786e57 (patch) | |
tree | e8276b4ecbef5f62250642d2bf519f7fd200cff2 | |
parent | a2edaf9fa267188d586a5e80b8728e69001f33d6 (diff) | |
download | s6-linux-init-0.1.0.0.tar.xz |
- make s6-linux-init-maker write stage1 to dir/init instead of stdoutv0.1.0.0
- version: 0.1.0.0
-rw-r--r-- | COPYING | 2 | ||||
-rw-r--r-- | INSTALL | 12 | ||||
-rw-r--r-- | doc/index.html | 19 | ||||
-rw-r--r-- | doc/quickstart.html | 5 | ||||
-rw-r--r-- | doc/s6-linux-init-maker.html | 50 | ||||
-rw-r--r-- | doc/upgrade.html | 18 | ||||
-rw-r--r-- | package/info | 2 | ||||
-rw-r--r-- | src/init/s6-linux-init-maker.c | 165 |
8 files changed, 151 insertions, 122 deletions
@@ -1,4 +1,4 @@ -Copyright (c) 2015 Laurent Bercot <ska-skaware@skarnet.org> +Copyright (c) 2015-2016 Laurent Bercot <ska-skaware@skarnet.org> Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above @@ -6,15 +6,15 @@ Build Instructions - A Linux-based system with a standard C development environment - GNU make version 3.81 or later - - skalibs version 2.3.8.0 or later: http://skarnet.org/software/skalibs/ + - skalibs version 2.3.10.0 or later: http://skarnet.org/software/skalibs/ - The binaries generated by the s6-linux-init-maker tool have some + The scripts generated by the s6-linux-init-maker program have some additional dependencies: - - execline version 2.1.4.2 or later: http://skarnet.org/software/execline/ - - s6-portable-utils version 2.0.5.3 or later: http://skarnet.org/software/s6-portable-utils/ - - s6-linux-utils version 2.0.2.3 or later: http://skarnet.org/software/s6-linux-utils/ - - s6 version 2.2.2.0 or later: http://skarnet.org/software/s6/ + - execline version 2.1.5.0 or later: http://skarnet.org/software/execline/ + - s6-portable-utils version 2.0.6.0 or later: http://skarnet.org/software/s6-portable-utils/ + - s6-linux-utils version 2.1.0.0 or later: http://skarnet.org/software/s6-linux-utils/ + - s6 version 2.3.0.0 or later: http://skarnet.org/software/s6/ This software is Linux-specific. It will run on a Linux kernel, version 2.6.32 or later. However, it should not be too hard to port to diff --git a/doc/index.html b/doc/index.html index efcd308..9906135 100644 --- a/doc/index.html +++ b/doc/index.html @@ -50,15 +50,15 @@ a small FAQ. <li> A Linux-based system with a standard C development environment </li> <li> GNU make, version 3.81 or later </li> <li> <a href="http://skarnet.org/software/skalibs/">skalibs</a> version -2.3.8.0 or later </li> +2.3.10.0 or later </li> <li> <a href="http://skarnet.org/software/execline/">execline</a> version -2.1.4.2 or later </li> +2.1.5.0 or later </li> <li> <a href="http://skarnet.org/software/s6-portable-utils/">s6-portable-utils</a> version -2.0.5.3 or later </li> +2.0.6.0 or later </li> <li> <a href="http://skarnet.org/software/s6-linux-utils/">s6-linux-utils</a> version -2.0.2.3 or later </li> +2.1.0.0 or later </li> <li> <a href="http://skarnet.org/software/s6/">s6</a> version -2.2.2.0 or later </li> +2.3.0.0 or later </li> </ul> <p> @@ -86,9 +86,14 @@ against the shared version of the skalibs library, it also becomes a <ul> <li> The current released version of s6-linux-init is -<a href="s6-linux-init-0.0.1.4.tar.gz">0.0.1.4</a>. </li> - <li> Alternatively, you can checkout a copy of the s6-linux-init git repository: +<a href="s6-linux-init-0.1.0.0.tar.gz">0.1.0.0</a>. </li> + <li> Alternatively, you can checkout a copy of the +<a href="http://git.skarnet.org/cgi-bin/cgit.cgi/s6-linux-init/">s6-linux-init +git repository</a>: <pre> git clone git://git.skarnet.org/s6-linux-init </pre> </li> + <li> There's also a +<a href="https://github.com/skarnet/s6-linux-init">GitHub mirror</a> +of the s6-linux-init git repository. </li> </ul> <h3> Compilation </h3> diff --git a/doc/quickstart.html b/doc/quickstart.html index da47334..bd758b1 100644 --- a/doc/quickstart.html +++ b/doc/quickstart.html @@ -39,10 +39,9 @@ add the <tt>-d 1</tt> option to the <tt>s6-linux-init-maker</tt> command line below. </li> <li> As root, run: <pre> rm -rf /tmp/s6-linux-init /tmp/init - s6-linux-init-maker /tmp/s6-linux-init > /tmp/init - chmod 0700 /tmp/init + s6-linux-init-maker /tmp/s6-linux-init mv /tmp/s6-linux-init /etc/ - mv /tmp/init /sbin/ </pre> </li> + ln -sf /etc/s6-linux-init/init /sbin/init </pre> </li> <li> Reboot. </li> <li> Congratulations! your machine is now running a s6-based init system. </li> </ul> diff --git a/doc/s6-linux-init-maker.html b/doc/s6-linux-init-maker.html index e2e0b2b..e82ce40 100644 --- a/doc/s6-linux-init-maker.html +++ b/doc/s6-linux-init-maker.html @@ -21,7 +21,12 @@ <p> <tt>s6-linux-init-maker</tt> reads configuration options on the command line, and outputs a directory to place in the -root filesystem as well as a script suitable as an init program. +root filesystem. That directory contains a script suitable +as an init program, as well as support file hierarchies to +get a complete +<a href="http://skarnet.org/software/s6/">s6</a> +infrastructure running when the system is booted on that +script. </p> <p> @@ -58,7 +63,7 @@ machine</em> - else the scripts will crash. [ -d <em>dev_style</em> ] \ [ -s <em>env_store</em> ] \ [ -e <em>initial_envvar</em> ] ... \ - <em>dir</em> > <em>stage1</em> + <em>dir</em> </pre> <ul> @@ -66,9 +71,9 @@ machine</em> - else the scripts will crash. <li> s6-linux-init-maker parses options on its command line. </li> <li> It writes data into a directory <em>dir</em>, which must not exist beforehand. </li> - <li> It then prints a script to its standard output. </li> <li> It exits 0 if everything went well, 100 if a user error occurred, -and 111 if a problem occurred during the directory or script creation. </li> +and 111 if a problem occurred during the creation of the directory +or its contents. </li> </ul> <p> @@ -81,35 +86,37 @@ tool can do it, as well as the GNU or busybox <tt>cp -a</tt> or <tt>mv</tt> comm </p> <p> - The <em>stage1</em> script printed by s6-linux-init-maker on its -stdout is then suitable as an init program. The administrator should -copy it to <tt>/sbin/init</tt> and make it executable. + The <tt><em>basedir</em>/init</tt> script +is then suitable as a "stage 1" init program, i.e. the first program +run by the kernel. The administrator should make a symbolic link +from <tt>/sbin/init</tt> to <tt><em>basedir</em>/init</tt>; the +machine will then be ready to boot </p> <h2> Boot sequence </h2> <p> - When the kernel boots, it runs the <em>stage1</em> script, and this is -what happens: + When the kernel boots, it runs the <tt><em>basedir</em>/init</tt> script, +also known as <em>stage 1</em>. and this is what happens: </p> <ul> - <li> <em>stage1</em> is an + <li> <em>stage 1</em> is an <a href="http://skarnet.org/software/execline/">execline</a> script, so the first process run by the kernel is the <a href="http://skarnet.org/software/execline/execlineb.html">execlineb</a> program launcher. </li> - <li> <em>stage1</em> mounts a + <li> <em>stage 1</em> mounts a <a href="https://www.kernel.org/doc/Documentation/filesystems/tmpfs.txt">tmpfs</a> filesystem on <em>tmpfsdir</em>. </li> - <li> <em>stage1</em> copies <tt><em>basedir</em>/run-image</tt> verbatim to + <li> <em>stage 1</em> copies <tt><em>basedir</em>/run-image</tt> verbatim to <em>tmpfsdir</em>. </li> - <li> <em>stage1</em> empties its environment, then reads a global set of environment variables from the + <li> <em>stage 1</em> empties its environment, then reads a global set of environment variables from the <tt><em>basedir</em>/env</tt> <a href="http://skarnet.org/software/s6/s6-envdir.html">environment directory</a>. </li> - <li> <em>stage1</em> forks a child that will block until + <li> <em>stage 1</em> forks a child that will block until <a href="http://skarnet.org/software/s6/s6-svscan.html">s6-svscan</a> is running. </li> - <li> <em>stage1</em> executes, as process 1, into + <li> <em>stage 1</em> executes, as process 1, into <a href="http://skarnet.org/software/s6/s6-svscan.html">s6-svscan</a>, with <tt><em>tmpfsdir</em>/service</tt> as a <a href="http://skarnet.org/software/s6/scandir.html">scan directory</a>. </li> @@ -122,7 +129,7 @@ instead of clogging the system console. </li> <li> If the <tt>-g</tt> option has been given to s6-linux-init-maker, the scan directory will also contain a service for an early getty. </li> <li> s6-svscan starts all the services defined in the scan directory, -and unblocks the child forked by <em>stage1</em>. </li> +and unblocks the child forked by <em>stage 1</em>. </li> <li> This child executes into <em>stage2</em>. </li> </ul> @@ -158,7 +165,7 @@ getty is essentially to make it easier to debug if <em>stage2</em> fails. </li> There is <em>nothing else</em>. In particular, no filesystem has been mounted yet, including <tt>/proc</tt> and <tt>/sys</tt>; and no one-time initialization -has been performed. The point of <em>stage1</em> is only to make it +has been performed. The point of <em>stage 1</em> is only to make it possible to run <em>stage2</em> with a logging infrastructure and a supervision infrastructure already available, and all the real machine and service initialization should happen in <em>stage2</em>. @@ -222,7 +229,8 @@ service manager. <h2> s6-linux-init-maker options </h2> <ul> - <li> <tt>-c</tt> <em>basedir</em> : at boot time, <em>stage1</em> + <li> <tt>-c</tt> <em>basedir</em> : at boot time, <em>stage 1</em>, +which should be accessible as <tt><em>basedir</em>/init</tt>, will read its read-only data from <em>basedir</em>. After running s6-linux-init-maker, the administrator should make sure to copy the created directory <em>dir</em> to <em>basedir</em>. <em>basedir</em> @@ -282,7 +290,7 @@ It must be absolute. Default is <li> <tt>-p</tt> <em>initial_path</em> : the value to set the PATH environment variable to, for all the starting processes. -This will be done as early as possible in <em>stage1</em>. It is +This will be done as early as possible in <em>stage 1</em>. It is absolutely necessary for <a href="http://skarnet.org/software/execline/">execline</a>, <a href="http://skarnet.org/software/s6/">s6</a>, @@ -314,13 +322,13 @@ 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>-s</tt> <em>env_store</em> : stage1 init sometimes + <li> <tt>-s</tt> <em>env_store</em> : stage 1 init sometimes inherits a few environment variables from the kernel. It empties its environment before spawning stage2 and executing into s6-svscan, in order to prevent those "kernel" environment variables from leaking into the whole process tree. However, sometimes those variables are needed at a later time; in that case, giving the <tt>-s</tt> option -to s6-linux-init-maker makes stage1 init dump the "kernel" environment +to s6-linux-init-maker makes stage 1 init dump the "kernel" environment variables into the <em>env_store</em> directory, via the <a href="http://skarnet.org/software/s6-portable-utils/s6-dumpenv.html">s6-dumpenv</a> program, before erasing them. <em>env_store</em> should obviously be diff --git a/doc/upgrade.html b/doc/upgrade.html index 2d8e90f..393b13a 100644 --- a/doc/upgrade.html +++ b/doc/upgrade.html @@ -18,6 +18,24 @@ <h1> What has changed in s6-linux-init </h1> +<h2> in 0.1.0.0 </h2> + +<ul> + <li> <a href="http://skarnet.org/software/skalibs/">skalibs</a> +dependency bumped to 2.3.10.0. </li> + <li> <a href="http://skarnet.org/software/execline/">execline</a> +dependency bumped to 2.1.5.0. </li> + <li> <a href="http://skarnet.org/software/s6-portable-utils/">s6-portable-utils</a> +dependency bumped to 2.0.6.0. </li> + <li> <a href="http://skarnet.org/software/s6-linux-utils/">s6-linux-utils</a> +dependency bumped to 2.1.0.0. </li> + <li> <a href="http://skarnet.org/software/s6/">s6</a> +dependency bumped to 2.3.0.0. </li> + <li> <a href="s6-linux-init-maker.html">s6-linux-init-maker</a> does +not write stage 1 init to stdout anymore; it writes it to <tt><em>dir/init</tt> +instead. </li> +</ul> + <h2> in 0.0.1.4 </h2> <ul> diff --git a/package/info b/package/info index 95854c2..e0f642e 100644 --- a/package/info +++ b/package/info @@ -1,4 +1,4 @@ package=s6-linux-init -version=0.0.1.4 +version=0.1.0.0 category=admin package_macro_name=S6_LINUX_INIT diff --git a/src/init/s6-linux-init-maker.c b/src/init/s6-linux-init-maker.c index fe890e9..c37b67c 100644 --- a/src/init/s6-linux-init-maker.c +++ b/src/init/s6-linux-init-maker.c @@ -170,6 +170,68 @@ static int sigusr2_script (buffer *b) return sig_script(b, '0') ; } +static inline int stage1_script (buffer *b) +{ + unsigned int sabase = satmp.len, pos, pos2 ; + char fmt[UINT_OFMT] ; + if (!put_shebang(b) + || buffer_puts(b, bindir) < 0 + || buffer_puts(b, "/export PATH ") < 0 + || !string_quote(&satmp, initial_path, str_len(initial_path))) return 0 ; + if (buffer_put(b, satmp.s + sabase, satmp.len - sabase) < 0) goto err ; + satmp.len = sabase ; + if (buffer_put(b, "\n", 1) < 0 + || buffer_puts(b, bindir) < 0 + || buffer_puts(b, "/cd /\ns6-setsid -qb --\numask 0") < 0 + || buffer_put(b, fmt, uint_ofmt(fmt, initial_umask)) < 0 + || buffer_puts(b, "\nif { s6-echo -- ") < 0 + || !string_quote(&satmp, BANNER, sizeof(BANNER) - 1)) return 0 ; + if (buffer_put(b, satmp.s, satmp.len) < 0) goto err ; + satmp.len = sabase ; + if (buffer_puts(b, " }\nif { s6-mount -nwt tmpfs -o mode=0755 tmpfs ") < 0 + || !string_quote(&satmp, slashrun, str_len(slashrun))) return 0 ; + pos = satmp.len ; + if (buffer_put(b, satmp.s + sabase, pos - sabase) < 0 + || buffer_puts(b, " }\nif { s6-hiercopy ") < 0 + || !string_quote(&satmp, robase, str_len(robase))) return 0 ; + pos2 = satmp.len ; + if (buffer_put(b, satmp.s + pos, pos2 - pos) < 0 + || buffer_puts(b, "/run-image ") < 0 + || buffer_put(b, satmp.s + sabase, pos - sabase) < 0 + || buffer_puts(b, " }\n") < 0) goto err ; + if (slashdev_style == 1) + { + if (buffer_puts(b, "if { s6-mount -nt devtmpfs dev /dev }\n") < 0) goto err ; + } + if (env_store) + { + unsigned int base = satmp.len ; + if (!string_quote(&satmp, env_store, str_len(env_store))) return 0 ; + if (buffer_puts(b, "if { unexport PATH s6-dumpenv -- ") < 0 + || buffer_put(b, satmp.s + base, satmp.len - base) < 0 + || buffer_puts(b, " }\n") < 0) goto err ; + satmp.len = base ; + } + if (buffer_puts(b, "emptyenv -p\ns6-envdir -I -- ") < 0 + || buffer_put(b, satmp.s + pos, pos2 - pos) < 0 + || buffer_puts(b, "/env\nredirfd -r 0 /dev/null\nredirfd -wnb 1 ") < 0 + || buffer_put(b, satmp.s + sabase, pos - sabase) < 0 + || buffer_puts(b, "/service/s6-svscan-log/fifo\nbackground\n{\n s6-setsid --\n redirfd -w 1 ") < 0 + || buffer_put(b, satmp.s + sabase, pos - sabase) < 0 + || buffer_puts(b, "/service/s6-svscan-log/fifo\n fdmove -c ") < 0 + || buffer_puts(b, redirect_stage2 ? "2 1" : "1 2") < 0 + || buffer_puts(b, "\n ") < 0 + || !string_quote(&satmp, init_script, str_len(init_script)) + || buffer_put(b, satmp.s + pos2, satmp.len - pos2) < 0 + || buffer_puts(b, "\n}\nunexport !\ncd ") < 0 + || buffer_put(b, satmp.s + sabase, pos - sabase) < 0 + || buffer_puts(b, "/service\nfdmove -c 2 1\ns6-svscan -st0\n") < 0) goto err ; + return 1 ; + err: + satmp.len = sabase ; + return 0 ; +} + static void cleanup (char const *base) { int e = errno ; @@ -250,30 +312,6 @@ static void auto_script (char const *base, char const *file, writetobuf_func_t_r close(fd) ; } -static inline void make_image (char const *base) -{ - auto_dir(base, "run-image", 0, 0, 0755) ; - auto_dir(base, "run-image/uncaught-logs", uncaught_logs_uid, uncaught_logs_gid, 02700) ; - auto_dir(base, "run-image/service", 0, 0, 0755) ; - auto_dir(base, "run-image/service/.s6-svscan", 0, 0, 0755) ; - auto_script(base, "run-image/service/.s6-svscan/crash", &crash_script) ; - auto_script(base, "run-image/service/.s6-svscan/finish", &finish_script) ; - auto_script(base, "run-image/service/.s6-svscan/SIGTERM", &sigterm_script) ; - auto_script(base, "run-image/service/.s6-svscan/SIGHUP", &sighup_script) ; - auto_script(base, "run-image/service/.s6-svscan/SIGQUIT", &sigquit_script) ; - auto_script(base, "run-image/service/.s6-svscan/SIGINT", &sigint_script) ; - auto_script(base, "run-image/service/.s6-svscan/SIGUSR1", &sigusr1_script) ; - auto_script(base, "run-image/service/.s6-svscan/SIGUSR2", &sigusr2_script) ; - auto_dir(base, "run-image/service/s6-svscan-log", 0, 0, 0755) ; - auto_fifo(base, "run-image/service/s6-svscan-log/fifo") ; - auto_script(base, "run-image/service/s6-svscan-log/run", &s6_svscan_log_script) ; - if (early_getty) - { - auto_dir(base, "run-image/service/s6-linux-init-early-getty", 0, 0, 0755) ; - auto_script(base, "run-image/service/s6-linux-init-early-getty/run", &early_getty_script) ; - } -} - static inline void make_env (char const *base, char const *modif, unsigned int modiflen) { auto_dir(base, "env", 0, 0, 0755) ; @@ -293,66 +331,29 @@ static inline void make_env (char const *base, char const *modif, unsigned int m } } -static inline int make_init_script (buffer *b) +static inline void make_image (char const *base) { - unsigned int sabase = satmp.len, pos, pos2 ; - char fmt[UINT_OFMT] ; - if (!put_shebang(b) - || buffer_puts(b, bindir) < 0 - || buffer_puts(b, "/export PATH ") < 0 - || !string_quote(&satmp, initial_path, str_len(initial_path))) return 0 ; - if (buffer_put(b, satmp.s + sabase, satmp.len - sabase) < 0) goto err ; - satmp.len = sabase ; - if (buffer_put(b, "\n", 1) < 0 - || buffer_puts(b, bindir) < 0 - || buffer_puts(b, "/cd /\ns6-setsid -qb --\numask 0") < 0 - || buffer_put(b, fmt, uint_ofmt(fmt, initial_umask)) < 0 - || buffer_puts(b, "\nif { s6-echo -- ") < 0 - || !string_quote(&satmp, BANNER, sizeof(BANNER) - 1)) return 0 ; - if (buffer_put(b, satmp.s, satmp.len) < 0) goto err ; - satmp.len = sabase ; - if (buffer_puts(b, " }\nif { s6-mount -nwt tmpfs -o mode=0755 tmpfs ") < 0 - || !string_quote(&satmp, slashrun, str_len(slashrun))) return 0 ; - pos = satmp.len ; - if (buffer_put(b, satmp.s + sabase, pos - sabase) < 0 - || buffer_puts(b, " }\nif { s6-hiercopy ") < 0 - || !string_quote(&satmp, robase, str_len(robase))) return 0 ; - pos2 = satmp.len ; - if (buffer_put(b, satmp.s + pos, pos2 - pos) < 0 - || buffer_puts(b, "/run-image ") < 0 - || buffer_put(b, satmp.s + sabase, pos - sabase) < 0 - || buffer_puts(b, " }\n") < 0) goto err ; - if (slashdev_style == 1) - { - if (buffer_puts(b, "if { s6-mount -nt devtmpfs dev /dev }\n") < 0) goto err ; - } - if (env_store) + auto_dir(base, "run-image", 0, 0, 0755) ; + auto_dir(base, "run-image/uncaught-logs", uncaught_logs_uid, uncaught_logs_gid, 02700) ; + auto_dir(base, "run-image/service", 0, 0, 0755) ; + auto_dir(base, "run-image/service/.s6-svscan", 0, 0, 0755) ; + auto_script(base, "run-image/service/.s6-svscan/crash", &crash_script) ; + auto_script(base, "run-image/service/.s6-svscan/finish", &finish_script) ; + auto_script(base, "run-image/service/.s6-svscan/SIGTERM", &sigterm_script) ; + auto_script(base, "run-image/service/.s6-svscan/SIGHUP", &sighup_script) ; + auto_script(base, "run-image/service/.s6-svscan/SIGQUIT", &sigquit_script) ; + auto_script(base, "run-image/service/.s6-svscan/SIGINT", &sigint_script) ; + auto_script(base, "run-image/service/.s6-svscan/SIGUSR1", &sigusr1_script) ; + auto_script(base, "run-image/service/.s6-svscan/SIGUSR2", &sigusr2_script) ; + auto_dir(base, "run-image/service/s6-svscan-log", 0, 0, 0755) ; + auto_fifo(base, "run-image/service/s6-svscan-log/fifo") ; + auto_script(base, "run-image/service/s6-svscan-log/run", &s6_svscan_log_script) ; + if (early_getty) { - unsigned int base = satmp.len ; - if (!string_quote(&satmp, env_store, str_len(env_store))) return 0 ; - if (buffer_puts(b, "if { unexport PATH s6-dumpenv -- ") < 0 - || buffer_put(b, satmp.s + base, satmp.len - base) < 0 - || buffer_puts(b, " }\n") < 0) goto err ; - satmp.len = base ; + auto_dir(base, "run-image/service/s6-linux-init-early-getty", 0, 0, 0755) ; + auto_script(base, "run-image/service/s6-linux-init-early-getty/run", &early_getty_script) ; } - if (buffer_puts(b, "emptyenv -p\ns6-envdir -I -- ") < 0 - || buffer_put(b, satmp.s + pos, pos2 - pos) < 0 - || buffer_puts(b, "/env\nredirfd -r 0 /dev/null\nredirfd -wnb 1 ") < 0 - || buffer_put(b, satmp.s + sabase, pos - sabase) < 0 - || buffer_puts(b, "/service/s6-svscan-log/fifo\nbackground\n{\n s6-setsid --\n redirfd -w 1 ") < 0 - || buffer_put(b, satmp.s + sabase, pos - sabase) < 0 - || buffer_puts(b, "/service/s6-svscan-log/fifo\n fdmove -c ") < 0 - || buffer_puts(b, redirect_stage2 ? "2 1" : "1 2") < 0 - || buffer_puts(b, "\n ") < 0 - || !string_quote(&satmp, init_script, str_len(init_script)) - || buffer_put(b, satmp.s + pos2, satmp.len - pos2) < 0 - || buffer_puts(b, "\n}\nunexport !\ncd ") < 0 - || buffer_put(b, satmp.s + sabase, pos - sabase) < 0 - || buffer_puts(b, "/service\nfdmove -c 2 1\ns6-svscan -st0\n") < 0) goto err ; - return 1 ; - err: - satmp.len = sabase ; - return 0 ; + auto_script(base, "init", &stage1_script) ; } int main (int argc, char const *const *argv) @@ -425,7 +426,5 @@ int main (int argc, char const *const *argv) make_env(argv[0], satmp.s, satmp.len) ; satmp.len = 0 ; make_image(argv[0]) ; - if (!make_init_script(buffer_1) || !buffer_flush(buffer_1)) - strerr_diefu1sys(111, "write to stdout") ; return 0 ; } |