Skip to contentSkip to conversation

containerd: Replace /lib/systemd/system with ${systemd_system_unitdir}

PATCH In review Amarnath Valluri 3 participants 8 messages Feb 8, 2017 – Feb 9, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 containerd: Replace /lib/systemd/system with ${systemd_system_unitdir}

Make use of bitbake variable where appropriate, this makes the recipe portable.

---
 recipes-containers/containerd/containerd_git.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-containers/containerd/containerd_git.bb +1 -1
index ca99e55..77c3e93 100644
@@ -83,6 +83,6 @@ do_install() {
 	fi
 }
 
-FILES_${PN} += "/lib/systemd/system/*"
+FILES_${PN} += "${systemd_system_unitdir}/*"
 
 INHIBIT_PACKAGE_STRIP = "1"
Signature · 1 line
2.7.4
#1 lore raw

PATCH 2/4 docker: Replace /usr/share with ${datadir}

Make use of bitbake variable where appropriate, this makes the recipe portable.

---
 recipes-containers/docker/docker_git.bb | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
recipes-containers/docker/docker_git.bb +5 -5
index 62a016a..c22b916 100644
@@ -142,18 +142,18 @@ do_install() {
 		install -m 0755 ${WORKDIR}/docker.init ${D}${sysconfdir}/init.d/docker.init
 	fi
 
-	mkdir -p ${D}/usr/share/docker/
-	cp ${WORKDIR}/hi.Dockerfile ${D}/usr/share/docker/
-	install -m 0755 ${S}/contrib/check-config.sh ${D}/usr/share/docker/
+	mkdir -p ${D}${datadir}/docker/
+	cp ${WORKDIR}/hi.Dockerfile ${D}${datadir}/docker/
+	install -m 0755 ${S}/contrib/check-config.sh ${D}${datadir}/docker/
 }
 
 inherit useradd
 USERADD_PACKAGES = "${PN}"
 GROUPADD_PARAM_${PN} = "-r docker"
 
-FILES_${PN} += "/lib/systemd/system/*"
+FILES_${PN} += "${systemd_unitdir}/system/*"
 
-FILES_${PN}-contrib += "/usr/share/docker/check-config.sh"
+FILES_${PN}-contrib += "${datadir}/docker/check-config.sh"
 RDEPENDS_${PN}-contrib += "bash"
 
 # DO NOT STRIP docker
Signature · 1 line
2.7.4
#2 lore raw

PATCH 3/4 lxc: Make use of bitbake variables where appropriate.

In reply to Amarnath Valluri
---
 recipes-containers/lxc/lxc_2.0.0.bb | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
recipes-containers/lxc/lxc_2.0.0.bb +3 -4
index dcbd171..2e6b967 100644
@@ -92,10 +92,9 @@ RDEPENDS_${PN}-templates += "bash"
 
 ALLOW_EMPTY_${PN}-networking = "1"
 
-FILES_${PN}-setup += "/etc/tmpfiles.d"
-FILES_${PN}-setup += "/lib/systemd/system"
-FILES_${PN}-setup += "/usr/lib/systemd/system"
-FILES_${PN}-setup += "/etc/init.d"
+FILES_${PN}-setup += "${sysconfdir}/tmpfiles.d"
+FILES_${PN}-setup += "${systemd_system_unitdir}"
+FILES_${PN}-setup += "${sysconfdir}/init.d"
 
 PRIVATE_LIBS_${PN}-ptest = "liblxc.so.1"
 
Signature · 1 line
2.7.4
#3 lore raw

PATCH 4/4 libvirt: Replace systemd units location to match with bitbake environment.

In reply to Amarnath Valluri
---
 recipes-extended/libvirt/libvirt_1.3.5.bb | 6 ++++++
 1 file changed, 6 insertions(+)
recipes-extended/libvirt/libvirt_1.3.5.bb +6 -0
index c848c99..206f59f 100644
@@ -213,6 +213,12 @@ PACKAGECONFIG[wireshark] = "--with-wireshark-dissector,--without-wireshark-disse
 # Enable the Python tool support
 require libvirt-python.inc
 
