2012-05-17 05:23:39

by Mike Frysinger

[permalink] [raw]
Subject: [PATCH] osd_login: fix DESTDIR install

If the destination dir doesn't exist, the current install fails:
make install-data-hook
make[4]: Entering directory `/var/tmp/portage/net-fs/nfs-utils-1.2.6/work/nfs-utils-1.2.6/utils/osd_login'
/usr/bin/install -c --mode 755 osd_login /var/tmp/portage/net-fs/nfs-utils-1.2.6/image//sbin/osd_login
/usr/bin/install: cannot create regular file ‘/var/tmp/portage/net-fs/nfs-utils-1.2.6/image//sbin/osd_login’: No such file or directory
make[4]: *** [install-data-hook] Error 1

Rewrite the code to use automake's existing script support rather
than trying to install the file by hand.

Reported-by: Branko BAdrljica <[email protected]>
Signed-off-by: Mike Frysinger <[email protected]>
---
utils/osd_login/Makefile.am | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/utils/osd_login/Makefile.am b/utils/osd_login/Makefile.am
index adc493a..c85584c 100644
--- a/utils/osd_login/Makefile.am
+++ b/utils/osd_login/Makefile.am
@@ -1,12 +1,11 @@
## Process this file with automake to produce Makefile.in

-OSD_LOGIN_FILES= osd_login
-
-EXTRA_DIST= $(OSD_LOGIN_FILES)
+# These scripts go in /sbin (not /usr/sbin), and that cannot be
+# overriden at config time.
+sbindir = /sbin

-all-local: $(OSD_LOGIN_FILES)
+OSD_LOGIN_FILES= osd_login

-install-data-hook:
- $(INSTALL) --mode 755 osd_login $(DESTDIR)/sbin/osd_login
+sbin_SCRIPTS= osd_login

MAINTAINERCLEANFILES = Makefile.in
--
1.7.8.6



2012-05-17 12:08:09

by Boaz Harrosh

[permalink] [raw]
Subject: Re: [PATCH] osd_login: fix DESTDIR install

On 05/17/2012 02:53 PM, Jim Rees wrote:

>
> Also it might be worth mentioning in the comment why we have this
> restriction.


This is because this script is called by Kernel and is
expected to be at /sbin/osd_login

Though there is a module param to change that.

Thanks, for the fix guys
Boaz



2012-05-17 12:20:02

by Boaz Harrosh

[permalink] [raw]
Subject: Re: [PATCH] osd_login: fix DESTDIR install

On 05/17/2012 08:24 AM, Mike Frysinger wrote:

> If the destination dir doesn't exist, the current install fails:
> make install-data-hook
> make[4]: Entering directory `/var/tmp/portage/net-fs/nfs-utils-1.2.6/work/nfs-utils-1.2.6/utils/osd_login'
> /usr/bin/install -c --mode 755 osd_login /var/tmp/portage/net-fs/nfs-utils-1.2.6/image//sbin/osd_login
> /usr/bin/install: cannot create regular file ‘/var/tmp/portage/net-fs/nfs-utils-1.2.6/image//sbin/osd_login’: No such file or directory
> make[4]: *** [install-data-hook] Error 1
>
> Rewrite the code to use automake's existing script support rather
> than trying to install the file by hand.
>
> Reported-by: Branko BAdrljica <[email protected]>
> Signed-off-by: Mike Frysinger <[email protected]>
> ---
> utils/osd_login/Makefile.am | 11 +++++------
> 1 files changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/utils/osd_login/Makefile.am b/utils/osd_login/Makefile.am
> index adc493a..c85584c 100644
> --- a/utils/osd_login/Makefile.am
> +++ b/utils/osd_login/Makefile.am
> @@ -1,12 +1,11 @@
> ## Process this file with automake to produce Makefile.in
>
> -OSD_LOGIN_FILES= osd_login
> -
> -EXTRA_DIST= $(OSD_LOGIN_FILES)
> +# These scripts go in /sbin (not /usr/sbin), and that cannot be
> +# overriden at config time.
> +sbindir = /sbin
>


On second thought, You know, I'm not sure about this fix.

A lot of times we install to a side folder, so we can later
tar and package the sub-folder without actually affecting
our live system. What will happen with the packagers that
are not RPM don't they rely on this?

I would like to let the user to install nfs-utils on the
side and to not conflict with the running system. Someone
how knows what he is doing can override the Kernel path
to what he wants. Just as he will need to override the
nfs init scripts.

So I would prefer if we can just create the $(DESTDIR)/sbin/


> -all-local: $(OSD_LOGIN_FILES)
> +OSD_LOGIN_FILES= osd_login
>
> -install-data-hook:
> - $(INSTALL) --mode 755 osd_login $(DESTDIR)/sbin/osd_login
> +sbin_SCRIPTS= osd_login
>


