All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Fixes for run-postinsts in sysvinit and systemd
@ 2014-01-13  7:38 Chen Qi
  2014-01-13  7:38 ` [PATCH 1/2] run-postinsts: remove the init script after a clean start-up Chen Qi
  2014-01-13  7:38 ` [PATCH 2/2] systemd-compat-units: make run-postinsts.service work correctly on target Chen Qi
  0 siblings, 2 replies; 7+ messages in thread
From: Chen Qi @ 2014-01-13  7:38 UTC (permalink / raw)
  To: openembedded-core

The following changes since commit 1b636173ca88e5ccca1992f9a12367a1189fa674:

  bitbake: toaster: Toaster GUI, generic search, filter and order (2014-01-10 15:20:26 +0000)

are available in the git repository at:

  git://git.pokylinux.org/poky-contrib ChenQi/run-postinsts-fixes
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/run-postinsts-fixes

Chen Qi (2):
  run-postinsts: remove the init script after a clean start-up
  systemd-compat-units: make run-postinsts.service work correctly on
    target

 meta/recipes-core/systemd/systemd-compat-units.bb  |    8 --------
 .../systemd-compat-units/run-postinsts.service     |    4 ++--
 .../run-postinsts/run-postinsts/run-postinsts      |   15 +++++++++++----
 3 files changed, 13 insertions(+), 14 deletions(-)

-- 
1.7.9.5



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

* [PATCH 1/2] run-postinsts: remove the init script after a clean start-up
  2014-01-13  7:38 [PATCH 0/2] Fixes for run-postinsts in sysvinit and systemd Chen Qi
@ 2014-01-13  7:38 ` Chen Qi
  2014-01-13  7:38 ` [PATCH 2/2] systemd-compat-units: make run-postinsts.service work correctly on target Chen Qi
  1 sibling, 0 replies; 7+ messages in thread
From: Chen Qi @ 2014-01-13  7:38 UTC (permalink / raw)
  To: openembedded-core

If we enable ipk/deb package back-end, and we have 'package-management'
in our IMAGE_FEATURES, then the /etc/rcS.d/S99run-postinsts would
still exist in our system after a clean start-up.

The initial design for run-postinsts requires the related init script
to be removed if there's no more post-install script left in the system.

This patch fixes this problem.

