[systemd-devel] [PATCH 2/4] fstab-generator: skip generation, if sysroot.mount already exists
Harald Hoyer
harald.hoyer at gmail.com
Tue Mar 5 03:34:37 PST 2013
Am 05.03.2013 07:28, schrieb harald at redhat.com:
> From: Harald Hoyer <harald at redhat.com>
>
> ---
> src/fstab-generator/fstab-generator.c | 11 ++++++++++-
> 1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c
> index fade192..3b8329b 100644
> --- a/src/fstab-generator/fstab-generator.c
> +++ b/src/fstab-generator/fstab-generator.c
> @@ -450,10 +450,19 @@ finish:
>
> static int parse_new_root_from_proc_cmdline(void) {
> char *w, *state;
> - _cleanup_free_ char *what = NULL, *type = NULL, *opts = NULL, *line = NULL;
> + _cleanup_free_ char *what = NULL, *type = NULL, *opts = NULL, *line = NULL, *mu = NULL;
> int r;
> size_t l;
>
> + /* Skip generation, if sysroot.mount already exists */
> + mu = strjoin(arg_dest, "/", "sysroot.mount", NULL);
> + if (!mu)
> + return log_oom();
> +
> + r = access(mu, R_OK);
> + if (r == 0)
> + return 0;
> +
> r = read_one_line_file("/proc/cmdline", &line);
> if (r < 0) {
> log_error("Failed to read /proc/cmdline, ignoring: %s", strerror(-r));
>
scratch that
most of my problems were solved with:
http://cgit.freedesktop.org/systemd/systemd/commit/?id=135b5212d4234f5b75c9b86c9f924047c8d07589
More information about the systemd-devel
mailing list