All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-networking][PATCH] postfix: split etc from ${PN} to ${PN}-cfg
@ 2019-10-22  3:10 Hongxu Jia
  2019-10-22  6:18 ` [PATCH V2] postfix: split /etc from ${PN} to ${PN}-cfg for ostree Hongxu Jia
  0 siblings, 1 reply; 2+ messages in thread
From: Hongxu Jia @ 2019-10-22  3:10 UTC (permalink / raw)
  To: raj.khem; +Cc: openembedded-devel

In postinst of ${PN}, call newaliases on etc may fail at do_rootfs
due to host setup. If fail, the postinst will rerun at target first
boot which cause update-alternatives in postinst rerun.

The update-alternatives rerun is not necessary, especially while /usr
is read-only and /etc is writable on target(such as ostree system).
split etc from ${PN} to ${PN}-cfg could avoid affect.

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta-networking/recipes-daemons/postfix/postfix.inc | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/meta-networking/recipes-daemons/postfix/postfix.inc b/meta-networking/recipes-daemons/postfix/postfix.inc
index 7781005..de45e08 100644
--- a/meta-networking/recipes-daemons/postfix/postfix.inc
+++ b/meta-networking/recipes-daemons/postfix/postfix.inc
@@ -203,7 +203,7 @@ ALTERNATIVE_LINK_NAME[newaliases.1] = "${mandir}/man1/newaliases.1"
 ALTERNATIVE_LINK_NAME[sendmail.1] = "${mandir}/man1/sendmail.1"
 
 PACKAGE_WRITE_DEPS += "postfix-native"
-pkg_postinst_${PN} () {
+pkg_postinst_${PN}-cfg () {
     if [ "x$D" = "x" ]; then
         touch /etc/aliases
         newaliases
@@ -224,7 +224,10 @@ pkg_postinst_${PN} () {
     fi
 }
 
+PACKAGES =+ "${PN}-cfg"
+RDEPENDS_${PN}_class-target += "${PN}-cfg"
 # Exclude .debug directories from the main package
-FILES_${PN} = "${sysconfdir} ${localstatedir} ${bindir}/* ${sbindir}/* \
+FILES_${PN} = "${localstatedir} ${bindir}/* ${sbindir}/* \
                ${libexecdir}/* ${systemd_unitdir}/*"
+FILES_${PN}-cfg = "${sysconfdir}"
 FILES_${PN}-dbg += "${libexecdir}/postfix/.debug"
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH V2] postfix: split /etc from ${PN} to ${PN}-cfg for ostree
  2019-10-22  3:10 [meta-networking][PATCH] postfix: split etc from ${PN} to ${PN}-cfg Hongxu Jia
@ 2019-10-22  6:18 ` Hongxu Jia
  0 siblings, 0 replies; 2+ messages in thread
From: Hongxu Jia @ 2019-10-22  6:18 UTC (permalink / raw)
  To: raj.khem; +Cc: openembedded-devel

In postinst of ${PN}, call newaliases on etc may fail at do_rootfs
due to host setup. If fail, the postinst will rerun at target first
boot which cause update-alternatives in postinst rerun.

For ostree system, /usr is readonly, /etc is writable, the
update-alternatives will be failed when run on target since it
needs write files in /usr. Split the postinst into two packages
can fix the problem:
* update-alternatives runs at do_rootfs
* newaliases runs at do_rootfs or first boot, it needs write files
  in /etc when run at first boot, while /etc is writable for ostree.

For non-ostree, everything will be OK as normal

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta-networking/recipes-daemons/postfix/postfix.inc | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/meta-networking/recipes-daemons/postfix/postfix.inc b/meta-networking/recipes-daemons/postfix/postfix.inc
index 7781005..de45e08 100644
--- a/meta-networking/recipes-daemons/postfix/postfix.inc
+++ b/meta-networking/recipes-daemons/postfix/postfix.inc
@@ -203,7 +203,7 @@ ALTERNATIVE_LINK_NAME[newaliases.1] = "${mandir}/man1/newaliases.1"
 ALTERNATIVE_LINK_NAME[sendmail.1] = "${mandir}/man1/sendmail.1"
 
 PACKAGE_WRITE_DEPS += "postfix-native"
-pkg_postinst_${PN} () {
+pkg_postinst_${PN}-cfg () {
     if [ "x$D" = "x" ]; then
         touch /etc/aliases
         newaliases
@@ -224,7 +224,10 @@ pkg_postinst_${PN} () {
     fi
 }
 
+PACKAGES =+ "${PN}-cfg"
+RDEPENDS_${PN}_class-target += "${PN}-cfg"
 # Exclude .debug directories from the main package
-FILES_${PN} = "${sysconfdir} ${localstatedir} ${bindir}/* ${sbindir}/* \
+FILES_${PN} = "${localstatedir} ${bindir}/* ${sbindir}/* \
                ${libexecdir}/* ${systemd_unitdir}/*"
+FILES_${PN}-cfg = "${sysconfdir}"
 FILES_${PN}-dbg += "${libexecdir}/postfix/.debug"
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-10-22  6:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-22  3:10 [meta-networking][PATCH] postfix: split etc from ${PN} to ${PN}-cfg Hongxu Jia
2019-10-22  6:18 ` [PATCH V2] postfix: split /etc from ${PN} to ${PN}-cfg for ostree Hongxu Jia

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.