Message ID | 20210410205331.158805-2-bkylerussell@gmail.com |
---|---|
State | Changes Requested |
Headers | show |
Series | [meta-swupdate,1/2] swupdate: replace /usr/lib in init.d to support multilib images | expand |
Hi Russell, On 10.04.21 22:53, Kyle Russell wrote: > Create a swupdate-progress-sysvinit package with the necessary startup script > for swupdate-progress to run correctly during startup of the initramfs recovery > image. > > This allows swupdate-progress to be installed in both a distro's main rootfs > which uses systemd, and the initramfs image which uses sysvinit. > > In order for the initramfs image to support automatic reboot, it needs > swupdate-progress to monitor the update process and trigger a reboot of > the system, but for distros configured to use systemd, the init script > needed to launch swupdate-progress isn't even installed to the > swupdate-progress package, so just installing swupdate-progress to the > initramfs isn't sufficient for this to work since the initramfs only uses > sysvinit. Both the init script (from swupdate-progress-sysvinig) and the > swupdate-progress package need to be installed to the initramfs. > > Signed-off-by: Kyle Russell <bkylerussell@gmail.com> > --- > recipes-extended/images/swupdate-image.inc | 2 +- > recipes-support/swupdate/swupdate.inc | 11 +++++++---- > 2 files changed, 8 insertions(+), 5 deletions(-) > > diff --git a/recipes-extended/images/swupdate-image.inc b/recipes-extended/images/swupdate-image.inc > index 795b4a2..928edad 100644 > --- a/recipes-extended/images/swupdate-image.inc > +++ b/recipes-extended/images/swupdate-image.inc > @@ -12,7 +12,7 @@ IMAGE_INSTALL = "base-files \ > libconfig \ > swupdate \ > swupdate-www \ > - ${@bb.utils.contains('SWUPDATE_INIT', 'tiny', 'virtual/initscripts-swupdate', 'initscripts sysvinit', d)} \ > + ${@bb.utils.contains('SWUPDATE_INIT', 'tiny', 'virtual/initscripts-swupdate', 'initscripts sysvinit swupdate-progress-sysvinit', d)} \ > util-linux-sfdisk \ > " > > diff --git a/recipes-support/swupdate/swupdate.inc b/recipes-support/swupdate/swupdate.inc > index 0d382bd..e5ff392 100644 > --- a/recipes-support/swupdate/swupdate.inc > +++ b/recipes-support/swupdate/swupdate.inc > @@ -36,6 +36,7 @@ PACKAGES =+ " \ > ${PN}-client \ > ${PN}-lua \ > ${PN}-progress \ > + ${PN}-progress-sysvinit \ > ${PN}-tools \ > ${PN}-tools-hawkbit \ > ${PN}-usb \ > @@ -51,8 +52,9 @@ FILES_${PN}-lua += "${libdir}/lua/" > FILES_${PN}-progress = " \ > ${bindir}/swupdate-progress \ > ${systemd_system_unitdir}/swupdate-progress.service \ > - ${libdir}/swupdate/conf.d/90-start-progress \ > " Ok - I am missing in this patch how 90-start-progress is installed in case of systemd. It belongs now to a new package as below, but this is added as RDEPENDS in case of SystemV. How is it installed on a distro with systemd as virtual/init (it does not belong anymore to FILES_${PN}-progress) ? > +FILES_${PN}-progress-sysvinit = "${libdir}/swupdate/conf.d/90-start-progress" > + > FILES_${PN}-usb = " \ > ${sysconfdir}/udev/rules.d/swupdate-usb.rules \ > ${systemd_system_unitdir}/swupdate-usb@.service \ > @@ -74,6 +76,7 @@ FILES_${PN}-www = " \ > " > > RDEPENDS_${PN}-usb += "${PN}-client" > +RDEPENDS_${PN}-progress += "${@bb.utils.contains('DISTRO_FEATURES','systemd','','${PN}-progress-sysvinit',d)}" > > # The tools package is deprecated, it is an empty meta package for backward compatibility > RDEPENDS_${PN}-tools += "${PN}-client ${PN}-progress ${PN}-tools-hawkbit \ > @@ -255,10 +258,10 @@ do_install () { > install -m 0644 ${WORKDIR}/tmpfiles-swupdate.conf ${D}${libdir}/tmpfiles.d/swupdate.conf > install -d ${D}${sysconfdir}/udev/rules.d > install -m 0644 ${WORKDIR}/swupdate-usb.rules ${D}${sysconfdir}/udev/rules.d/ > - else > - # in case of systemd there is a service file, for sysv init we need to start it as well > - install -m 0644 ${WORKDIR}/90-start-progress ${D}${libdir}/swupdate/conf.d/ > fi > + > + # in case of systemd there is a service file, for sysv init we need to start it as well > + install -m 0644 ${WORKDIR}/90-start-progress ${D}${libdir}/swupdate/conf.d/ > } > > INITSCRIPT_NAME = "swupdate" > Best regards, Stefano Babic
${PN}-progress has always contained the necessary file to support systemd (swupdate-progress.service), and it still does. There is no change here. Before this patch, 90-start-progress was *also* installed in ${PN}-progress if systemd was *not* the virtual/init. (swupdate-progress.service was still installed, though unused and extra.) After this patch, 90-start-progress is now installed in a separate package. This allows us to still include this in images (like the initramfs) even when our main rootfs distro configuration uses systemd for virtual/init. The main distro still gets swupdate-progress.service through ${PN}-progress, but the initramfs can additionally install ${PN}-progress-sysvinit. Ideally, you don't need both swupdate-progress.service and 90-start-progress, but I didn't split the packages further in the interest of compatibility. If you do *not* specify systemd as virtual/init, then today you get both, which is the reason I added the following line: RDEPENDS_${PN}-progress += "${@bb.utils.contains('DISTRO_FEATURES','systemd','','${PN}-progress-sysvinit',d)}" I think it would be better to have two packages: ${PN}-progress-systemd and ${PN}-progress-sysvinit, and both should RDEPEND on ${PN}-progress. However, this would change the top-level package on which images are required to declare RDEPENDS (select either ${PN}-progress-systemd or ${PN}-progress-sysvinit instead of ${PN}-progress), and I didn't want to break existing images. Maybe ${PN}-progress should become an empty/dummy package that either RDEPENDS on ${PN}-progress-systemd or ${PN}-progress-sysvinit based on DISTRO_FEATURES, and maybe those two packages should both RDEPEND on ${PN}-progress-bin (which contains /usr/bin/swupdate-progress). That would remove the unnecessary init script in both cases, and also allow the initramfs to separately RDEPEND on ${PN}-progress-sysvinit. Thoughts? Kyle On Sun, Apr 11, 2021 at 8:01 AM Stefano Babic <sbabic@denx.de> wrote: > Hi Russell, > > On 10.04.21 22:53, Kyle Russell wrote: > > Create a swupdate-progress-sysvinit package with the necessary startup > script > > for swupdate-progress to run correctly during startup of the initramfs > recovery > > image. > > > > This allows swupdate-progress to be installed in both a distro's main > rootfs > > which uses systemd, and the initramfs image which uses sysvinit. > > > > In order for the initramfs image to support automatic reboot, it needs > > swupdate-progress to monitor the update process and trigger a reboot of > > the system, but for distros configured to use systemd, the init script > > needed to launch swupdate-progress isn't even installed to the > > swupdate-progress package, so just installing swupdate-progress to the > > initramfs isn't sufficient for this to work since the initramfs only uses > > sysvinit. Both the init script (from swupdate-progress-sysvinig) and the > > swupdate-progress package need to be installed to the initramfs. > > > > Signed-off-by: Kyle Russell <bkylerussell@gmail.com> > > --- > > recipes-extended/images/swupdate-image.inc | 2 +- > > recipes-support/swupdate/swupdate.inc | 11 +++++++---- > > 2 files changed, 8 insertions(+), 5 deletions(-) > > > > diff --git a/recipes-extended/images/swupdate-image.inc > b/recipes-extended/images/swupdate-image.inc > > index 795b4a2..928edad 100644 > > --- a/recipes-extended/images/swupdate-image.inc > > +++ b/recipes-extended/images/swupdate-image.inc > > @@ -12,7 +12,7 @@ IMAGE_INSTALL = "base-files \ > > libconfig \ > > swupdate \ > > swupdate-www \ > > - ${@bb.utils.contains('SWUPDATE_INIT', 'tiny', > 'virtual/initscripts-swupdate', 'initscripts sysvinit', d)} \ > > + ${@bb.utils.contains('SWUPDATE_INIT', 'tiny', > 'virtual/initscripts-swupdate', 'initscripts sysvinit > swupdate-progress-sysvinit', d)} \ > > util-linux-sfdisk \ > > " > > > > diff --git a/recipes-support/swupdate/swupdate.inc > b/recipes-support/swupdate/swupdate.inc > > index 0d382bd..e5ff392 100644 > > --- a/recipes-support/swupdate/swupdate.inc > > +++ b/recipes-support/swupdate/swupdate.inc > > @@ -36,6 +36,7 @@ PACKAGES =+ " \ > > ${PN}-client \ > > ${PN}-lua \ > > ${PN}-progress \ > > + ${PN}-progress-sysvinit \ > > ${PN}-tools \ > > ${PN}-tools-hawkbit \ > > ${PN}-usb \ > > @@ -51,8 +52,9 @@ FILES_${PN}-lua += "${libdir}/lua/" > > FILES_${PN}-progress = " \ > > ${bindir}/swupdate-progress \ > > ${systemd_system_unitdir}/swupdate-progress.service \ > > - ${libdir}/swupdate/conf.d/90-start-progress \ > > " > > Ok - I am missing in this patch how 90-start-progress is installed in > case of systemd. It belongs now to a new package as below, but this is > added as RDEPENDS in case of SystemV. How is it installed on a distro > with systemd as virtual/init (it does not belong anymore to > FILES_${PN}-progress) ? > > > +FILES_${PN}-progress-sysvinit = > "${libdir}/swupdate/conf.d/90-start-progress" > > + > > FILES_${PN}-usb = " \ > > ${sysconfdir}/udev/rules.d/swupdate-usb.rules \ > > ${systemd_system_unitdir}/swupdate-usb@.service \ > > @@ -74,6 +76,7 @@ FILES_${PN}-www = " \ > > " > > > > RDEPENDS_${PN}-usb += "${PN}-client" > > +RDEPENDS_${PN}-progress += > "${@bb.utils.contains('DISTRO_FEATURES','systemd','','${PN}-progress-sysvinit',d)}" > > > > # The tools package is deprecated, it is an empty meta package for > backward compatibility > > RDEPENDS_${PN}-tools += "${PN}-client ${PN}-progress > ${PN}-tools-hawkbit \ > > @@ -255,10 +258,10 @@ do_install () { > > install -m 0644 ${WORKDIR}/tmpfiles-swupdate.conf > ${D}${libdir}/tmpfiles.d/swupdate.conf > > install -d ${D}${sysconfdir}/udev/rules.d > > install -m 0644 ${WORKDIR}/swupdate-usb.rules > ${D}${sysconfdir}/udev/rules.d/ > > - else > > - # in case of systemd there is a service file, for sysv init we > need to start it as well > > - install -m 0644 ${WORKDIR}/90-start-progress > ${D}${libdir}/swupdate/conf.d/ > > fi > > + > > + # in case of systemd there is a service file, for sysv init we need > to start it as well > > + install -m 0644 ${WORKDIR}/90-start-progress > ${D}${libdir}/swupdate/conf.d/ > > } > > > > INITSCRIPT_NAME = "swupdate" > > > > > Best regards, > Stefano Babic > > -- > You received this message because you are subscribed to the Google Groups > "swupdate" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to swupdate+unsubscribe@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/swupdate/10f85f79-40e3-0d44-68e5-7ed2e91d7f5b%40denx.de > . >
Hi Kyle, On 12.04.21 01:12, Kyle Russell wrote: > ${PN}-progress has always contained the necessary file to support > systemd (swupdate-progress.service), and it still does. There is no > change here. Before this patch, 90-start-progress was *also* installed > in ${PN}-progress if systemd was *not* the virtual/init. Ok, right - so the patch remove 90-start-progress is systemd is the virtual/init, but yes, it is not required and it should not be installed. Agree. > (swupdate-progress.service was still installed, though unused and extra.) Right, this is the run unit. > > After this patch, 90-start-progress is now installed in a separate > package. This allows us to still include this in images (like the > initramfs) even when our main rootfs distro configuration uses systemd > for virtual/init. The main distro still gets swupdate-progress.service > through ${PN}-progress, but the initramfs can additionally install > ${PN}-progress-sysvinit. Ok, fine. > > Ideally, you don't need both swupdate-progress.service and > 90-start-progress, but I didn't split the packages further in the > interest of compatibility. Right - my big concern is to not break image generation, as most (already delivered projects) just include swupdate-progress. > If you do *not* specify systemd as > virtual/init, then today you get both, which is the reason I added the > following line: > > RDEPENDS_${PN}-progress += > "${@bb.utils.contains('DISTRO_FEATURES','systemd','','${PN}-progress-sysvinit',d)}" I see > I think it would be better to have two packages: ${PN}-progress-systemd > and ${PN}-progress-sysvinit, and both should RDEPEND on ${PN}-progress. > However, this would change the top-level package on which images are > required to declare RDEPENDS (select either ${PN}-progress-systemd or > ${PN}-progress-sysvinit instead of ${PN}-progress), and I didn't want to > break existing images. Exactly - it is better, but it breaks current images, so we should not do. > Maybe ${PN}-progress should become an > empty/dummy package that either RDEPENDS on ${PN}-progress-systemd or > ${PN}-progress-sysvinit based on DISTRO_FEATURES, and maybe those two > packages should both RDEPEND on ${PN}-progress-bin (which contains > /usr/bin/swupdate-progress). This is also a good a clean way. > That would remove the unnecessary init > script in both cases, and also allow the initramfs to separately RDEPEND > on ${PN}-progress-sysvinit. Well, this seems a nice way to clean up ! ALLOW_EMPTY_${PN}-progress = "1" and the RDEPENDS above should do the work. > > Thoughts? Best regards, Stefano Babic > Kyle > > On Sun, Apr 11, 2021 at 8:01 AM Stefano Babic <sbabic@denx.de > <mailto:sbabic@denx.de>> wrote: > > Hi Russell, > > On 10.04.21 22:53, Kyle Russell wrote: > > Create a swupdate-progress-sysvinit package with the necessary > startup script > > for swupdate-progress to run correctly during startup of the > initramfs recovery > > image. > > > > This allows swupdate-progress to be installed in both a distro's > main rootfs > > which uses systemd, and the initramfs image which uses sysvinit. > > > > In order for the initramfs image to support automatic reboot, it > needs > > swupdate-progress to monitor the update process and trigger a > reboot of > > the system, but for distros configured to use systemd, the init > script > > needed to launch swupdate-progress isn't even installed to the > > swupdate-progress package, so just installing swupdate-progress > to the > > initramfs isn't sufficient for this to work since the initramfs > only uses > > sysvinit. Both the init script (from swupdate-progress-sysvinig) > and the > > swupdate-progress package need to be installed to the initramfs. > > > > Signed-off-by: Kyle Russell <bkylerussell@gmail.com > <mailto:bkylerussell@gmail.com>> > > --- > > recipes-extended/images/swupdate-image.inc | 2 +- > > recipes-support/swupdate/swupdate.inc | 11 +++++++---- > > 2 files changed, 8 insertions(+), 5 deletions(-) > > > > diff --git a/recipes-extended/images/swupdate-image.inc > b/recipes-extended/images/swupdate-image.inc > > index 795b4a2..928edad 100644 > > --- a/recipes-extended/images/swupdate-image.inc > > +++ b/recipes-extended/images/swupdate-image.inc > > @@ -12,7 +12,7 @@ IMAGE_INSTALL = "base-files \ > > libconfig \ > > swupdate \ > > swupdate-www \ > > - ${@bb.utils.contains('SWUPDATE_INIT', 'tiny', > 'virtual/initscripts-swupdate', 'initscripts sysvinit', d)} \ > > + ${@bb.utils.contains('SWUPDATE_INIT', 'tiny', > 'virtual/initscripts-swupdate', 'initscripts sysvinit > swupdate-progress-sysvinit', d)} \ > > util-linux-sfdisk \ > > " > > > > diff --git a/recipes-support/swupdate/swupdate.inc > b/recipes-support/swupdate/swupdate.inc > > index 0d382bd..e5ff392 100644 > > --- a/recipes-support/swupdate/swupdate.inc > > +++ b/recipes-support/swupdate/swupdate.inc > > @@ -36,6 +36,7 @@ PACKAGES =+ " \ > > ${PN}-client \ > > ${PN}-lua \ > > ${PN}-progress \ > > + ${PN}-progress-sysvinit \ > > ${PN}-tools \ > > ${PN}-tools-hawkbit \ > > ${PN}-usb \ > > @@ -51,8 +52,9 @@ FILES_${PN}-lua += "${libdir}/lua/" > > FILES_${PN}-progress = " \ > > ${bindir}/swupdate-progress \ > > ${systemd_system_unitdir}/swupdate-progress.service \ > > - ${libdir}/swupdate/conf.d/90-start-progress \ > > " > > Ok - I am missing in this patch how 90-start-progress is installed in > case of systemd. It belongs now to a new package as below, but this is > added as RDEPENDS in case of SystemV. How is it installed on a distro > with systemd as virtual/init (it does not belong anymore to > FILES_${PN}-progress) ? > > > +FILES_${PN}-progress-sysvinit = > "${libdir}/swupdate/conf.d/90-start-progress" > > + > > FILES_${PN}-usb = " \ > > ${sysconfdir}/udev/rules.d/swupdate-usb.rules \ > > ${systemd_system_unitdir}/swupdate-usb@.service \ > > @@ -74,6 +76,7 @@ FILES_${PN}-www = " \ > > " > > > > RDEPENDS_${PN}-usb += "${PN}-client" > > +RDEPENDS_${PN}-progress += > "${@bb.utils.contains('DISTRO_FEATURES','systemd','','${PN}-progress-sysvinit',d)}" > > > > # The tools package is deprecated, it is an empty meta package > for backward compatibility > > RDEPENDS_${PN}-tools += "${PN}-client ${PN}-progress > ${PN}-tools-hawkbit \ > > @@ -255,10 +258,10 @@ do_install () { > > install -m 0644 ${WORKDIR}/tmpfiles-swupdate.conf > ${D}${libdir}/tmpfiles.d/swupdate.conf > > install -d ${D}${sysconfdir}/udev/rules.d > > install -m 0644 ${WORKDIR}/swupdate-usb.rules > ${D}${sysconfdir}/udev/rules.d/ > > - else > > - # in case of systemd there is a service file, for sysv > init we need to start it as well > > - install -m 0644 ${WORKDIR}/90-start-progress > ${D}${libdir}/swupdate/conf.d/ > > fi > > + > > + # in case of systemd there is a service file, for sysv init > we need to start it as well > > + install -m 0644 ${WORKDIR}/90-start-progress > ${D}${libdir}/swupdate/conf.d/ > > } > > > > INITSCRIPT_NAME = "swupdate" > > > > > Best regards, > Stefano Babic > > -- > You received this message because you are subscribed to the Google > Groups "swupdate" group. > To unsubscribe from this group and stop receiving emails from it, > send an email to swupdate+unsubscribe@googlegroups.com > <mailto:swupdate%2Bunsubscribe@googlegroups.com>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/swupdate/10f85f79-40e3-0d44-68e5-7ed2e91d7f5b%40denx.de > <https://groups.google.com/d/msgid/swupdate/10f85f79-40e3-0d44-68e5-7ed2e91d7f5b%40denx.de>. > > -- > You received this message because you are subscribed to the Google > Groups "swupdate" group. > To unsubscribe from this group and stop receiving emails from it, send > an email to swupdate+unsubscribe@googlegroups.com > <mailto:swupdate+unsubscribe@googlegroups.com>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/swupdate/CAFrQVPPkKLHh75tZSD%2BD_N%2Bw%3DnDYqNcmBGh6qqAk_UtAMNNKrw%40mail.gmail.com > <https://groups.google.com/d/msgid/swupdate/CAFrQVPPkKLHh75tZSD%2BD_N%2Bw%3DnDYqNcmBGh6qqAk_UtAMNNKrw%40mail.gmail.com?utm_medium=email&utm_source=footer>.
Ok, I'll fix it up and send out a new patch today. On Mon, Apr 12, 2021, 4:04 AM Stefano Babic <sbabic@denx.de> wrote: > Hi Kyle, > > On 12.04.21 01:12, Kyle Russell wrote: > > ${PN}-progress has always contained the necessary file to support > > systemd (swupdate-progress.service), and it still does. There is no > > change here. Before this patch, 90-start-progress was *also* installed > > in ${PN}-progress if systemd was *not* the virtual/init. > Ok, right - so the patch remove 90-start-progress is systemd is the > virtual/init, but yes, it is not required and it should not be > installed. Agree. > > > (swupdate-progress.service was still installed, though unused and extra.) > > Right, this is the run unit. > > > > > After this patch, 90-start-progress is now installed in a separate > > package. This allows us to still include this in images (like the > > initramfs) even when our main rootfs distro configuration uses systemd > > for virtual/init. The main distro still gets swupdate-progress.service > > through ${PN}-progress, but the initramfs can additionally install > > ${PN}-progress-sysvinit. > > Ok, fine. > > > > > Ideally, you don't need both swupdate-progress.service and > > 90-start-progress, but I didn't split the packages further in the > > interest of compatibility. > > Right - my big concern is to not break image generation, as most > (already delivered projects) just include swupdate-progress. > > > If you do *not* specify systemd as > > virtual/init, then today you get both, which is the reason I added the > > following line: > > > > RDEPENDS_${PN}-progress += > > > "${@bb.utils.contains('DISTRO_FEATURES','systemd','','${PN}-progress-sysvinit',d)}" > > I see > > > I think it would be better to have two packages: ${PN}-progress-systemd > > and ${PN}-progress-sysvinit, and both should RDEPEND on ${PN}-progress. > > However, this would change the top-level package on which images are > > required to declare RDEPENDS (select either ${PN}-progress-systemd or > > ${PN}-progress-sysvinit instead of ${PN}-progress), and I didn't want to > > break existing images. > > Exactly - it is better, but it breaks current images, so we should not do. > > > Maybe ${PN}-progress should become an > > empty/dummy package that either RDEPENDS on ${PN}-progress-systemd or > > ${PN}-progress-sysvinit based on DISTRO_FEATURES, and maybe those two > > packages should both RDEPEND on ${PN}-progress-bin (which contains > > /usr/bin/swupdate-progress). > > This is also a good a clean way. > > > That would remove the unnecessary init > > script in both cases, and also allow the initramfs to separately RDEPEND > > on ${PN}-progress-sysvinit. > > Well, this seems a nice way to clean up ! > ALLOW_EMPTY_${PN}-progress = "1" and the RDEPENDS above should do the work. > > > > > Thoughts? > > > Best regards, > Stefano Babic > > > > Kyle > > > > On Sun, Apr 11, 2021 at 8:01 AM Stefano Babic <sbabic@denx.de > > <mailto:sbabic@denx.de>> wrote: > > > > Hi Russell, > > > > On 10.04.21 22:53, Kyle Russell wrote: > > > Create a swupdate-progress-sysvinit package with the necessary > > startup script > > > for swupdate-progress to run correctly during startup of the > > initramfs recovery > > > image. > > > > > > This allows swupdate-progress to be installed in both a distro's > > main rootfs > > > which uses systemd, and the initramfs image which uses sysvinit. > > > > > > In order for the initramfs image to support automatic reboot, it > > needs > > > swupdate-progress to monitor the update process and trigger a > > reboot of > > > the system, but for distros configured to use systemd, the init > > script > > > needed to launch swupdate-progress isn't even installed to the > > > swupdate-progress package, so just installing swupdate-progress > > to the > > > initramfs isn't sufficient for this to work since the initramfs > > only uses > > > sysvinit. Both the init script (from swupdate-progress-sysvinig) > > and the > > > swupdate-progress package need to be installed to the initramfs. > > > > > > Signed-off-by: Kyle Russell <bkylerussell@gmail.com > > <mailto:bkylerussell@gmail.com>> > > > --- > > > recipes-extended/images/swupdate-image.inc | 2 +- > > > recipes-support/swupdate/swupdate.inc | 11 +++++++---- > > > 2 files changed, 8 insertions(+), 5 deletions(-) > > > > > > diff --git a/recipes-extended/images/swupdate-image.inc > > b/recipes-extended/images/swupdate-image.inc > > > index 795b4a2..928edad 100644 > > > --- a/recipes-extended/images/swupdate-image.inc > > > +++ b/recipes-extended/images/swupdate-image.inc > > > @@ -12,7 +12,7 @@ IMAGE_INSTALL = "base-files \ > > > libconfig \ > > > swupdate \ > > > swupdate-www \ > > > - ${@bb.utils.contains('SWUPDATE_INIT', 'tiny', > > 'virtual/initscripts-swupdate', 'initscripts sysvinit', d)} \ > > > + ${@bb.utils.contains('SWUPDATE_INIT', 'tiny', > > 'virtual/initscripts-swupdate', 'initscripts sysvinit > > swupdate-progress-sysvinit', d)} \ > > > util-linux-sfdisk \ > > > " > > > > > > diff --git a/recipes-support/swupdate/swupdate.inc > > b/recipes-support/swupdate/swupdate.inc > > > index 0d382bd..e5ff392 100644 > > > --- a/recipes-support/swupdate/swupdate.inc > > > +++ b/recipes-support/swupdate/swupdate.inc > > > @@ -36,6 +36,7 @@ PACKAGES =+ " \ > > > ${PN}-client \ > > > ${PN}-lua \ > > > ${PN}-progress \ > > > + ${PN}-progress-sysvinit \ > > > ${PN}-tools \ > > > ${PN}-tools-hawkbit \ > > > ${PN}-usb \ > > > @@ -51,8 +52,9 @@ FILES_${PN}-lua += "${libdir}/lua/" > > > FILES_${PN}-progress = " \ > > > ${bindir}/swupdate-progress \ > > > ${systemd_system_unitdir}/swupdate-progress.service \ > > > - ${libdir}/swupdate/conf.d/90-start-progress \ > > > " > > > > Ok - I am missing in this patch how 90-start-progress is installed in > > case of systemd. It belongs now to a new package as below, but this > is > > added as RDEPENDS in case of SystemV. How is it installed on a distro > > with systemd as virtual/init (it does not belong anymore to > > FILES_${PN}-progress) ? > > > > > +FILES_${PN}-progress-sysvinit = > > "${libdir}/swupdate/conf.d/90-start-progress" > > > + > > > FILES_${PN}-usb = " \ > > > ${sysconfdir}/udev/rules.d/swupdate-usb.rules \ > > > ${systemd_system_unitdir}/swupdate-usb@.service \ > > > @@ -74,6 +76,7 @@ FILES_${PN}-www = " \ > > > " > > > > > > RDEPENDS_${PN}-usb += "${PN}-client" > > > +RDEPENDS_${PN}-progress += > > > "${@bb.utils.contains('DISTRO_FEATURES','systemd','','${PN}-progress-sysvinit',d)}" > > > > > > # The tools package is deprecated, it is an empty meta package > > for backward compatibility > > > RDEPENDS_${PN}-tools += "${PN}-client ${PN}-progress > > ${PN}-tools-hawkbit \ > > > @@ -255,10 +258,10 @@ do_install () { > > > install -m 0644 ${WORKDIR}/tmpfiles-swupdate.conf > > ${D}${libdir}/tmpfiles.d/swupdate.conf > > > install -d ${D}${sysconfdir}/udev/rules.d > > > install -m 0644 ${WORKDIR}/swupdate-usb.rules > > ${D}${sysconfdir}/udev/rules.d/ > > > - else > > > - # in case of systemd there is a service file, for sysv > > init we need to start it as well > > > - install -m 0644 ${WORKDIR}/90-start-progress > > ${D}${libdir}/swupdate/conf.d/ > > > fi > > > + > > > + # in case of systemd there is a service file, for sysv init > > we need to start it as well > > > + install -m 0644 ${WORKDIR}/90-start-progress > > ${D}${libdir}/swupdate/conf.d/ > > > } > > > > > > INITSCRIPT_NAME = "swupdate" > > > > > > > > > Best regards, > > Stefano Babic > > > > -- > > You received this message because you are subscribed to the Google > > Groups "swupdate" group. > > To unsubscribe from this group and stop receiving emails from it, > > send an email to swupdate+unsubscribe@googlegroups.com > > <mailto:swupdate%2Bunsubscribe@googlegroups.com>. > > To view this discussion on the web visit > > > https://groups.google.com/d/msgid/swupdate/10f85f79-40e3-0d44-68e5-7ed2e91d7f5b%40denx.de > > < > https://groups.google.com/d/msgid/swupdate/10f85f79-40e3-0d44-68e5-7ed2e91d7f5b%40denx.de > >. > > > > -- > > You received this message because you are subscribed to the Google > > Groups "swupdate" group. > > To unsubscribe from this group and stop receiving emails from it, send > > an email to swupdate+unsubscribe@googlegroups.com > > <mailto:swupdate+unsubscribe@googlegroups.com>. > > To view this discussion on the web visit > > > https://groups.google.com/d/msgid/swupdate/CAFrQVPPkKLHh75tZSD%2BD_N%2Bw%3DnDYqNcmBGh6qqAk_UtAMNNKrw%40mail.gmail.com > > < > https://groups.google.com/d/msgid/swupdate/CAFrQVPPkKLHh75tZSD%2BD_N%2Bw%3DnDYqNcmBGh6qqAk_UtAMNNKrw%40mail.gmail.com?utm_medium=email&utm_source=footer > >. > > > -- > ===================================================================== > DENX Software Engineering GmbH, Managing Director: Wolfgang Denk > HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany > Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic@denx.de > ===================================================================== > > -- > You received this message because you are subscribed to the Google Groups > "swupdate" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to swupdate+unsubscribe@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/swupdate/b9871b64-7851-7891-e8af-99b8db6f0cb6%40denx.de > . >
Hi Stefano, I noticed you pulled in my first patch yesterday, and I just wanted to make sure you saw the v2 patch I posted to this thread like we discussed. Please let me know if you have any other suggestions that need to be addressed. Thanks, Kyle On Mon, Apr 12, 2021, 8:46 AM Kyle Russell <bkylerussell@gmail.com> wrote: > Ok, I'll fix it up and send out a new patch today. > > On Mon, Apr 12, 2021, 4:04 AM Stefano Babic <sbabic@denx.de> wrote: > >> Hi Kyle, >> >> On 12.04.21 01:12, Kyle Russell wrote: >> > ${PN}-progress has always contained the necessary file to support >> > systemd (swupdate-progress.service), and it still does. There is no >> > change here. Before this patch, 90-start-progress was *also* installed >> > in ${PN}-progress if systemd was *not* the virtual/init. >> Ok, right - so the patch remove 90-start-progress is systemd is the >> virtual/init, but yes, it is not required and it should not be >> installed. Agree. >> >> > (swupdate-progress.service was still installed, though unused and >> extra.) >> >> Right, this is the run unit. >> >> > >> > After this patch, 90-start-progress is now installed in a separate >> > package. This allows us to still include this in images (like the >> > initramfs) even when our main rootfs distro configuration uses systemd >> > for virtual/init. The main distro still gets swupdate-progress.service >> > through ${PN}-progress, but the initramfs can additionally install >> > ${PN}-progress-sysvinit. >> >> Ok, fine. >> >> > >> > Ideally, you don't need both swupdate-progress.service and >> > 90-start-progress, but I didn't split the packages further in the >> > interest of compatibility. >> >> Right - my big concern is to not break image generation, as most >> (already delivered projects) just include swupdate-progress. >> >> > If you do *not* specify systemd as >> > virtual/init, then today you get both, which is the reason I added the >> > following line: >> > >> > RDEPENDS_${PN}-progress += >> > >> "${@bb.utils.contains('DISTRO_FEATURES','systemd','','${PN}-progress-sysvinit',d)}" >> >> I see >> >> > I think it would be better to have two packages: ${PN}-progress-systemd >> > and ${PN}-progress-sysvinit, and both should RDEPEND on >> ${PN}-progress. >> > However, this would change the top-level package on which images are >> > required to declare RDEPENDS (select either ${PN}-progress-systemd or >> > ${PN}-progress-sysvinit instead of ${PN}-progress), and I didn't want >> to >> > break existing images. >> >> Exactly - it is better, but it breaks current images, so we should not do. >> >> > Maybe ${PN}-progress should become an >> > empty/dummy package that either RDEPENDS on ${PN}-progress-systemd or >> > ${PN}-progress-sysvinit based on DISTRO_FEATURES, and maybe those two >> > packages should both RDEPEND on ${PN}-progress-bin (which contains >> > /usr/bin/swupdate-progress). >> >> This is also a good a clean way. >> >> > That would remove the unnecessary init >> > script in both cases, and also allow the initramfs to separately >> RDEPEND >> > on ${PN}-progress-sysvinit. >> >> Well, this seems a nice way to clean up ! >> ALLOW_EMPTY_${PN}-progress = "1" and the RDEPENDS above should do the >> work. >> >> > >> > Thoughts? >> >> >> Best regards, >> Stefano Babic >> >> >> > Kyle >> > >> > On Sun, Apr 11, 2021 at 8:01 AM Stefano Babic <sbabic@denx.de >> > <mailto:sbabic@denx.de>> wrote: >> > >> > Hi Russell, >> > >> > On 10.04.21 22:53, Kyle Russell wrote: >> > > Create a swupdate-progress-sysvinit package with the necessary >> > startup script >> > > for swupdate-progress to run correctly during startup of the >> > initramfs recovery >> > > image. >> > > >> > > This allows swupdate-progress to be installed in both a distro's >> > main rootfs >> > > which uses systemd, and the initramfs image which uses sysvinit. >> > > >> > > In order for the initramfs image to support automatic reboot, it >> > needs >> > > swupdate-progress to monitor the update process and trigger a >> > reboot of >> > > the system, but for distros configured to use systemd, the init >> > script >> > > needed to launch swupdate-progress isn't even installed to the >> > > swupdate-progress package, so just installing swupdate-progress >> > to the >> > > initramfs isn't sufficient for this to work since the initramfs >> > only uses >> > > sysvinit. Both the init script (from swupdate-progress-sysvinig) >> > and the >> > > swupdate-progress package need to be installed to the initramfs. >> > > >> > > Signed-off-by: Kyle Russell <bkylerussell@gmail.com >> > <mailto:bkylerussell@gmail.com>> >> > > --- >> > > recipes-extended/images/swupdate-image.inc | 2 +- >> > > recipes-support/swupdate/swupdate.inc | 11 +++++++---- >> > > 2 files changed, 8 insertions(+), 5 deletions(-) >> > > >> > > diff --git a/recipes-extended/images/swupdate-image.inc >> > b/recipes-extended/images/swupdate-image.inc >> > > index 795b4a2..928edad 100644 >> > > --- a/recipes-extended/images/swupdate-image.inc >> > > +++ b/recipes-extended/images/swupdate-image.inc >> > > @@ -12,7 +12,7 @@ IMAGE_INSTALL = "base-files \ >> > > libconfig \ >> > > swupdate \ >> > > swupdate-www \ >> > > - ${@bb.utils.contains('SWUPDATE_INIT', 'tiny', >> > 'virtual/initscripts-swupdate', 'initscripts sysvinit', d)} \ >> > > + ${@bb.utils.contains('SWUPDATE_INIT', 'tiny', >> > 'virtual/initscripts-swupdate', 'initscripts sysvinit >> > swupdate-progress-sysvinit', d)} \ >> > > util-linux-sfdisk \ >> > > " >> > > >> > > diff --git a/recipes-support/swupdate/swupdate.inc >> > b/recipes-support/swupdate/swupdate.inc >> > > index 0d382bd..e5ff392 100644 >> > > --- a/recipes-support/swupdate/swupdate.inc >> > > +++ b/recipes-support/swupdate/swupdate.inc >> > > @@ -36,6 +36,7 @@ PACKAGES =+ " \ >> > > ${PN}-client \ >> > > ${PN}-lua \ >> > > ${PN}-progress \ >> > > + ${PN}-progress-sysvinit \ >> > > ${PN}-tools \ >> > > ${PN}-tools-hawkbit \ >> > > ${PN}-usb \ >> > > @@ -51,8 +52,9 @@ FILES_${PN}-lua += "${libdir}/lua/" >> > > FILES_${PN}-progress = " \ >> > > ${bindir}/swupdate-progress \ >> > > ${systemd_system_unitdir}/swupdate-progress.service \ >> > > - ${libdir}/swupdate/conf.d/90-start-progress \ >> > > " >> > >> > Ok - I am missing in this patch how 90-start-progress is installed >> in >> > case of systemd. It belongs now to a new package as below, but this >> is >> > added as RDEPENDS in case of SystemV. How is it installed on a >> distro >> > with systemd as virtual/init (it does not belong anymore to >> > FILES_${PN}-progress) ? >> > >> > > +FILES_${PN}-progress-sysvinit = >> > "${libdir}/swupdate/conf.d/90-start-progress" >> > > + >> > > FILES_${PN}-usb = " \ >> > > ${sysconfdir}/udev/rules.d/swupdate-usb.rules \ >> > > ${systemd_system_unitdir}/swupdate-usb@.service \ >> > > @@ -74,6 +76,7 @@ FILES_${PN}-www = " \ >> > > " >> > > >> > > RDEPENDS_${PN}-usb += "${PN}-client" >> > > +RDEPENDS_${PN}-progress += >> > >> "${@bb.utils.contains('DISTRO_FEATURES','systemd','','${PN}-progress-sysvinit',d)}" >> > > >> > > # The tools package is deprecated, it is an empty meta package >> > for backward compatibility >> > > RDEPENDS_${PN}-tools += "${PN}-client ${PN}-progress >> > ${PN}-tools-hawkbit \ >> > > @@ -255,10 +258,10 @@ do_install () { >> > > install -m 0644 ${WORKDIR}/tmpfiles-swupdate.conf >> > ${D}${libdir}/tmpfiles.d/swupdate.conf >> > > install -d ${D}${sysconfdir}/udev/rules.d >> > > install -m 0644 ${WORKDIR}/swupdate-usb.rules >> > ${D}${sysconfdir}/udev/rules.d/ >> > > - else >> > > - # in case of systemd there is a service file, for sysv >> > init we need to start it as well >> > > - install -m 0644 ${WORKDIR}/90-start-progress >> > ${D}${libdir}/swupdate/conf.d/ >> > > fi >> > > + >> > > + # in case of systemd there is a service file, for sysv init >> > we need to start it as well >> > > + install -m 0644 ${WORKDIR}/90-start-progress >> > ${D}${libdir}/swupdate/conf.d/ >> > > } >> > > >> > > INITSCRIPT_NAME = "swupdate" >> > > >> > >> > >> > Best regards, >> > Stefano Babic >> > >> > -- >> > You received this message because you are subscribed to the Google >> > Groups "swupdate" group. >> > To unsubscribe from this group and stop receiving emails from it, >> > send an email to swupdate+unsubscribe@googlegroups.com >> > <mailto:swupdate%2Bunsubscribe@googlegroups.com>. >> > To view this discussion on the web visit >> > >> https://groups.google.com/d/msgid/swupdate/10f85f79-40e3-0d44-68e5-7ed2e91d7f5b%40denx.de >> > < >> https://groups.google.com/d/msgid/swupdate/10f85f79-40e3-0d44-68e5-7ed2e91d7f5b%40denx.de >> >. >> > >> > -- >> > You received this message because you are subscribed to the Google >> > Groups "swupdate" group. >> > To unsubscribe from this group and stop receiving emails from it, send >> > an email to swupdate+unsubscribe@googlegroups.com >> > <mailto:swupdate+unsubscribe@googlegroups.com>. >> > To view this discussion on the web visit >> > >> https://groups.google.com/d/msgid/swupdate/CAFrQVPPkKLHh75tZSD%2BD_N%2Bw%3DnDYqNcmBGh6qqAk_UtAMNNKrw%40mail.gmail.com >> > < >> https://groups.google.com/d/msgid/swupdate/CAFrQVPPkKLHh75tZSD%2BD_N%2Bw%3DnDYqNcmBGh6qqAk_UtAMNNKrw%40mail.gmail.com?utm_medium=email&utm_source=footer >> >. >> >> >> -- >> ===================================================================== >> DENX Software Engineering GmbH, Managing Director: Wolfgang Denk >> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany >> Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic@denx.de >> ===================================================================== >> >> -- >> You received this message because you are subscribed to the Google Groups >> "swupdate" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to swupdate+unsubscribe@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/swupdate/b9871b64-7851-7891-e8af-99b8db6f0cb6%40denx.de >> . >> >
Hi Kyle, On 18.04.21 13:40, Kyle Russell wrote: > Hi Stefano, > > I noticed you pulled in my first patch yesterday, and I just wanted to > make sure you saw the v2 patch I posted to this thread like we > discussed. No, I guess I have made a mistake a V2 did not appear anymore in the patchwork's queue. Thanks for hint. > Please let me know if you have any other suggestions that > need to be addressed. I applied V2 to meta-swupdate (all supported branches, that is thud/zeus/dunfell/gatesgarth/master), thanks ! Best regards, Stefano > > Thanks, > Kyle > > On Mon, Apr 12, 2021, 8:46 AM Kyle Russell <bkylerussell@gmail.com > <mailto:bkylerussell@gmail.com>> wrote: > > Ok, I'll fix it up and send out a new patch today. > > On Mon, Apr 12, 2021, 4:04 AM Stefano Babic <sbabic@denx.de > <mailto:sbabic@denx.de>> wrote: > > Hi Kyle, > > On 12.04.21 01:12, Kyle Russell wrote: > > ${PN}-progress has always contained the necessary file to > support > > systemd (swupdate-progress.service), and it still does. > There is no > > change here. Before this patch, 90-start-progress was *also* > installed > > in ${PN}-progress if systemd was *not* the virtual/init. > Ok, right - so the patch remove 90-start-progress is systemd is the > virtual/init, but yes, it is not required and it should not be > installed. Agree. > > > (swupdate-progress.service was still installed, though unused > and extra.) > > Right, this is the run unit. > > > > > After this patch, 90-start-progress is now installed in a > separate > > package. This allows us to still include this in images > (like the > > initramfs) even when our main rootfs distro configuration > uses systemd > > for virtual/init. The main distro still gets > swupdate-progress.service > > through ${PN}-progress, but the initramfs can additionally > install > > ${PN}-progress-sysvinit. > > Ok, fine. > > > > > Ideally, you don't need both swupdate-progress.service and > > 90-start-progress, but I didn't split the packages further in > the > > interest of compatibility. > > Right - my big concern is to not break image generation, as most > (already delivered projects) just include swupdate-progress. > > > If you do *not* specify systemd as > > virtual/init, then today you get both, which is the reason I > added the > > following line: > > > > RDEPENDS_${PN}-progress += > > > "${@bb.utils.contains('DISTRO_FEATURES','systemd','','${PN}-progress-sysvinit',d)}" > > I see > > > I think it would be better to have two packages: > ${PN}-progress-systemd > > and ${PN}-progress-sysvinit, and both should RDEPEND on > ${PN}-progress. > > However, this would change the top-level package on which > images are > > required to declare RDEPENDS (select either > ${PN}-progress-systemd or > > ${PN}-progress-sysvinit instead of ${PN}-progress), and I > didn't want to > > break existing images. > > Exactly - it is better, but it breaks current images, so we > should not do. > > > Maybe ${PN}-progress should become an > > empty/dummy package that either RDEPENDS on > ${PN}-progress-systemd or > > ${PN}-progress-sysvinit based on DISTRO_FEATURES, and maybe > those two > > packages should both RDEPEND on ${PN}-progress-bin (which > contains > > /usr/bin/swupdate-progress). > > This is also a good a clean way. > > > That would remove the unnecessary init > > script in both cases, and also allow the initramfs to > separately RDEPEND > > on ${PN}-progress-sysvinit. > > Well, this seems a nice way to clean up ! > ALLOW_EMPTY_${PN}-progress = "1" and the RDEPENDS above should > do the work. > > > > > Thoughts? > > > Best regards, > Stefano Babic > > > > Kyle > > > > On Sun, Apr 11, 2021 at 8:01 AM Stefano Babic <sbabic@denx.de > <mailto:sbabic@denx.de> > > <mailto:sbabic@denx.de <mailto:sbabic@denx.de>>> wrote: > > > > Hi Russell, > > > > On 10.04.21 22:53, Kyle Russell wrote: > > > Create a swupdate-progress-sysvinit package with the > necessary > > startup script > > > for swupdate-progress to run correctly during startup > of the > > initramfs recovery > > > image. > > > > > > This allows swupdate-progress to be installed in both > a distro's > > main rootfs > > > which uses systemd, and the initramfs image which uses > sysvinit. > > > > > > In order for the initramfs image to support automatic > reboot, it > > needs > > > swupdate-progress to monitor the update process and > trigger a > > reboot of > > > the system, but for distros configured to use systemd, > the init > > script > > > needed to launch swupdate-progress isn't even > installed to the > > > swupdate-progress package, so just installing > swupdate-progress > > to the > > > initramfs isn't sufficient for this to work since the > initramfs > > only uses > > > sysvinit. Both the init script (from > swupdate-progress-sysvinig) > > and the > > > swupdate-progress package need to be installed to the > initramfs. > > > > > > Signed-off-by: Kyle Russell <bkylerussell@gmail.com > <mailto:bkylerussell@gmail.com> > > <mailto:bkylerussell@gmail.com > <mailto:bkylerussell@gmail.com>>> > > > --- > > > recipes-extended/images/swupdate-image.inc | 2 +- > > > recipes-support/swupdate/swupdate.inc | 11 > +++++++---- > > > 2 files changed, 8 insertions(+), 5 deletions(-) > > > > > > diff --git a/recipes-extended/images/swupdate-image.inc > > b/recipes-extended/images/swupdate-image.inc > > > index 795b4a2..928edad 100644 > > > --- a/recipes-extended/images/swupdate-image.inc > > > +++ b/recipes-extended/images/swupdate-image.inc > > > @@ -12,7 +12,7 @@ IMAGE_INSTALL = "base-files \ > > > libconfig \ > > > swupdate \ > > > swupdate-www \ > > > - ${@bb.utils.contains('SWUPDATE_INIT', > 'tiny', > > 'virtual/initscripts-swupdate', 'initscripts sysvinit', d)} \ > > > + ${@bb.utils.contains('SWUPDATE_INIT', > 'tiny', > > 'virtual/initscripts-swupdate', 'initscripts sysvinit > > swupdate-progress-sysvinit', d)} \ > > > util-linux-sfdisk \ > > > " > > > > > > diff --git a/recipes-support/swupdate/swupdate.inc > > b/recipes-support/swupdate/swupdate.inc > > > index 0d382bd..e5ff392 100644 > > > --- a/recipes-support/swupdate/swupdate.inc > > > +++ b/recipes-support/swupdate/swupdate.inc > > > @@ -36,6 +36,7 @@ PACKAGES =+ " \ > > > ${PN}-client \ > > > ${PN}-lua \ > > > ${PN}-progress \ > > > + ${PN}-progress-sysvinit \ > > > ${PN}-tools \ > > > ${PN}-tools-hawkbit \ > > > ${PN}-usb \ > > > @@ -51,8 +52,9 @@ FILES_${PN}-lua += "${libdir}/lua/" > > > FILES_${PN}-progress = " \ > > > ${bindir}/swupdate-progress \ > > > > ${systemd_system_unitdir}/swupdate-progress.service \ > > > - ${libdir}/swupdate/conf.d/90-start-progress \ > > > " > > > > Ok - I am missing in this patch how 90-start-progress is > installed in > > case of systemd. It belongs now to a new package as > below, but this is > > added as RDEPENDS in case of SystemV. How is it installed > on a distro > > with systemd as virtual/init (it does not belong anymore to > > FILES_${PN}-progress) ? > > > > > +FILES_${PN}-progress-sysvinit = > > "${libdir}/swupdate/conf.d/90-start-progress" > > > + > > > FILES_${PN}-usb = " \ > > > ${sysconfdir}/udev/rules.d/swupdate-usb.rules \ > > > ${systemd_system_unitdir}/swupdate-usb@.service \ > > > @@ -74,6 +76,7 @@ FILES_${PN}-www = " \ > > > " > > > > > > RDEPENDS_${PN}-usb += "${PN}-client" > > > +RDEPENDS_${PN}-progress += > > > "${@bb.utils.contains('DISTRO_FEATURES','systemd','','${PN}-progress-sysvinit',d)}" > > > > > > # The tools package is deprecated, it is an empty > meta package > > for backward compatibility > > > RDEPENDS_${PN}-tools += "${PN}-client ${PN}-progress > > ${PN}-tools-hawkbit \ > > > @@ -255,10 +258,10 @@ do_install () { > > > install -m 0644 > ${WORKDIR}/tmpfiles-swupdate.conf > > ${D}${libdir}/tmpfiles.d/swupdate.conf > > > install -d ${D}${sysconfdir}/udev/rules.d > > > install -m 0644 ${WORKDIR}/swupdate-usb.rules > > ${D}${sysconfdir}/udev/rules.d/ > > > - else > > > - # in case of systemd there is a service file, > for sysv > > init we need to start it as well > > > - install -m 0644 ${WORKDIR}/90-start-progress > > ${D}${libdir}/swupdate/conf.d/ > > > fi > > > + > > > + # in case of systemd there is a service file, for > sysv init > > we need to start it as well > > > + install -m 0644 ${WORKDIR}/90-start-progress > > ${D}${libdir}/swupdate/conf.d/ > > > } > > > > > > INITSCRIPT_NAME = "swupdate" > > > > > > > > > Best regards, > > Stefano Babic > > > > -- > > You received this message because you are subscribed to > the Google > > Groups "swupdate" group. > > To unsubscribe from this group and stop receiving emails > from it, > > send an email to swupdate+unsubscribe@googlegroups.com > <mailto:swupdate%2Bunsubscribe@googlegroups.com> > > <mailto:swupdate%2Bunsubscribe@googlegroups.com > <mailto:swupdate%252Bunsubscribe@googlegroups.com>>. > > To view this discussion on the web visit > > > https://groups.google.com/d/msgid/swupdate/10f85f79-40e3-0d44-68e5-7ed2e91d7f5b%40denx.de > <https://groups.google.com/d/msgid/swupdate/10f85f79-40e3-0d44-68e5-7ed2e91d7f5b%40denx.de> > > > <https://groups.google.com/d/msgid/swupdate/10f85f79-40e3-0d44-68e5-7ed2e91d7f5b%40denx.de <https://groups.google.com/d/msgid/swupdate/10f85f79-40e3-0d44-68e5-7ed2e91d7f5b%40denx.de>>. > > > > -- > > You received this message because you are subscribed to the > Google > > Groups "swupdate" group. > > To unsubscribe from this group and stop receiving emails from > it, send > > an email to swupdate+unsubscribe@googlegroups.com > <mailto:swupdate%2Bunsubscribe@googlegroups.com> > > <mailto:swupdate+unsubscribe@googlegroups.com > <mailto:swupdate%2Bunsubscribe@googlegroups.com>>. > > To view this discussion on the web visit > > > https://groups.google.com/d/msgid/swupdate/CAFrQVPPkKLHh75tZSD%2BD_N%2Bw%3DnDYqNcmBGh6qqAk_UtAMNNKrw%40mail.gmail.com > <https://groups.google.com/d/msgid/swupdate/CAFrQVPPkKLHh75tZSD%2BD_N%2Bw%3DnDYqNcmBGh6qqAk_UtAMNNKrw%40mail.gmail.com> > > > > <https://groups.google.com/d/msgid/swupdate/CAFrQVPPkKLHh75tZSD%2BD_N%2Bw%3DnDYqNcmBGh6qqAk_UtAMNNKrw%40mail.gmail.com?utm_medium=email&utm_source=footer > <https://groups.google.com/d/msgid/swupdate/CAFrQVPPkKLHh75tZSD%2BD_N%2Bw%3DnDYqNcmBGh6qqAk_UtAMNNKrw%40mail.gmail.com?utm_medium=email&utm_source=footer>>. > > > -- > ===================================================================== > DENX Software Engineering GmbH, Managing Director: Wolfgang > Denk > HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, > Germany > Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: > sbabic@denx.de <mailto:sbabic@denx.de> > ===================================================================== > > -- > You received this message because you are subscribed to the > Google Groups "swupdate" group. > To unsubscribe from this group and stop receiving emails from > it, send an email to swupdate+unsubscribe@googlegroups.com > <mailto:swupdate%2Bunsubscribe@googlegroups.com>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/swupdate/b9871b64-7851-7891-e8af-99b8db6f0cb6%40denx.de > <https://groups.google.com/d/msgid/swupdate/b9871b64-7851-7891-e8af-99b8db6f0cb6%40denx.de>. >
No worries. :) Thanks! On Sun, Apr 18, 2021, 8:11 AM Stefano Babic <stefano.babic@denx.de> wrote: > Hi Kyle, > > On 18.04.21 13:40, Kyle Russell wrote: > > Hi Stefano, > > > > I noticed you pulled in my first patch yesterday, and I just wanted to > > make sure you saw the v2 patch I posted to this thread like we > > discussed. > > No, I guess I have made a mistake a V2 did not appear anymore in the > patchwork's queue. Thanks for hint. > > > Please let me know if you have any other suggestions that > > need to be addressed. > > I applied V2 to meta-swupdate (all supported branches, that is > thud/zeus/dunfell/gatesgarth/master), thanks ! > > Best regards, > Stefano > > > > > Thanks, > > Kyle > > > > On Mon, Apr 12, 2021, 8:46 AM Kyle Russell <bkylerussell@gmail.com > > <mailto:bkylerussell@gmail.com>> wrote: > > > > Ok, I'll fix it up and send out a new patch today. > > > > On Mon, Apr 12, 2021, 4:04 AM Stefano Babic <sbabic@denx.de > > <mailto:sbabic@denx.de>> wrote: > > > > Hi Kyle, > > > > On 12.04.21 01:12, Kyle Russell wrote: > > > ${PN}-progress has always contained the necessary file to > > support > > > systemd (swupdate-progress.service), and it still does. > > There is no > > > change here. Before this patch, 90-start-progress was *also* > > installed > > > in ${PN}-progress if systemd was *not* the virtual/init. > > Ok, right - so the patch remove 90-start-progress is systemd is > the > > virtual/init, but yes, it is not required and it should not be > > installed. Agree. > > > > > (swupdate-progress.service was still installed, though unused > > and extra.) > > > > Right, this is the run unit. > > > > > > > > After this patch, 90-start-progress is now installed in a > > separate > > > package. This allows us to still include this in images > > (like the > > > initramfs) even when our main rootfs distro configuration > > uses systemd > > > for virtual/init. The main distro still gets > > swupdate-progress.service > > > through ${PN}-progress, but the initramfs can additionally > > install > > > ${PN}-progress-sysvinit. > > > > Ok, fine. > > > > > > > > Ideally, you don't need both swupdate-progress.service and > > > 90-start-progress, but I didn't split the packages further in > > the > > > interest of compatibility. > > > > Right - my big concern is to not break image generation, as most > > (already delivered projects) just include swupdate-progress. > > > > > If you do *not* specify systemd as > > > virtual/init, then today you get both, which is the reason I > > added the > > > following line: > > > > > > RDEPENDS_${PN}-progress += > > > > > > "${@bb.utils.contains('DISTRO_FEATURES','systemd','','${PN}-progress-sysvinit',d)}" > > > > I see > > > > > I think it would be better to have two packages: > > ${PN}-progress-systemd > > > and ${PN}-progress-sysvinit, and both should RDEPEND on > > ${PN}-progress. > > > However, this would change the top-level package on which > > images are > > > required to declare RDEPENDS (select either > > ${PN}-progress-systemd or > > > ${PN}-progress-sysvinit instead of ${PN}-progress), and I > > didn't want to > > > break existing images. > > > > Exactly - it is better, but it breaks current images, so we > > should not do. > > > > > Maybe ${PN}-progress should become an > > > empty/dummy package that either RDEPENDS on > > ${PN}-progress-systemd or > > > ${PN}-progress-sysvinit based on DISTRO_FEATURES, and maybe > > those two > > > packages should both RDEPEND on ${PN}-progress-bin (which > > contains > > > /usr/bin/swupdate-progress). > > > > This is also a good a clean way. > > > > > That would remove the unnecessary init > > > script in both cases, and also allow the initramfs to > > separately RDEPEND > > > on ${PN}-progress-sysvinit. > > > > Well, this seems a nice way to clean up ! > > ALLOW_EMPTY_${PN}-progress = "1" and the RDEPENDS above should > > do the work. > > > > > > > > Thoughts? > > > > > > Best regards, > > Stefano Babic > > > > > > > Kyle > > > > > > On Sun, Apr 11, 2021 at 8:01 AM Stefano Babic <sbabic@denx.de > > <mailto:sbabic@denx.de> > > > <mailto:sbabic@denx.de <mailto:sbabic@denx.de>>> wrote: > > > > > > Hi Russell, > > > > > > On 10.04.21 22:53, Kyle Russell wrote: > > > > Create a swupdate-progress-sysvinit package with the > > necessary > > > startup script > > > > for swupdate-progress to run correctly during startup > > of the > > > initramfs recovery > > > > image. > > > > > > > > This allows swupdate-progress to be installed in both > > a distro's > > > main rootfs > > > > which uses systemd, and the initramfs image which uses > > sysvinit. > > > > > > > > In order for the initramfs image to support automatic > > reboot, it > > > needs > > > > swupdate-progress to monitor the update process and > > trigger a > > > reboot of > > > > the system, but for distros configured to use systemd, > > the init > > > script > > > > needed to launch swupdate-progress isn't even > > installed to the > > > > swupdate-progress package, so just installing > > swupdate-progress > > > to the > > > > initramfs isn't sufficient for this to work since the > > initramfs > > > only uses > > > > sysvinit. Both the init script (from > > swupdate-progress-sysvinig) > > > and the > > > > swupdate-progress package need to be installed to the > > initramfs. > > > > > > > > Signed-off-by: Kyle Russell <bkylerussell@gmail.com > > <mailto:bkylerussell@gmail.com> > > > <mailto:bkylerussell@gmail.com > > <mailto:bkylerussell@gmail.com>>> > > > > --- > > > > recipes-extended/images/swupdate-image.inc | 2 +- > > > > recipes-support/swupdate/swupdate.inc | 11 > > +++++++---- > > > > 2 files changed, 8 insertions(+), 5 deletions(-) > > > > > > > > diff --git a/recipes-extended/images/swupdate-image.inc > > > b/recipes-extended/images/swupdate-image.inc > > > > index 795b4a2..928edad 100644 > > > > --- a/recipes-extended/images/swupdate-image.inc > > > > +++ b/recipes-extended/images/swupdate-image.inc > > > > @@ -12,7 +12,7 @@ IMAGE_INSTALL = "base-files \ > > > > libconfig \ > > > > swupdate \ > > > > swupdate-www \ > > > > - ${@bb.utils.contains('SWUPDATE_INIT', > > 'tiny', > > > 'virtual/initscripts-swupdate', 'initscripts sysvinit', > d)} \ > > > > + ${@bb.utils.contains('SWUPDATE_INIT', > > 'tiny', > > > 'virtual/initscripts-swupdate', 'initscripts sysvinit > > > swupdate-progress-sysvinit', d)} \ > > > > util-linux-sfdisk \ > > > > " > > > > > > > > diff --git a/recipes-support/swupdate/swupdate.inc > > > b/recipes-support/swupdate/swupdate.inc > > > > index 0d382bd..e5ff392 100644 > > > > --- a/recipes-support/swupdate/swupdate.inc > > > > +++ b/recipes-support/swupdate/swupdate.inc > > > > @@ -36,6 +36,7 @@ PACKAGES =+ " \ > > > > ${PN}-client \ > > > > ${PN}-lua \ > > > > ${PN}-progress \ > > > > + ${PN}-progress-sysvinit \ > > > > ${PN}-tools \ > > > > ${PN}-tools-hawkbit \ > > > > ${PN}-usb \ > > > > @@ -51,8 +52,9 @@ FILES_${PN}-lua += "${libdir}/lua/" > > > > FILES_${PN}-progress = " \ > > > > ${bindir}/swupdate-progress \ > > > > > > ${systemd_system_unitdir}/swupdate-progress.service \ > > > > - ${libdir}/swupdate/conf.d/90-start-progress \ > > > > " > > > > > > Ok - I am missing in this patch how 90-start-progress is > > installed in > > > case of systemd. It belongs now to a new package as > > below, but this is > > > added as RDEPENDS in case of SystemV. How is it installed > > on a distro > > > with systemd as virtual/init (it does not belong anymore > to > > > FILES_${PN}-progress) ? > > > > > > > +FILES_${PN}-progress-sysvinit = > > > "${libdir}/swupdate/conf.d/90-start-progress" > > > > + > > > > FILES_${PN}-usb = " \ > > > > ${sysconfdir}/udev/rules.d/swupdate-usb.rules \ > > > > ${systemd_system_unitdir}/swupdate-usb@.service > \ > > > > @@ -74,6 +76,7 @@ FILES_${PN}-www = " \ > > > > " > > > > > > > > RDEPENDS_${PN}-usb += "${PN}-client" > > > > +RDEPENDS_${PN}-progress += > > > > > > "${@bb.utils.contains('DISTRO_FEATURES','systemd','','${PN}-progress-sysvinit',d)}" > > > > > > > > # The tools package is deprecated, it is an empty > > meta package > > > for backward compatibility > > > > RDEPENDS_${PN}-tools += "${PN}-client ${PN}-progress > > > ${PN}-tools-hawkbit \ > > > > @@ -255,10 +258,10 @@ do_install () { > > > > install -m 0644 > > ${WORKDIR}/tmpfiles-swupdate.conf > > > ${D}${libdir}/tmpfiles.d/swupdate.conf > > > > install -d ${D}${sysconfdir}/udev/rules.d > > > > install -m 0644 ${WORKDIR}/swupdate-usb.rules > > > ${D}${sysconfdir}/udev/rules.d/ > > > > - else > > > > - # in case of systemd there is a service file, > > for sysv > > > init we need to start it as well > > > > - install -m 0644 ${WORKDIR}/90-start-progress > > > ${D}${libdir}/swupdate/conf.d/ > > > > fi > > > > + > > > > + # in case of systemd there is a service file, for > > sysv init > > > we need to start it as well > > > > + install -m 0644 ${WORKDIR}/90-start-progress > > > ${D}${libdir}/swupdate/conf.d/ > > > > } > > > > > > > > INITSCRIPT_NAME = "swupdate" > > > > > > > > > > > > > Best regards, > > > Stefano Babic > > > > > > -- > > > You received this message because you are subscribed to > > the Google > > > Groups "swupdate" group. > > > To unsubscribe from this group and stop receiving emails > > from it, > > > send an email to swupdate+unsubscribe@googlegroups.com > > <mailto:swupdate%2Bunsubscribe@googlegroups.com> > > > <mailto:swupdate%2Bunsubscribe@googlegroups.com > > <mailto:swupdate%252Bunsubscribe@googlegroups.com>>. > > > To view this discussion on the web visit > > > > > > https://groups.google.com/d/msgid/swupdate/10f85f79-40e3-0d44-68e5-7ed2e91d7f5b%40denx.de > > < > https://groups.google.com/d/msgid/swupdate/10f85f79-40e3-0d44-68e5-7ed2e91d7f5b%40denx.de > > > > > > > < > https://groups.google.com/d/msgid/swupdate/10f85f79-40e3-0d44-68e5-7ed2e91d7f5b%40denx.de > < > https://groups.google.com/d/msgid/swupdate/10f85f79-40e3-0d44-68e5-7ed2e91d7f5b%40denx.de > >>. > > > > > > -- > > > You received this message because you are subscribed to the > > Google > > > Groups "swupdate" group. > > > To unsubscribe from this group and stop receiving emails from > > it, send > > > an email to swupdate+unsubscribe@googlegroups.com > > <mailto:swupdate%2Bunsubscribe@googlegroups.com> > > > <mailto:swupdate+unsubscribe@googlegroups.com > > <mailto:swupdate%2Bunsubscribe@googlegroups.com>>. > > > To view this discussion on the web visit > > > > > > https://groups.google.com/d/msgid/swupdate/CAFrQVPPkKLHh75tZSD%2BD_N%2Bw%3DnDYqNcmBGh6qqAk_UtAMNNKrw%40mail.gmail.com > > < > https://groups.google.com/d/msgid/swupdate/CAFrQVPPkKLHh75tZSD%2BD_N%2Bw%3DnDYqNcmBGh6qqAk_UtAMNNKrw%40mail.gmail.com > > > > > > > > > < > https://groups.google.com/d/msgid/swupdate/CAFrQVPPkKLHh75tZSD%2BD_N%2Bw%3DnDYqNcmBGh6qqAk_UtAMNNKrw%40mail.gmail.com?utm_medium=email&utm_source=footer > > < > https://groups.google.com/d/msgid/swupdate/CAFrQVPPkKLHh75tZSD%2BD_N%2Bw%3DnDYqNcmBGh6qqAk_UtAMNNKrw%40mail.gmail.com?utm_medium=email&utm_source=footer > >>. > > > > > > -- > > > ===================================================================== > > DENX Software Engineering GmbH, Managing Director: Wolfgang > > Denk > > HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, > > Germany > > Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: > > sbabic@denx.de <mailto:sbabic@denx.de> > > > ===================================================================== > > > > -- > > You received this message because you are subscribed to the > > Google Groups "swupdate" group. > > To unsubscribe from this group and stop receiving emails from > > it, send an email to swupdate+unsubscribe@googlegroups.com > > <mailto:swupdate%2Bunsubscribe@googlegroups.com>. > > To view this discussion on the web visit > > > https://groups.google.com/d/msgid/swupdate/b9871b64-7851-7891-e8af-99b8db6f0cb6%40denx.de > > < > https://groups.google.com/d/msgid/swupdate/b9871b64-7851-7891-e8af-99b8db6f0cb6%40denx.de > >. > > > > -- > ===================================================================== > DENX Software Engineering GmbH, Managing Director: Wolfgang Denk > HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany > Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic@denx.de > ===================================================================== > > -- > You received this message because you are subscribed to the Google Groups > "swupdate" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to swupdate+unsubscribe@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/swupdate/7713e4a2-5b8c-c90a-af8c-b8ff8e1d45e1%40denx.de > . >
diff --git a/recipes-extended/images/swupdate-image.inc b/recipes-extended/images/swupdate-image.inc index 795b4a2..928edad 100644 --- a/recipes-extended/images/swupdate-image.inc +++ b/recipes-extended/images/swupdate-image.inc @@ -12,7 +12,7 @@ IMAGE_INSTALL = "base-files \ libconfig \ swupdate \ swupdate-www \ - ${@bb.utils.contains('SWUPDATE_INIT', 'tiny', 'virtual/initscripts-swupdate', 'initscripts sysvinit', d)} \ + ${@bb.utils.contains('SWUPDATE_INIT', 'tiny', 'virtual/initscripts-swupdate', 'initscripts sysvinit swupdate-progress-sysvinit', d)} \ util-linux-sfdisk \ " diff --git a/recipes-support/swupdate/swupdate.inc b/recipes-support/swupdate/swupdate.inc index 0d382bd..e5ff392 100644 --- a/recipes-support/swupdate/swupdate.inc +++ b/recipes-support/swupdate/swupdate.inc @@ -36,6 +36,7 @@ PACKAGES =+ " \ ${PN}-client \ ${PN}-lua \ ${PN}-progress \ + ${PN}-progress-sysvinit \ ${PN}-tools \ ${PN}-tools-hawkbit \ ${PN}-usb \ @@ -51,8 +52,9 @@ FILES_${PN}-lua += "${libdir}/lua/" FILES_${PN}-progress = " \ ${bindir}/swupdate-progress \ ${systemd_system_unitdir}/swupdate-progress.service \ - ${libdir}/swupdate/conf.d/90-start-progress \ " +FILES_${PN}-progress-sysvinit = "${libdir}/swupdate/conf.d/90-start-progress" + FILES_${PN}-usb = " \ ${sysconfdir}/udev/rules.d/swupdate-usb.rules \ ${systemd_system_unitdir}/swupdate-usb@.service \ @@ -74,6 +76,7 @@ FILES_${PN}-www = " \ " RDEPENDS_${PN}-usb += "${PN}-client" +RDEPENDS_${PN}-progress += "${@bb.utils.contains('DISTRO_FEATURES','systemd','','${PN}-progress-sysvinit',d)}" # The tools package is deprecated, it is an empty meta package for backward compatibility RDEPENDS_${PN}-tools += "${PN}-client ${PN}-progress ${PN}-tools-hawkbit \ @@ -255,10 +258,10 @@ do_install () { install -m 0644 ${WORKDIR}/tmpfiles-swupdate.conf ${D}${libdir}/tmpfiles.d/swupdate.conf install -d ${D}${sysconfdir}/udev/rules.d install -m 0644 ${WORKDIR}/swupdate-usb.rules ${D}${sysconfdir}/udev/rules.d/ - else - # in case of systemd there is a service file, for sysv init we need to start it as well - install -m 0644 ${WORKDIR}/90-start-progress ${D}${libdir}/swupdate/conf.d/ fi + + # in case of systemd there is a service file, for sysv init we need to start it as well + install -m 0644 ${WORKDIR}/90-start-progress ${D}${libdir}/swupdate/conf.d/ } INITSCRIPT_NAME = "swupdate"
Create a swupdate-progress-sysvinit package with the necessary startup script for swupdate-progress to run correctly during startup of the initramfs recovery image. This allows swupdate-progress to be installed in both a distro's main rootfs which uses systemd, and the initramfs image which uses sysvinit. In order for the initramfs image to support automatic reboot, it needs swupdate-progress to monitor the update process and trigger a reboot of the system, but for distros configured to use systemd, the init script needed to launch swupdate-progress isn't even installed to the swupdate-progress package, so just installing swupdate-progress to the initramfs isn't sufficient for this to work since the initramfs only uses sysvinit. Both the init script (from swupdate-progress-sysvinig) and the swupdate-progress package need to be installed to the initramfs. Signed-off-by: Kyle Russell <bkylerussell@gmail.com> --- recipes-extended/images/swupdate-image.inc | 2 +- recipes-support/swupdate/swupdate.inc | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-)