But actually I do not understand these Makefiles. It might be
that it's what I want with the above "sbin_SCRIPTS="

> MAINTAINERCLEANFILES = Makefile.in


Thanks
Boaz

2012-05-17 16:08:14

by Mike Frysinger

[permalink] [raw]
Subject: Re: [PATCH] osd_login: fix DESTDIR install

On Thursday 17 May 2012 09:09:25 Jim Rees wrote:
> Boaz Harrosh wrote:
>
> On second thought, You know, I'm not sure about this fix.
>
> A lot of times we install to a side folder, so we can later
> tar and package the sub-folder without actually affecting
> our live system. What will happen with the packagers that
> are not RPM don't they rely on this?
>
> I would like to let the user to install nfs-utils on the
> side and to not conflict with the running system. Someone
> how knows what he is doing can override the Kernel path
> to what he wants. Just as he will need to override the
> nfs init scripts.
>
> So I would prefer if we can just create the $(DESTDIR)/sbin/
>
> I think the makefiles already create $(DESTDIR)$(sbindir). The problem was
> that you weren't using $(DESTDIR)$(sbindir), you were using
> $(DESTDIR)/sbin. The patch sets $(sbindir) to /sbin, so everything should
> just work.
>
> But I could be wrong, automake is a black box to me.

i don't think that was the issue. the osd_login dir wasn't telling automake
that it was installing anything (whether sbindir or /sbin or anywhere else),
so this makefile didn't create the destdir automatically.

now that automake knows we have things to install into $sbindir (regardless of
its value), it knows it has to create it before trying to install things.

it might have worked in the past for people because either (1) they didn't use
DESTDIR into an empty path or (2) they weren't running in parallel so the
other subdir (that installs `mount`) took care of implicitly creating
$(DESTDIR)/sbin for them.
-mike


Attachments:
signature.asc (836.00 B)
This is a digitally signed message part.

2012-05-17 12:29:15

by Steve Dickson

[permalink] [raw]
Subject: Re: [PATCH] osd_login: fix DESTDIR install

Hey Jim,

On 05/17/2012 07:53 AM, Jim Rees wrote:
> Mike Frysinger wrote:
>
> diff --git a/utils/osd_login/Makefile.am b/utils/osd_login/Makefile.am
> index adc493a..c85584c 100644
> --- a/utils/osd_login/Makefile.am
> +++ b/utils/osd_login/Makefile.am
> @@ -1,12 +1,11 @@
> ## Process this file with automake to produce Makefile.in
>
> -OSD_LOGIN_FILES= osd_login
> -
> -EXTRA_DIST= $(OSD_LOGIN_FILES)
> +# These scripts go in /sbin (not /usr/sbin), and that cannot be
> +# overriden at config time.
> +sbindir = /sbin
>
> You misspelled "overridden." Yes, I know you just copied this line from
> mount/Makefile.am, but there is no sense compounding the error.
Thanks for pointing out the misspelling in mount/Makefile.am... its
been corrected...

steved.

>
> Also it might be worth mentioning in the comment why we have this
> restriction.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html

2012-05-17 12:28:15

by Steve Dickson

[permalink] [raw]
Subject: Re: [PATCH] osd_login: fix DESTDIR install