[YOCTO #5718]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 .../run-postinsts/run-postinsts/run-postinsts      |   15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts b/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts
index c94c3e9..11141ec 100755
--- a/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts
+++ b/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts
@@ -16,7 +16,16 @@ for pm in rpm deb ipk; do
 	fi
 done
 
-[ -z "$pi_dir" ] && exit 0
+remove_rcsd_link () {
+	if [ -n "`which update-rc.d`" ]; then
+		update-rc.d -f run-postinsts remove
+	fi
+}
+
+if [ -z "$pi_dir" ]; then
+	remove_rcsd_link
+	exit 0
+fi
 
 [ -e #SYSCONFDIR#/default/postinst ] && . #SYSCONFDIR#/default/postinst
 
@@ -43,7 +52,5 @@ done
 # and the rcS.d link
 if [ $remove_pi_dir = 1 ]; then
 	rm -rf $pi_dir
-	if [ -n "`which update-rc.d`" ]; then
-		update-rc.d -f run-postinsts remove
-	fi
+	remove_rcsd_link
 fi
-- 
1.7.9.5



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

* [PATCH 2/2] systemd-compat-units: make run-postinsts.service work correctly on target
  2014-01-13  7:38 [PATCH 0/2] Fixes for run-postinsts in sysvinit and systemd Chen Qi
  2014-01-13  7:38 ` [PATCH 1/2] run-postinsts: remove the init script after a clean start-up Chen Qi
@ 2014-01-13  7:38 ` Chen Qi
  2014-01-13 17:01   ` Burton, Ross
  1 sibling, 1 reply; 7+ messages in thread
From: Chen Qi @ 2014-01-13  7:38 UTC (permalink / raw)
  To: openembedded-core

If we are using systemd as the init manager and rpm as the package
back-end, then the post-install script would not run at system start-up.

The problem is that we now have two init scripts to deal with post-install
scripts in our system. They are installed as /etc/rcS.d/S98run-postinsts and
/etc/rcS.d/S99run-postinsts respectively, however, the run-postinsts.service
in systemd only deals with the former one.

This patch fixes this problem to make run-postinsts.service work correctly
for the three package back-ends with/without 'package-management' in the
IMAGE_FEATURES.

This patch also hardcodes 98 and 99 instead of using POSTINSTALL_INITPOSITION
because using that variable doesn't bring anything useful.

[YOCTO #5719]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/recipes-core/systemd/systemd-compat-units.bb  |    8 --------
 .../systemd-compat-units/run-postinsts.service     |    4 ++--
 2 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/meta/recipes-core/systemd/systemd-compat-units.bb b/meta/recipes-core/systemd/systemd-compat-units.bb
index 9f28283..5a6adb2 100644
--- a/meta/recipes-core/systemd/systemd-compat-units.bb
+++ b/meta/recipes-core/systemd/systemd-compat-units.bb
@@ -14,8 +14,6 @@ SRC_URI = "file://*.service"
 do_install() {
 	install -d ${D}${systemd_unitdir}/system/basic.target.wants
 	install -d ${D}${systemd_unitdir}/system/sysinit.target.wants/
-	sed -i -e 's,@POSTINSTALL_INITPOSITION@,${POSTINSTALL_INITPOSITION},g' \
-			${WORKDIR}/run-postinsts.service
 	install -m 0644 ${WORKDIR}/run-postinsts.service ${D}${systemd_unitdir}/system
 	ln -sf ../run-postinsts.service ${D}${systemd_unitdir}/system/basic.target.wants/
 	ln -sf ../run-postinsts.service ${D}${systemd_unitdir}/system/sysinit.target.wants/
@@ -50,9 +48,3 @@ pkg_postinst_${PN} () {
 
 FILES_${PN} = "${systemd_unitdir}/system ${bindir}"
 RDPEPENDS_${PN} = "systemd"
-
-# Define a variable to allow distros to run configure earlier.
-# (for example, to enable loading of ethernet kernel modules before networking starts)
-# note: modifying name or default value for POSTINSTALL_INITPOSITION requires
-# changes in opkg.inc
-POSTINSTALL_INITPOSITION ?= "98"
diff --git a/meta/recipes-core/systemd/systemd-compat-units/run-postinsts.service b/meta/recipes-core/systemd/systemd-compat-units/run-postinsts.service
index 35cf3d3..1dc7b1a 100644
--- a/meta/recipes-core/systemd/systemd-compat-units/run-postinsts.service
+++ b/meta/recipes-core/systemd/systemd-compat-units/run-postinsts.service
@@ -1,12 +1,12 @@
 [Unit]
 Description=Run pending postinsts
 DefaultDependencies=no
-ConditionPathExists=|/etc/rcS.d/S@POSTINSTALL_INITPOSITION@run-postinsts
+ConditionPathExistsGlob=/etc/rcS.d/S*run-postinsts
 After=systemd-remount-fs.service systemd-tmpfiles-setup.service tmp.mount
 Before=sysinit.target
 
 [Service]
-ExecStart=/etc/rcS.d/S@POSTINSTALL_INITPOSITION@run-postinsts
+ExecStart=-/etc/rcS.d/S98run-postinsts ; -/etc/rcS.d/S99run-postinsts
 RemainAfterExit=No
 Type=oneshot
 StandardOutput=syslog
-- 
1.7.9.5



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

* Re: [PATCH 2/2] systemd-compat-units: make run-postinsts.service work correctly on target
  2014-01-13  7:38 ` [PATCH 2/2] systemd-compat-units: make run-postinsts.service work correctly on target Chen Qi
@ 2014-01-13 17:01   ` Burton, Ross
  2014-01-14  1:50     ` ChenQi
  0 siblings, 1 reply; 7+ messages in thread
From: Burton, Ross @ 2014-01-13 17:01 UTC (permalink / raw)
  To: Chen Qi; +Cc: OE-core

On 13 January 2014 07:38, Chen Qi <Qi.Chen@windriver.com> wrote:
> +ExecStart=-/etc/rcS.d/S98run-postinsts ; -/etc/rcS.d/S99run-postinsts

Can we just make opkg and run-postinsts write that file using the same number?

Also, that service file needs to move directly into run-postinsts.
There's a start in poky-contrib:ross/postinsts if you want to finish
it off. :)

Ross


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

* Re: [PATCH 2/2] systemd-compat-units: make run-postinsts.service work correctly on target
  2014-01-13 17:01   ` Burton, Ross
@ 2014-01-14  1:50     ` ChenQi
  2014-01-22 17:08       ` Burton, Ross
  0 siblings, 1 reply; 7+ messages in thread
From: ChenQi @ 2014-01-14  1:50 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

On 01/14/2014 01:01 AM, Burton, Ross wrote:
> On 13 January 2014 07:38, Chen Qi <Qi.Chen@windriver.com> wrote:
>> +ExecStart=-/etc/rcS.d/S98run-postinsts ; -/etc/rcS.d/S99run-postinsts
> Can we just make opkg and run-postinsts write that file using the same number?
>
> Also, that service file needs to move directly into run-postinsts.
> There's a start in poky-contrib:ross/postinsts if you want to finish
> it off. :)
>
> Ross
>
>

Hi Ross,

As you have started working on this problem, I think I'll just drop this 
patch.

After looking at your branch, I think there's only one thing to look out 
for. When we're using ipk/dpkg as the package back-end, and 
'package-management' is in IMAGE_FEATURES, there would be no 
/etc/*-postinsts.

Best Regards,
Chen Qi



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

* Re: [PATCH 2/2] systemd-compat-units: make run-postinsts.service work correctly on target
  2014-01-14  1:50     ` ChenQi
@ 2014-01-22 17:08       ` Burton, Ross
  2014-01-23  1:28         ` ChenQi
  0 siblings, 1 reply; 7+ messages in thread
From: Burton, Ross @ 2014-01-22 17:08 UTC (permalink / raw)
  To: ChenQi; +Cc: OE-core

On 14 January 2014 01:50, ChenQi <Qi.Chen@windriver.com> wrote:
> As you have started working on this problem, I think I'll just drop this
> patch.
>
> After looking at your branch, I think there's only one thing to look out
> for. When we're using ipk/dpkg as the package back-end, and
> 'package-management' is in IMAGE_FEATURES, there would be no
> /etc/*-postinsts.

I started but didn't finish - as you've taken the systemd bugs could
you finish this off?  Pretty sure I filed a bug to go with it.

Ross


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

* Re: [PATCH 2/2] systemd-compat-units: make run-postinsts.service work correctly on target
  2014-01-22 17:08       ` Burton, Ross
@ 2014-01-23  1:28         ` ChenQi
  0 siblings, 0 replies; 7+ messages in thread
From: ChenQi @ 2014-01-23  1:28 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

On 01/23/2014 01:08 AM, Burton, Ross wrote:
> On 14 January 2014 01:50, ChenQi <Qi.Chen@windriver.com> wrote:
>> As you have started working on this problem, I think I'll just drop this
>> patch.
>>
>> After looking at your branch, I think there's only one thing to look out
>> for. When we're using ipk/dpkg as the package back-end, and
>> 'package-management' is in IMAGE_FEATURES, there would be no
>> /etc/*-postinsts.
> I started but didn't finish - as you've taken the systemd bugs could
> you finish this off?  Pretty sure I filed a bug to go with it.
>
> Ross
>
>

OK.

Best Regards,
Chen Qi


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

end of thread, other threads:[~2014-01-23  1:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-13  7:38 [PATCH 0/2] Fixes for run-postinsts in sysvinit and systemd Chen Qi
2014-01-13  7:38 ` [PATCH 1/2] run-postinsts: remove the init script after a clean start-up Chen Qi
2014-01-13  7:38 ` [PATCH 2/2] systemd-compat-units: make run-postinsts.service work correctly on target Chen Qi
2014-01-13 17:01   ` Burton, Ross
2014-01-14  1:50     ` ChenQi
2014-01-22 17:08       ` Burton, Ross
2014-01-23  1:28         ` ChenQi

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.