Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error building icicle_nand_defconfig #7

Closed
kolabit opened this issue Jul 10, 2023 · 15 comments
Closed

Error building icicle_nand_defconfig #7

kolabit opened this issue Jul 10, 2023 · 15 comments

Comments

@kolabit
Copy link

kolabit commented Jul 10, 2023

Cap you please help? I tried to build icicle_nand_defconfig, and got the following error

host-hss-payload-generator v2023.06 Building
/usr/bin/make -j33 -C /home/kola/rv_linux/buildroot/output/build/host-hss-payload-generator-v2023.06/tools/hss-payload-generator HOST_INCLUDES=-I/home/kola/rv_linux/buildroot/output/host/usr/include/ LDFLAGS=-L/home/kola/rv_linux/buildroot/output/host/lib -Wl,-rpath,/home/kola/rv_linux/buildroot/output/host/lib
cp "/home/kola/rv_linux/buildroot/output/images/u-boot.bin" /home/kola/rv_linux/buildroot/output/build/host-hss-payload-generator-v2023.06/tools/hss-payload-generator/src.bin
( if [ "" = "y" ]; then cp /home/kola/rv_linux/buildroot/output/images/mpfs-rpmsg-remote.elf /home/kola/rv_linux/buildroot/output/build/host-hss-payload-generator-v2023.06/tools/hss-payload-generator/amp.elf; fi; cd /home/kola/rv_linux/buildroot/output/build/host-hss-payload-generator-v2023.06/tools/hss-payload-generator; ./hss-payload-generator -c "/home/kola/rv_linux/buildroot-external-microchip/board/microchip/icicle/config.yaml" -v /home/kola/rv_linux/buildroot/output/images/payload.bin; )
./hss-payload-generator: error while loading shared libraries: libyaml-0.so.2: cannot open shared object file: No such file or directory
make: *** [package/pkg-generic.mk:292: /home/kola/rv_linux/buildroot/output/build/host-hss-payload-generator-v2023.06/.stamp_built] Error 127

@jamiegibbons
Copy link
Contributor

Hello. We have not been able to reproduce your error on our end. Could we please get some more detail of your system so that we can advise further? e.g. What branch/tag of buildroot-external-microchip are you using? What OS are you building from, and what version of this OS?

@kolabit
Copy link
Author

kolabit commented Jul 11, 2023

Hi

System is Ubuntu20.04 in Docker container.

root@49caf304cb7b:/home/kola/rv_linux/buildroot# uname -r
5.15.0-76-generic
root@49caf304cb7b:/home/kola/rv_linux/buildroot# cat /etc/os-release 
NAME="Ubuntu"
VERSION="20.04.4 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.4 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
root@49caf304cb7b:/home/kola/rv_linux/buildroot#

I followed the build steps described here:
https://github.com/linux4microchip/buildroot-external-microchip#readme

sudo apt-get install subversion build-essential bison flex gettext \
libncurses5-dev texinfo autoconf automake libtool mercurial git-core \
gperf gawk expat curl cvs libexpat-dev bzr unzip bc python-dev \
wget cpio rsync xxd bmap-tools

git clone https://github.com/linux4microchip/buildroot-external-microchip.git -b 2022.02-mchp
git clone https://git.busybox.net/buildroot -b 2022.02
cd buildroot
BR2_EXTERNAL=../buildroot-external-microchip/ make icicle_nand_defconfig
make

@jamiegibbons
Copy link
Contributor

Thank you for the above information. I have double checked this process on my machine and it is working. It has been checked with the same tags and OS version as you've mentioned above. This is not an error with Buildroot or our configuration. Might be worth trying a clean build: make clean, BR2_EXTERNAL=../buildroot-external-microchip/ make icicle_nand_defconfig, make.

It seems though that this is an error with this library on your machine - libyaml, and the associated symbolic link to libyaml-0.so.2. You may need to update your LD_LIBRARY_PATH. I hope that you can find some help here and here.

