[meta-swupdate] Errors when building swupdate

748 views
Skip to first unread message

joh.sc...@gmail.com

unread,
Aug 10, 2017, 6:01:58 AM8/10/17
to swupdate
Hi,

when building the swupdate package on pyro using "bitbake swupdate", it complains that json-c, curl, openssl and mtd-utils are not found and it doesn't find the header files. In swupdate.inc, there are checks whether some of the variables are set (CONFIG_JSON, CONFIG_SURICATTA). However, at the time of the check, these variables are not set, while later during compiling time, they seem to be set, possibly due to dependencies in the configuration that are resolved during build time.

One additional error that I did not find a solution to yet is the following that occurs after resolving the dependencies manually by adding them to DEPENDS:

| ==========
| bootloader/lib.a(uboot.o): In function `bootloader_env_set':
| uboot.c:(.text.bootloader_env_set+0xb0): undefined reference to `fw_env_flush'
| collect2: error: ld returned 1 exit status
| Makefile:375: recipe for target 'swupdate_unstripped' failed
| make: *** [swupdate_unstripped] Error 1
| make: *** Waiting for unfinished jobs....
| arm-poky-linux-gnueabi-strip -s --remove-section=.note --remove-section=.comment tools/progress_unstripped -o tools/progress; chmod a+x tools/progress
| arm-poky-linux-gnueabi-strip -s --remove-section=.note --remove-section=.comment tools/hawkbitcfg_unstripped -o tools/hawkbitcfg; chmod a+x tools/hawkbitcfg
| arm-poky-linux-gnueabi-strip -s --remove-section=.note --remove-section=.comment tools/client_unstripped -o tools/client; chmod a+x tools/client
| arm-poky-linux-gnueabi-strip -s --remove-section=.note --remove-section=.comment tools/sendtohawkbit_unstripped -o tools/sendtohawkbit; chmod a+x tools/sendtohawkbit
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_compile (log file is located at /data/yocto-var-pyro/build/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/swupdate/2017.07-r0/temp/log.do_compile.6213)


Best regards
Johannes

joh.sc...@gmail.com

unread,
Aug 10, 2017, 7:24:07 AM8/10/17
to swupdate, joh.sc...@gmail.com
I figured out that the problem regarding u-boot is due to an old version of u-boot in the layer of the board provider.

Best regards
Johannes

Stefano Babic

unread,
Aug 10, 2017, 12:39:27 PM8/10/17
to joh.sc...@gmail.com, swupdate
Hi Johannes,

On 10/08/2017 12:01, joh.sc...@gmail.com wrote:
> Hi,
>
> when building the swupdate package on pyro using "bitbake swupdate", it complains that json-c, curl, openssl and mtd-utils are not found and it doesn't find the header files. In swupdate.inc, there are checks whether some of the variables are set (CONFIG_JSON, CONFIG_SURICATTA). However, at the time of the check, these variables are not set, while later during compiling time, they seem to be set, possibly due to dependencies in the configuration that are resolved during build time.
>

Dependencies must be checked before building, that is before running
do_configure. They are done by reading "defconfig". I can imagine that
you run "bitbake menuconfig", you add something, you have not updated a
"defconfig", and when it builds there are of course missing dependencies.

This is quite a chicken-egg problem, because DEPENDS must be set at the
early beginning but dependencies are added later when configure si running.


