Skip to contentSkip to conversation

automatically install correct initscript

PATCH Applied Robert Love 4 participants 10 messages Mar 2, 2004 – Mar 3, 2004 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 automatically install correct initscript

Here we go.

Should work, for SuSE, Red Hat, and Debian - albeit I didn't test it much :-)

Robert Love

 Makefile |   11 ++++++++++-
 TODO     |    1 - 
 2 files changed, 10 insertions(+), 2 deletions(-)
Makefile +10 -1
diff -urN udev-019/Makefile udev/Makefile
@@ -341,6 +341,15 @@
 	-
 endif
 
+install-initscript: etc/init.d/udev etc/init.d/udev.debian etc/init.d/udev.init.LSB
+	@if [ -f /etc/redhat-release ]; then \
+		$(INSTALL_DATA) etc/init.d/udev $(etcdir)/init.d/udev; \
+	elif [ -f /etc/SuSE-release ]; then \
+		$(INSTALL_DATA) etc/init.d/udev.init.LSB $(etcdir)/init.d/udev; \
+	elif [ -f /etc/debian_version ]; then \
+		$(INSTALL_DATA) etc/init.d/udev.debian $(etcdir)/init.d/udev; \
+	fi
+
 install-config: $(GEN_CONFIGS)
 	$(INSTALL) -d $(DESTDIR)$(configdir)
 	@if [ ! -r $(DESTDIR)$(configdir)udev.conf ]; then \
@@ -356,7 +365,7 @@
 		$(INSTALL_DATA) $(LOCAL_CFG_DIR)/udev.permissions $(DESTDIR)$(configdir); \
 	fi
 
-install: install-config install-dbus-policy all
+install: install-initscript install-config install-dbus-policy all
 	$(INSTALL) -d $(DESTDIR)$(udevdir)
 	$(INSTALL) -d $(DESTDIR)$(hotplugdir)
 	$(INSTALL_PROGRAM) -D $(ROOT) $(DESTDIR)$(sbindir)/$(ROOT)
TODO +0 -1
diff -urN udev-019/TODO udev/TODO
@@ -7,7 +7,6 @@
 
 
 - more documentation (can never have too much.)
-- install the proper init.d script based on the distro we are running on.
 - persuade the distro packagers to submit their changes (or just steal them
   if we can find them...)
 - create kernel name to devfs name config file so that all of the devfs users

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#1 lore raw
Quoted 4 lines · Robert Love

Here we go.

Should work, for SuSE, Red Hat, and Debian - albeit I didn't test it much :-)

Seems that line 380 of the Makefile doesn't play with you :)

Kay

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#2 lore raw
In reply to Robert Love
Quoted 1 line · Kay Sievers

Seems that line 380 of the Makefile doesn't play with you :)

Ack, I did not even see that! Thanks.

Let's rip that out, and always use the new built-in logic to determine what initscript to install.

Robert Love

 Makefile |   17 ++++++++++-------
 TODO     |    1 -
 2 files changed, 10 insertions(+), 8 deletions(-)
Makefile +10 -7
diff -urN udev-019/Makefile udev/Makefile
@@ -341,6 +341,15 @@
 	-
 endif
 
+install-initscript: etc/init.d/udev etc/init.d/udev.debian etc/init.d/udev.init.LSB
+	@if [ -f /etc/redhat-release ]; then \
+		$(INSTALL_DATA) etc/init.d/udev $(etcdir)/init.d/udev; \
+	elif [ -f /etc/SuSE-release ]; then \
+		$(INSTALL_DATA) etc/init.d/udev.init.LSB $(etcdir)/init.d/udev; \
+	elif [ -f /etc/debian_version ]; then \
+		$(INSTALL_DATA) etc/init.d/udev.debian $(etcdir)/init.d/udev; \
+	fi
+
 install-config: $(GEN_CONFIGS)
 	$(INSTALL) -d $(DESTDIR)$(configdir)
 	@if [ ! -r $(DESTDIR)$(configdir)udev.conf ]; then \
@@ -356,7 +365,7 @@
 		$(INSTALL_DATA) $(LOCAL_CFG_DIR)/udev.permissions $(DESTDIR)$(configdir); \
 	fi
 
