linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fix install/uninstall paths for cross compilation
@ 2005-10-26  5:38 Aras Vaichas
  2005-10-26 14:57 ` Kay Sievers
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Aras Vaichas @ 2005-10-26  5:38 UTC (permalink / raw)
  To: linux-hotplug

This patch fixes some problems with installing EXTRAS and uninstalling binaries 
and man pages when DESTDIR has been set e.g. for cross compilation, or creating 
an initrd

regards,

Aras Vaichas


--- Makefile.orig       2005-10-26 13:49:47.000000000 +1000
+++ Makefile    2005-10-26 15:21:35.000000000 +1000
@@ -123,7 +123,7 @@
  sbindir =      ${exec_prefix}/sbin
  usrbindir =    ${exec_prefix}/usr/bin
  usrsbindir =   ${exec_prefix}/usr/sbin
-mandir =       ${prefix}/usr/share/man
+mandir =       ${DESTDIR}/usr/share/man
  configdir =    ${etcdir}/udev
  udevdir =      /dev
  udevdb =       ${udevdir}/.udevdb
@@ -390,31 +390,41 @@
         $(INSTALL_PROGRAM) -D udevstart $(DESTDIR)$(sbindir)/udevstart
         @extras="$(EXTRAS)"; for target in $$extras; do \
                 echo $$target; \
-               $(MAKE) prefix=$(prefix) -C $$target $@; \
+               $(MAKE) DESTDIR=$(DESTDIR) prefix=$(prefix) -C $$target $@; \
         done;
  ifndef DESTDIR
         - killall udevd
         - rm -rf $(udevdb)
         - $(sbindir)/udevd --daemon
+else
+       @echo; \
+       echo "You will have to manually restart udevd on the target"; \
+       echo
  endif
  .PHONY: install-bin

  uninstall-bin:
-       - rm -f $(sbindir)/udev
-       - rm -f $(sbindir)/udevd
-       - rm -f $(sbindir)/udevsend
-       - rm -f $(sbindir)/udevinitsend
-       - rm -f $(sbindir)/udeveventrecoreder
-       - rm -f $(sbindir)/udevcontrol
-       - rm -f $(sbindir)/udevstart
-       - rm -f $(usrsbindir)/udevmonitor
-       - rm -f $(usrbindir)/udevinfo
-       - rm -f $(usrbindir)/udevtest
-       - rm -rf $(udevdb)
+       - rm -f $(DESTDIR)$(sbindir)/udev
+       - rm -f $(DESTDIR)$(sbindir)/udevd
+       - rm -f $(DESTDIR)$(sbindir)/udevsend
+       - rm -f $(DESTDIR)$(sbindir)/udevinitsend
+       - rm -f $(DESTDIR)$(sbindir)/udeveventrecoreder
+       - rm -f $(DESTDIR)$(sbindir)/udevcontrol
+       - rm -f $(DESTDIR)$(sbindir)/udevstart
+       - rm -f $(DESTDIR)$(usrsbindir)/udevmonitor
+       - rm -f $(DESTDIR)$(usrbindir)/udevinfo
+       - rm -f $(DESTDIR)$(usrbindir)/udevtest
+       - rm -rf $(DESTDIR)$(udevdb)
+ifndef DESTDIR
         - killall udevd
+else
+       @echo; \
+       echo "You will have to manually stop udevd on the target"; \
+       echo
+endif
         @extras="$(EXTRAS)"; for target in $$extras; do \
                 echo $$target; \
-               $(MAKE) prefix=$(prefix) -C $$target $@; \
+               $(MAKE) DESTDIR=$(DESTDIR) prefix=$(prefix) -C $$target $@; \
         done;
  .PHONY: uninstall-bin


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

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

* Re: [PATCH] fix install/uninstall paths for cross compilation
  2005-10-26  5:38 [PATCH] fix install/uninstall paths for cross compilation Aras Vaichas
@ 2005-10-26 14:57 ` Kay Sievers
  2005-10-27  0:59 ` Aras Vaichas
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Kay Sievers @ 2005-10-26 14:57 UTC (permalink / raw)
  To: linux-hotplug

On Wed, Oct 26, 2005 at 03:38:04PM +1000, Aras Vaichas wrote:
> This patch fixes some problems with installing EXTRAS and uninstalling 
> binaries and man pages when DESTDIR has been set e.g. for cross 
> compilation, or creating an initrd

Commandline options to make are automatically passed to the submakes,
no need to list them explicitly.

DESTDIR is for packaging. What would a "uninstall" be good for?

Kay


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

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

* Re: [PATCH] fix install/uninstall paths for cross compilation
  2005-10-26  5:38 [PATCH] fix install/uninstall paths for cross compilation Aras Vaichas
  2005-10-26 14:57 ` Kay Sievers
