All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] update-rc.d changes
@ 2019-06-21  2:08 changqing.li
  2019-06-21  2:08 ` [PATCH 1/2] update-rc.d: support enable/disable options changqing.li
  2019-06-21  2:08 ` [PATCH 2/2] update-rc.d: update SRCREV and license checksum changqing.li
  0 siblings, 2 replies; 3+ messages in thread
From: changqing.li @ 2019-06-21  2:08 UTC (permalink / raw)
  To: openembedded-core

From: Changqing Li <changqing.li@windriver.com>

1. update-rc.d.bbclass: change to work align with new update-rc.d behavior
2. update-rc.d_0.8.bb: update SRCREV and license checksum

Changqing Li (2):
  update-rc.d: support enable/disable options
  update-rc.d: update SRCREV and license checksum

 meta/classes/update-rc.d.bbclass                 | 28 ++++--------------------
 meta/recipes-core/update-rc.d/update-rc.d_0.8.bb |  4 ++--
 2 files changed, 6 insertions(+), 26 deletions(-)

-- 
2.7.4



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

* [PATCH 1/2] update-rc.d: support enable/disable options
  2019-06-21  2:08 [PATCH 0/2] update-rc.d changes changqing.li
@ 2019-06-21  2:08 ` changqing.li
  2019-06-21  2:08 ` [PATCH 2/2] update-rc.d: update SRCREV and license checksum changqing.li
  1 sibling, 0 replies; 3+ messages in thread
From: changqing.li @ 2019-06-21  2:08 UTC (permalink / raw)
  To: openembedded-core

From: Changqing Li <changqing.li@windriver.com>

* update-rc.d has added support of enable/disable options, which are
  expected to keep the previous configuration even after upgrade the packages.
  With support for these options, it will only create start/stop link
  when there are none, or it will keep the previous configuration.

  Our preinst uses "-f remove" to remove any links under the /etc/rcrunlevel.d
  which is conflicting behavior with disable/enable options, so remove it.

  For example, if a user disabled one service before upgrade,
  then after upgrade the service could be started. This happens because during preinst,
  all links have been deleted, then postinst may create the link to start service.

  With this change, we remove preinst and therefore keep the previous links
  so that after upgrade, if a link existed for the package, then the postinst
  will not create new start/stop links.

* remove '-f' for postinst. Previously, the keepalived recipe used 'remove'
  during postinst, so we needed the -f, but now the keepalived recipe has fixed
  this problem, so it's safe to remove '-f'.

