Re: [systemd-devel] [PATCH] build: lookup for the mount binary

2013-10-31 Thread Harald Hoyer
On 10/30/2013 09:25 PM, Cristian Rodríguez wrote:
 El 30/10/13 15:34, Harald Hoyer escribió:
 On 10/30/2013 07:27 PM, Cristian Rodríguez wrote:
 El mié 30 oct 2013 15:18:48 CLST, Tom Gundersen escribió:
 On Wed, Oct 30, 2013 at 7:12 PM, Cristian Rodríguez
 crrodrig...@opensuse.org wrote:
 Real executable might be in /usr and not in /bin

 I'm not against the patch, but the justification seems lacking... Does
 anyone actually do this? I.e., have a mount that is not symlinked to
 by /bin/mount?

 I am not aware of anyone not having a symlink to /bin/mount.. however,
 when creating an initrd with dracut the symlink is not included (only
 the real binary is at /usr/bin/mount) and mounting stuff breaks.

 It is either this patch or I should send a patch to dracut instead :-)

 In any case, from my perspective this is the right thing to do anyway.


 Can you provide me the output of dracut --debug -f test.img, so I can see 
 what
 goes wrong?

 Normally dracut also installs the symlink.

 
 Here is the debug log attached, this is dracut git HEAD.
 
 The resulting initrd drops you into the emergency shell because systemd is
 unable to find /bin/mount to mount /sysroot.
 
 Workaround to continue boot is to create the symlink and exit or a adding
 band-aid hack to
 http://git.kernel.org/cgit/boot/dracut/dracut.git/tree/modules.d/99fs-lib/module-setup.sh
 just before inst_multiple -o $_helpers fsck to force installation of mount as
 /bin/mount , clearly not the right thing to do ;-)
 

dracut-install: Handle 'mount'
dracut-install: PATH=/usr/sbin:/sbin:/usr/bin:/bin
dracut-install: stat(/usr/sbin/mount) != 0
dracut-install: stat(/sbin/mount) != 0
dracut-install: find_binary(mount) == /usr/bin/mount
dracut-install: dracut_install '/usr/bin/mount'
dracut-install: dracut_install('/usr/bin/mount', '/usr/bin/mount')
dracut-install: dracut_install ret = 0
dracut-install: cp '/usr/bin/mount' '/var/tmp/initramfs.pRJ2ZL/usr/bin/mount'
dracut-install: dracut_install ret = 0
dracut-install: dracut_install '/usr/bin/mount' OK


So, the PATH dracut uses is PATH=/usr/sbin:/sbin:/usr/bin:/bin.
dracut-install finds a real mount at /usr/bin/mount.

So, you are saying, that you have a symbolic link pointing:

/bin/mount - /usr/bin/mount

??

Otherwise dracut would have installed the symbolic link and the file it points 
to.

What we might can do, is search _all_ components of PATH for the binaries and
install everyone of them.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] build: lookup for the mount binary

2013-10-31 Thread Cristian Rodríguez

El jue 31 oct 2013 07:43:54 CLST, Harald Hoyer escribió:

On 10/30/2013 09:25 PM, Cristian Rodríguez wrote:

El 30/10/13 15:34, Harald Hoyer escribió:

On 10/30/2013 07:27 PM, Cristian Rodríguez wrote:

El mié 30 oct 2013 15:18:48 CLST, Tom Gundersen escribió:

On Wed, Oct 30, 2013 at 7:12 PM, Cristian Rodríguez
crrodrig...@opensuse.org wrote:

Real executable might be in /usr and not in /bin


I'm not against the patch, but the justification seems lacking... Does
anyone actually do this? I.e., have a mount that is not symlinked to
by /bin/mount?


I am not aware of anyone not having a symlink to /bin/mount.. however,
when creating an initrd with dracut the symlink is not included (only
the real binary is at /usr/bin/mount) and mounting stuff breaks.

It is either this patch or I should send a patch to dracut instead :-)

In any case, from my perspective this is the right thing to do anyway.



Can you provide me the output of dracut --debug -f test.img, so I can see what
goes wrong?

Normally dracut also installs the symlink.



Here is the debug log attached, this is dracut git HEAD.

The resulting initrd drops you into the emergency shell because systemd is
unable to find /bin/mount to mount /sysroot.

Workaround to continue boot is to create the symlink and exit or a adding
band-aid hack to
http://git.kernel.org/cgit/boot/dracut/dracut.git/tree/modules.d/99fs-lib/module-setup.sh
just before inst_multiple -o $_helpers fsck to force installation of mount as
/bin/mount , clearly not the right thing to do ;-)