> One additional error that I did not find a solution to yet is the following that occurs after resolving the dependencies manually by adding them to DEPENDS:
>
> | ==========
> | bootloader/lib.a(uboot.o): In function `bootloader_env_set':
> | uboot.c:(.text.bootloader_env_set+0xb0): undefined reference to `fw_env_flush'
> | collect2: error: ld returned 1 exit status
> | Makefile:375: recipe for target 'swupdate_unstripped' failed
> | make: *** [swupdate_unstripped] Error 1
> | make: *** Waiting for unfinished jobs....
> | arm-poky-linux-gnueabi-strip -s --remove-section=.note --remove-section=.comment tools/progress_unstripped -o tools/progress; chmod a+x tools/progress
> | arm-poky-linux-gnueabi-strip -s --remove-section=.note --remove-section=.comment tools/hawkbitcfg_unstripped -o tools/hawkbitcfg; chmod a+x tools/hawkbitcfg
> | arm-poky-linux-gnueabi-strip -s --remove-section=.note --remove-section=.comment tools/client_unstripped -o tools/client; chmod a+x tools/client
> | arm-poky-linux-gnueabi-strip -s --remove-section=.note --remove-section=.comment tools/sendtohawkbit_unstripped -o tools/sendtohawkbit; chmod a+x tools/sendtohawkbit
> | WARNING: exit code 1 from a shell command.
> | ERROR: Function failed: do_compile (log file is located at /data/yocto-var-pyro/build/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/swupdate/2017.07-r0/temp/log.do_compile.6213)
>

Old u-boot and old libubootenv.a

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
=====================================================================

joh.sc...@gmail.com

unread,
Aug 11, 2017, 4:27:32 AM8/11/17
to swupdate, joh.sc...@gmail.com, sba...@denx.de
Hi Stefano,

Thanks for your answer.

I actually didn't run menuconfig, so it used the standard defconfig provided by meta-swupdate.

I suggest adding the needed dependencies for the standard configuration to the defconfig in the layer such that it compiles out of the box when adding the layer and building swupdate. In our case, we use autobuilder and are fine with the standard configuration, at least at this time. So, menuconfig would not be a direct option, we would rather have to include a new configuration in our own layer, which could be generated by menuconfig before. However, for most cases this might not be necessary if the provided defconfig would compile directly.

Best regards
Johannes

Stefano Babic

unread,
Aug 11, 2017, 6:31:26 AM8/11/17
to joh.sc...@gmail.com, swupdate, sba...@denx.de
Hi Johannes,

On 11/08/2017 10:27, joh.sc...@gmail.com wrote:
> Hi Stefano,
>
> Thanks for your answer.
>
> I actually didn't run menuconfig, so it used the standard defconfig provided by meta-swupdate.
>
> I suggest adding the needed dependencies for the standard configuration to the defconfig in the layer such that it compiles out of the box when adding the layer and building swupdate.

No. This is wrong. It hides a bug instead of fixing it. If it does not
compile, it means that the defconfig is not correct (maybe it is an old
version) and the dependencies are not correctly set.

If we add to DEPENDS, yes it is fine but then libraries are installe
dincreasing the footprint.

Best regards,
Stefano Babic

joh.sc...@gmail.com

unread,
Aug 11, 2017, 7:28:17 AM8/11/17
to swupdate, joh.sc...@gmail.com, sba...@denx.de
Hi Stefano,

I may misunderstand, but I think the defconfig in the meta-layer is not correct.

My suggestion was not to add DEPENDS in the recipe, or to change the method, but to make the defconfig file provided in the layer compatible by adding the CONFIG_* variables that are missing for it to be able to compile to meta-swupdate/recipes-support/swupdate/swupdate/defconfig.

One example is CONFIG_JSON, which is not present in meta-swupdate/recipes-support/swupdate/swupdate/defconfig but will be automatically activated during build time after the checks.

Best,
Johannes

derick...@gmail.com

unread,
Oct 18, 2017, 5:12:08 AM10/18/17
to swupdate
joh.sc...@gmail.com於 2017年8月10日星期四 UTC+8下午6時01分58秒寫道:
Hi All,
Any update from this matter? Do you figure out the problem?

Stefano Babic

unread,
Oct 18, 2017, 10:49:03 AM10/18/17
to derick...@gmail.com, swupdate
Please reread the original thread - it was already discussed and was
explained which is the cause.
Reply all
Reply to author
Forward
0 new messages