-install: install-config install-dbus-policy all
+install: install-initscript install-config install-dbus-policy all
 	$(INSTALL) -d $(DESTDIR)$(udevdir)
 	$(INSTALL) -d $(DESTDIR)$(hotplugdir)
 	$(INSTALL_PROGRAM) -D $(ROOT) $(DESTDIR)$(sbindir)/$(ROOT)
@@ -364,12 +373,6 @@
 	$(INSTALL_PROGRAM) -D $(SENDER) $(DESTDIR)$(sbindir)/$(SENDER)
 	$(INSTALL_PROGRAM) -D $(HELPER) $(DESTDIR)$(sbindir)/$(HELPER)
 	$(INSTALL_PROGRAM) -D $(TESTER) $(DESTDIR)$(sbindir)/$(TESTER)
-	@if [ "x$(USE_LSB)" = "xtrue" ]; then \
-		$(INSTALL_PROGRAM) -D etc/init.d/udev.init.LSB $(DESTDIR)$(initdir)/udev; \
-		ln -s $(DESTDIR)$(initdir)/udev $(sbindir)/rcudev; \
-	else \
-		$(INSTALL_PROGRAM) -D etc/init.d/udev $(DESTDIR)$(initdir)/udev; \
-	fi
 	$(INSTALL_DATA) -D udev.8 $(DESTDIR)$(mandir)/man8/udev.8
 	$(INSTALL_DATA) -D udevinfo.8 $(DESTDIR)$(mandir)/man8/udevinfo.8
 	$(INSTALL_DATA) -D udevd.8 $(DESTDIR)$(mandir)/man8/udevd.8
TODO +0 -1
diff -urN udev-019/TODO udev/TODO
@@ -7,7 +7,6 @@
 
 
 - more documentation (can never have too much.)
-- install the proper init.d script based on the distro we are running on.
 - persuade the distro packagers to submit their changes (or just steal them
   if we can find them...)
 - create kernel name to devfs name config file so that all of the devfs users

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#3 lore raw
In reply to Robert Love
Quoted 8 lines · Robert Love
Quoted 1 line · Kay Sievers

Seems that line 380 of the Makefile doesn't play with you :)

Ack, I did not even see that! Thanks.

Let's rip that out, and always use the new built-in logic to determine what initscript to install.

Yes, it's fine now.
Hmm, whats left? TODO is almost empty for what I'm capable of :)

thanks,
Kay

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#4 lore raw
In reply to Robert Love
Quoted 4 lines · Robert Love

Ack, I did not even see that! Thanks.

Let's rip that out, and always use the new built-in logic to determine what initscript to install.

Hm, looks like we do not need the %{lsb} and USE_LSB logic at all, anymore.

Here is the patch, updated, removing both completely.

Robert Love

 Makefile  |   17 ++++++++++-------
 TODO      |    1 - 
 udev.spec |   10 ----------
 3 files changed, 10 insertions(+), 18 deletions(-)
Makefile +10 -7
diff -urN udev-019/Makefile udev/Makefile
@@ -341,6 +341,15 @@
 	-
 endif
 
+install-initscript: etc/init.d/udev etc/init.d/udev.debian etc/init.d/udev.init.LSB
+	@if [ -f /etc/redhat-release ]; then \
+		$(INSTALL_DATA) etc/init.d/udev $(etcdir)/init.d/udev; \
+	elif [ -f /etc/SuSE-release ]; then \
+		$(INSTALL_DATA) etc/init.d/udev.init.LSB $(etcdir)/init.d/udev; \
+	elif [ -f /etc/debian_version ]; then \
+		$(INSTALL_DATA) etc/init.d/udev.debian $(etcdir)/init.d/udev; \
+	fi
+
 install-config: $(GEN_CONFIGS)
 	$(INSTALL) -d $(DESTDIR)$(configdir)
 	@if [ ! -r $(DESTDIR)$(configdir)udev.conf ]; then \
@@ -356,7 +365,7 @@
 		$(INSTALL_DATA) $(LOCAL_CFG_DIR)/udev.permissions $(DESTDIR)$(configdir); \
 	fi
 
