Jump to content

How to build a package from source inside the armbian build system?


dmitgrib
Go to solution Solved by SteeMan,

Recommended Posts

Hi
I am building armbian image for Nanopi Neo. I need to include SWUpdate package in my armbian build. The already built SWUpdate package does not work for me, because I need to disable CONFIG_SIGNED_IMAGES.

 

As far as I understand, I need to rebuild SWUpdate inside the armbian build system.


Can you please help me to understand where I should write commands to build SWUpdate from source (git repo), so that armbian build system will put the built binary and libraries into the resulting image?

 

Link to comment
Share on other sites

Thank you @Werner for your time. But this method does not produce the desired result.
The `customize-image.sh` script is called from an environment with no development tools. I tried running `gcc` and got

Quote

[🐳|🔨]   + gcc --version
[🐳|🔨]   /tmp/customize-image.sh: line 54: gcc: command not found


The link you provided says "You can run additional commands to customize the created image." and it works successfully, but nothing more. That is, I can copy, delete files from the image, I can call `apt-get` to install packages, but I can't find the development tools to build packages there.

I assumed that I could compile and build the SWUpdate package from the environment where the Linux kernel and U-Boot are built. Is this how to do it?

 

Edited by dmitgrib
Link to comment
Share on other sites

Thank you @Werner!

I realized that I can add everything I need for the build.

But after the build, I have to remove packages and maybe something else to make the target system clean. It seems to me that this is an artificially created job, while in the part where the kernel was just built, all the necessary cross-compilation tools are present.

Can't I build a package in a toolchain environment?

Link to comment
Share on other sites

  • Solution
6 minutes ago, dmitgrib said:

Can't I build a package in a toolchain environment?


That isn't how the armbian build system works.  Armbian is basically the u-boot and linux kernel (which are built from sources in the framework) plus an ubuntu/debian userspace.

 

The build process builds the u-boot and kernel packages and then installs them along with the user space packages from ubuntu or debian based on what distribution you are using.  There isn't a reason to build other things as they are just installed from repositories.

 

So what you probably want to do is build your custom .deb in your own environment and then install it through the armbian build.

 

Link to comment
Share on other sites

17 часов назад, dmitgrib сказал:

I assumed that I could compile and build the SWUpdate package from the environment where the Linux kernel and U-Boot are built. Is this how to do it?

SWUpdate package - Here, please, in more detail. What is this package?
Maybe I can help.

Link to comment
Share on other sites

10 часов назад, dmitgrib сказал:

swupdate is a Linux update agent with the goal to provide an efficient and safe way to update an embedded system.

@dmitgrib As far as I understand from your messages, the package from the debian repository does not work for you.

 

Warning:
Several packages that install and modify files on flash devices, memory devices, and bootloaders do not work correctly in the Armbian OS.

Just because the paths or names of the target files are different.

 

In this package, at least two libraries require additional attention, in addition to attention to the source texts of the package itself:

swupdate (2022.12+dfsg-4+deb12u1)

 swupdate is a Linux update agent with the goal to provide an efficient and safe way to update an embedded system.

 - Install on embedded media (eMMC, SD, Raw NAND, NOR and SPI-NOR flashes)
 - Allow delivery single image for multiple devices
 - Multiple interfaces for getting software
   1. local storage
   2. integrated web server
   3. integrated REST client connector to hawkBit
   4. remote server download
 - Software delivered as images, gzipped tarball, etc
 - Allow custom handlers for installing FPGA/ microcontroller firmware.
 - Power-Off safe

.....
dep: libgpiod2 (>= 1.1)
    C library for interacting with Linux GPIO device - shared libraries
.....
dep: libswupdate0.1 (>= 2021.04)
    Library for controlling the swupdate framework

 

The best way to make a package is to repeat the steps described in the debian documentation #packaging-tutorial

You can do this directly on the device.

sudo nano /etc/apt/sources.list
replace "# deb-src" to "deb-src"

sudo apt update
mkdir packaging
cd packaging
# not sudo:
apt-get source swupdate

sudo apt-get build-dep swupdate

Next, we edit the source texts and assemble them as described in the documentation.

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines