enclustra-bsp / bsp-altera

4 stars 7 forks source link

Problems with building the software and with the documentation #5

Open chrisbohens opened 5 months ago

chrisbohens commented 5 months ago

Hi,

I am using Docker to clone this repos update branch and build the Linux kernel and dtb file for my SA2 module:

docker build -t enc -f Dockerfile .

My Dockerfile is:

FROM ubuntu:22.04

RUN apt-get update && \
    apt-get install --no-install-recommends -y \
      python2 dialog make git tar unzip curl wget bc libssl-dev patch rsync autoconf g++ gcc flex bison u-boot-tools

# Why is this necessary but not mentioned in the docs?
RUN apt-get install --no-install-recommends -y \
      apt-transport-https ca-certificates
RUN update-ca-certificates
RUN apt-get install --no-install-recommends -y \
      cpio

RUN git clone https://github.com/enclustra-bsp/bsp-altera.git -b update

RUN cd bsp-altera && ./build.sh -d Mercury_SA2/Mercury_PE1/MMC -x Linux -x U-Boot

# This throws an error:
# RUN cd bsp-altera && ./build.sh -d Mercury_SA2/Mercury_PE1/MMC

1) Edited, see comment below.

2) There are dependencies missing in your docs in the update branch, namely ca-certificates and cpio and possibly more, see 3)

3) I only managed to get Linux and U-Boot to properly build. Buildroot threw an error:

#0 318.9 INFO: Building Buildroot
#0 318.9 +make enclustra_altera_defconfig -j17
#0 318.9 make enclustra_altera_defconfig completed successfully
#0 318.9 +make EBE_OVERLAYS=/bsp-altera/out_Mercury_SA2_Mercury_PE1_MMC/overlays -j17
#0 318.9 ERROR: Error running make EBE_OVERLAYS={ebe_overlays} -j17 for Buildroot
#0 318.9 INFO: Working directory: /bsp-altera
#0 318.9 INFO: Copying files for U-Boot
#0 318.9 INFO: Copying ./sources/altera-uboot/.config to ./out_Mercury_SA2_Mercury_PE1_MMC/configs/uboot_dotconfig
#0 318.9 INFO: Copying ./sources/altera-uboot/boot.scr to ./out_Mercury_SA2_Mercury_PE1_MMC/boot.scr
#0 318.9 INFO: Copying ./sources/altera-uboot/u-boot-with-spl.sfp to ./out_Mercury_SA2_Mercury_PE1_MMC/u-boot-with-spl.sfp
#0 318.9 INFO: Copying files for Linux
#0 318.9 INFO: Copying ./sources/altera-linux/arch/arm/boot/uImage to ./out_Mercury_SA2_Mercury_PE1_MMC/uImage
#0 318.9 INFO: Copying ./sources/altera-linux/.config to ./out_Mercury_SA2_Mercury_PE1_MMC/configs/kernel_dotconfig
#0 318.9 INFO: Copying ./sources/altera-linux/arch/arm/boot/dts/enclustra_generated.dtb to ./out_Mercury_SA2_Mercury_PE1_MMC/devicetree.dtb
#0 318.9 INFO: --------------------------------------------------------------------------------
#0 318.9 ERROR: BUILD FAILED
#0 318.9 INFO: Device: Mercury SA2 Mercury PE1 MMC
#0 318.9 INFO: Targets: U-Boot (fetch + build), Buildroot (fetch), Linux (fetch + build)
#0 318.9 INFO: Binaries: ME-SA2-D6-7I-D11
------
Dockerfile:20
--------------------
  18 |
  19 |     # RUN cd bsp-altera && ./build.sh -d Mercury_SA2/Mercury_PE1/MMC -x Linux -x U-Boot
  20 | >>> RUN cd bsp-altera && ./build.sh -d Mercury_SA2/Mercury_PE1/MMC
  21 |
  22 |
--------------------
ERROR: failed to solve: process "/bin/sh -c cd bsp-altera && ./build.sh -d Mercury_SA2/Mercury_PE1/MMC" did not complete successfully: exit code: 1

Running it natively doesn't work either. So what is wrong/missing?

Please make it clear how to properly build your software. Usually this should be noted in the readme of the master branch in one way or another.

chrisbohens commented 5 months ago

I managed to build U-Boot and Kernel on the master branch. In your documentation for Ubuntu 14.04 you have:

sudo apt update
sudo apt install -y autoconf bc build-essential curl git mercurial \
                    libc6-i386 python python-dialog unzip wget

In this bash code snippet missing are:

rsync tar g++ gcc patch dialog make libssl-dev

Not all of these are part of the Ubuntu 14.04 base image/installation! The non-decriptive error messages that I've gotten from your build.sh didn't exactly help with that either. Missing dependencies should be clearly stated.

andreas-buerkler-enclustra commented 5 months ago

Hi,

Thank you for the input, I will check the build dependencies and update the documentation accordingly.

We are currently updating this Linux BSP to a newer version to make it compatible with the latest Vivado versions. The update branch is still under development, but a release is planned in the next few days (including merge to master branch).

chrisbohens commented 5 months ago

Alright, I have managed to get the master branch working but I get the exact same error when I try to build Buildroot.

I can send you my Ubuntu 14.04 Dockerfile later.

chrisbohens commented 5 months ago
FROM ubuntu:14.04

RUN apt-get update && \
    apt-get install --no-install-recommends -y \
      autoconf bc build-essential curl git mercurial libc6-i386 python python-dialog unzip wget

# This is missing in the bash code snippet:
RUN apt-get install --no-install-recommends -y \
      rsync tar g++ gcc patch dialog make libssl-dev

RUN git clone https://github.com/enclustra-bsp/bsp-altera.git

RUN cd bsp-altera && ./build.sh -d Mercury_SA2/Mercury_PE1/MMC

I am building the dockerimage the same way as above. And I also get the same error as above when trying to build Buildroot.

andreas-buerkler-enclustra commented 5 months ago

I recommend to use the update branch because main branch is quite outdated.

I created a build on a newly installed Ubuntu 22.04 (server). The only package that was missing in the prerequisites list was bzip2. I already updated the documentation.

chrisbohens commented 5 months ago

Ok. Does building Buildroot work properly at your end? Right now we build it using the official Buildroot repo. It would make our build process a bit more straight forward if we could build it from this repo instead. I am still getting this cryptic error, see my original post above.

andreas-buerkler-enclustra commented 5 months ago

Building Buildroot is working on my end. Please check the build.log file for errors. The console output only shows that the Buildroot make command failed. You can also send the build.log file to support@enclustra.com, if you need help with it.