Skip to contentSkip to conversation

lms8: handle different host setups

PATCH In review Ross Burton 2 participants 2 messages Jun 25, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lms8: handle different host setups

The configure script looks at the *host* environment to decide where to install the init script, so it's location at packaging time can change.

---
 common/recipes-bsp/amt/lms8_8.0.0-7.bb |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
common/recipes-bsp/amt/lms8_8.0.0-7.bb +7 -1
index fbb4e45..65c413a 100644
@@ -26,7 +26,13 @@ INITSCRIPT_PARAMS = "defaults"
 do_install_append () {
 	mv ${D}/${sbindir}/lms ${D}/${sbindir}/lms8
 	install -d ${D}${sysconfdir}/init.d
-	mv ${D}${sysconfdir}/rc.d/init.d/lms ${D}${sysconfdir}/init.d/${INITSCRIPT_NAME}
+	# The configure script looks at the host to decide where to put init
+	# scripts, so move it at the same time as renaming it.
+	if test -f ${D}${sysconfdir}/rc.d/init.d/lms ; then
+		mv ${D}${sysconfdir}/rc.d/init.d/lms ${D}${sysconfdir}/init.d/${INITSCRIPT_NAME}
+	else
+		mv ${D}${sysconfdir}/init.d/lms ${D}${sysconfdir}/init.d/${INITSCRIPT_NAME}
+	fi
 	sed -i 's/^NAME=lms/NAME=lms8/' ${D}${sysconfdir}/init.d/${INITSCRIPT_NAME}
 	rmdir ${D}${datadir} || :
 }
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 4 lines · Ross Burton

The configure script looks at the *host* environment to decide where to install the init script, so it's location at packaging time can change.

Pulled into meta-intel/master.

Thanks,

Tom

Quoted 23 lines
---
 common/recipes-bsp/amt/lms8_8.0.0-7.bb |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
common/recipes-bsp/amt/lms8_8.0.0-7.bb +7 -1
index fbb4e45..65c413a 100644
@@ -26,7 +26,13 @@ INITSCRIPT_PARAMS = "defaults"
 do_install_append () {
 	mv ${D}/${sbindir}/lms ${D}/${sbindir}/lms8
 	install -d ${D}${sysconfdir}/init.d
-	mv ${D}${sysconfdir}/rc.d/init.d/lms ${D}${sysconfdir}/init.d/${INITSCRIPT_NAME}
+	# The configure script looks at the host to decide where to put init
+	# scripts, so move it at the same time as renaming it.
+	if test -f ${D}${sysconfdir}/rc.d/init.d/lms ; then
+		mv ${D}${sysconfdir}/rc.d/init.d/lms ${D}${sysconfdir}/init.d/${INITSCRIPT_NAME}
+	else
+		mv ${D}${sysconfdir}/init.d/lms ${D}${sysconfdir}/init.d/${INITSCRIPT_NAME}
+	fi
 	sed -i 's/^NAME=lms/NAME=lms8/' ${D}${sysconfdir}/init.d/${INITSCRIPT_NAME}
 	rmdir ${D}${datadir} || :
 }