[Yocto #12955]

Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
 meta/classes/update-rc.d.bbclass | 28 ++++------------------------
 1 file changed, 4 insertions(+), 24 deletions(-)

diff --git a/meta/classes/update-rc.d.bbclass b/meta/classes/update-rc.d.bbclass
index 265c4be..1366fee 100644
--- a/meta/classes/update-rc.d.bbclass
+++ b/meta/classes/update-rc.d.bbclass
@@ -20,28 +20,14 @@ def use_updatercd(d):
         return '[ -n "$D" -o ! -d /run/systemd/system ]'
     return 'true'
 
-updatercd_preinst() {
-if ${@use_updatercd(d)} && [ -z "$D" -a -f "${INIT_D_DIR}/${INITSCRIPT_NAME}" ]; then
-	${INIT_D_DIR}/${INITSCRIPT_NAME} stop || :
-fi
-if ${@use_updatercd(d)} && type update-rc.d >/dev/null 2>/dev/null; then
-	if [ -n "$D" ]; then
-		OPT="-f -r $D"
-	else
-		OPT="-f"
-	fi
-	update-rc.d $OPT ${INITSCRIPT_NAME} remove
-fi
-}
-
 PACKAGE_WRITE_DEPS += "update-rc.d-native"
 
 updatercd_postinst() {
 if ${@use_updatercd(d)} && type update-rc.d >/dev/null 2>/dev/null; then
 	if [ -n "$D" ]; then
-		OPT="-f -r $D"
+		OPT="-r $D"
 	else
-		OPT="-f -s"
+		OPT="-s"
 	fi
 	update-rc.d $OPT ${INITSCRIPT_NAME} ${INITSCRIPT_PARAMS}
 fi
@@ -79,7 +65,7 @@ python __anonymous() {
 PACKAGESPLITFUNCS_prepend = "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'populate_packages_updatercd ', '', d)}"
 PACKAGESPLITFUNCS_remove_class-nativesdk = "populate_packages_updatercd "
 
-populate_packages_updatercd[vardeps] += "updatercd_prerm updatercd_postrm updatercd_preinst updatercd_postinst"
+populate_packages_updatercd[vardeps] += "updatercd_prerm updatercd_postrm updatercd_postinst"
 populate_packages_updatercd[vardepsexclude] += "OVERRIDES"
 
 python populate_packages_updatercd () {
@@ -95,7 +81,7 @@ python populate_packages_updatercd () {
             d.appendVar('RDEPENDS_' + pkg, ' %sinitd-functions' % (mlprefix))
 
     def update_rcd_package(pkg):
-        bb.debug(1, 'adding update-rc.d calls to preinst/postinst/prerm/postrm for %s' % pkg)
+        bb.debug(1, 'adding update-rc.d calls to postinst/prerm/postrm for %s' % pkg)
 
         localdata = bb.data.createCopy(d)
         overrides = localdata.getVar("OVERRIDES")
@@ -103,12 +89,6 @@ python populate_packages_updatercd () {
 
         update_rcd_auto_depend(pkg)
 
-        preinst = d.getVar('pkg_preinst_%s' % pkg)
-        if not preinst:
-            preinst = '#!/bin/sh\n'
-        preinst += localdata.getVar('updatercd_preinst')
-        d.setVar('pkg_preinst_%s' % pkg, preinst)
-
         postinst = d.getVar('pkg_postinst_%s' % pkg)
         if not postinst:
             postinst = '#!/bin/sh\n'
-- 
2.7.4



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

* [PATCH 2/2] update-rc.d: update SRCREV and license checksum
  2019-06-21  2:08 [PATCH 0/2] update-rc.d changes changqing.li
  2019-06-21  2:08 ` [PATCH 1/2] update-rc.d: support enable/disable options changqing.li
@ 2019-06-21  2:08 ` changqing.li
  1 sibling, 0 replies; 3+ messages in thread
From: changqing.li @ 2019-06-21  2:08 UTC (permalink / raw)
  To: openembedded-core

From: Changqing Li <changqing.li@windriver.com>

Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
 meta/recipes-core/update-rc.d/update-rc.d_0.8.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-core/update-rc.d/update-rc.d_0.8.bb b/meta/recipes-core/update-rc.d/update-rc.d_0.8.bb
index baa21ae..75632d9 100644
--- a/meta/recipes-core/update-rc.d/update-rc.d_0.8.bb
+++ b/meta/recipes-core/update-rc.d/update-rc.d_0.8.bb
@@ -4,10 +4,10 @@ DESCRIPTION = "update-rc.d is a utility that allows the management of symlinks t
 SECTION = "base"
 
 LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://update-rc.d;beginline=5;endline=15;md5=148a48321b10eb37c1fa3ee02b940a75"
+LIC_FILES_CHKSUM = "file://update-rc.d;beginline=5;endline=15;md5=d40a07c27f535425934bb5001f2037d9"
 
 SRC_URI = "git://git.yoctoproject.org/update-rc.d"
-SRCREV = "22e0692898c3e7ceedc8eb5ff4ec8e0b9c340b2d"
+SRCREV = "4b150b25b38de688d25cde2b2d22c268ed65a748"
 
 UPSTREAM_CHECK_COMMITS = "1"
 
-- 
2.7.4



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

end of thread, other threads:[~2019-06-21  2:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-21  2:08 [PATCH 0/2] update-rc.d changes changqing.li
2019-06-21  2:08 ` [PATCH 1/2] update-rc.d: support enable/disable options changqing.li
2019-06-21  2:08 ` [PATCH 2/2] update-rc.d: update SRCREV and license checksum changqing.li

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.