dracut-install: Handle 'mount'
dracut-install: PATH=/usr/sbin:/sbin:/usr/bin:/bin
dracut-install: stat(/usr/sbin/mount) != 0
dracut-install: stat(/sbin/mount) != 0
dracut-install: find_binary(mount) == /usr/bin/mount
dracut-install: dracut_install '/usr/bin/mount'
dracut-install: dracut_install('/usr/bin/mount', '/usr/bin/mount')
dracut-install: dracut_install ret = 0
dracut-install: cp '/usr/bin/mount' '/var/tmp/initramfs.pRJ2ZL/usr/bin/mount'
dracut-install: dracut_install ret = 0
dracut-install: dracut_install '/usr/bin/mount' OK


So, the PATH dracut uses is PATH=/usr/sbin:/sbin:/usr/bin:/bin.
dracut-install finds a real mount at /usr/bin/mount.

So, you are saying, that you have a symbolic link pointing:

/bin/mount - /usr/bin/mount

??


Yes /bin/mount - /usr/bin/mount .



What we might can do, is search _all_ components of PATH for the binaries and
install everyone of them.


That will be cool. because there is the same problem with the following 
binaries


setfont, loadkeys, blkid and mount.



--
Judging by their response, the meanest thing you can do to people on 
the Internet is to give them really good software for free. - Anil Dash

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] build: lookup for the mount binary

2013-10-30 Thread Tom Gundersen
On Wed, Oct 30, 2013 at 7:12 PM, Cristian Rodríguez
crrodrig...@opensuse.org wrote:
 Real executable might be in /usr and not in /bin

I'm not against the patch, but the justification seems lacking... Does
anyone actually do this? I.e., have a mount that is not symlinked to
by /bin/mount?