@ 2005-10-27  0:59 ` Aras Vaichas
  2005-10-31  1:56 ` Kay Sievers
  2005-10-31  4:08 ` Aras Vaichas
  3 siblings, 0 replies; 5+ messages in thread
From: Aras Vaichas @ 2005-10-27  0:59 UTC (permalink / raw)
  To: linux-hotplug

Kay Sievers wrote:
> On Wed, Oct 26, 2005 at 03:38:04PM +1000, Aras Vaichas wrote:
> 
>>This patch fixes some problems with installing EXTRAS and uninstalling 
>>binaries and man pages when DESTDIR has been set e.g. for cross 
>>compilation, or creating an initrd
> 
> 
> Commandline options to make are automatically passed to the submakes,
> no need to list them explicitly.

Can you confirm this by echoing DESTDIR in, say, extras/run_directory/Makefile?

This gave me an empty string unless I explicitly passed it to the submake. Did 
I make a mistake somewhere?


> DESTDIR is for packaging. What would a "uninstall" be good for?

To remove the man pages from an embedded Linux target which has no use for man 
pages, or to remove an old version of udev from an nfsroot "live" filing 
system. Considering that udev is in such active development, this will happen 
frequently.

It's common for me to do something like "make install" and then follow with a 
"make uninstall-man" or similar because it's easier during the development of a 
package or live filing system.

But I understand your point - "why would one delete files from a package that 
is to be shipped to somewhere else?" Yes?

Regardless, without my patch this Makefile was potentially fatal to the host 
system. When I ran "make install", it installed the binaries and man pages to 
the correct destination. e.g. /DESTDIR/sbin/ ... but when I ran "make 
uninstall-bin" it deleted the binaries from /sbin !

"uninstall" should remove the files from where "install" put them.


regards,

Aras Vaichas


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

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

* Re: [PATCH] fix install/uninstall paths for cross compilation
  2005-10-26  5:38 [PATCH] fix install/uninstall paths for cross compilation Aras Vaichas
  2005-10-26 14:57 ` Kay Sievers
  2005-10-27  0:59 ` Aras Vaichas
@ 2005-10-31  1:56 ` Kay Sievers
  2005-10-31  4:08 ` Aras Vaichas
  3 siblings, 0 replies; 5+ messages in thread
From: Kay Sievers @ 2005-10-31  1:56 UTC (permalink / raw)
  To: linux-hotplug

On Thu, Oct 27, 2005 at 10:59:33AM +1000, Aras Vaichas wrote:
> Kay Sievers wrote:
> >On Wed, Oct 26, 2005 at 03:38:04PM +1000, Aras Vaichas wrote:
> >
> >>This patch fixes some problems with installing EXTRAS and uninstalling 
> >>binaries and man pages when DESTDIR has been set e.g. for cross 
> >>compilation, or creating an initrd
> >
> >
> >Commandline options to make are automatically passed to the submakes,
> >no need to list them explicitly.
> 
> Can you confirm this by echoing DESTDIR in, say, 
> extras/run_directory/Makefile?

What do you mean with "echoing"? Sure, passing it the usual way to make
works, otherwise the package building which installs everything in a temp
directory to pack it into an archive wouldn't work.

  make DESTDIR=x EXTRAS=extras/volume_id install
  extras/volume_id
  make[1]: Entering directory `/home/kay/src/udev/extras/volume_id'
  /usr/bin/install -c vol_id x/sbin/vol_id

