cyrus-sasl: remove the unnecessary pkg_postinst
PATCH 1/5 cyrus-sasl: remove the unnecessary pkg_postinst
From: Chen Qi <[email protected]>
saslpasswd2 is used by an administrator to set a user's sasl password, setting a default one in pkg_postinst in not only unnecessary but also inappropriate.
Besides, running saslpasswd2 takes a significant amount of time to finish, so this pkg_postinst will make the first boot take longer time.
According to the above two reasons, the patch remove the pkg_postint.
--- .../cyrus-sasl/cyrus-sasl_2.1.26.bb | 5 ----- 1 file changed, 5 deletions(-)
meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl_2.1.26.bb +0 -5
@@ -54,11 +54,6 @@ USERADD_PACKAGES = "${PN}-bin" GROUPADD_PARAM_${PN}-bin = "--system mail" USERADD_PARAM_${PN}-bin = "--system --home=/var/spool/mail -g mail cyrus" -pkg_postinst_${PN}-bin () { - echo "cyrus" | saslpasswd2 -p -c cyrus - chgrp mail /etc/sasldb2 -} - SRC_URI[md5sum] = "a7f4e5e559a0e37b3ffc438c9456e425" SRC_URI[sha256sum] = "8fbc5136512b59bb793657f36fadda6359cae3b08f01fd16b3d406f1345b7bc3"
Signature · 1 line
1.7.9.5
PATCH 2/5 radvd: fix pkg_postinst
From: Chen Qi <[email protected]>
`/etc/init.d/populate-volatile.sh update' only needs to run in case of an on-target installation. And it should have a prerequisite that the script is executable.
--- meta-networking/recipes-daemons/radvd/radvd.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
meta-networking/recipes-daemons/radvd/radvd.inc +3 -1
@@ -38,5 +38,7 @@ USERADD_PACKAGES = "${PN}" USERADD_PARAM_${PN} = "--system --home ${localstatedir}/run/radvd/ -M -g nogroup radvd" pkg_postinst_${PN} () { - ${sysconfdir}/init.d/populate-volatile.sh update + if [ -z "$D" -a -x /etc/init.d/populate-volatile.sh ]; then + /etc/init.d/populate-volatile.sh update + fi }
Signature · 1 line
1.7.9.5
PATCH 3/5 quagga: fix pkg_postinst
In reply to [email protected]From: Chen Qi <[email protected]>
This patch mainly involves two changes.
1. Create necessary files at do_install task. Add these configuration files to the CONFFILES variable.
2. Move the chmod' and chown' commands to do_install task.
After these two changes, qugga can run successfully at rootfs time.
--- .../recipes-protocols/quagga/quagga.inc | 28 +++++++++++++------- 1 file changed, 19 insertions(+), 9 deletions(-)
meta-networking/recipes-protocols/quagga/quagga.inc +19 -9
@@ -73,6 +73,14 @@ do_install () { install -m 0640 ${S}/$f/$f.conf.sample ${D}${sysconfdir}/quagga/$f.conf.sample done + for f in bgpd vtysh babeld isisd ospfd ripngd zebra ripd ospf6d; do + touch ${D}${sysconfdir}/quagga/$f.conf + done + chown quagga:quaggavty ${D}${sysconfdir}/quagga + chown quagga:quagga ${D}${sysconfdir}/quagga/*.conf + chmod 750 ${D}${sysconfdir}/quagga + chmod 640 ${D}${sysconfdir}/quagga/*.conf + # Install quagga oe_runmake install DESTDIR=${D} prefix=${prefix} \ sbindir=${sbindir} \
@@ -108,7 +116,17 @@ FILES_${PN}-watchquagga = "${sbindir}/watchquagga ${sysconfdir}/default/watchqua ${sysconfdir}/init.d/watchquagga" # Indicate that the default files are configuration files -CONFFILES_${PN} = "${sysconfdir}/default/quagga" +CONFFILES_${PN} = "${sysconfdir}/default/quagga \ + ${sysconfdir}/quagga/bgpd.conf \ + ${sysconfdir}/quagga/vtysh.conf \ + ${sysconfdir}/quagga/babeld.conf \ + ${sysconfdir}/quagga/isisd.conf \ + ${sysconfdir}/quagga/ospfd.conf \ + ${sysconfdir}/quagga/ripngd.conf \ + ${sysconfdir}/quagga/zebra.conf \ + ${sysconfdir}/quagga/ripd.conf \ + ${sysconfdir}/quagga/ospf6d.conf \ + " CONFFILES_${PN}-watchquagga = "${sysconfdir}/default/watchquagga" # Stop the names being rewritten due to the internal shared libraries
@@ -132,14 +150,6 @@ GROUPADD_PARAM_${PN} = "--system quagga ; --system quaggavty" USERADD_PARAM_${PN} = "--system --home ${localstatedir}/run/quagga/ -M -g quagga quagga" pkg_postinst_${PN} () { - if [ "x$D" != "x" ] ; then - exit 1 - fi - for f in bgpd vtysh babeld isisd ospfd ripngd zebra ripd ospf6d; do touch ${sysconfdir}/quagga/$f.conf; done - chown quagga:quaggavty ${sysconfdir}/quagga - chown quagga:quagga ${sysconfdir}/quagga/*.conf - chmod 750 ${sysconfdir}/quagga - chmod 640 ${sysconfdir}/quagga/*.conf if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then ${sysconfdir}/init.d/populate-volatile.sh update fi
Signature · 1 line
1.7.9.5
PATCH 4/5 ndisc6: chmod in do_install and remove unnecessary pkg_postinst
In reply to [email protected]From: Chen Qi <[email protected]>
We can use chmod to set the SUID bit for applications in the do_install task. If we do so, the pkg_postinsts are no longer needed.
--- .../recipes-support/ndisc6/ndisc6_1.0.2.bb | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-)
meta-networking/recipes-support/ndisc6/ndisc6_1.0.2.bb +4 -10
@@ -49,14 +49,8 @@ servers through slateless IPv6 autoconfiguration." do_install_append () { rm -rf ${D}${localstatedir} -} -# Enable SUID bit for applications that need it -pkg_postinst_${PN}-rltraceroute6 () { - chmod 4555 ${bindir}/rltraceroute6 -} -pkg_postinst_${PN}-ndisc6 () { - chmod 4555 ${bindir}/ndisc6 -} -pkg_postinst_${PN}-rdisc6 () { - chmod 4555 ${bindir}/rdisc6 + # Enable SUID bit for applications that need it + chmod 4555 ${D}${bindir}/rltraceroute6 + chmod 4555 ${D}${bindir}/ndisc6 + chmod 4555 ${D}${bindir}/rdisc6 }
Signature · 1 line
1.7.9.5
PATCH 5/5 bridge-utils: inherit update-alternatives to avoid duplicate code
In reply to [email protected]From: Chen Qi <[email protected]>
Inherit update-alternatives to avoid duplicate code.
--- .../recipes-support/bridge-utils/bridge-utils.inc | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-)
meta-networking/recipes-support/bridge-utils/bridge-utils.inc +5 -9
@@ -11,7 +11,11 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/bridge/bridge-utils-${PV}.tar.gz \ file://bridge-utils-1.5-fix-incorrect-command-in-manual.patch \ " -inherit autotools +inherit autotools update-alternatives + +ALTERNATIVE_${PN} = "brctl" +ALTERNATIVE_PRIORITY[brctl] = "100" +ALTERNATIVE_LINK_NAME[brctl] = "${sbindir}/brctl" EXTRA_OECONF = "--with-linux-headers=${STAGING_INCDIR}"
@@ -23,11 +27,3 @@ do_install_append () { } RRECOMMENDS_${PN} = "kernel-module-bridge" - -pkg_postinst_${PN} () { - update-alternatives --install ${sbindir}/brctl brctl brctl.${PN} 100 -} - -pkg_prerm_${PN} () { - update-alternatives --remove brctl brctl.${PN} -}
Signature · 1 line
1.7.9.5
Merged this set. Thanks.
-J.
Quoted 32 lines · [[oe][meta-networking][PATCH 1/5] cyrus-sasl: remove the unnecessary…
From: Chen Qi <[email protected]>
saslpasswd2 is used by an administrator to set a user's sasl password, setting a default one in
pkg_postinstin not only unnecessary but also inappropriate.Besides, running saslpasswd2 takes a significant amount of time to finish, so this
pkg_postinstwill make the first boot take longer time.According to the above two reasons, the patch remove the
pkg_postint.Signed-off-by Chen Qi <[email protected]>--- .../cyrus-sasl/cyrus-sasl_2.1.26.bb | 5 ----- 1 file changed, 5 deletions(-)meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl_2.1.26.bb +0
-5@@ -54,11 +54,6 @@ USERADD_PACKAGES = "${PN}-bin" GROUPADD_PARAM_${PN}-bin = "--system mail" USERADD_PARAM_${PN}-bin = "--system --home=/var/spool/mail -g mail cyrus" -pkg_postinst_${PN}-bin () { - echo "cyrus" | saslpasswd2 -p -c cyrus - chgrp mail /etc/sasldb2 -} - SRC_URI[md5sum] = "a7f4e5e559a0e37b3ffc438c9456e425" SRC_URI[sha256sum] = "8fbc5136512b59bb793657f36fadda6359cae3b08f01fd16b3d406f1345b7bc3"
Signature · 2 lines
-Joe MacDonald. :wq