From: Harald Hoyer <harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: "Ali H. Caliskan"
<ali.h.caliskan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: systemd-fstab-generator overwrites sysroot.mount created by dmsquash-generator.
Date: Wed, 2 Sep 2015 13:20:52 +0200 [thread overview]
Message-ID: <55E6DB94.8060205@redhat.com> (raw)
In-Reply-To: <CAFO=TmWCtM6-GabdH9GrLExBR4EH9=U+9zFDucQkBhdhAvND7g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On 18.07.2015 15:27, Ali H. Caliskan wrote:
> dracut-dmsquash-generator creates $GENERATOR_DIR/sysroot.mount and
> dracut-rootfs-generator doesn't touch it but systemd-fstab-generator
> does overwrite the sysroot.mount file which causes error like "Timed
> out waiting for device dev-mapper-live\x2drw.device." I don't know if
> it can be resolved by dracut or if systemd should skip writing
> sysroot.mount if it already exists.
>
> I'm able to boot with rd.live.image by letting
> dracut-dmsquash-generator create sysroot.mount.new and then tell
> dracut-rootfs-generator to sysmlink sysroot.mount.new to
> initrd-root-fs.target.requires/sysroot.mount. Also I had to remove "if
> [ -z "$DRACUT_SYSTEMD" ]; then" condition from the
> dmsquash-live-root.sh in order to mount LiveOS/rootfs.img into
> /sysroot directory.
Hmm,
according to the man page systemd.generator:
SYNOPSIS
/path/to/generator normal-dir early-dir late-dir
1. normal-dir
argv[1] may be used to override unit files in /usr, but not those in
/etc. This means that unit files placed in this directory take precedence
over vendor unit configuration but not over native
user/administrator unit configuration.
2. early-dir
argv[2] may be used to override unit files in /usr and in /etc. This
means that unit files placed in this directory take precedence over all
configuration, both vendor and user/administrator.
3. late-dir
argv[3] may be used to extend the unit file tree without overriding
any other unit files. Any native configuration files supplied by the
vendor or user/administrator take precedence over the generated ones
placed in this directory.
systemd-fstab-generator uses argv[1], so this is normal-dir
<https://github.com/systemd/systemd/blob/master/src/fstab-generator/fstab-generator.c#L653>
dmsquash-generator.sh uses argv[2], so this is early-dir
<https://github.com/haraldh/dracut/blob/master/modules.d/90dmsquash-live/dmsquash-generator.sh#L53>
If I run test/TEST-16-DMSQUASH and rd.break before switch-root, I can see
switch_root:/run/systemd# find generator.early/
generator.early/
generator.early/dev-mapper-live\x2drw.device.d
generator.early/dev-mapper-live\x2drw.device.d/timeout.conf
generator.early/sysroot.mount
switch_root:/run/systemd# find generator
generator
generator/initrd-root-fs.target.requires
generator/initrd-root-fs.target.requires/sysroot.mount
generator/sysroot.mount
# systemctl show sysroot.mount |grep Path
FragmentPath=/run/systemd/generator.early/sysroot.mount
# cat generator.early/sysroot.mount
[Unit]
Before=initrd-root-fs.target
[Mount]
Where=/sysroot
What=/dev/mapper/live-rw
# cat generator/sysroot.mount
# Automatically generated by systemd-fstab-generator
[Unit]
SourcePath=/proc/cmdline
Documentation=man:fstab(5) man:systemd-fstab-generator(8)
Before=initrd-root-fs.target
[Mount]
What=live:CDLABEL=LiveCD
Where=/sysroot
Options=rw
So, works as expected. The question is, why is your system different?
next prev parent reply other threads:[~2015-09-02 11:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-18 13:27 systemd-fstab-generator overwrites sysroot.mount created by dmsquash-generator Ali H. Caliskan
[not found] ` <CAFO=TmWCtM6-GabdH9GrLExBR4EH9=U+9zFDucQkBhdhAvND7g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-09-02 11:20 ` Harald Hoyer [this message]
[not found] ` <55E6DB94.8060205-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-10-25 12:54 ` Ali H. Caliskan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55E6DB94.8060205@redhat.com \
--to=harald-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=ali.h.caliskan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox