<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hi all,</p>
    <p>Does anyone have suggestion for me?</p>
    <p>Thanks.</p>
    <p>Hongzhi.Song<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 2018年03月01日 18:35, Hongzhi, Song
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:415639a4-b01a-514e-5eb8-2242cbec1bf9@windriver.com">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <p>Defect:</p>
      <p>    The exiting method of automount of udev in <font
          face="Times New Roman, Times, serif"><i>oe-core/meta/ </i></font>is
        using <br>
      </p>
      <p><font face="Times New Roman, Times, serif"><i>automount.rules</i></font>
        which call <font face="Times New Roman, Times, serif"><i>mount.sh</i></font>
        that using <i><font face="Times New Roman, Times, serif">/bin/mount</font></i>
        to mount device. <br>
      </p>
      <p>But systemd-udevd detaches <font face="Times New Roman, Times,
          serif"><i>mount()</i></font> operations done within the
        service <br>
      </p>
      <p>from the rest of the system with MountFlag=slave, this means
        host can <br>
      </p>
      <p>not access device. (e.g. Executing <font face="Times New
          Roman, Times, serif"><i>mkfs.ext4 /dev/sda1/</i></font>
        prompts <br>
      </p>
      <p><i><font face="Times New Roman, Times, serif">/dev/sda1 is
            apparently in use by the system; will not make a filesystem
            here!</font></i>)<br>
      </p>
      <p><br>
      </p>
      <p>Solution:</p>
      <p>    Systemd upstream suggest that the best way is to use
        "systemd-mount" <br>
      </p>
      <p>in udev rules, which will request the mount operation to be
        executed by PID 1.<br>
      </p>
      <p>And I have tested it was effective.</p>
      <p><br>
      </p>
      <p>Uncertain:</p>
      <p>    The exiting method is designed for <font face="Times New
          Roman, Times, serif"><i>SysV-init </i></font>which is not
        compatible to <br>
      </p>
      <p>systemd-udev, at least that's what I think. So I think that we
        should design</p>
      <p>a new rule or organizational structure to be suitable for
        systemd-udev and <br>
      </p>
      <p>to mount deferent device. Dose anyone help do this? Or I can
        make some <br>
      </p>
      <p>improvements on the basis of the existing with "systemd-mount".<br>
      </p>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
    </blockquote>
    <br>
  </body>
</html>