Skip to contentSkip to conversation

fix some hardcoded paths

PATCH New André Draszik 1 participant 6 messages Jul 24, 2015

lore
Share & tools
lore
#0 lore raw

cover fix some hardcoded paths

These patches update a few places where we can use ${sysconfdir} ${bindir} etc. instead of hardcoding them.

#1 lore raw

PATCH 1/5 rsync: use ${sysconfdir} instead of hardcoding /etc

From: André Draszik <[email protected]>

---
 meta/recipes-devtools/rsync/rsync.inc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/recipes-devtools/rsync/rsync.inc +2 -2
index 4223c59..c65f270 100644
@@ -16,8 +16,8 @@ SRC_URI = "http://rsync.samba.org/ftp/rsync/src/rsync-${PV}.tar.gz \
 inherit autotools
 
 do_install_append() {
-	install -d ${D}/etc
-	install -m 0644 ${WORKDIR}/rsyncd.conf ${D}/etc
+	install -d ${D}${sysconfdir}
+	install -m 0644 ${WORKDIR}/rsyncd.conf ${D}${sysconfdir}
 }
 
 EXTRA_OEMAKE='STRIP=""'
Signature · 1 line
2.1.4
#2 lore raw

PATCH 2/5 opkg: read config file from ${sysconfdir} instead of /etc

In reply to André Draszik

From: André Draszik <[email protected]>

Opkg's configure script doesn't use the value from --sysconfdir to determine the location of the conf file, it uses the value from --with-opkgetcdir

---
 meta/recipes-devtools/opkg/opkg_0.2.4.bb | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-devtools/opkg/opkg_0.2.4.bb +1 -0
index ec0f923..56df920 100644
@@ -38,6 +38,7 @@ PACKAGECONFIG[sha256] = "--enable-sha256,--disable-sha256"
 PACKAGECONFIG[pathfinder] = "--enable-pathfinder,--disable-pathfinder,pathfinder"
 
 EXTRA_OECONF = "\
+  --with-opkgetcdir=${sysconfdir} \
   --with-opkglibdir=${OPKGLIBDIR} \
 "
 
Signature · 1 line
2.1.4
#3 lore raw

PATCH 3/5 initscripts: urandom: respect ${localstatedir} instead of hardcoding /var

In reply to André Draszik

From: André Draszik <[email protected]>

---
 meta/recipes-core/initscripts/initscripts_1.0.bb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/recipes-core/initscripts/initscripts_1.0.bb +2 -1
index b1d917d..f90de6e 100644
@@ -79,7 +79,7 @@ do_install () {
 	install -d ${D}${sysconfdir}/default
 	install -d ${D}${sysconfdir}/default/volatiles
 	# Holds state information pertaining to urandom
-	install -d ${D}/var/lib/urandom
+	install -d ${D}${localstatedir}/lib/urandom
 
 	install -m 0644    ${WORKDIR}/functions		${D}${sysconfdir}/init.d
 	install -m 0755    ${WORKDIR}/bootmisc.sh	${D}${sysconfdir}/init.d
@@ -94,6 +94,7 @@ do_install () {
 	install -m 0755    ${WORKDIR}/single		${D}${sysconfdir}/init.d
 	install -m 0755    ${WORKDIR}/umountnfs.sh	${D}${sysconfdir}/init.d
 	install -m 0755    ${WORKDIR}/urandom		${D}${sysconfdir}/init.d
+	sed -i ${D}${sysconfdir}/init.d/urandom -e 's,/var/,${localstatedir}/,g;s,/etc/,${sysconfdir}/,g'
 	install -m 0755    ${WORKDIR}/devpts.sh	${D}${sysconfdir}/init.d
 	install -m 0755    ${WORKDIR}/devpts		${D}${sysconfdir}/default
 	install -m 0755    ${WORKDIR}/sysfs.sh		${D}${sysconfdir}/init.d
Signature · 1 line
2.1.4
#4 lore raw

PATCH 4/5 run-postinsts: use ${localstatedir} instead of hardcoding /var/lib

In reply to André Draszik

From: André Draszik <[email protected]>

---
 meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts | 2 +-
 meta/recipes-devtools/run-postinsts/run-postinsts_1.0.bb        | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts +1 -1
index ac9cee6..58ea85e 100755
@@ -20,7 +20,7 @@ for pm in $backend_list; do
 
 	case $pm in
 		"deb")
-			if [ -s "/var/lib/dpkg/status" ]; then
+			if [ -s "#LOCALSTATEDIR#/lib/dpkg/status" ]; then
 				pm_installed=true
 				break
 			fi
meta/recipes-devtools/run-postinsts/run-postinsts_1.0.bb +1 -0
index d126132..11c94e5 100644
@@ -39,6 +39,7 @@ do_install() {
 	sed -i -e 's:#SYSCONFDIR#:${sysconfdir}:g' \
                -e 's:#SBINDIR#:${sbindir}:g' \
                -e 's:#BASE_BINDIR#:${base_bindir}:g' \
+               -e 's:#LOCALSTATEDIR#:${localstatedir}:g' \
                ${D}${sbindir}/run-postinsts \
                ${D}${systemd_unitdir}/system/run-postinsts.service
 }
Signature · 1 line
2.1.4
#5 lore raw

PATCH 5/5 opkg-utils: use ${bindir} instead of hardcoding /usr/bin

In reply to André Draszik

From: André Draszik <[email protected]>

---
 meta/recipes-devtools/opkg-utils/opkg-utils_git.bb | 4 ++++
 1 file changed, 4 insertions(+)
meta/recipes-devtools/opkg-utils/opkg-utils_git.bb +4 -0
index 2f66632..5f518d2 100644
@@ -28,6 +28,10 @@ do_install() {
 	oe_runmake PREFIX=${prefix} DESTDIR=${D} install
 }
 
+do_install_append_class-target() {
+	sed -i ${D}${bindir}/update-alternatives -e 's,/usr/bin,${bindir},g; s,/usr/lib,${libdir},g'
+}
+
 PACKAGES =+ "update-alternatives-opkg"
 FILES_update-alternatives-opkg = "${bindir}/update-alternatives"
 RPROVIDES_update-alternatives-opkg = "update-alternatives update-alternatives-cworth"
Signature · 1 line
2.1.4