> This gave me an empty string unless I explicitly passed it to the submake. 
> Did I make a mistake somewhere?

That should work from the main Makefile, all other values are passed
that way too.

> >DESTDIR is for packaging. What would a "uninstall" be good for?
> 
> To remove the man pages from an embedded Linux target which has no use for 
> man pages, or to remove an old version of udev from an nfsroot "live" 
> filing system. Considering that udev is in such active development, this 
> will happen frequently.
> 
> It's common for me to do something like "make install" and then follow with 
> a "make uninstall-man" or similar because it's easier during the 
> development of a package or live filing system.
> 
> But I understand your point - "why would one delete files from a package 
> that is to be shipped to somewhere else?" Yes?
> 
> Regardless, without my patch this Makefile was potentially fatal to the 
> host system. When I ran "make install", it installed the binaries and man 
> pages to the correct destination. e.g. /DESTDIR/sbin/ ... but when I ran 
> "make uninstall-bin" it deleted the binaries from /sbin !
> 
> "uninstall" should remove the files from where "install" put them.

Ok, I've added the DESTDIR to the uninstall target. :)

Thanks,
Kay


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

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

* Re: [PATCH] fix install/uninstall paths for cross compilation
  2005-10-26  5:38 [PATCH] fix install/uninstall paths for cross compilation Aras Vaichas
                   ` (2 preceding siblings ...)
  2005-10-31  1:56 ` Kay Sievers
@ 2005-10-31  4:08 ` Aras Vaichas
  3 siblings, 0 replies; 5+ messages in thread
From: Aras Vaichas @ 2005-10-31  4:08 UTC (permalink / raw)
  To: linux-hotplug

Kay Sievers wrote:
> On Thu, Oct 27, 2005 at 10:59:33AM +1000, Aras Vaichas wrote:
> 
>>Kay Sievers wrote:
>>
>>>On Wed, Oct 26, 2005 at 03:38:04PM +1000, Aras Vaichas wrote:
>>>
>>>
>>>>This patch fixes some problems with installing EXTRAS and uninstalling 
>>>>binaries and man pages when DESTDIR has been set e.g. for cross 
>>>>compilation, or creating an initrd
>>>
>>>
>>>Commandline options to make are automatically passed to the submakes,
>>>no need to list them explicitly.
>>
>>Can you confirm this by echoing DESTDIR in, say, 
>>extras/run_directory/Makefile?
> 
> What do you mean with "echoing"? Sure, passing it the usual way to make

Sorry, I was being a bit lazy with my language! What I meant was to use echo as 
a debug statement in extras/*/Makefile to see if DESTDIR was actually being 
passed.

e.g. in extras/run_directory/Makefile

install-bin: all
+        @echo DESTDIR = $(DESTDIR)
         $(INSTALL_PROGRAM) udev_run_devd $(DESTDIR)$(sbindir)/udev_run_devd

The main Makefile explicitly passes "prefix" to the submake, so doesn't DESTDIR 
have to be passed as well? If I don't pass it, it doesn't get set.


>>"uninstall" should remove the files from where "install" put them.
> 
> Ok, I've added the DESTDIR to the uninstall target. :)

Thanks!

regards,

Aras Vaichas


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

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

end of thread, other threads:[~2005-10-31  4:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-26  5:38 [PATCH] fix install/uninstall paths for cross compilation Aras Vaichas
2005-10-26 14:57 ` Kay Sievers
2005-10-27  0:59 ` Aras Vaichas
2005-10-31  1:56 ` Kay Sievers
2005-10-31  4:08 ` Aras Vaichas

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).