On 05/17/2012 01:24 AM, Mike Frysinger wrote:
> If the destination dir doesn't exist, the current install fails:
> make install-data-hook
> make[4]: Entering directory `/var/tmp/portage/net-fs/nfs-utils-1.2.6/work/nfs-utils-1.2.6/utils/osd_login'
> /usr/bin/install -c --mode 755 osd_login /var/tmp/portage/net-fs/nfs-utils-1.2.6/image//sbin/osd_login
> /usr/bin/install: cannot create regular file ‘/var/tmp/portage/net-fs/nfs-utils-1.2.6/image//sbin/osd_login’: No such file or directory
> make[4]: *** [install-data-hook] Error 1
>
> Rewrite the code to use automake's existing script support rather
> than trying to install the file by hand.
>
> Reported-by: Branko BAdrljica <[email protected]>
> Signed-off-by: Mike Frysinger <[email protected]>I
I took Neil's patch... commit d4d3920 which basically does
the same thing... (I believe)...

steved.

> ---
> utils/osd_login/Makefile.am | 11 +++++------
> 1 files changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/utils/osd_login/Makefile.am b/utils/osd_login/Makefile.am
> index adc493a..c85584c 100644
> --- a/utils/osd_login/Makefile.am
> +++ b/utils/osd_login/Makefile.am
> @@ -1,12 +1,11 @@
> ## Process this file with automake to produce Makefile.in
>
> -OSD_LOGIN_FILES= osd_login
> -
> -EXTRA_DIST= $(OSD_LOGIN_FILES)
> +# These scripts go in /sbin (not /usr/sbin), and that cannot be
> +# overriden at config time.
> +sbindir = /sbin
>
> -all-local: $(OSD_LOGIN_FILES)
> +OSD_LOGIN_FILES= osd_login
>
> -install-data-hook:
> - $(INSTALL) --mode 755 osd_login $(DESTDIR)/sbin/osd_login
> +sbin_SCRIPTS= osd_login
>
> MAINTAINERCLEANFILES = Makefile.in

2012-05-17 12:42:32

by NeilBrown

[permalink] [raw]
Subject: Re: [PATCH] osd_login: fix DESTDIR install

On Thu, 17 May 2012 08:27:43 -0400 Steve Dickson <[email protected]> wrote:

>
>
> On 05/17/2012 01:24 AM, Mike Frysinger wrote:
> > If the destination dir doesn't exist, the current install fails:
> > make install-data-hook
> > make[4]: Entering directory `/var/tmp/portage/net-fs/nfs-utils-1.2.6/work/nfs-utils-1.2.6/utils/osd_login'
> > /usr/bin/install -c --mode 755 osd_login /var/tmp/portage/net-fs/nfs-utils-1.2.6/image//sbin/osd_login
> > /usr/bin/install: cannot create regular file ‘/var/tmp/portage/net-fs/nfs-utils-1.2.6/image//sbin/osd_login’: No such file or directory
> > make[4]: *** [install-data-hook] Error 1
> >
> > Rewrite the code to use automake's existing script support rather
> > than trying to install the file by hand.
> >
> > Reported-by: Branko BAdrljica <[email protected]>
> > Signed-off-by: Mike Frysinger <[email protected]>I
> I took Neil's patch... commit d4d3920 which basically does
> the same thing... (I believe)...

Yes, nearly identical - I was stunned. :-)

NeilBrown


Attachments:
signature.asc (828.00 B)

2012-05-17 11:53:39

by Jim Rees

[permalink] [raw]
Subject: Re: [PATCH] osd_login: fix DESTDIR install

Mike Frysinger wrote:

diff --git a/utils/osd_login/Makefile.am b/utils/osd_login/Makefile.am
index adc493a..c85584c 100644
--- a/utils/osd_login/Makefile.am
+++ b/utils/osd_login/Makefile.am
@@ -1,12 +1,11 @@
## Process this file with automake to produce Makefile.in

-OSD_LOGIN_FILES= osd_login
-
-EXTRA_DIST= $(OSD_LOGIN_FILES)
+# These scripts go in /sbin (not /usr/sbin), and that cannot be
+# overriden at config time.
+sbindir = /sbin

You misspelled "overridden." Yes, I know you just copied this line from
mount/Makefile.am, but there is no sense compounding the error.

Also it might be worth mentioning in the comment why we have this
restriction.

2012-05-17 13:09:32

by Jim Rees

[permalink] [raw]
Subject: Re: [PATCH] osd_login: fix DESTDIR install

Boaz Harrosh wrote:

On second thought, You know, I'm not sure about this fix.

A lot of times we install to a side folder, so we can later
tar and package the sub-folder without actually affecting
our live system. What will happen with the packagers that
are not RPM don't they rely on this?

I would like to let the user to install nfs-utils on the
side and to not conflict with the running system. Someone
how knows what he is doing can override the Kernel path
to what he wants. Just as he will need to override the
nfs init scripts.

So I would prefer if we can just create the $(DESTDIR)/sbin/

I think the makefiles already create $(DESTDIR)$(sbindir). The problem was
that you weren't using $(DESTDIR)$(sbindir), you were using
$(DESTDIR)/sbin. The patch sets $(sbindir) to /sbin, so everything should
just work.

But I could be wrong, automake is a black box to me.

2012-05-17 13:42:32

by Boaz Harrosh

[permalink] [raw]
Subject: Re: [PATCH] osd_login: fix DESTDIR install

On 05/17/2012 04:09 PM, Jim Rees wrote:

> Boaz Harrosh wrote:
>
> On second thought, You know, I'm not sure about this fix.
>
> A lot of times we install to a side folder, so we can later
> tar and package the sub-folder without actually affecting
> our live system. What will happen with the packagers that
> are not RPM don't they rely on this?
>
> I would like to let the user to install nfs-utils on the
> side and to not conflict with the running system. Someone
> how knows what he is doing can override the Kernel path
> to what he wants. Just as he will need to override the
> nfs init scripts.
>
> So I would prefer if we can just create the $(DESTDIR)/sbin/
>
> I think the makefiles already create $(DESTDIR)$(sbindir). The problem was
> that you weren't using $(DESTDIR)$(sbindir), you were using
> $(DESTDIR)/sbin. The patch sets $(sbindir) to /sbin, so everything should
> just work.
>
> But I could be wrong, automake is a black box to me.


Make sense thanks. Just wanted to make sure.
Boaz