openshwprojects / OpenBK7231T_App

Open source firmware (Tasmota/Esphome replacement) for BK7231T, BK7231N, BL2028N, T34, XR809, W800/W801, W600/W601, BL602 and LN882H
https://openbekeniot.github.io/webapp/devicesList.html
1.43k stars 254 forks source link

.rbl build for OpenBK7231T is broken for Ubuntu 22.04, works on Ubuntu 20.04 #809

Closed vfonov closed 1 year ago

vfonov commented 1 year ago

Describe the bug Building firmware on Ubuntu 22.04 for OTA update (.rbl file) doesn't work on Ubuntu 22.04, either in Docker or on bare metal. Works on Ubuntu 20.04

Firmware:

To Reproduce Using Docker build:

  1. create docker image docker build -t openbk_build --build-arg USERNAME=$USER .
  2. request build for OpenBK7231T: docker run --env TARGET_SDKS="OpenBK7231T" --rm -it -v "$(pwd)/..":/OpenBK7231T_App openbk_build
  3. See error
    
    ../toolchain/gcc-arm-none-eabi-4_9-2015q1/bin/arm-none-eabi-nm ../../../apps/OpenBK7231T/output/dev_20230426_122610/OpenBK7231T_dev_20230426_122610.axf | sort > ../../../apps/OpenBK7231T/output/dev_20230426_122610/OpenBK7231T_dev_20230426_122610.map
    ../toolchain/gcc-arm-none-eabi-4_9-2015q1/bin/arm-none-eabi-objdump -d ../../../apps/OpenBK7231T/output/dev_20230426_122610/OpenBK7231T_dev_20230426_122610.axf > ../../../apps/OpenBK7231T/output/dev_20230426_122610/OpenBK7231T_dev_20230426_122610.asm
    ../toolchain/gcc-arm-none-eabi-4_9-2015q1/bin/arm-none-eabi-objcopy -O binary ../../../apps/OpenBK7231T/output/dev_20230426_122610/OpenBK7231T_dev_20230426_122610.axf ../../../apps/OpenBK7231T/output/dev_20230426_122610/OpenBK7231T_dev_20230426_122610.bin
    make[3]: Leaving directory '/OpenBK7231T_App/sdk/OpenBK7231T/platforms/bk7231t/bk7231t_os'
    make[2]: Leaving directory '/OpenBK7231T_App/sdk/OpenBK7231T/platforms/bk7231t/bk7231t_os'
    Start Combined
    make[1]: *** [Makefile:102: build-BK7231] Error 130
    make[1]: Leaving directory '/OpenBK7231T_App'
    make: *** [Makefile:74: OpenBK7231T] Error 2
    ****************************************

Done building OpenBeken for the following platforms: OpenBK7231T Find outputs in: ../output/dev_20230426_122610

4. inspecting `../output/dev_20230426_122610`:

OpenBK7231T_dev_20230426_122610.bin OpenBK7231T_dev_20230426_122610.asm OpenBK7231T_dev_20230426_122610.map OpenBK7231T_dev_20230426_122610.axf

.rbl file is not there.

**The Fix**
It's possible to fix this issue by making a docker image based on ubuntu-20.04: 

FROM --platform=linux/amd64 ubuntu:20.04

With this change, build works properly and produces more files:

OpenBK7231T_QIO_dev_20230426_122203.bin OpenBK7231T_dev_20230426_122203.rbl OpenBK7231T_UA_dev_20230426_122203.bin OpenBK7231T_UG_dev_20230426_122203.bin



**Source of the error**
The error seem to be caused by https://github.com/openshwprojects/OpenBK7231T/blob/master/platforms/bk7231t/bk7231t_os/tools/generate/package_tool/linux/otafix 
michaelkamprath commented 1 year ago

I can confirm the bug and the suggested fix. @vfonov do you want to do the PR or should I?

github-actions[bot] commented 1 year ago

:tada: This issue has been resolved in version 1.17.111 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: