Wazuh Package Builder Script armhf

121 views
Skip to first unread message

Symeon Zapsis

unread,
Aug 29, 2024, 2:05:30 AM8/29/24
to Wazuh | Mailing List
Dear Wazuh Team,
I trying to build a binary for armhf (board STM32MP157F-DK2).
I followed the instructions for cross-compile provided in the https://github.com/wazuh/wazuh/tree/master/packages
I run this command under root:
./generate_package.sh -t agent -a armhf -s /tmp
The process of building the Docker image, compiling the files, etc., took around 7-8 hours, but it resulted in the following error:

cd external && test -e cJSON.tar.gz && gunzip cJSON.tar.gz || true
/bin/sh: 1: cd: can't cd to external
cd external && test -e cJSON.tar && tar -xf cJSON.tar || true
/bin/sh: 1: cd: can't cd to external
test -e external/cJSON.tar && rm external/cJSON.tar || true
test -d external/cJSON ||\
(curl -so external/cJSON.tar.gz https://packages.wazuh.com/deps/30/libraries/sources/cJSON.tar.gz &&\
cd external && gunzip cJSON.tar.gz && tar -xf cJSON.tar && rm cJSON.tar)
Makefile:952: recipe for target 'external/cJSON.tar.gz' failed
make[2]: *** [external/cJSON.tar.gz] Error 23
make[2]: Leaving directory '/build_wazuh/agent/wazuh-agent-5.0.0/src'
debian/rules:40: recipe for target 'override_dh_install' failed
make[1]: *** [override_dh_install] Error 2
make[1]: Leaving directory '/build_wazuh/agent/wazuh-agent-5.0.0'
debian/rules:30: recipe for target 'binary' failed
make: *** [binary] Error 2

Could you please help me resolve this error?

I have attached output.txt for more details.

Thank you in advance.

Best regards.
Symeon Zapsis

output.txt

Jeremias Ignacio Posse

unread,
Aug 29, 2024, 2:47:51 AM8/29/24
to Wazuh | Mailing List
Hello Symeon, I’ll be with you in just a few minutes. Thank you for your patience.

Jeremias Ignacio Posse

unread,
Aug 29, 2024, 6:52:52 AM8/29/24
to Wazuh | Mailing List
Sorry for the dealy, what should i recomend you to do is:

Manually download the cJSON dependency and place it in the correct location:
Download the cJSON tarball from the correct source:
curl -so /tmp/cJSON.tar.gz https://packages.wazuh.com/deps/30/libraries/sources/cJSON.tar.gz

Extract the tarball:
tar -xf /tmp/cJSON.tar.gz -C /build_wazuh/agent/wazuh-agent-5.0.0/src/external/

Retry the build process:
cd /build_wazuh/agent/wazuh-agent-5.0.0/src
make deps TARGET=agent

Check Dependencies:
Ensure that other dependencies (such as libdb) are also correctly downloaded and accessible.

Update Wazuh:
Consider using the latest version of Wazuh (if possible) to benefit from any fixes or improvements related to dependency handling.

Also I will recommend you to read this issue   Unable to download manager dependencies · Issue #6099 · wazuh/wazuh · GitHub, it gives me some useful information about how to debug/fix your issue 

Remember to replace placeholders with actual paths and filenames relevant to your environment.
 If you encounter any further issues or need additional assistance, feel free to ask

Symeon Zapsis

unread,
Aug 29, 2024, 9:15:14 AM8/29/24
to Wazuh | Mailing List
Dear Jeremias,

Thank you for your answer.

I followed your steps:
1. I downloaded manually cJSON dependency and placed it in the correct location.
2. I rerun the script: ./generate_package.sh -t agent -a armhf -s /tmp

The previous error resolved, but I faced another one:

ake[2]: Leaving directory '/build_wazuh/agent/wazuh-agent-5.0.0/src'
make -j2 -C src/ TARGET=agent USE_SELINUX=yes DEBUG=no
make[2]: Entering directory '/build_wazuh/agent/wazuh-agent-5.0.0/src'
make[2]: *** No rule to make target 'agent', needed by 'build'.  Stop.

make[2]: Leaving directory '/build_wazuh/agent/wazuh-agent-5.0.0/src'
debian/rules:40: recipe for target 'override_dh_install' failed
make[1]: *** [override_dh_install] Error 2
make[1]: Leaving directory '/build_wazuh/agent/wazuh-agent-5.0.0'
debian/rules:30: recipe for target 'binary' failed
make: *** [binary] Error 2
dpkg-buildpackage: error: sudo debian/rules binary gave error exit status 2
debuild: fatal error at line 1116:
dpkg-buildpackage -rsudo -us -uc -b -nc failed
+ return 1
+ return 1
+ clean 1
+ exit_code=1
+ find /home/user/Desktop/STM32/wazuh/packages/debs/armhf/agent '(' -name '*.sh' -o -name '*.tar.gz' -o -name 'wazuh-*' ')' '!' -name docker_builder.sh -exec rm -rf '{}' +
+ exit 1

What do you suggest I do next?

I attached log file.

Best regards,
Symeon

3.generate_package_armhf.txt

Symeon Zapsis

unread,
Sep 2, 2024, 2:13:22 AM9/2/24
to Wazuh | Mailing List
Kind reminder.

Symeon Zapsis

unread,
Sep 2, 2024, 3:28:02 AM9/2/24
to Wazuh | Mailing List

Dear Jeremias,
No need to reply. Your colleague, Mr. Manuel Jose Cano Rojo, has already responded in another thread.
Thank you.
Best regards.
Symeon

Jeremias Ignacio Posse

unread,
Sep 3, 2024, 1:05:47 AM9/3/24
to Wazuh | Mailing List
Sorry for my delay and thank you for your patice! If there’s anything else you’d like assistance with or any other questions you have, feel free to ask
Reply all
Reply to author
Forward
0 new messages