summaryrefslogtreecommitdiff
path: root/meta-phosphor/recipes-phosphor
diff options
context:
space:
mode:
authorBrad Bishop <bradleyb@fuzziesquirrel.com>2019-03-22 02:08:15 +0300
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2019-03-26 23:46:15 +0300
commit4eceffc5e563f588b93ef53c7b35dfd83fad35fc (patch)
tree8131ae8b650f619fc5df70e791db2917e7eb46e8 /meta-phosphor/recipes-phosphor
parent7a367207514092b07989f7ae3ea175169cbc045f (diff)
downloadopenbmc-4eceffc5e563f588b93ef53c7b35dfd83fad35fc.tar.xz
certificates: clean up config recipes
Since the config recipe packages will create symlinks to the certificate manager template, RDEPEND rather than RRECOMMEND on the certificate manager package (which provides the template). Avoid obmc-phosphor-systemd. Enabling systemd units is the realm of packaging scripts and the SYSTEMD_LINK feature in obmc-phosphor-systemd implements this incorrectly. Just directly code install, pkg_postinst and pkg_prerm here rather than trying to fix obmc-phosphor-systemd - the extra indirection is more harmful to ease of comprehension for seasoned Yocto developers than the couple of lines of code it saves. (From meta-phosphor rev: 1a4e65e5847e299348b5f28ffa2b4b1837769deb) Change-Id: Ideb12d62461b3b18ff5c92f3a76f1aa20c94a269 Tested: Built witherspoon image and verified rootfs unchanged. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'meta-phosphor/recipes-phosphor')
-rw-r--r--meta-phosphor/recipes-phosphor/certificate/phosphor-nslcd-authority-cert-config.bb23
-rw-r--r--meta-phosphor/recipes-phosphor/certificate/phosphor-nslcd-authority-cert-config/env (renamed from meta-phosphor/recipes-phosphor/certificate/phosphor-nslcd-authority-cert-config/obmc/cert/authority)0
-rw-r--r--meta-phosphor/recipes-phosphor/certificate/phosphor-nslcd-cert-config.bb25
-rw-r--r--meta-phosphor/recipes-phosphor/certificate/phosphor-nslcd-cert-config/env (renamed from meta-phosphor/recipes-phosphor/certificate/phosphor-nslcd-cert-config/obmc/cert/nslcd)0
4 files changed, 37 insertions, 11 deletions
diff --git a/meta-phosphor/recipes-phosphor/certificate/phosphor-nslcd-authority-cert-config.bb b/meta-phosphor/recipes-phosphor/certificate/phosphor-nslcd-authority-cert-config.bb
index 4e240ad38..d41de2b59 100644
--- a/meta-phosphor/recipes-phosphor/certificate/phosphor-nslcd-authority-cert-config.bb
+++ b/meta-phosphor/recipes-phosphor/certificate/phosphor-nslcd-authority-cert-config.bb
@@ -5,11 +5,24 @@ PR = "r1"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${PHOSPHORBASE}/LICENSE;md5=19407077e42b1ba3d653da313f1f5b4e"
-RRECOMMENDS_${PN} = "phosphor-certificate-manager"
+RDEPENDS_${PN} = "phosphor-certificate-manager"
inherit allarch
-inherit obmc-phosphor-systemd
-SYSTEMD_SERVICE_${PN} = ""
-SYSTEMD_ENVIRONMENT_FILE_${PN} = "obmc/cert/authority"
-SYSTEMD_LINK_${PN} = "../phosphor-certificate-manager@.service:${SYSTEMD_DEFAULT_TARGET}.wants/phosphor-certificate-manager@authority.service"
+SRC_URI = "file://env"
+
+do_install() {
+ install -D ${WORKDIR}/env ${D}/${sysconfdir}/default/obmc/cert/authority
+}
+
+pkg_postinst_${PN}() {
+ LINK="$D$systemd_system_unitdir/multi-user.target.wants/phosphor-certificate-manager@authority.service"
+ TARGET="../phosphor-certificate-manager@.service"
+ mkdir -p $D$systemd_system_unitdir/multi-user.target.wants
+ ln -s $TARGET $LINK
+}
+
+pkg_prerm_${PN}() {
+ LINK="$D$systemd_system_unitdir/multi-user.target.wants/phosphor-certificate-manager@authority.service"
+ rm $LINK
+}
diff --git a/meta-phosphor/recipes-phosphor/certificate/phosphor-nslcd-authority-cert-config/obmc/cert/authority b/meta-phosphor/recipes-phosphor/certificate/phosphor-nslcd-authority-cert-config/env
index 849d695b5..849d695b5 100644
--- a/meta-phosphor/recipes-phosphor/certificate/phosphor-nslcd-authority-cert-config/obmc/cert/authority
+++ b/meta-phosphor/recipes-phosphor/certificate/phosphor-nslcd-authority-cert-config/env
diff --git a/meta-phosphor/recipes-phosphor/certificate/phosphor-nslcd-cert-config.bb b/meta-phosphor/recipes-phosphor/certificate/phosphor-nslcd-cert-config.bb
index c1dacfdcf..d344851fc 100644
--- a/meta-phosphor/recipes-phosphor/certificate/phosphor-nslcd-cert-config.bb
+++ b/meta-phosphor/recipes-phosphor/certificate/phosphor-nslcd-cert-config.bb
@@ -1,15 +1,28 @@
-SUMMARY = "Phosphor certificate manager configuration for an nslcd certificate"
+SUMMARY = "Phosphor certificate manager configuration for a nslcd certificate"
PR = "r1"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${PHOSPHORBASE}/LICENSE;md5=19407077e42b1ba3d653da313f1f5b4e"
-RRECOMMENDS_${PN} = "phosphor-certificate-manager"
+RDEPENDS_${PN} = "phosphor-certificate-manager"
inherit allarch
-inherit obmc-phosphor-systemd
-SYSTEMD_SERVICE_${PN} = ""
-SYSTEMD_ENVIRONMENT_FILE_${PN} = "obmc/cert/nslcd"
-SYSTEMD_LINK_${PN} = "../phosphor-certificate-manager@.service:${SYSTEMD_DEFAULT_TARGET}.wants/phosphor-certificate-manager@nslcd.service"
+SRC_URI = "file://env"
+
+do_install() {
+ install -D ${WORKDIR}/env ${D}/${sysconfdir}/default/obmc/cert/nslcd
+}
+
+pkg_postinst_${PN}() {
+ LINK="$D$systemd_system_unitdir/multi-user.target.wants/phosphor-certificate-manager@nslcd.service"
+ TARGET="../phosphor-certificate-manager@.service"
+ mkdir -p $D$systemd_system_unitdir/multi-user.target.wants
+ ln -s $TARGET $LINK
+}
+
+pkg_prerm_${PN}() {
+ LINK="$D$systemd_system_unitdir/multi-user.target.wants/phosphor-certificate-manager@nslcd.service"
+ rm $LINK
+}
diff --git a/meta-phosphor/recipes-phosphor/certificate/phosphor-nslcd-cert-config/obmc/cert/nslcd b/meta-phosphor/recipes-phosphor/certificate/phosphor-nslcd-cert-config/env
index 8ac1bf77e..8ac1bf77e 100644
--- a/meta-phosphor/recipes-phosphor/certificate/phosphor-nslcd-cert-config/obmc/cert/nslcd
+++ b/meta-phosphor/recipes-phosphor/certificate/phosphor-nslcd-cert-config/env