Also could you check your buildroot log to see if libyaml was built properly? It should be the step before the hss-payload-generator builds. You can also check buildroot/output/host/lib to see if any library related to libyaml is present.

@kolabit
Copy link
Author

kolabit commented Jul 12, 2023

I have tried make clean, BR2_EXTERNAL=../buildroot-external-microchip/ make icicle_nand_defconfig, make, and got the same error. Will try other recipes and let you know.

@kolabit
Copy link
Author

kolabit commented Jul 15, 2023

I've just added libs to LD_LIBRARY_PATH, and it helped
export LD_LIBRARY_PATH=/home/kola/rv_build_root/buildroot/output/host/lib
Pretty strange, since the command line included
LDFLAGS=-L/home/kola/rv_linux/buildroot/output/host/lib

@kolabit
Copy link
Author

kolabit commented Jul 19, 2023

If I build icicle_defconfig, I get this:

INFO: hdimage(sdcard.img): The option 'gpt' is deprecated. Use 'partition-table-type' instead
INFO: cmd: "mkdir -p "/home/kola/rv_build_root/buildroot/output/images"" (stderr):
INFO: vfat(boot.vfat): cmd: "dd if=/dev/zero of="/home/kola/rv_build_root/buildroot/output/images/boot.vfat" seek=62914560 count=0 bs=1 2>/dev/null" (stderr):
INFO: vfat(boot.vfat): cmd: "mkdosfs   '/home/kola/rv_build_root/buildroot/output/images/boot.vfat'" (stderr):
/bin/sh: 1: mkdosfs: not found
INFO: vfat(boot.vfat): cmd: "rm -f "/home/kola/rv_build_root/buildroot/output/images/boot.vfat"" (stderr):
ERROR: vfat(boot.vfat): failed to generate boot.vfat
bmaptool: ERROR: An error occurred, here is the traceback:
Traceback (most recent call last):
  File "/home/kola/rv_build_root/buildroot/output/host/lib/python3.10/site-packages/bmaptools/BmapCreate.py", line 200, in _open_image_file
    self._f_image = open(self._image_path, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: '/home/kola/rv_build_root/buildroot/output/images/sdcard.img'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/kola/rv_build_root/buildroot/output/host/lib/python3.10/site-packages/bmaptools/CLI.py", line 555, in create_command
    creator = BmapCreate.BmapCreate(args.image, output, "sha256")
  File "/home/kola/rv_build_root/buildroot/output/host/lib/python3.10/site-packages/bmaptools/BmapCreate.py", line 166, in __init__
    self._open_image_file()
  File "/home/kola/rv_build_root/buildroot/output/host/lib/python3.10/site-packages/bmaptools/BmapCreate.py", line 202, in _open_image_file
    raise Error("cannot open image file '%s': %s"

bmaptool: ERROR: cannot open image file '/home/kola/rv_build_root/buildroot/output/images/sdcard.img': [Errno 2] No such file or directory: '/home/kola/rv_build_root/buildroot/output/images/sdcard.img'

make: *** [Makefile:817: target-post-image] Error 1
root@820fe220d007:/home/kola/rv_build_root/buildroot# ls /home/kola/rv_build_root/buildroot/output/images/
Image  Image.gz  boot.scr  dts  microchip  mpfs_icicle  mpfs_icicle.itb  mpfs_icicle.its  payload.bin  rootfs.cpio  rootfs.cpio.gz  rootfs.tar  sdcard.bmap  u-boot.bin
root@820fe220d007:/home/kola/rv_build_root/buildroot# 

@kolabit
Copy link
Author

kolabit commented Jul 19, 2023

As I see, it uses make -J33. Is it possible that sdcard.img just was not yet created by the parallel make's task ?

@jamiegibbons
Copy link
Contributor

Hi, could you add BR2_PACKAGE_HOST_DOSFSTOOLS=y to your icicle_defconfig and then run a clean build again please? Also buildroot doesn't support top-level parallel build tasks so you can just run make instead of make j -33.

@kolabit
Copy link
Author

kolabit commented Jul 21, 2023

BR2_PACKAGE_HOST_DOSFSTOOLS=y resolved the issue.
However, if export LD_LIBRARY_PATH=/home/kola/rv_build_root/buildroot/output/host/lib was set before make is run, this error will occur

>>> acl 2.3.1 Building
PATH="/home/kola/rv_build_root/buildroot/output/host/bin:/home/kola/rv_build_root/buildroot/output/host/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"  /usr/bin/make -j33  -C /home/kola/rv_build_root/buildroot/output/build/acl-2.3.1/
make[1]: Entering directory '/home/kola/rv_build_root/buildroot/output/build/acl-2.3.1'
Making all in po
make[2]: Entering directory '/home/kola/rv_build_root/buildroot/output/build/acl-2.3.1/po'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/kola/rv_build_root/buildroot/output/build/acl-2.3.1/po'
make[2]: Entering directory '/home/kola/rv_build_root/buildroot/output/build/acl-2.3.1'
  CCLD     libacl.la
/home/kola/rv_build_root/buildroot/output/host/lib/gcc/riscv64-buildroot-linux-gnu/11.2.0/../../../../riscv64-buildroot-linux-gnu/bin/ld: /home/kola/rv_build_root/buildroot/output/host/lib/libattr.so: error adding symbols: file in wrong format
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:1188: libacl.la] Error 1
make[2]: Leaving directory '/home/kola/rv_build_root/buildroot/output/build/acl-2.3.1'
make[1]: *** [Makefile:1942: all-recursive] Error 1
make[1]: Leaving directory '/home/kola/rv_build_root/buildroot/output/build/acl-2.3.1'
make: *** [package/pkg-generic.mk:292: /home/kola/rv_build_root/buildroot/output/build/acl-2.3.1/.stamp_built] Error 2

So, to get the build working, it is necessary to run make, get an error from my initial post, then define export LD_LIBRARY_PATH=/home/kola/rv_build_root/buildroot/output/host/lib, and run make again

@jamiegibbons
Copy link
Contributor

Glad you were able to get a completed build and an image in your output/images dir. Thank you for letting us know about the above issue. We will take a further look into this over the coming weeks. All the best.

@ConchuOD
Copy link
Member

The original issue here seems to be fixed, so I'll go ahead and close this.

@kolabit
Copy link
Author

kolabit commented Jul 25, 2023

I am sorry, but if I include gstreamer components (with make menuconfig), I get similar error. It says "disk is full", but it has plenty of space >100G.

>>>   Executing post-image script /home/kola/rv_build_root/buildroot-external-microchip/board/microchip/icicle/post-image.sh
mv: cannot stat '*.dtbo': No such file or directory
INFO: cmd: "mkdir -p "/home/kola/rv_build_root/buildroot/output/build/genimage.tmp"" (stderr):
INFO: cmd: "rm -rf "/home/kola/rv_build_root/buildroot/output/build/genimage.tmp"/*" (stderr):
INFO: cmd: "mkdir -p "/home/kola/rv_build_root/buildroot/output/build/genimage.tmp"" (stderr):
INFO: cmd: "cp -a "/tmp/tmp.5YrrOxiwzt" "/home/kola/rv_build_root/buildroot/output/build/genimage.tmp/root"" (stderr):
INFO: cmd: "find '/home/kola/rv_build_root/buildroot/output/build/genimage.tmp/root' -depth -type d -printf '%P\0' | xargs -0 -I {} touch -r '/tmp/tmp.5YrrOxiwzt/{}' '/home/kola/rv_build_root/buildroot/output/build/genimage.tmp/root/{}'" (stderr):
INFO: hdimage(sdcard.img): The option 'gpt' is deprecated. Use 'partition-table-type' instead
INFO: cmd: "mkdir -p "/home/kola/rv_build_root/buildroot/output/images"" (stderr):
INFO: vfat(boot.vfat): cmd: "dd if=/dev/zero of="/home/kola/rv_build_root/buildroot/output/images/boot.vfat" seek=62914560 count=0 bs=1 2>/dev/null" (stderr):
INFO: vfat(boot.vfat): cmd: "mkdosfs   '/home/kola/rv_build_root/buildroot/output/images/boot.vfat'" (stderr):
INFO: vfat(boot.vfat): adding file 'boot.scr' as 'boot.scr' ...
INFO: vfat(boot.vfat): cmd: "MTOOLS_SKIP_CHECK=1 mcopy -sp -i '/home/kola/rv_build_root/buildroot/output/images/boot.vfat' '/home/kola/rv_build_root/buildroot/output/images/boot.scr' '::boot.scr'" (stderr):
INFO: vfat(boot.vfat): adding file 'mpfs_icicle.itb' as 'mpfs_icicle.itb' ...
INFO: vfat(boot.vfat): cmd: "MTOOLS_SKIP_CHECK=1 mcopy -sp -i '/home/kola/rv_build_root/buildroot/output/images/boot.vfat' '/home/kola/rv_build_root/buildroot/output/images/mpfs_icicle.itb' '::'" (stderr):
Disk full
INFO: vfat(boot.vfat): cmd: "rm -f "/home/kola/rv_build_root/buildroot/output/images/boot.vfat"" (stderr):
ERROR: vfat(boot.vfat): failed to generate boot.vfat
bmaptool: ERROR: An error occurred, here is the traceback:
Traceback (most recent call last):
  File "/home/kola/rv_build_root/buildroot/output/host/lib/python3.10/site-packages/bmaptools/BmapCreate.py", line 200, in _open_image_file
    self._f_image = open(self._image_path, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: '/home/kola/rv_build_root/buildroot/output/images/sdcard.img'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/kola/rv_build_root/buildroot/output/host/lib/python3.10/site-packages/bmaptools/CLI.py", line 555, in create_command
    creator = BmapCreate.BmapCreate(args.image, output, "sha256")
  File "/home/kola/rv_build_root/buildroot/output/host/lib/python3.10/site-packages/bmaptools/BmapCreate.py", line 166, in __init__
    self._open_image_file()
  File "/home/kola/rv_build_root/buildroot/output/host/lib/python3.10/site-packages/bmaptools/BmapCreate.py", line 202, in _open_image_file
    raise Error("cannot open image file '%s': %s"

bmaptool: ERROR: cannot open image file '/home/kola/rv_build_root/buildroot/output/images/sdcard.img': [Errno 2] No such file or directory: '/home/kola/rv_build_root/buildroot/output/images/sdcard.img'

make: *** [Makefile:817: target-post-image] Error 1
root@3e7e8a9bd41c:/home/kola/rv_build_root/buildroot# 

@jamiegibbons
Copy link
Contributor

It is unclear if you are trying to add gstreamer to the nand image (icicle_nand_defconfig) as this discussion was started with or a standard icicle image (icicle_defconfg)? It seams you're using the standard config from this screenshot. Is it just gstreamer you are trying to add or have you added other packages to the default image? Can you be more specific about the gstreamer package you are trying to add? Perhaps you could provide us with further details in a new issue if you would like further advice as this is a separate issue.
Assuming you are just trying to add BR2_PACKAGE_GSTREAMER1, we have not been able to reproduce the error. As mentioned, we need more details in order to be able to advise further.

@kolabit
Copy link
Author

kolabit commented Jul 26, 2023

You're right. Let's keep it closed, and I open the new issue with the proper description.

@kolabit
Copy link
Author

kolabit commented Jul 26, 2023

I can't reproduce "disk full" error with Gstreamer anymore. I open the new issue if this appears again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants