linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] osd_login: fix DESTDIR install
@ 2012-05-17  5:24 Mike Frysinger
  2012-05-17 11:53 ` Jim Rees
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Mike Frysinger @ 2012-05-17  5:24 UTC (permalink / raw)
  To: linux-nfs

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 <brankob@avtomatika.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 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


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] osd_login: fix DESTDIR install
  2012-05-17  5:24 [PATCH] osd_login: fix DESTDIR install Mike Frysinger
@ 2012-05-17 11:53 ` Jim Rees
  2012-05-17 12:07   ` Boaz Harrosh
  2012-05-17 12:28   ` Steve Dickson
  2012-05-17 12:19 ` Boaz Harrosh
  2012-05-17 12:27 ` Steve Dickson
  2 siblings, 2 replies; 10+ messages in thread
From: Jim Rees @ 2012-05-17 11:53 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: linux-nfs

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.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] osd_login: fix DESTDIR install
  2012-05-17 11:53 ` Jim Rees
@ 2012-05-17 12:07   ` Boaz Harrosh
  2012-05-17 12:28   ` Steve Dickson
  1 sibling, 0 replies; 10+ messages in thread
From: Boaz Harrosh @ 2012-05-17 12:07 UTC (permalink / raw)
  To: Jim Rees; +Cc: Mike Frysinger, linux-nfs

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



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] osd_login: fix DESTDIR install
  2012-05-17  5:24 [PATCH] osd_login: fix DESTDIR install Mike Frysinger
  2012-05-17 11:53 ` Jim Rees
@ 2012-05-17 12:19 ` Boaz Harrosh
  2012-05-17 13:09   ` Jim Rees
  2012-05-17 12:27 ` Steve Dickson
  2 siblings, 1 reply; 10+ messages in thread
From: Boaz Harrosh @ 2012-05-17 12:19 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: linux-nfs

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 <brankob@avtomatika.com>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> ---
>  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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] osd_login: fix DESTDIR install
  2012-05-17  5:24 [PATCH] osd_login: fix DESTDIR install Mike Frysinger
  2012-05-17 11:53 ` Jim Rees
  2012-05-17 12:19 ` Boaz Harrosh
@ 2012-05-17 12:27 ` Steve Dickson
  2012-05-17 12:42   ` NeilBrown
  2 siblings, 1 reply; 10+ messages in thread
From: Steve Dickson @ 2012-05-17 12:27 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: linux-nfs



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 <brankob@avtomatika.com>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] osd_login: fix DESTDIR install
  2012-05-17 11:53 ` Jim Rees
  2012-05-17 12:07   ` Boaz Harrosh
@ 2012-05-17 12:28   ` Steve Dickson
  1 sibling, 0 replies; 10+ messages in thread
From: Steve Dickson @ 2012-05-17 12:28 UTC (permalink / raw)
  To: Jim Rees; +Cc: Mike Frysinger, linux-nfs

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 majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] osd_login: fix DESTDIR install
  2012-05-17 12:27 ` Steve Dickson
@ 2012-05-17 12:42   ` NeilBrown
  0 siblings, 0 replies; 10+ messages in thread
From: NeilBrown @ 2012-05-17 12:42 UTC (permalink / raw)
  To: Steve Dickson; +Cc: Mike Frysinger, linux-nfs

[-- Attachment #1: Type: text/plain, Size: 1050 bytes --]

On Thu, 17 May 2012 08:27:43 -0400 Steve Dickson <SteveD@redhat.com> 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 <brankob@avtomatika.com>
> > Signed-off-by: Mike Frysinger <vapier@gentoo.org>I
> I took Neil's patch... commit d4d3920 which basically does
> the same thing... (I believe)...  

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

NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] osd_login: fix DESTDIR install
  2012-05-17 12:19 ` Boaz Harrosh
@ 2012-05-17 13:09   ` Jim Rees
  2012-05-17 13:42     ` Boaz Harrosh
  2012-05-17 16:08     ` Mike Frysinger
  0 siblings, 2 replies; 10+ messages in thread
From: Jim Rees @ 2012-05-17 13:09 UTC (permalink / raw)
  To: Boaz Harrosh; +Cc: Mike Frysinger, linux-nfs

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.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] osd_login: fix DESTDIR install
  2012-05-17 13:09   ` Jim Rees
@ 2012-05-17 13:42     ` Boaz Harrosh
  2012-05-17 16:08     ` Mike Frysinger
  1 sibling, 0 replies; 10+ messages in thread
From: Boaz Harrosh @ 2012-05-17 13:42 UTC (permalink / raw)
  To: Jim Rees; +Cc: Mike Frysinger, linux-nfs

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] osd_login: fix DESTDIR install
  2012-05-17 13:09   ` Jim Rees
  2012-05-17 13:42     ` Boaz Harrosh
@ 2012-05-17 16:08     ` Mike Frysinger
  1 sibling, 0 replies; 10+ messages in thread
From: Mike Frysinger @ 2012-05-17 16:08 UTC (permalink / raw)
  To: Jim Rees; +Cc: Boaz Harrosh, linux-nfs

[-- Attachment #1: Type: Text/Plain, Size: 1660 bytes --]

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

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-05-17 16:08 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-17  5:24 [PATCH] osd_login: fix DESTDIR install Mike Frysinger
2012-05-17 11:53 ` Jim Rees
2012-05-17 12:07   ` Boaz Harrosh
2012-05-17 12:28   ` Steve Dickson
2012-05-17 12:19 ` Boaz Harrosh
2012-05-17 13:09   ` Jim Rees
2012-05-17 13:42     ` Boaz Harrosh
2012-05-17 16:08     ` Mike Frysinger
2012-05-17 12:27 ` Steve Dickson
2012-05-17 12:42   ` NeilBrown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).