-install: install-config install-dbus-policy all
+install: install-initscript install-config install-dbus-policy all
 	$(INSTALL) -d $(DESTDIR)$(udevdir)
 	$(INSTALL) -d $(DESTDIR)$(hotplugdir)
 	$(INSTALL_PROGRAM) -D $(ROOT) $(DESTDIR)$(sbindir)/$(ROOT)
@@ -364,12 +373,6 @@
 	$(INSTALL_PROGRAM) -D $(SENDER) $(DESTDIR)$(sbindir)/$(SENDER)
 	$(INSTALL_PROGRAM) -D $(HELPER) $(DESTDIR)$(sbindir)/$(HELPER)
 	$(INSTALL_PROGRAM) -D $(TESTER) $(DESTDIR)$(sbindir)/$(TESTER)
-	@if [ "x$(USE_LSB)" = "xtrue" ]; then \
-		$(INSTALL_PROGRAM) -D etc/init.d/udev.init.LSB $(DESTDIR)$(initdir)/udev; \
-		ln -s $(DESTDIR)$(initdir)/udev $(sbindir)/rcudev; \
-	else \
-		$(INSTALL_PROGRAM) -D etc/init.d/udev $(DESTDIR)$(initdir)/udev; \
-	fi
 	$(INSTALL_DATA) -D udev.8 $(DESTDIR)$(mandir)/man8/udev.8
 	$(INSTALL_DATA) -D udevinfo.8 $(DESTDIR)$(mandir)/man8/udevinfo.8
 	$(INSTALL_DATA) -D udevd.8 $(DESTDIR)$(mandir)/man8/udevd.8
TODO +0 -1
diff -urN udev-019/TODO udev/TODO
@@ -7,7 +7,6 @@
 
 
 - more documentation (can never have too much.)
-- install the proper init.d script based on the distro we are running on.
 - persuade the distro packagers to submit their changes (or just steal them
   if we can find them...)
 - create kernel name to devfs name config file so that all of the devfs users
udev.spec +0 -10
diff -urN udev-019/udev.spec udev/udev.spec
@@ -27,11 +27,6 @@
 # 1 - debugging enabled
 %define debug 0
 
-# if we want to use the LSB version of the init script or the Redhat one
-# 0 - use Redhat: etc/init.d/udev
-# 1 - use LSB: etc/init.d/udev.init.LSB
-%define lsb 0
-
 # if we want to build the scsi_id "extra" package or not
 # 0 - do not build the package
 # 1 - build it
@@ -100,11 +95,6 @@
 %else
 	USE_SELINUXúlse	\
 %endif
-%if %{lsb}
-	USE_LSB=true		\
-%else
-	USE_LSBúlse		\
-%endif
 	EXTRAS="	\
 %if %{scsi_id}
 	extras/scsi_id	\

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

Applied
#5 lore raw
In reply to Robert Love
Quoted 11 lines · Robert Love
Quoted 4 lines · Robert Love

Ack, I did not even see that! Thanks.

Let's rip that out, and always use the new built-in logic to determine what initscript to install.

Hm, looks like we do not need the %{lsb} and USE_LSB logic at all, anymore.

Here is the patch, updated, removing both completely.

Looks great, thanks for it.

Applied,

greg k-h

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#6 lore raw
In reply to Robert Love
Quoted 11 lines · * Robert Love ([email protected]) wrote:
Quoted 4 lines · Robert Love

Ack, I did not even see that! Thanks.

Let's rip that out, and always use the new built-in logic to determine what initscript to install.

Hm, looks like we do not need the %{lsb} and USE_LSB logic at all, anymore.

Here is the patch, updated, removing both completely.

[snip]

Review

Quoted 7 lines
(quoted diff) +7 -0
+	@if [ -f /etc/redhat-release ]; then \
+		$(INSTALL_DATA) etc/init.d/udev $(etcdir)/init.d/udev; \
+	elif [ -f /etc/SuSE-release ]; then \
+		$(INSTALL_DATA) etc/init.d/udev.init.LSB $(etcdir)/init.d/udev; \
+	elif [ -f /etc/debian_version ]; then \
+		$(INSTALL_DATA) etc/init.d/udev.debian $(etcdir)/init.d/udev; \
+	fi

[snip]