+do_configure_prepend() {
+	systemd_system_unitdir="${@d.getVar('systemd_system_unitdir')}"
+	sed -i -e "s;^SYSTEMD_UNIT_DIR =.*;SYSTEMD_UNIT_DIR = $systemd_system_unitdir;" \
+	     ${S}/daemon/Makefile.am ${S}/src/Makefile.am ${S}/tools/Makefile.am
+}
+
 do_install_append() {
 	install -d ${D}/etc/init.d
 	install -d ${D}/etc/libvirt
Signature · 1 line
2.7.4
#4 lore raw

Re: [PATCH 4/4] libvirt: Replace systemd units location to match with bitbake environment.

Quoted 10 lines · Amarnath Valluri
---
 recipes-extended/libvirt/libvirt_1.3.5.bb | 6 ++++++
 1 file changed, 6 insertions(+)
recipes-extended/libvirt/libvirt_1.3.5.bb +0 -0
index c848c99..206f59f 100644

recipes-extended/libvirt/libvirt_1.3.5.bb PACKAGECONFIG[wireshark] = "--with-wireshark-dissector,--without-wireshark-disse · line 219

Quoted 7 lines
recipes-extended/libvirt/libvirt_1.3.5.bb +4 -0
@@ -213,6 +213,12 @@ PACKAGECONFIG[wireshark] = "--with-wireshark-dissector,--without-wireshark-disse
 # Enable the Python tool support
 require libvirt-python.inc
 
+do_configure_prepend() {
+       systemd_system_unitdir="${@d.getVar('systemd_system_unitdir')}"
+       sed -i -e "s;^SYSTEMD_UNIT_DIR =.*;SYSTEMD_UNIT_DIR = $systemd_system_unitdir;" \
+            ${S}/daemon/Makefile.am ${S}/src/Makefile.am ${S}/tools/Makefile.am

The others patches look fine but for this one is there no way to pass the value to make? I almost prefer to have this taken care of via a patch to the source instead of sed expressions here.

Mark

Quoted 13 lines
recipes-extended/libvirt/libvirt_1.3.5.bb +2 -1
+}
+
 do_install_append() {
        install -d ${D}/etc/init.d
        install -d ${D}/etc/libvirt
--

2.7.4

--
_______________________________________________
meta-virtualization mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-virtualization

author
#5 lore raw

Re: [PATCH 4/4] libvirt: Replace systemd units location to match with bitbake environment.

Quoted 15 lines · Mark Asselstine
Quoted 13 lines · Amarnath Valluri
---
  recipes-extended/libvirt/libvirt_1.3.5.bb | 6 ++++++
  1 file changed, 6 insertions(+)
recipes-extended/libvirt/libvirt_1.3.5.bb +0 -0
index c848c99..206f59f 100644
@@ -213,6 +213,12 @@ PACKAGECONFIG[wireshark] = "--with-wireshark-dissector,--without-wireshark-disse
  # Enable the Python tool support
  require libvirt-python.inc
 
Quoted 7 lines

recipes-extended/libvirt/libvirt_1.3.5.bb PACKAGECONFIG[wireshark] = "--with-wireshark-dissector,--without-wireshark-disse · line 219

Quoted 4 lines
recipes-extended/libvirt/libvirt_1.3.5.bb +4 -0
+do_configure_prepend() {
+       systemd_system_unitdir="${@d.getVar('systemd_system_unitdir')}"
+       sed -i -e "s;^SYSTEMD_UNIT_DIR =.*;SYSTEMD_UNIT_DIR = $systemd_system_unitdir;" \
+            ${S}/daemon/Makefile.am ${S}/src/Makefile.am ${S}/tools/Makefile.am

The others patches look fine but for this one is there no way to pass the value to make? I almost prefer to have this taken care of via a patch to the source instead of sed expressions here.

Its value is hard coded in Makefile.am, one thing we can do is to patch the configure.ac to make systemd unit dir configurable from outside. I can send the V2 with this change.

-Amarnath

#6 lore raw

Re: [PATCH 4/4] libvirt: Replace systemd units location to match with bitbake environment.

Quoted 29 lines · avalluri

On 08.02.2017 16:15, Mark Asselstine wrote:

On Wed, Feb 8, 2017 at 8:46 AM, Amarnath Valluri
<[email protected]> wrote:

---
 recipes-extended/libvirt/libvirt_1.3.5.bb | 6 ++++++
 1 file changed, 6 insertions(+)
recipes-extended/libvirt/libvirt_1.3.5.bb +0 -0
index c848c99..206f59f 100644
@@ -213,6 +213,12 @@ PACKAGECONFIG[wireshark] =

"--with-wireshark-dissector,--without-wireshark-disse
# Enable the Python tool support
require libvirt-python.inc

recipes-extended/libvirt/libvirt_1.3.5.bb +3 -0
+do_configure_prepend() {
+       systemd_system_unitdir="${@d.getVar('systemd_system_unitdir')}"
+       sed -i -e "s;^SYSTEMD_UNIT_DIR =.*;SYSTEMD_UNIT_DIR =

$systemd_system_unitdir;" \
+ ${S}/daemon/Makefile.am ${S}/src/Makefile.am
${S}/tools/Makefile.am

Quoted 7 lines

The others patches look fine but for this one is there no way to pass the value to make? I almost prefer to have this taken care of via a patch to the source instead of sed expressions here.

Its value is hard coded in Makefile.am, one thing we can do is to patch the configure.ac to make systemd unit dir configurable from outside. I can send the V2 with this change.

I prefer that approach. Looking forward to the v2.

Mark

Quoted 9 lines

-Amarnath

--
_______________________________________________
meta-virtualization mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-virtualization

#7 lore raw
In reply to Amarnath Valluri

All 4 patches in this series are now merged.

Bruce

On Wed, Feb 8, 2017 at 8:46 AM, Amarnath Valluri <[email protected]

Quoted 32 lines

wrote:

Make use of bitbake variable where appropriate, this makes the recipe portable.

---
 recipes-containers/containerd/containerd_git.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-containers/containerd/containerd_git.bb +1 -2
index ca99e55..77c3e93 100644
@@ -83,6 +83,6 @@ do_install() {
        fi
 }
 
-FILES_${PN} += "/lib/systemd/system/*"
+FILES_${PN} += "${systemd_system_unitdir}/*"
 
 INHIBIT_PACKAGE_STRIP = "1"
--

2.7.4

--
_______________________________________________
meta-virtualization mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-virtualization

Signature · 2 lines
"Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end"