Re: [yocto] [PATCH] [meta-swupdate] Fix build error of dependence.

108 views
Skip to first unread message

Stefano Babic

unread,
Jun 4, 2020, 3:22:07 AM6/4/20
to zhengruoqin, yo...@yoctoproject.org, swupdate
Hi Zheng,

there is a ML for SWUpdate and meta-swupdate (see CC), we are
cross-posting here:

On 04.06.20 14:26, zhengruoqin wrote:
> -c -o mongoose/mongoose.o mongoose/mongoose.c
> | mongoose/mongoose.c:4496:10: fatal error: openssl/ssl.h: No such file
> or directory
>
> Signed-off-by: Zheng Ruoqing <zhengr...@cn.fujitsu.com>
> ---
> recipes-support/swupdate/swupdate.inc | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/recipes-support/swupdate/swupdate.inc b/recipes-support/swupdate/swupdate.inc
> index 9ea0a8a..3d9a3fa 100644
> --- a/recipes-support/swupdate/swupdate.inc
> +++ b/recipes-support/swupdate/swupdate.inc
> @@ -123,6 +123,9 @@ python () {
> elif 'CONFIG_SSL_IMPL_MBEDTLS=y\n' in features:
> depends += ' mbedtls'
>
> + if 'CONFIG_MONGOOSESSL=y\n' in features:
> + depends += ' openssl'
> +

openSSL is not the only supported SSL library, the Webserver runs also
with mbedTLS. This patch forces to use openSSL and conflicts in case
mbedTLS is used as signing and crypto library.

> if 'CONFIG_JSON=y\n' in features:
> depends += ' json-c'
>
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
>
> View/Reply Online (#49576): https://lists.yoctoproject.org/g/yocto/message/49576
> Mute This Topic: https://lists.yoctoproject.org/mt/74665103/3618551
> Group Owner: yocto...@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [sba...@denx.de]
> -=-=-=-=-=-=-=-=-=-=-=-
>

Best regards,
Stefano Babic




Zheng, Ruoqin

unread,
Jun 8, 2020, 4:50:27 AM6/8/20
to Stefano Babic, yo...@yoctoproject.org, swupdate
Hi Stefano

> there is a ML for SWUpdate and meta-swupdate (see CC), we are cross-
> posting here:
Thank you, I got it.

> openSSL is not the only supported SSL library, the Webserver runs also with
> mbedTLS. This patch forces to use openSSL and conflicts in case mbedTLS is
> used as signing and crypto library.
>
> > if 'CONFIG_JSON=y\n' in features:
> > depends += ' json-c'
OK, I'll update my patch and send V2 version.

--------------------------------------------------
Zheng Ruoqin
Nanjing Fujitsu Nanda Software Tech. Co., Ltd.(FNST)
ADDR.: No.6 Wenzhu Road, Software Avenue,
Nanjing, 210012, China
MAIL : zhengr...@cn.fujistu.com

Stefano Babic

unread,
Jun 8, 2020, 4:55:24 AM6/8/20
to Zheng, Ruoqin, Stefano Babic, yo...@yoctoproject.org, swupdate
Hi Zheng,

On 08.06.20 10:49, Zheng, Ruoqin wrote:
> Hi Stefano
>
>> there is a ML for SWUpdate and meta-swupdate (see CC), we are cross-
>> posting here:
> Thank you, I got it.
>
>> openSSL is not the only supported SSL library, the Webserver runs also with
>> mbedTLS. This patch forces to use openSSL and conflicts in case mbedTLS is
>> used as signing and crypto library.
>>
>>> if 'CONFIG_JSON=y\n' in features:
>>> depends += ' json-c'
> OK, I'll update my patch and send V2 version.
>

I do not think the issue exists. In fact, CONFIG_MONGOOSESSL is
protected by CONFIG_SSL_IMPL_OPENSSL or CONFIG_SSL_IMPL_MBEDTLS. If you
set CONFIG_MONGOOSESSL, SSL is already set.

The only way to go into the issue is to modify directly your defconfig
file instead of running "bitbake -c menuconfig" and then apply the
diffconfig or the new defconfig. But this is of course a wrong way,
exactly as in kernel.

Try to run "mnuconfig" and then you can apply the fragment to your
diffconfig (fragments are supported, too).

Best regards,
Stefano
--
=====================================================================
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: sba...@denx.de
=====================================================================

Zheng, Ruoqin

unread,
Jun 18, 2020, 3:09:39 AM6/18/20
to Stefano Babic, yo...@yoctoproject.org, swupdate
Hi, Stefano


I'm sorry I'm so late for your reply.


> I do not think the issue exists.


I bitbake swupdate with poky and meta-oe without any modifications, depend error happens, isn't it an issue?


> In fact, CONFIG_MONGOOSESSL is protected by

> CONFIG_SSL_IMPL_OPENSSL or CONFIG_SSL_IMPL_MBEDTLS. If you set

> CONFIG_MONGOOSESSL, SSL is already set.


I don't find the relationship of CONFIG_MONGOOSESSL and CONFIG_SSL_IMPL_OPENSSL or CONFIG_SSL_IMPL_MBEDTLS in menuconfig step.

---------------------------

$ grep MONGOOSESSL tmp/work/core2-64-poky-linux/swupdate/2020.04-r0/git/ -r | grep Kconfig

$

---------------------------

By default CONFIG_SSL_IMPL_OPENSSL will be enable during configure step. But openssl is not in the dependences of swupdate. That' s why error happens by default.

Of course, YP users can fix this build error by manuconfig or modified the defconfig. But that's not friendly.

In fact, after configuring the CONFIG_SSL_IMPL_OPENSSL will be added into .config file. But swupdate.inc judges which dependence will be added by defconfig file before configure step.

So, I thought out two methods to fix this issue to make swupdate can be passed by default.

1. Added openssl into dependences by DEPENDS parameter, such as the following:

----------------------------

--- a/recipes-support/swupdate/swupdate.inc

+++ b/recipes-support/swupdate/swupdate.inc

@@ -72,7 +72,7 @@ S = "${WORKDIR}/git/"

......

-DEPENDS += "kern-tools-native"

+DEPENDS += "kern-tools-native openssl"

----------------------------


2. Added CONFIG_SSL_IMPL_OPENSSL into defconfig file.

----------------------------

--- a/recipes-support/swupdate/swupdate/defconfig

+++ b/recipes-support/swupdate/swupdate/defconfig

@@ -96,3 +96,4 @@ CONFIG_SHELLSCRIPTHANDLER=y

# CONFIG_ARCHIVE is not set

# CONFIG_REMOTE_HANDLER is not set

# CONFIG_BOOTLOADERHANDLER is not set

+CONFIG_SSL_IMPL_OPENSSL=y

----------------------------

Users who want to use mbedtls instead if openssl can added bbappend file to modify the DEPENDS parameter or defconfig file.

How about my suggestion?

Best regards

Zheng​

________________________________________
发件人: Stefano Babic <sba...@denx.de>
发送时间: 2020年6月8日 16:55
收件人: Zheng, Ruoqin; Stefano Babic; yo...@yoctoproject.org
抄送: swupdate
主题: Re: [swupdate] RE: [yocto] [PATCH] [meta-swupdate] Fix build error of dependence.

Stefano Babic

unread,
Jun 18, 2020, 3:43:04 AM6/18/20
to Zheng, Ruoqin, Stefano Babic, yo...@yoctoproject.org, swupdate
Hi Zheng,

On 18.06.20 09:08, Zheng, Ruoqin wrote:
> Hi, Stefano
>
>
> I'm sorry I'm so late for your reply.
>
>
>> I do not think the issue exists.
>
>
> I bitbake swupdate with poky and meta-oe without any modifications, depend error happens, isn't it an issue?
>

It depends what you are meaning.

>
>> In fact, CONFIG_MONGOOSESSL is protected by
>
>> CONFIG_SSL_IMPL_OPENSSL or CONFIG_SSL_IMPL_MBEDTLS. If you set
>
>> CONFIG_MONGOOSESSL, SSL is already set.
>
>
> I don't find the relationship of CONFIG_MONGOOSESSL and CONFIG_SSL_IMPL_OPENSSL or CONFIG_SSL_IMPL_MBEDTLS in menuconfig step.

In mongoose/Config.in:

config MONGOOSESSL
bool "SSL support"
depends on MONGOOSE
depends on SSL_IMPL_OPENSSL || SSL_IMPL_MBEDTLS

CONFIG_MONGOOSESSL cannot be set if one of the SSL options is not set,
and they can be chosen via SSL menu.

>
> ---------------------------
>
> $ grep MONGOOSESSL tmp/work/core2-64-poky-linux/swupdate/2020.04-r0/git/ -r | grep Kconfig
>

Search for Config.in and Kconfig in root.

> $
>
> ---------------------------
>
> By default CONFIG_SSL_IMPL_OPENSSL will be enable during configure step. But openssl is not in the dependences of swupdate. That' s why error happens by default.

Because the tree of dependency is SSL, then MBEDTLS or OPENSSL

>
> Of course, YP users can fix this build error by manuconfig or modified the defconfig. But that's not friendly.
>
>
>
> In fact, after configuring the CONFIG_SSL_IMPL_OPENSSL will be added into .config file. But swupdate.inc judges which dependence will be added by defconfig file before configure step.

Ok - if you are using fragments, you have to add the missing
dependencies on your own, that is true.

>
> So, I thought out two methods to fix this issue to make swupdate can be passed by default.
>
> 1. Added openssl into dependences by DEPENDS parameter, such as the following:

Ok, so you are saying that the defconfig shipped with meta-swupdate is
inconsistent. This can be because it was not updated with last
SWUpdate's version, and it does not know about the new CONFIG options.

Anyway, think about that SWUpdate should match the MACHINE, that is most
users need to configure it and add a swupdate_%.bbappend with own
configuration. In any case, if this is broken, I agree it should be fixed.

>
> ----------------------------
>
> --- a/recipes-support/swupdate/swupdate.inc
>
> +++ b/recipes-support/swupdate/swupdate.inc
>
> @@ -72,7 +72,7 @@ S = "${WORKDIR}/git/"
>
> ......
>
> -DEPENDS += "kern-tools-native"
>
> +DEPENDS += "kern-tools-native openssl"

No, this is wrong, as users can select MBEDTLS.

>
> ----------------------------
>
>
> 2. Added CONFIG_SSL_IMPL_OPENSSL into defconfig file.
>
> ----------------------------
>
> --- a/recipes-support/swupdate/swupdate/defconfig
>
> +++ b/recipes-support/swupdate/swupdate/defconfig
>
> @@ -96,3 +96,4 @@ CONFIG_SHELLSCRIPTHANDLER=y
>
> # CONFIG_ARCHIVE is not set
>
> # CONFIG_REMOTE_HANDLER is not set
>
> # CONFIG_BOOTLOADERHANDLER is not set
>
> +CONFIG_SSL_IMPL_OPENSSL=y
>
> ----------------------------
>
>
> Users who want to use mbedtls instead if openssl can added bbappend file to modify the DEPENDS parameter or defconfig file.

But they need to remove openssl from DEPENDS and they need to know wich
dependencies are already set - it does not work.

>
>
> How about my suggestion?

Default defconfig does not match current SWUpdate and it is what should
be fixed.

Best regards,
Stefano

Alexander Vickberg

unread,
Jun 18, 2020, 4:18:40 AM6/18/20
to Stefano Babic, Zheng, Ruoqin, yo...@yoctoproject.org, swupdate
Hi,

This issue surfaced as a side effect of my patch in commit 293f273, sorry about that. The defconfig was not updated and does not include any default SSL implementation choice but it will be added by cml1_do_configure (yes "" | make oldconfig). That is after the DEPENDS variable has been built. I propose the defconfig is updated to include the default SSL implementation option.

Best Regards
Alexander Vickberg

--
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/647f2241-e847-1476-a294-7d4b4882e236%40denx.de.

Stefano Babic

unread,
Jun 18, 2020, 4:22:28 AM6/18/20
to Alexander Vickberg, Stefano Babic, Zheng, Ruoqin, yo...@yoctoproject.org, swupdate
Hi Alexander,

On 18.06.20 10:18, Alexander Vickberg wrote:
> Hi,
>
> This issue surfaced as a side effect of my patch in commit 293f273,
> sorry about that. The defconfig was not updated and does not include any
> default SSL implementation choice but it will be added
> by cml1_do_configure (yes "" | make oldconfig). That is after the
> DEPENDS variable has been built. I propose the defconfig is updated to
> include the default SSL implementation option.

Agree on this.

Regards,
Stefano

>
> Best Regards
> Alexander Vickberg
>
> Den tors 18 juni 2020 kl 09:43 skrev Stefano Babic <sba...@denx.de
> <mailto:sba...@denx.de>>:
> > 发件人: Stefano Babic <sba...@denx.de <mailto:sba...@denx.de>>
> > 发送时间: 2020年6月8日 16:55
> > 收件人: Zheng, Ruoqin; Stefano Babic; yo...@yoctoproject.org
> <mailto:yo...@yoctoproject.org>
> <mailto:zhengr...@cn.fujistu.com>
> >>
> >>
> >>
> >>> -----Original Message-----
> >>> From: Stefano Babic <sba...@denx.de <mailto:sba...@denx.de>>
> >>> Sent: Thursday, June 4, 2020 3:22 PM
> >>> To: Zheng, Ruoqin/郑 若钦 <zhengr...@cn.fujitsu.com
> <mailto:zhengr...@cn.fujitsu.com>>;
> >>> yo...@yoctoproject.org <mailto:yo...@yoctoproject.org>
> >>> Cc: swupdate <swup...@googlegroups.com
> <mailto:swup...@googlegroups.com>>
> >>> Subject: Re: [yocto] [PATCH] [meta-swupdate] Fix build error of
> dependence.
> >>>
> >>> Hi Zheng,
> >>>
> >>> there is a ML for SWUpdate and meta-swupdate (see CC), we are
> cross-
> >>> posting here:
> >>>
> >>> On 04.06.20 14:26, zhengruoqin wrote:
> >>>>    -c -o mongoose/mongoose.o mongoose/mongoose.c
> >>>> | mongoose/mongoose.c:4496:10: fatal error: openssl/ssl.h: No such
> >>>> | file
> >>>> or directory
> >>>>
> >>>> Signed-off-by: Zheng Ruoqing <zhengr...@cn.fujitsu.com
> <mailto:zhengr...@cn.fujitsu.com>>
> <mailto:yocto%2Bo...@lists.yoctoproject.org>
> >>>> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub
> >>>> [sba...@denx.de <mailto:sba...@denx.de>]
> >>>> -=-=-=-=-=-=-=-=-=-=-=-
> >>>>
> >>>
> >>> Best regards,
> >>> Stefano Babic
> >>>
> >>>
> >>>
> >>>
> >>>
> >>
> >>
> >>
> >
> >
> > --
> > =====================================================================
> > 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:
> sba...@denx.de <mailto:sba...@denx.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:
> sba...@denx.de <mailto:sba...@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+u...@googlegroups.com
> <mailto:swupdate%2Bunsu...@googlegroups.com>.
> --
> 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
> <mailto:swupdate+u...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/swupdate/CAAxSGfY9uDN708Cy5LFd3cgeRMgfBT85o8Pw%3DmFwL-T66oOe%2Bw%40mail.gmail.com
> <https://groups.google.com/d/msgid/swupdate/CAAxSGfY9uDN708Cy5LFd3cgeRMgfBT85o8Pw%3DmFwL-T66oOe%2Bw%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Zheng, Ruoqin

unread,
Jun 19, 2020, 2:21:33 AM6/19/20
to Stefano Babic, Alexander Vickberg, yo...@yoctoproject.org, swupdate
Hi, 

So, the conclusion is adding a default SSL implementation option(CONFIG_SSL_IMPL_OPENSSL) into defconfig, is it?
Is there anybody plans to do it? Or let me submit a patch?

Best regards
Zheng Ruoqin

________________________________________
From: Stefano Babic <sba...@denx.de>
Sent: Thursday, June 18, 2020 16:22
To: Alexander Vickberg; Stefano Babic
Cc: Zheng, Ruoqin; yo...@yoctoproject.org; swupdate
Subject: Re: [swupdate] RE: [yocto] [PATCH] [meta-swupdate] Fix build error of dependence.

Stefano Babic

unread,
Jun 19, 2020, 4:53:36 AM6/19/20
to Zheng, Ruoqin, Stefano Babic, Alexander Vickberg, yo...@yoctoproject.org, swupdate
Hi Zheng,

On 19.06.20 08:20, Zheng, Ruoqin wrote:
> Hi, 
>
> So, the conclusion is adding a default SSL implementation option(CONFIG_SSL_IMPL_OPENSSL) into defconfig, is it?

Yes

> Is there anybody plans to do it? Or let me submit a patch?

Just send the patch to SWUpdate's ML, I will integrate then.

Regards,
Stefano

Zheng, Ruoqin

unread,
Jun 22, 2020, 4:19:47 AM6/22/20
to swupdate
-c -o mongoose/mongoose.o mongoose/mongoose.c


| mongoose/mongoose.c:4496:10: fatal error: openssl/ssl.h: No such file
or directory


Signed-off-by: Zheng Ruoqin <zhengr...@cn.fujitsu.com>

---
 recipes-support/swupdate/swupdate/defconfig | 1 +
 1 file changed, 1 insertion(+)


diff --git a/recipes-support/swupdate/swupdate/defconfig b/recipes-support/swupdate/swupdate/defconfig
index ffb3ea4..4e61f21 100644


--- a/recipes-support/swupdate/swupdate/defconfig
+++ b/recipes-support/swupdate/swupdate/defconfig
@@ -96,3 +96,4 @@ CONFIG_SHELLSCRIPTHANDLER=y
 # CONFIG_ARCHIVE is not set
 # CONFIG_REMOTE_HANDLER is not set
 # CONFIG_BOOTLOADERHANDLER is not set
+CONFIG_SSL_IMPL_OPENSSL=y
--

2.17.1

Stefano Babic

unread,
Jun 22, 2020, 6:38:09 AM6/22/20
to Zheng, Ruoqin, swupdate
Hi Zheng,
I guess you have just edited the file and you have not rerun a
menuconfig. The file is then generated and some other CONFIG are still
missing. I send a new patch with all changes, then.

Best regards,
Stefano Babic


--
=====================================================================
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: sba...@denx.de
=====================================================================

Zheng, Ruoqin

unread,
Jun 22, 2020, 10:06:55 PM6/22/20
to Stefano Babic, swupdate
Hi Stefano

> I guess you have just edited the file and you have not rerun a menuconfig. The
> file is then generated and some other CONFIG are still missing. I send a new
> patch with all changes, then.

Yes, I have just edited the file and rebuild the OSS. It was passed so I thought it was no problem.

Best regards,
Zheng

--


--------------------------------------------------
Zheng Ruoqin
Nanjing Fujitsu Nanda Software Tech. Co., Ltd.(FNST)
ADDR.: No.6 Wenzhu Road, Software Avenue,
Nanjing, 210012, China
MAIL : zhengr...@cn.fujistu.com

Hi Zheng,

Stefano Babic

unread,
Jun 23, 2020, 2:29:38 AM6/23/20
to Zheng, Ruoqin, Stefano Babic, swupdate
Hi Zheng,

On 23.06.20 04:05, Zheng, Ruoqin wrote:
> Hi Stefano
>
>> I guess you have just edited the file and you have not rerun a menuconfig. The
>> file is then generated and some other CONFIG are still missing. I send a new
>> patch with all changes, then.
>
> Yes, I have just edited the file and rebuild the OSS. It was passed so I thought it was no problem.
>

Ok, no problem - I have regenerated the file via menuconfig and applied
to meta-swupdate (-master and -dunfell branches).

Best regards,
Stefano Babic
Reply all
Reply to author
Forward
0 new messages