Skip to contentSkip to conversation

dbus: Remove hardcoded reference to /usr in System V startup script

PATCH Applied Phil Blundell 4 participants 5 messages Sep 22, 2012 – Sep 24, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dbus: Remove hardcoded reference to /usr in System V startup script

Use ${bindir} to locate the binary instead.

---
 meta/recipes-core/dbus/dbus-1.6.4/dbus-1.init |    2 +-
 meta/recipes-core/dbus/dbus.inc               |    5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)
meta/recipes-core/dbus/dbus-1.6.4/dbus-1.init +1 -1
index 17b58ed..64f2170 100644
@@ -16,7 +16,7 @@
 
 set -e
 
-DAEMON=/usr/bin/dbus-daemon
+DAEMON=@bindir@/dbus-daemon
 NAME=dbus
 DAEMONUSER=messagebus           # must match /etc/dbus-1/system.conf
 PIDFILE=/var/run/messagebus.pid # must match /etc/dbus-1/system.conf
meta/recipes-core/dbus/dbus.inc +3 -2
index 8f35f56..5c99e11 100644
@@ -10,7 +10,7 @@ DEPENDS = "expat virtual/libintl ${@base_contains('DISTRO_FEATURES', 'x11', '${X
 DEPENDS_virtclass-native = "expat-native virtual/libintl-native"
 DEPENDS_virtclass-nativesdk = "nativesdk-expat virtual/nativesdk-libintl virtual/libx11"
 
-INC_PR = "r3"
+INC_PR = "r4"
 
 SRC_URI = "http://dbus.freedesktop.org/releases/dbus/dbus-${PV}.tar.gz \
            file://tmpdir.patch; \
@@ -79,7 +79,8 @@ do_install() {
 	autotools_do_install
 
 	install -d ${D}${sysconfdir}/init.d
-	install -m 0755 ${WORKDIR}/dbus-1.init ${D}${sysconfdir}/init.d/dbus-1
+	sed 's:@bindir@:${bindir}:' < ${WORKDIR}/dbus-1.init >${WORKDIR}/dbus-1.init.sh
+	install -m 0755 ${WORKDIR}/dbus-1.init.sh ${D}${sysconfdir}/init.d/dbus-1
 
 	install -d ${D}${sysconfdir}/default/volatiles
 	echo "d messagebus messagebus 0755 ${localstatedir}/run/dbus none" \
Signature · 1 line
1.7.9
#1 lore raw

meta/recipes-core/dbus/dbus.inc do_install() { · line 82

Quoted 2 lines · Phil Blundell
meta/recipes-core/dbus/dbus.inc +1 -1
-	install -m 0755 ${WORKDIR}/dbus-1.init ${D}${sysconfdir}/init.d/dbus-1
+	sed 's:@bindir@:${bindir}:' < ${WORKDIR}/dbus-1.init >${WORKDIR}/dbus-1.init.sh

Does that actually work? The variable reference is inside single quotes so it won't be expanded by the shell, right?

#2 lore raw
Quoted 6 lines · On Sunday 23 September 2012 15:45:20 Colin Walters wrote:
Quoted 3 lines · Phil Blundell
(quoted diff) +1 -1
-	install -m 0755 ${WORKDIR}/dbus-1.init ${D}${sysconfdir}/init.d/dbus-1
+	sed 's:@bindir@:${bindir}:' < ${WORKDIR}/dbus-1.init
Quoted 1 line

${WORKDIR}/dbus-1.init.sh

Does that actually work? The variable reference is inside single quotes so it won't be expanded by the shell, right?

What is being expanded here at parse time is a bitbake variable rather than a shell variable, so it should work fine.

Cheers,
Paul

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre
#3 lore raw
Quoted 2 lines · Paul Eggleton

What is being expanded here at parse time is a bitbake variable rather than a shell variable, so it should work fine.

Ok, sorry for the noise.