-t

 ---
  configure.ac|  4 
  src/core/mount.c|  4 ++--
  src/remount-fs/remount-fs.c | 10 +-
  3 files changed, 11 insertions(+), 7 deletions(-)

 diff --git a/configure.ac b/configure.ac
 index 7e41d57..8ad3c43 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -78,6 +78,10 @@ AC_PATH_PROG([KMOD], [kmod], [/usr/bin/kmod])

  AC_PATH_PROG([KEXEC], [kexec], [/usr/sbin/kexec])

 +AC_PATH_PROG([MOUNT_BIN], [mount], [/bin/mount])
 +AC_DEFINE_UNQUOTED(MOUNT_BIN, [$MOUNT_BIN], [Path to /bin/mount])
 +
 +
  # gtkdocize greps for '^GTK_DOC_CHECK', so it needs to be on its own line
  m4_ifdef([GTK_DOC_CHECK], [
  GTK_DOC_CHECK([1.18],[--flavour no-tmpl])],
 diff --git a/src/core/mount.c b/src/core/mount.c
 index 88563b3..69c932b 100644
 --- a/src/core/mount.c
 +++ b/src/core/mount.c
 @@ -915,7 +915,7 @@ static void mount_enter_mounting(Mount *m) {
  if (m-from_fragment)
  r = exec_command_set(
  m-control_command,
 -/bin/mount,
 +MOUNT_BIN,
  m-parameters_fragment.what,
  m-where,
  -t, m-parameters_fragment.fstype ? 
 m-parameters_fragment.fstype : auto,
 @@ -974,7 +974,7 @@ static void mount_enter_remounting(Mount *m) {

  r = exec_command_set(
  m-control_command,
 -/bin/mount,
 +MOUNT_BIN,
  m-parameters_fragment.what,
  m-where,
  -t, m-parameters_fragment.fstype ? 
 m-parameters_fragment.fstype : auto,
 diff --git a/src/remount-fs/remount-fs.c b/src/remount-fs/remount-fs.c
 index 847637a..c1fc78b 100644
 --- a/src/remount-fs/remount-fs.c
 +++ b/src/remount-fs/remount-fs.c
 @@ -96,15 +96,15 @@ int main(int argc, char *argv[]) {
  const char *arguments[5];
  /* Child */

 -arguments[0] = /bin/mount;
 +arguments[0] = MOUNT_BIN;
  arguments[1] = me-mnt_dir;
  arguments[2] = -o;
  arguments[3] = remount;
  arguments[4] = NULL;

 -execv(/bin/mount, (char **) arguments);
 +execv(MOUNT_BIN, (char **) arguments);

 -log_error(Failed to execute /bin/mount: %m);
 +log_error(Failed to execute %s: %m, MOUNT_BIN);
  _exit(EXIT_FAILURE);
  }

 @@ -144,9 +144,9 @@ int main(int argc, char *argv[]) {
  if (s) {
  if (!is_clean_exit(si.si_code, si.si_status, NULL)) {
  if (si.si_code == CLD_EXITED)
 -log_error(/bin/mount for %s exited 
 with exit status %i., s, si.si_status);
 +log_error(%s for %s exited with 
 exit status %i., MOUNT_BIN, s, si.si_status);
  else
 -log_error(/bin/mount for %s 
 terminated by signal %s., s, signal_to_string(si.si_status));
 +log_error(%s for %s terminated by 
 signal %s., MOUNT_BIN, s, signal_to_string(si.si_status));

  ret = EXIT_FAILURE;
  }
 --
 1.8.4

 ___
 systemd-devel mailing list
 systemd-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/systemd-devel
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] build: lookup for the mount binary

2013-10-30 Thread Cristian Rodríguez
El mié 30 oct 2013 15:18:48 CLST, Tom Gundersen escribió:
 On Wed, Oct 30, 2013 at 7:12 PM, Cristian Rodríguez
 crrodrig...@opensuse.org wrote:
 Real executable might be in /usr and not in /bin

 I'm not against the patch, but the justification seems lacking... Does
 anyone actually do this? I.e., have a mount that is not symlinked to
 by /bin/mount?

I am not aware of anyone not having a symlink to /bin/mount.. however, 
when creating an initrd with dracut the symlink is not included (only 
the real binary is at /usr/bin/mount) and mounting stuff breaks.

It is either this patch or I should send a patch to dracut instead :-)

In any case, from my perspective this is the right thing to do anyway.


--
Any real systematist (or scientist in general) has to be ready to 
heave all that he or she has believed in, consider it crap, and move 
on, in the face of new evidence. That is how we differ from clerics.

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] build: lookup for the mount binary

2013-10-30 Thread Harald Hoyer
On 10/30/2013 07:27 PM, Cristian Rodríguez wrote:
 El mié 30 oct 2013 15:18:48 CLST, Tom Gundersen escribió:
 On Wed, Oct 30, 2013 at 7:12 PM, Cristian Rodríguez
 crrodrig...@opensuse.org wrote:
 Real executable might be in /usr and not in /bin

 I'm not against the patch, but the justification seems lacking... Does
 anyone actually do this? I.e., have a mount that is not symlinked to
 by /bin/mount?
 
 I am not aware of anyone not having a symlink to /bin/mount.. however, 
 when creating an initrd with dracut the symlink is not included (only 
 the real binary is at /usr/bin/mount) and mounting stuff breaks.
 
 It is either this patch or I should send a patch to dracut instead :-)
 
 In any case, from my perspective this is the right thing to do anyway.
 

Can you provide me the output of dracut --debug -f test.img, so I can see what
goes wrong?

Normally dracut also installs the symlink.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] build: lookup for the mount binary

2013-10-30 Thread Dave Reisner
On Wed, Oct 30, 2013 at 03:27:06PM -0300, Cristian Rodríguez wrote:
 El mié 30 oct 2013 15:18:48 CLST, Tom Gundersen escribió:
  On Wed, Oct 30, 2013 at 7:12 PM, Cristian Rodríguez
  crrodrig...@opensuse.org wrote:
  Real executable might be in /usr and not in /bin
 
  I'm not against the patch, but the justification seems lacking... Does
  anyone actually do this? I.e., have a mount that is not symlinked to
  by /bin/mount?
 
 I am not aware of anyone not having a symlink to /bin/mount.. however, 
 when creating an initrd with dracut the symlink is not included (only 
 the real binary is at /usr/bin/mount) and mounting stuff breaks.

I think Tom meant that /bin would be a symlink to /usr/bin, which
implicitly links /bin/mount to /usr/bin/mount.

 It is either this patch or I should send a patch to dracut instead :-)

If Dracut doesn't create the above symlink, it really needs to. Or, it
needs to install mount in the right place. I'm curious why you'd be
the first person to report such a failure.

 In any case, from my perspective this is the right thing to do anyway.
 
 --
 Any real systematist (or scientist in general) has to be ready to 
 heave all that he or she has believed in, consider it crap, and move 
 on, in the face of new evidence. That is how we differ from clerics.
 
 ___
 systemd-devel mailing list
 systemd-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/systemd-devel
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] build: lookup for the mount binary

2013-10-30 Thread Tom Gundersen
On Wed, Oct 30, 2013 at 7:51 PM, Cristian Rodríguez
crrodrig...@opensuse.org wrote:
 El 30/10/13 15:39, Dave Reisner escribió:

 I think Tom meant that /bin would be a symlink to /usr/bin, which
 implicitly links /bin/mount to /usr/bin/mount.

 In openSUSE, /bin is not a symlink to /usr/bin, only executables in that
 directory might be, mount is one of them.

 It is either this patch or I should send a patch to dracut instead :-)

 If Dracut doesn't create the above symlink, it really needs to. Or, it
 needs to install mount in the right place. I'm curious why you'd be
 the first person to report such a failure.

 Probably because we are just integrating dracut into openSUSE releases
 as the default initrd generator and I am trying to tackle some
 low-hanging fruit now ;-)

In this case, it probably makes sense to install all your binaries in
your initrd to /usr/bin/ and point /usr/sbin, /bin and /sbin all to
/usr/bin. Even if you don't do that in your real root. That should
hopefully remove most of the headaches.

Cheers,

Tom
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel