diff mbox series

[v2] swupdate,classes: Transition from WORKDIR to UNPACKDIR

Message ID 20240828080711.3872233-1-raj.khem@gmail.com
State Accepted
Delegated to: Stefano Babic
Headers show
Series [v2] swupdate,classes: Transition from WORKDIR to UNPACKDIR | expand

Commit Message

Khem Raj Aug. 28, 2024, 8:07 a.m. UTC
UNPACKDIR is newly introduced post 5.0 release
which is used by do_unpack tasks instead of WORKDIR [1]

[1] https://git.yoctoproject.org/poky/commit/?id=d24a7d0fb16457e10e7a216d4c9ae3fb265113d1

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 classes-recipe/swupdate-common.bbclass |  4 ++--
 recipes-support/swupdate/swupdate.inc  | 22 +++++++++++-----------
 2 files changed, 13 insertions(+), 13 deletions(-)

Comments

Stefano Babic Aug. 31, 2024, 3:46 p.m. UTC | #1
Hi Khem,

On 28.08.24 10:07, Khem Raj wrote:
> UNPACKDIR is newly introduced post 5.0 release
> which is used by do_unpack tasks instead of WORKDIR [1]
>
> [1] https://git.yoctoproject.org/poky/commit/?id=d24a7d0fb16457e10e7a216d4c9ae3fb265113d1
>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>   classes-recipe/swupdate-common.bbclass |  4 ++--
>   recipes-support/swupdate/swupdate.inc  | 22 +++++++++++-----------
>   2 files changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/classes-recipe/swupdate-common.bbclass b/classes-recipe/swupdate-common.bbclass
> index 0367f81..f080c98 100644
> --- a/classes-recipe/swupdate-common.bbclass
> +++ b/classes-recipe/swupdate-common.bbclass
> @@ -319,10 +319,10 @@ python do_swuimage () {
>       import shutil
>
>       list_for_cpio = ["sw-description"]
> -    workdir = d.getVar('WORKDIR')
> +    unpackdir = d.getVar('UNPACKDIR')
>       s = d.getVar('S')
>       imgdeploydir = d.getVar('SWUDEPLOYDIR')
> -    shutil.copyfile(os.path.join(workdir, "sw-description"), os.path.join(s, "sw-description"))
> +    shutil.copyfile(os.path.join(unpackdir, "sw-description"), os.path.join(s, "sw-description"))
>
>       if d.getVar('SWUPDATE_SIGNING'):
>           list_for_cpio.append('sw-description.sig')
> diff --git a/recipes-support/swupdate/swupdate.inc b/recipes-support/swupdate/swupdate.inc
> index 188c25c..a981818 100644
> --- a/recipes-support/swupdate/swupdate.inc
> +++ b/recipes-support/swupdate/swupdate.inc
> @@ -249,7 +249,7 @@ do_configure () {
>   CONFIG_EXTRA_CFLAGS="${CFLAGS}"
>   CONFIG_EXTRA_LDFLAGS="${LDFLAGS}"
>   HEREDOC
> -    cat ${WORKDIR}/defconfig >> ${WORKDIR}/.config
> +    cat ${UNPACKDIR}/defconfig >> ${WORKDIR}/.config
>
>       merge_config.sh -O ${B} -m ${WORKDIR}/.config ${@" ".join(find_cfgs(d))}
>       (cd ${S} && cml1_do_configure)
> @@ -271,34 +271,34 @@ do_install () {
>       fi
>
>       install -d ${D}${sysconfdir}/init.d
> -    install -m 755 ${WORKDIR}/swupdate ${D}${sysconfdir}/init.d
> +    install -m 755 ${UNPACKDIR}/swupdate ${D}${sysconfdir}/init.d
>       sed -i -e "s|/usr/lib/|${libdir}/|" ${D}${sysconfdir}/init.d/swupdate
>
>       # shell based configuration loader allows to place code snippets into this folder
>       install -d ${D}${libdir}/swupdate/conf.d
> -    install -m 755 ${WORKDIR}/swupdate.sh ${D}${libdir}/swupdate
> +    install -m 755 ${UNPACKDIR}/swupdate.sh ${D}${libdir}/swupdate
>       sed -i 's#@LIBDIR@#${libdir}#g' ${D}${libdir}/swupdate/swupdate.sh
>       if ${SWUPDATE_MONGOOSE}; then
> -        install -m 644 ${WORKDIR}/10-mongoose-args ${D}${libdir}/swupdate/conf.d/
> +        install -m 644 ${UNPACKDIR}/10-mongoose-args ${D}${libdir}/swupdate/conf.d/
>       fi
>       install -d ${D}${systemd_unitdir}/system
> -    install -m 644 ${WORKDIR}/swupdate.service ${D}${systemd_system_unitdir}
> +    install -m 644 ${UNPACKDIR}/swupdate.service ${D}${systemd_system_unitdir}
>       sed -i 's#@LIBDIR@#${libdir}#' ${D}${systemd_system_unitdir}/swupdate.service
> -    install -m 644 ${WORKDIR}/swupdate.socket.tmpl ${D}${systemd_system_unitdir}/swupdate.socket
> +    install -m 644 ${UNPACKDIR}/swupdate.socket.tmpl ${D}${systemd_system_unitdir}/swupdate.socket
>       sed -e "s,@@SWUPDATE_SOCKET_CTRL_PATH@@,${SWUPDATE_SOCKET_CTRL_PATH},g" \
>           -e "s,@@SWUPDATE_SOCKET_PROGRESS_PATH@@,${SWUPDATE_SOCKET_PROGRESS_PATH},g" \
>           -i ${D}${systemd_system_unitdir}/swupdate.socket
> -    install -m 644 ${WORKDIR}/swupdate-usb@.service ${D}${systemd_system_unitdir}
> -    install -m 644 ${WORKDIR}/swupdate-progress.service ${D}${systemd_system_unitdir}
> +    install -m 644 ${UNPACKDIR}/swupdate-usb@.service ${D}${systemd_system_unitdir}
> +    install -m 644 ${UNPACKDIR}/swupdate-progress.service ${D}${systemd_system_unitdir}
>
>       if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
>           install -d ${D}${nonarch_libdir}/tmpfiles.d
> -        install -m 0644 ${WORKDIR}/tmpfiles-swupdate.conf ${D}${nonarch_libdir}/tmpfiles.d/swupdate.conf
> +        install -m 0644 ${UNPACKDIR}/tmpfiles-swupdate.conf ${D}${nonarch_libdir}/tmpfiles.d/swupdate.conf
>           install -d ${D}${sysconfdir}/udev/rules.d
> -        install -m 0644 ${WORKDIR}/swupdate-usb.rules ${D}${sysconfdir}/udev/rules.d/
> +        install -m 0644 ${UNPACKDIR}/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/
> +        install -m 0644 ${UNPACKDIR}/90-start-progress ${D}${libdir}/swupdate/conf.d/
>       fi
>   }
>
>


Yes, sure, thanks ! I will apply it soon.

Best regards,
Stefano
Dan Walkes Sept. 1, 2024, 3:14 p.m. UTC | #2
Hi Khem and Stefano,
This looks like a subset of the changes proposed 
in https://groups.google.com/g/swupdate/c/U-GNI3mhbX0.  Would you like me 
to rebase on these?

On Saturday, August 31, 2024 at 9:46:23 AM UTC-6 Stefano Babic wrote:

> Hi Khem,
>
> On 28.08.24 10:07, Khem Raj wrote:
> > UNPACKDIR is newly introduced post 5.0 release
> > which is used by do_unpack tasks instead of WORKDIR [1]
> >
> > [1] 
> https://git.yoctoproject.org/poky/commit/?id=d24a7d0fb16457e10e7a216d4c9ae3fb265113d1
> >
> > Signed-off-by: Khem Raj <raj....@gmail.com>
> > ---
> > classes-recipe/swupdate-common.bbclass | 4 ++--
> > recipes-support/swupdate/swupdate.inc | 22 +++++++++++-----------
> > 2 files changed, 13 insertions(+), 13 deletions(-)
> >
> > diff --git a/classes-recipe/swupdate-common.bbclass 
> b/classes-recipe/swupdate-common.bbclass
> > index 0367f81..f080c98 100644
> > --- a/classes-recipe/swupdate-common.bbclass
> > +++ b/classes-recipe/swupdate-common.bbclass
> > @@ -319,10 +319,10 @@ python do_swuimage () {
> > import shutil
> >
> > list_for_cpio = ["sw-description"]
> > - workdir = d.getVar('WORKDIR')
> > + unpackdir = d.getVar('UNPACKDIR')
> > s = d.getVar('S')
> > imgdeploydir = d.getVar('SWUDEPLOYDIR')
> > - shutil.copyfile(os.path.join(workdir, "sw-description"), 
> os.path.join(s, "sw-description"))
> > + shutil.copyfile(os.path.join(unpackdir, "sw-description"), 
> os.path.join(s, "sw-description"))
> >
> > if d.getVar('SWUPDATE_SIGNING'):
> > list_for_cpio.append('sw-description.sig')
> > diff --git a/recipes-support/swupdate/swupdate.inc 
> b/recipes-support/swupdate/swupdate.inc
> > index 188c25c..a981818 100644
> > --- a/recipes-support/swupdate/swupdate.inc
> > +++ b/recipes-support/swupdate/swupdate.inc
> > @@ -249,7 +249,7 @@ do_configure () {
> > CONFIG_EXTRA_CFLAGS="${CFLAGS}"
> > CONFIG_EXTRA_LDFLAGS="${LDFLAGS}"
> > HEREDOC
> > - cat ${WORKDIR}/defconfig >> ${WORKDIR}/.config
> > + cat ${UNPACKDIR}/defconfig >> ${WORKDIR}/.config
> >
> > merge_config.sh -O ${B} -m ${WORKDIR}/.config ${@" ".join(find_cfgs(d))}
> > (cd ${S} && cml1_do_configure)
> > @@ -271,34 +271,34 @@ do_install () {
> > fi
> >
> > install -d ${D}${sysconfdir}/init.d
> > - install -m 755 ${WORKDIR}/swupdate ${D}${sysconfdir}/init.d
> > + install -m 755 ${UNPACKDIR}/swupdate ${D}${sysconfdir}/init.d
> > sed -i -e "s|/usr/lib/|${libdir}/|" ${D}${sysconfdir}/init.d/swupdate
> >
> > # shell based configuration loader allows to place code snippets into 
> this folder
> > install -d ${D}${libdir}/swupdate/conf.d
> > - install -m 755 ${WORKDIR}/swupdate.sh ${D}${libdir}/swupdate
> > + install -m 755 ${UNPACKDIR}/swupdate.sh ${D}${libdir}/swupdate
> > sed -i 's#@LIBDIR@#${libdir}#g' ${D}${libdir}/swupdate/swupdate.sh
> > if ${SWUPDATE_MONGOOSE}; then
> > - install -m 644 ${WORKDIR}/10-mongoose-args 
> ${D}${libdir}/swupdate/conf.d/
> > + install -m 644 ${UNPACKDIR}/10-mongoose-args 
> ${D}${libdir}/swupdate/conf.d/
> > fi
> > install -d ${D}${systemd_unitdir}/system
> > - install -m 644 ${WORKDIR}/swupdate.service 
> ${D}${systemd_system_unitdir}
> > + install -m 644 ${UNPACKDIR}/swupdate.service 
> ${D}${systemd_system_unitdir}
> > sed -i 's#@LIBDIR@#${libdir}#' 
> ${D}${systemd_system_unitdir}/swupdate.service
> > - install -m 644 ${WORKDIR}/swupdate.socket.tmpl 
> ${D}${systemd_system_unitdir}/swupdate.socket
> > + install -m 644 ${UNPACKDIR}/swupdate.socket.tmpl 
> ${D}${systemd_system_unitdir}/swupdate.socket
> > sed -e "s,@@SWUPDATE_SOCKET_CTRL_PATH@@,${SWUPDATE_SOCKET_CTRL_PATH},g" \
> > -e 
> "s,@@SWUPDATE_SOCKET_PROGRESS_PATH@@,${SWUPDATE_SOCKET_PROGRESS_PATH},g" \
> > -i ${D}${systemd_system_unitdir}/swupdate.socket
> > - install -m 644 ${WORKDIR}/swupdate-usb@.service 
> ${D}${systemd_system_unitdir}
> > - install -m 644 ${WORKDIR}/swupdate-progress.service 
> ${D}${systemd_system_unitdir}
> > + install -m 644 ${UNPACKDIR}/swupdate-usb@.service 
> ${D}${systemd_system_unitdir}
> > + install -m 644 ${UNPACKDIR}/swupdate-progress.service 
> ${D}${systemd_system_unitdir}
> >
> > if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; 
> then
> > install -d ${D}${nonarch_libdir}/tmpfiles.d
> > - install -m 0644 ${WORKDIR}/tmpfiles-swupdate.conf 
> ${D}${nonarch_libdir}/tmpfiles.d/swupdate.conf
> > + install -m 0644 ${UNPACKDIR}/tmpfiles-swupdate.conf 
> ${D}${nonarch_libdir}/tmpfiles.d/swupdate.conf
> > install -d ${D}${sysconfdir}/udev/rules.d
> > - install -m 0644 ${WORKDIR}/swupdate-usb.rules 
> ${D}${sysconfdir}/udev/rules.d/
> > + install -m 0644 ${UNPACKDIR}/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/
> > + install -m 0644 ${UNPACKDIR}/90-start-progress 
> ${D}${libdir}/swupdate/conf.d/
> > fi
> > }
> >
> >
>
>
> Yes, sure, thanks ! I will apply it soon.
>
> Best regards,
> Stefano
>
Khem Raj Sept. 1, 2024, 4:35 p.m. UTC | #3
On Sun, Sep 1, 2024 at 8:14 AM Dan Walkes <danwalkes@trellis-logic.com>
wrote:

> Hi Khem and Stefano,
> This looks like a subset of the changes proposed in
> https://groups.google.com/g/swupdate/c/U-GNI3mhbX0.  Would you like me to
> rebase on these?
>


Above patch is changing valid operations from workdir to unpackdir eg
building the .config file in swupdate.inc file

My suggestion is to apply this patch as I have tested it with current
master

And then if you have a delta let’s apply that on top after looking into it

>
>
> On Saturday, August 31, 2024 at 9:46:23 AM UTC-6 Stefano Babic wrote:
>
>> Hi Khem,
>>
>> On 28.08.24 10:07, Khem Raj wrote:
>> > UNPACKDIR is newly introduced post 5.0 release
>> > which is used by do_unpack tasks instead of WORKDIR [1]
>> >
>> > [1]
>> https://git.yoctoproject.org/poky/commit/?id=d24a7d0fb16457e10e7a216d4c9ae3fb265113d1
>> >
>> > Signed-off-by: Khem Raj <raj....@gmail.com>
>>
> > ---
>> > classes-recipe/swupdate-common.bbclass | 4 ++--
>> > recipes-support/swupdate/swupdate.inc | 22 +++++++++++-----------
>> > 2 files changed, 13 insertions(+), 13 deletions(-)
>> >
>> > diff --git a/classes-recipe/swupdate-common.bbclass
>> b/classes-recipe/swupdate-common.bbclass
>> > index 0367f81..f080c98 100644
>> > --- a/classes-recipe/swupdate-common.bbclass
>> > +++ b/classes-recipe/swupdate-common.bbclass
>> > @@ -319,10 +319,10 @@ python do_swuimage () {
>> > import shutil
>> >
>> > list_for_cpio = ["sw-description"]
>> > - workdir = d.getVar('WORKDIR')
>> > + unpackdir = d.getVar('UNPACKDIR')
>> > s = d.getVar('S')
>> > imgdeploydir = d.getVar('SWUDEPLOYDIR')
>> > - shutil.copyfile(os.path.join(workdir, "sw-description"),
>> os.path.join(s, "sw-description"))
>> > + shutil.copyfile(os.path.join(unpackdir, "sw-description"),
>> os.path.join(s, "sw-description"))
>> >
>> > if d.getVar('SWUPDATE_SIGNING'):
>> > list_for_cpio.append('sw-description.sig')
>> > diff --git a/recipes-support/swupdate/swupdate.inc
>> b/recipes-support/swupdate/swupdate.inc
>> > index 188c25c..a981818 100644
>> > --- a/recipes-support/swupdate/swupdate.inc
>> > +++ b/recipes-support/swupdate/swupdate.inc
>> > @@ -249,7 +249,7 @@ do_configure () {
>> > CONFIG_EXTRA_CFLAGS="${CFLAGS}"
>> > CONFIG_EXTRA_LDFLAGS="${LDFLAGS}"
>> > HEREDOC
>> > - cat ${WORKDIR}/defconfig >> ${WORKDIR}/.config
>> > + cat ${UNPACKDIR}/defconfig >> ${WORKDIR}/.config
>> >
>> > merge_config.sh -O ${B} -m ${WORKDIR}/.config ${@"
>> ".join(find_cfgs(d))}
>> > (cd ${S} && cml1_do_configure)
>> > @@ -271,34 +271,34 @@ do_install () {
>> > fi
>> >
>> > install -d ${D}${sysconfdir}/init.d
>> > - install -m 755 ${WORKDIR}/swupdate ${D}${sysconfdir}/init.d
>> > + install -m 755 ${UNPACKDIR}/swupdate ${D}${sysconfdir}/init.d
>> > sed -i -e "s|/usr/lib/|${libdir}/|" ${D}${sysconfdir}/init.d/swupdate
>> >
>> > # shell based configuration loader allows to place code snippets into
>> this folder
>> > install -d ${D}${libdir}/swupdate/conf.d
>> > - install -m 755 ${WORKDIR}/swupdate.sh ${D}${libdir}/swupdate
>> > + install -m 755 ${UNPACKDIR}/swupdate.sh ${D}${libdir}/swupdate
>> > sed -i 's#@LIBDIR@#${libdir}#g' ${D}${libdir}/swupdate/swupdate.sh
>> > if ${SWUPDATE_MONGOOSE}; then
>> > - install -m 644 ${WORKDIR}/10-mongoose-args
>> ${D}${libdir}/swupdate/conf.d/
>> > + install -m 644 ${UNPACKDIR}/10-mongoose-args
>> ${D}${libdir}/swupdate/conf.d/
>> > fi
>> > install -d ${D}${systemd_unitdir}/system
>> > - install -m 644 ${WORKDIR}/swupdate.service
>> ${D}${systemd_system_unitdir}
>> > + install -m 644 ${UNPACKDIR}/swupdate.service
>> ${D}${systemd_system_unitdir}
>> > sed -i 's#@LIBDIR@#${libdir}#'
>> ${D}${systemd_system_unitdir}/swupdate.service
>> > - install -m 644 ${WORKDIR}/swupdate.socket.tmpl
>> ${D}${systemd_system_unitdir}/swupdate.socket
>> > + install -m 644 ${UNPACKDIR}/swupdate.socket.tmpl
>> ${D}${systemd_system_unitdir}/swupdate.socket
>> > sed -e "s,@@SWUPDATE_SOCKET_CTRL_PATH@@,${SWUPDATE_SOCKET_CTRL_PATH},g"
>> \
>> > -e "s,@@SWUPDATE_SOCKET_PROGRESS_PATH@@,${SWUPDATE_SOCKET_PROGRESS_PATH},g"
>> \
>> > -i ${D}${systemd_system_unitdir}/swupdate.socket
>> > - install -m 644 ${WORKDIR}/swupdate-usb@.service
>> ${D}${systemd_system_unitdir}
>> > - install -m 644 ${WORKDIR}/swupdate-progress.service
>> ${D}${systemd_system_unitdir}
>> > + install -m 644 ${UNPACKDIR}/swupdate-usb@.service
>> ${D}${systemd_system_unitdir}
>> > + install -m 644 ${UNPACKDIR}/swupdate-progress.service
>> ${D}${systemd_system_unitdir}
>> >
>> > if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)};
>> then
>> > install -d ${D}${nonarch_libdir}/tmpfiles.d
>> > - install -m 0644 ${WORKDIR}/tmpfiles-swupdate.conf
>> ${D}${nonarch_libdir}/tmpfiles.d/swupdate.conf
>> > + install -m 0644 ${UNPACKDIR}/tmpfiles-swupdate.conf
>> ${D}${nonarch_libdir}/tmpfiles.d/swupdate.conf
>> > install -d ${D}${sysconfdir}/udev/rules.d
>> > - install -m 0644 ${WORKDIR}/swupdate-usb.rules
>> ${D}${sysconfdir}/udev/rules.d/
>> > + install -m 0644 ${UNPACKDIR}/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/
>> > + install -m 0644 ${UNPACKDIR}/90-start-progress
>> ${D}${libdir}/swupdate/conf.d/
>> > fi
>> > }
>> >
>> >
>>
>>
>> Yes, sure, thanks ! I will apply it soon.
>>
>> Best regards,
>> Stefano
>>
> --
> 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/4a9ccc58-ca41-4324-9599-3269a9f26577n%40googlegroups.com
> <https://groups.google.com/d/msgid/swupdate/4a9ccc58-ca41-4324-9599-3269a9f26577n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
Dan Walkes Sept. 2, 2024, 5:41 p.m. UTC | #4
On Sunday, September 1, 2024 at 12:41:47 PM UTC-6 Khem Raj wrote:

On Sun, Sep 1, 2024 at 8:14 AM Dan Walkes <danw...@trellis-logic.com> wrote:

Hi Khem and Stefano,
This looks like a subset of the changes proposed in 
https://groups.google.com/g/swupdate/c/U-GNI3mhbX0.  Would you like me to 
rebase on these?



Above patch is changing valid operations from workdir to unpackdir eg 
building the .config file in swupdate.inc file 


Understood, and I've confirmed it resolves the first of the three issues 
referenced at  https://groups.google.com/g/swupdate/c/U-GNI3mhbX0.  The 
other two remain, however.
 

My suggestion is to apply this patch as I have tested it with current 
master  


And then if you have a delta let’s apply that on top after looking into it 


The delta is at 
https://github.com/Trellis-Logic/meta-swupdate/commit/e9d77c8c62730d5651a89c69350c16fcd77b0c8b 
- see the remaining two issues and explanation there.

The second of the two issues is blocking the working master implementation 
of swupdate on https://github.com/OE4T/tegra-demo-distro so would be great 
to get that applied.  If you don't want to fix the warning I can move that 
out of the patch.
 



On Saturday, August 31, 2024 at 9:46:23 AM UTC-6 Stefano Babic wrote:

Hi Khem, 

On 28.08.24 10:07, Khem Raj wrote: 
> UNPACKDIR is newly introduced post 5.0 release 
> which is used by do_unpack tasks instead of WORKDIR [1] 
> 
> [1] 
https://git.yoctoproject.org/poky/commit/?id=d24a7d0fb16457e10e7a216d4c9ae3fb265113d1 
> 
> Signed-off-by: Khem Raj <raj....@gmail.com> 

> --- 
> classes-recipe/swupdate-common.bbclass | 4 ++-- 
> recipes-support/swupdate/swupdate.inc | 22 +++++++++++----------- 
> 2 files changed, 13 insertions(+), 13 deletions(-) 
> 
> diff --git a/classes-recipe/swupdate-common.bbclass 
b/classes-recipe/swupdate-common.bbclass 
> index 0367f81..f080c98 100644 
> --- a/classes-recipe/swupdate-common.bbclass 
> +++ b/classes-recipe/swupdate-common.bbclass 
> @@ -319,10 +319,10 @@ python do_swuimage () { 
> import shutil 
> 
> list_for_cpio = ["sw-description"] 
> - workdir = d.getVar('WORKDIR') 
> + unpackdir = d.getVar('UNPACKDIR') 
> s = d.getVar('S') 
> imgdeploydir = d.getVar('SWUDEPLOYDIR') 
> - shutil.copyfile(os.path.join(workdir, "sw-description"), 
os.path.join(s, "sw-description")) 
> + shutil.copyfile(os.path.join(unpackdir, "sw-description"), 
os.path.join(s, "sw-description")) 
> 
> if d.getVar('SWUPDATE_SIGNING'): 
> list_for_cpio.append('sw-description.sig') 
> diff --git a/recipes-support/swupdate/swupdate.inc 
b/recipes-support/swupdate/swupdate.inc 
> index 188c25c..a981818 100644 
> --- a/recipes-support/swupdate/swupdate.inc 
> +++ b/recipes-support/swupdate/swupdate.inc 
> @@ -249,7 +249,7 @@ do_configure () { 
> CONFIG_EXTRA_CFLAGS="${CFLAGS}" 
> CONFIG_EXTRA_LDFLAGS="${LDFLAGS}" 
> HEREDOC 
> - cat ${WORKDIR}/defconfig >> ${WORKDIR}/.config 
> + cat ${UNPACKDIR}/defconfig >> ${WORKDIR}/.config 
> 
> merge_config.sh -O ${B} -m ${WORKDIR}/.config ${@" ".join(find_cfgs(d))} 
> (cd ${S} && cml1_do_configure) 
> @@ -271,34 +271,34 @@ do_install () { 
> fi 
> 
> install -d ${D}${sysconfdir}/init.d 
> - install -m 755 ${WORKDIR}/swupdate ${D}${sysconfdir}/init.d 
> + install -m 755 ${UNPACKDIR}/swupdate ${D}${sysconfdir}/init.d 
> sed -i -e "s|/usr/lib/|${libdir}/|" ${D}${sysconfdir}/init.d/swupdate 
> 
> # shell based configuration loader allows to place code snippets into 
this folder 
> install -d ${D}${libdir}/swupdate/conf.d 
> - install -m 755 ${WORKDIR}/swupdate.sh ${D}${libdir}/swupdate 
> + install -m 755 ${UNPACKDIR}/swupdate.sh ${D}${libdir}/swupdate 
> sed -i 's#@LIBDIR@#${libdir}#g' ${D}${libdir}/swupdate/swupdate.sh 
> if ${SWUPDATE_MONGOOSE}; then 
> - install -m 644 ${WORKDIR}/10-mongoose-args 
${D}${libdir}/swupdate/conf.d/ 
> + install -m 644 ${UNPACKDIR}/10-mongoose-args 
${D}${libdir}/swupdate/conf.d/ 
> fi 
> install -d ${D}${systemd_unitdir}/system 
> - install -m 644 ${WORKDIR}/swupdate.service 
${D}${systemd_system_unitdir} 
> + install -m 644 ${UNPACKDIR}/swupdate.service 
${D}${systemd_system_unitdir} 
> sed -i 's#@LIBDIR@#${libdir}#' 
${D}${systemd_system_unitdir}/swupdate.service 
> - install -m 644 ${WORKDIR}/swupdate.socket.tmpl 
${D}${systemd_system_unitdir}/swupdate.socket 
> + install -m 644 ${UNPACKDIR}/swupdate.socket.tmpl 
${D}${systemd_system_unitdir}/swupdate.socket 
> sed -e "s,@@SWUPDATE_SOCKET_CTRL_PATH@@,${SWUPDATE_SOCKET_CTRL_PATH},g" \ 
> -e 
"s,@@SWUPDATE_SOCKET_PROGRESS_PATH@@,${SWUPDATE_SOCKET_PROGRESS_PATH},g" \ 
> -i ${D}${systemd_system_unitdir}/swupdate.socket 
> - install -m 644 ${WORKDIR}/swupdate-usb@.service 
${D}${systemd_system_unitdir} 
> - install -m 644 ${WORKDIR}/swupdate-progress.service 
${D}${systemd_system_unitdir} 
> + install -m 644 ${UNPACKDIR}/swupdate-usb@.service 
${D}${systemd_system_unitdir} 
> + install -m 644 ${UNPACKDIR}/swupdate-progress.service 
${D}${systemd_system_unitdir} 
> 
> if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; 
then 
> install -d ${D}${nonarch_libdir}/tmpfiles.d 
> - install -m 0644 ${WORKDIR}/tmpfiles-swupdate.conf 
${D}${nonarch_libdir}/tmpfiles.d/swupdate.conf 
> + install -m 0644 ${UNPACKDIR}/tmpfiles-swupdate.conf 
${D}${nonarch_libdir}/tmpfiles.d/swupdate.conf 
> install -d ${D}${sysconfdir}/udev/rules.d 
> - install -m 0644 ${WORKDIR}/swupdate-usb.rules 
${D}${sysconfdir}/udev/rules.d/ 
> + install -m 0644 ${UNPACKDIR}/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/ 
> + install -m 0644 ${UNPACKDIR}/90-start-progress 
${D}${libdir}/swupdate/conf.d/ 
> fi 
> } 
> 
> 


Yes, sure, thanks ! I will apply it soon. 

Best regards, 
Stefano
Stefano Babic Sept. 6, 2024, 1:02 p.m. UTC | #5
Hi Khem, Dan,

sorry for late answer, mismatch is due because I haven't found time
before to check it and apply:

On 02.09.24 19:41, Dan Walkes wrote:
>
> On Sunday, September 1, 2024 at 12:41:47 PM UTC-6 Khem Raj wrote:
>
>     On Sun, Sep 1, 2024 at 8:14 AM Dan Walkes
>     <danw...@trellis-logic.com> wrote:
>
>         Hi Khem and Stefano,
>         This looks like a subset of the changes proposed in
>         https://groups.google.com/g/swupdate/c/U-GNI3mhbX0
>         <https://groups.google.com/g/swupdate/c/U-GNI3mhbX0>.  Would you
>         like me to rebase on these?
>
>
>
>     Above patch is changing valid operations from workdir to unpackdir
>     eg building the .config file in swupdate.inc file
>
>
> Understood, and I've confirmed it resolves the first of the three issues
> referenced at https://groups.google.com/g/swupdate/c/U-GNI3mhbX0
> <https://groups.google.com/g/swupdate/c/U-GNI3mhbX0>.

As it was already tested and patch is very straightforward, I will
propose this:

- I apply (now) Khem's
- Dan will rebase (as you propose) a send a new patch, with the
description of the open issues.

>  The other two
> remain, however.

I will then apply it - thanks !

Best regards,
Stefano

>
>     My suggestion is to apply this patch as I have tested it with
>     current master
>
>
>     And then if you have a delta let’s apply that on top after looking
>     into it
>
>
> The delta is at
> https://github.com/Trellis-Logic/meta-swupdate/commit/e9d77c8c62730d5651a89c69350c16fcd77b0c8b - see the remaining two issues and explanation there.
>
> The second of the two issues is blocking the working master
> implementation of swupdate on https://github.com/OE4T/tegra-demo-distro
> so would be great to get that applied.  If you don't want to fix the
> warning I can move that out of the patch.
>
>
>
>         On Saturday, August 31, 2024 at 9:46:23 AM UTC-6 Stefano Babic
>         wrote:
>
>             Hi Khem,
>
>             On 28.08.24 10:07, Khem Raj wrote:
>              > UNPACKDIR is newly introduced post 5.0 release
>              > which is used by do_unpack tasks instead of WORKDIR [1]
>              >
>              > [1]
>             https://git.yoctoproject.org/poky/commit/?id=d24a7d0fb16457e10e7a216d4c9ae3fb265113d1 <https://git.yoctoproject.org/poky/commit/?id=d24a7d0fb16457e10e7a216d4c9ae3fb265113d1>
>              >
>              > Signed-off-by: Khem Raj <raj....@gmail.com>
>
>              > ---
>              > classes-recipe/swupdate-common.bbclass | 4 ++--
>              > recipes-support/swupdate/swupdate.inc | 22
>             +++++++++++-----------
>              > 2 files changed, 13 insertions(+), 13 deletions(-)
>              >
>              > diff --git a/classes-recipe/swupdate-common.bbclass
>             b/classes-recipe/swupdate-common.bbclass
>              > index 0367f81..f080c98 100644
>              > --- a/classes-recipe/swupdate-common.bbclass
>              > +++ b/classes-recipe/swupdate-common.bbclass
>              > @@ -319,10 +319,10 @@ python do_swuimage () {
>              > import shutil
>              >
>              > list_for_cpio = ["sw-description"]
>              > - workdir = d.getVar('WORKDIR')
>              > + unpackdir = d.getVar('UNPACKDIR')
>              > s = d.getVar('S')
>              > imgdeploydir = d.getVar('SWUDEPLOYDIR')
>              > - shutil.copyfile(os.path.join(workdir,
>             "sw-description"), os.path.join(s, "sw-description"))
>              > + shutil.copyfile(os.path.join(unpackdir,
>             "sw-description"), os.path.join(s, "sw-description"))
>              >
>              > if d.getVar('SWUPDATE_SIGNING'):
>              > list_for_cpio.append('sw-description.sig')
>              > diff --git a/recipes-support/swupdate/swupdate.inc
>             b/recipes-support/swupdate/swupdate.inc
>              > index 188c25c..a981818 100644
>              > --- a/recipes-support/swupdate/swupdate.inc
>              > +++ b/recipes-support/swupdate/swupdate.inc
>              > @@ -249,7 +249,7 @@ do_configure () {
>              > CONFIG_EXTRA_CFLAGS="${CFLAGS}"
>              > CONFIG_EXTRA_LDFLAGS="${LDFLAGS}"
>              > HEREDOC
>              > - cat ${WORKDIR}/defconfig >> ${WORKDIR}/.config
>              > + cat ${UNPACKDIR}/defconfig >> ${WORKDIR}/.config
>              >
>              > merge_config.sh -O ${B} -m ${WORKDIR}/.config ${@"
>             ".join(find_cfgs(d))}
>              > (cd ${S} && cml1_do_configure)
>              > @@ -271,34 +271,34 @@ do_install () {
>              > fi
>              >
>              > install -d ${D}${sysconfdir}/init.d
>              > - install -m 755 ${WORKDIR}/swupdate
>             ${D}${sysconfdir}/init.d
>              > + install -m 755 ${UNPACKDIR}/swupdate
>             ${D}${sysconfdir}/init.d
>              > sed -i -e "s|/usr/lib/|${libdir}/|"
>             ${D}${sysconfdir}/init.d/swupdate
>              >
>              > # shell based configuration loader allows to place code
>             snippets into this folder
>              > install -d ${D}${libdir}/swupdate/conf.d
>              > - install -m 755 ${WORKDIR}/swupdate.sh
>             ${D}${libdir}/swupdate
>              > + install -m 755 ${UNPACKDIR}/swupdate.sh
>             ${D}${libdir}/swupdate
>              > sed -i 's#@LIBDIR@#${libdir}#g'
>             ${D}${libdir}/swupdate/swupdate.sh
>              > if ${SWUPDATE_MONGOOSE}; then
>              > - install -m 644 ${WORKDIR}/10-mongoose-args
>             ${D}${libdir}/swupdate/conf.d/
>              > + install -m 644 ${UNPACKDIR}/10-mongoose-args
>             ${D}${libdir}/swupdate/conf.d/
>              > fi
>              > install -d ${D}${systemd_unitdir}/system
>              > - install -m 644 ${WORKDIR}/swupdate.service
>             ${D}${systemd_system_unitdir}
>              > + install -m 644 ${UNPACKDIR}/swupdate.service
>             ${D}${systemd_system_unitdir}
>              > sed -i 's#@LIBDIR@#${libdir}#'
>             ${D}${systemd_system_unitdir}/swupdate.service
>              > - install -m 644 ${WORKDIR}/swupdate.socket.tmpl
>             ${D}${systemd_system_unitdir}/swupdate.socket
>              > + install -m 644 ${UNPACKDIR}/swupdate.socket.tmpl
>             ${D}${systemd_system_unitdir}/swupdate.socket
>              > sed -e
>             "s,@@SWUPDATE_SOCKET_CTRL_PATH@@,${SWUPDATE_SOCKET_CTRL_PATH},g" \
>              > -e
>             "s,@@SWUPDATE_SOCKET_PROGRESS_PATH@@,${SWUPDATE_SOCKET_PROGRESS_PATH},g" \
>              > -i ${D}${systemd_system_unitdir}/swupdate.socket
>              > - install -m 644 ${WORKDIR}/swupdate-usb@.service
>             ${D}${systemd_system_unitdir}
>              > - install -m 644 ${WORKDIR}/swupdate-progress.service
>             ${D}${systemd_system_unitdir}
>              > + install -m 644 ${UNPACKDIR}/swupdate-usb@.service
>             ${D}${systemd_system_unitdir}
>              > + install -m 644 ${UNPACKDIR}/swupdate-progress.service
>             ${D}${systemd_system_unitdir}
>              >
>              > if
>             ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
>              > install -d ${D}${nonarch_libdir}/tmpfiles.d
>              > - install -m 0644 ${WORKDIR}/tmpfiles-swupdate.conf
>             ${D}${nonarch_libdir}/tmpfiles.d/swupdate.conf
>              > + install -m 0644 ${UNPACKDIR}/tmpfiles-swupdate.conf
>             ${D}${nonarch_libdir}/tmpfiles.d/swupdate.conf
>              > install -d ${D}${sysconfdir}/udev/rules.d
>              > - install -m 0644 ${WORKDIR}/swupdate-usb.rules
>             ${D}${sysconfdir}/udev/rules.d/
>              > + install -m 0644 ${UNPACKDIR}/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/
>              > + install -m 0644 ${UNPACKDIR}/90-start-progress
>             ${D}${libdir}/swupdate/conf.d/
>              > fi
>              > }
>              >
>              >
>
>
>             Yes, sure, thanks ! I will apply it soon.
>
>             Best regards,
>             Stefano
>
>         --
>         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+u...@googlegroups.com.
>         To view this discussion on the web visit
>         https://groups.google.com/d/msgid/swupdate/4a9ccc58-ca41-4324-9599-3269a9f26577n%40googlegroups.com <https://groups.google.com/d/msgid/swupdate/4a9ccc58-ca41-4324-9599-3269a9f26577n%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
> 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/d4af0344-6567-4f64-a0b2-5615d8f886d0n%40googlegroups.com <https://groups.google.com/d/msgid/swupdate/d4af0344-6567-4f64-a0b2-5615d8f886d0n%40googlegroups.com?utm_medium=email&utm_source=footer>.
diff mbox series

Patch

diff --git a/classes-recipe/swupdate-common.bbclass b/classes-recipe/swupdate-common.bbclass
index 0367f81..f080c98 100644
--- a/classes-recipe/swupdate-common.bbclass
+++ b/classes-recipe/swupdate-common.bbclass
@@ -319,10 +319,10 @@  python do_swuimage () {
     import shutil
 
     list_for_cpio = ["sw-description"]
-    workdir = d.getVar('WORKDIR')
+    unpackdir = d.getVar('UNPACKDIR')
     s = d.getVar('S')
     imgdeploydir = d.getVar('SWUDEPLOYDIR')
-    shutil.copyfile(os.path.join(workdir, "sw-description"), os.path.join(s, "sw-description"))
+    shutil.copyfile(os.path.join(unpackdir, "sw-description"), os.path.join(s, "sw-description"))
 
     if d.getVar('SWUPDATE_SIGNING'):
         list_for_cpio.append('sw-description.sig')
diff --git a/recipes-support/swupdate/swupdate.inc b/recipes-support/swupdate/swupdate.inc
index 188c25c..a981818 100644
--- a/recipes-support/swupdate/swupdate.inc
+++ b/recipes-support/swupdate/swupdate.inc
@@ -249,7 +249,7 @@  do_configure () {
 CONFIG_EXTRA_CFLAGS="${CFLAGS}"
 CONFIG_EXTRA_LDFLAGS="${LDFLAGS}"
 HEREDOC
-    cat ${WORKDIR}/defconfig >> ${WORKDIR}/.config
+    cat ${UNPACKDIR}/defconfig >> ${WORKDIR}/.config
 
     merge_config.sh -O ${B} -m ${WORKDIR}/.config ${@" ".join(find_cfgs(d))}
     (cd ${S} && cml1_do_configure)
@@ -271,34 +271,34 @@  do_install () {
     fi
 
     install -d ${D}${sysconfdir}/init.d
-    install -m 755 ${WORKDIR}/swupdate ${D}${sysconfdir}/init.d
+    install -m 755 ${UNPACKDIR}/swupdate ${D}${sysconfdir}/init.d
     sed -i -e "s|/usr/lib/|${libdir}/|" ${D}${sysconfdir}/init.d/swupdate
 
     # shell based configuration loader allows to place code snippets into this folder
     install -d ${D}${libdir}/swupdate/conf.d
-    install -m 755 ${WORKDIR}/swupdate.sh ${D}${libdir}/swupdate
+    install -m 755 ${UNPACKDIR}/swupdate.sh ${D}${libdir}/swupdate
     sed -i 's#@LIBDIR@#${libdir}#g' ${D}${libdir}/swupdate/swupdate.sh
     if ${SWUPDATE_MONGOOSE}; then
-        install -m 644 ${WORKDIR}/10-mongoose-args ${D}${libdir}/swupdate/conf.d/
+        install -m 644 ${UNPACKDIR}/10-mongoose-args ${D}${libdir}/swupdate/conf.d/
     fi
     install -d ${D}${systemd_unitdir}/system
-    install -m 644 ${WORKDIR}/swupdate.service ${D}${systemd_system_unitdir}
+    install -m 644 ${UNPACKDIR}/swupdate.service ${D}${systemd_system_unitdir}
     sed -i 's#@LIBDIR@#${libdir}#' ${D}${systemd_system_unitdir}/swupdate.service
-    install -m 644 ${WORKDIR}/swupdate.socket.tmpl ${D}${systemd_system_unitdir}/swupdate.socket
+    install -m 644 ${UNPACKDIR}/swupdate.socket.tmpl ${D}${systemd_system_unitdir}/swupdate.socket
     sed -e "s,@@SWUPDATE_SOCKET_CTRL_PATH@@,${SWUPDATE_SOCKET_CTRL_PATH},g" \
         -e "s,@@SWUPDATE_SOCKET_PROGRESS_PATH@@,${SWUPDATE_SOCKET_PROGRESS_PATH},g" \
         -i ${D}${systemd_system_unitdir}/swupdate.socket
-    install -m 644 ${WORKDIR}/swupdate-usb@.service ${D}${systemd_system_unitdir}
-    install -m 644 ${WORKDIR}/swupdate-progress.service ${D}${systemd_system_unitdir}
+    install -m 644 ${UNPACKDIR}/swupdate-usb@.service ${D}${systemd_system_unitdir}
+    install -m 644 ${UNPACKDIR}/swupdate-progress.service ${D}${systemd_system_unitdir}
 
     if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
         install -d ${D}${nonarch_libdir}/tmpfiles.d
-        install -m 0644 ${WORKDIR}/tmpfiles-swupdate.conf ${D}${nonarch_libdir}/tmpfiles.d/swupdate.conf
+        install -m 0644 ${UNPACKDIR}/tmpfiles-swupdate.conf ${D}${nonarch_libdir}/tmpfiles.d/swupdate.conf
         install -d ${D}${sysconfdir}/udev/rules.d
-        install -m 0644 ${WORKDIR}/swupdate-usb.rules ${D}${sysconfdir}/udev/rules.d/
+        install -m 0644 ${UNPACKDIR}/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/
+        install -m 0644 ${UNPACKDIR}/90-start-progress ${D}${libdir}/swupdate/conf.d/
     fi
 }