Speaking as a package and distribution maintainer and all around CM and
build guy, there are two problems I feel the need to point out. First, you're installing into $(etcdir) directly. Bad, Bad, Bad. -always- obey DESTDIR. -always-. Second, the distro I'm installing into isn't necessarily the distro I'm building on. Any opposition to making the tests obey DESTDIR as well?
--
Chris Larson - kergoth at handhelds dot org
Embedded Linux Developer - clarson at ti dot com
OpenZaurus Project Maintainer - http://openzaurus.org/

#
# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
#

Makefile renamed from Makefile~fix-initscriptinstall-destdir +6 -6
@@ -342,12 +342,12 @@
 endif
 
 install-initscript: etc/init.d/udev etc/init.d/udev.debian etc/init.d/udev.init.LSB
-	@if [ -f /etc/redhat-release ]; then \
-		$(INSTALL_DATA) etc/init.d/udev $(etcdir)/init.d/udev; \
-	elif [ -f /etc/SuSE-release ]; then \
-		$(INSTALL_DATA) etc/init.d/udev.init.LSB $(etcdir)/init.d/udev; \
-	elif [ -f /etc/debian_version ]; then \
-		$(INSTALL_DATA) etc/init.d/udev.debian $(etcdir)/init.d/udev; \
+	@if [ -f $(DESTDIR)/etc/redhat-release ]; then \
+		$(INSTALL_DATA) etc/init.d/udev $(DESTDIR)$(etcdir)/init.d/udev; \
+	elif [ -f $(DESTDIR)/etc/SuSE-release ]; then \
+		$(INSTALL_DATA) etc/init.d/udev.init.LSB $(DESTDIR)$(etcdir)/init.d/udev; \
+	elif [ -f $(DESTDIR)/etc/debian_version ]; then \
+		$(INSTALL_DATA) etc/init.d/udev.debian $(DESTDIR)$(etcdir)/init.d/udev; \
 	fi
 
 install-config: $(GEN_CONFIGS)
#7 lore raw
In reply to Robert Love
Quoted 6 lines · Chris Larson

Speaking as a package and distribution maintainer and all around CM and
build guy, there are two problems I feel the need to point out. First, you're installing into $(etcdir) directly. Bad, Bad, Bad. -always- obey DESTDIR. -always-. Second, the distro I'm installing into isn't necessarily the distro I'm building on. Any opposition to making the tests obey DESTDIR as well?

I already made this change in the 021 release.

As for the cross-distro install issue, do you have any suggestions?

thanks,

greg k-h

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#8 lore raw
In reply to Robert Love
Quoted 9 lines · * Greg KH ([email protected]) wrote:
Quoted 6 lines · Chris Larson

Speaking as a package and distribution maintainer and all around CM and
build guy, there are two problems I feel the need to point out. First, you're installing into $(etcdir) directly. Bad, Bad, Bad. -always- obey DESTDIR. -always-. Second, the distro I'm installing into isn't necessarily the distro I'm building on. Any opposition to making the tests obey DESTDIR as well?

I already made this change in the 021 release.

Oh good, glad to hear it.

Quoted 1 line

As for the cross-distro install issue, do you have any suggestions?

Well, how about something as simple as using a makefile variable that contains the name of the initscript to be installed, so that it can be easily overridden by those building it?
--
Chris Larson - kergoth at handhelds dot org
Embedded Linux Developer - clarson at ti dot com
OpenZaurus Project Maintainer - http://openzaurus.org/

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#9 lore raw
In reply to Robert Love
Quoted 11 lines · Chris Larson
Quoted 9 lines · * Greg KH ([email protected]) wrote:
Quoted 6 lines · Chris Larson

Speaking as a package and distribution maintainer and all around CM and
build guy, there are two problems I feel the need to point out. First, you're installing into $(etcdir) directly. Bad, Bad, Bad. -always- obey DESTDIR. -always-. Second, the distro I'm installing into isn't necessarily the distro I'm building on. Any opposition to making the tests obey DESTDIR as well?

I already made this change in the 021 release.

Quoted 7 lines

Oh good, glad to hear it.

Quoted 1 line

As for the cross-distro install issue, do you have any suggestions?

Well, how about something as simple as using a makefile variable that contains the name of the initscript to be installed, so that it can be easily overridden by those building it?

Sounds good to me, care to write a patch? :)

thanks,

greg k-h

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel