creating packages in the armbian build system


going
 Share

3 3

Recommended Posts

8 minutes ago, going said:

In a clean system, only the script worked
compile.sh Reassembly, when the compiler cache is full, takes 9 minutes.


Build server host is Focal. Compilation stalls on bare metal too, on two Hirsute guest machines and on one Focal. It makes me crazy :( 

Link to post
Share on other sites

Armbian is a community driven open source project. Do you like to contribute your code?

2 hours ago, Cornelius said:

Only major difference I see, is you appear to be using the builddeb/mkdebian files from 5.10.y,

These are scripts from kernel 5.11. and they are adapted to armbian.

Thanks for the link to the scripts, I saw that something needs to be checked.

Link to post
Share on other sites

2 minutes ago, Igor said:

Build server host is Focal. Compilation stalls on bare metal too, on two Hirsute guest machines and on one Focal. It makes me crazy

For the sake of experiment, we will try to disable the creation of the kernel header module in the configuration for 5.12.
I have run out of ideas. Tomorrow I will make the scripts easier, as in the 5.4 kernel.
As just shown @Cornelius

Link to post
Share on other sites

22 hours ago, Cornelius said:

 

Our problem of recompiling to a single thread was in the rules file.
 

diff --git a/packages/armbian/mkdebian b/packages/armbian/mkdebian
index cfd38864c..02189b7a3 100755
--- a/packages/armbian/mkdebian
+++ b/packages/armbian/mkdebian
@@ -231,15 +231,11 @@ cat <<EOF > debian/rules
 
 srctree ?= .
 
-build-indep:
-build-arch:
+build:
        \$(MAKE) KERNELRELEASE=${version} ARCH=${ARCH} \
        KBUILD_BUILD_VERSION=${revision} -f \$(srctree)/Makefile
 
-build: build-arch
-
-binary-indep:
-binary-arch: build-arch
+binary-arch:
        \$(MAKE) KERNELRELEASE=${version} ARCH=${ARCH} \
        KBUILD_BUILD_VERSION=${revision} -f \$(srctree)/Makefile intdeb-pkg
 

Your link came in very handy.

Link to post
Share on other sites

I had to take a fascinating journey through Makefiles and scripts for building packages in kernel sources.

 

In the original:
After executing the mkdebian script, the debian/rules file looks like:

#!$(command -v $MAKE) -f

srctree ?= .

build-indep:
build-arch:
	$(MAKE) KERNELRELEASE=5.12.9-sunxi64 ARCH=arm64         KBUILD_BUILD_VERSION=trunk -f $(srctree)/Makefile

build: build-arch

binary-indep:
binary-arch: build-arch
	$(MAKE) KERNELRELEASE=5.12.9-sunxi64 ARCH=arm64         KBUILD_BUILD_VERSION=trunk -f $(srctree)/Makefile intdeb-pkg

clean:
	rm -rf debian/*tmp debian/files
	$(MAKE) clean

binary: binary-arch

This behavior causes the target to be collected at the package creation stage, if for some reason the target is considered not collected.
The possible reason is the timestamp. This is a kind of insurance for a full-fledged assembly.

Note the substitution of the MAKE variable. Here it's a simple call to /usr/bin/make.

But, at this stage, we have already collected all the necessary goals.
What could be the reason? For each kernel branch (5.4 5.10 5.12 ...) these reasons may be several and they will differ.
Therefore, the simpler version of the debian/rules file turned out to be the most working one:

#!/usr/bin/make -f

srctree ?= .

build:
        $(MAKE) KERNELRELEASE=5.12.9-sunxi64 ARCH=arm64         KBUILD_BUILD_VERSION=trunk -f $(srctree)/Makefile

binary-arch:
        $(MAKE) KERNELRELEASE=5.12.9-sunxi64 ARCH=arm64         KBUILD_BUILD_VERSION=trunk -f $(srctree)/Makefile intdeb-pkg

clean:
        rm -rf debian/*tmp debian/files
        $(MAKE) clean

binary: binary-arch

 

 

In any case, this file is very simple to be good.

We need to develop it so that it can, for example, build a separate package with kernel modules that are not used on all boards.

 

P.S. Example for hirsute debian/rules

 

Link to post
Share on other sites

@Igor @lanefu There are two options working in this branch.

For 5.12, the standard process for applying patches is.

For 5.10, a series of patches is used.
Both variants use the new mechanism and version numbering for the kernel and u-boot.

Here I have laid out a hand tool with which I extract a series of patches.

 

My lib.config

~/build$ cat userpatches/lib.config 
# KERNELSOURCE="https://github.com/megous/linux"
if [ "$KERNELPATCHDIR" == "sunxi-current" ]; then
KERNELSOURCE='git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git'
KERNELBRANCH=tag:v5.10.37
fi

 

Result:

~/build$ ls output/images/
Armbian_21.08.0~trunk_Orangepipc2_focal_edge_5.12.9_minimal.img
Armbian_21.08.0~trunk_Orangepipc2_focal_edge_5.12.9_minimal.img.sha
Armbian_21.08.0~trunk_Orangepipc2_focal_edge_5.12.9_minimal.img.txt

~/build$ ls output/debs             
armbian-config_21.08.0~trunk_all.deb         linux-dtb-edge-sunxi64_5.12.9-21.08.0~trunk_arm64.deb
armbian-firmware_21.08.0~trunk_all.deb       linux-headers-edge-sunxi64_5.12.9-21.08.0~trunk_arm64.deb
armbian-firmware-full_21.08.0~trunk_all.deb  linux-image-edge-sunxi64_5.12.9-21.08.0~trunk_arm64.deb
armbian-zsh_21.08.0~trunk_all.deb            linux-libc-dev-edge-sunxi64_5.12.9-21.08.0~trunk_arm64.deb
extra                                        linux-source-edge-sunxi64_21.08.0~trunk_all.deb
focal                                        linux-u-boot-orangepipc2-edge_21.08.0~trunk_arm64.deb

~/build$ dpkg --info output/debs/linux-u-boot-orangepipc2-edge_21.08.0~trunk_arm64.deb 
 new Debian package, version 2.0.
 size 287004 bytes: control archive=424 bytes.
     335 байт(а),    11 строк      control              
 Package: linux-u-boot-orangepipc2-edge
 Version: 2021.04-armbian-21.08.0~trunk
 Architecture: arm64
 Maintainer: Igor Pecovnik <igor.pecovnik@****l.com>
 Installed-Size: 1
 Section: kernel
 Priority: optional
 Provides: armbian-u-boot
 Replaces: armbian-u-boot
 Conflicts: armbian-u-boot, u-boot-sunxi
 Description: Uboot loader 2021.04-armbian

~/build$ dpkg --info output/debs/linux-image-edge-sunxi64_5.12.9-21.08.0~trunk_arm64.deb 
 new Debian package, version 2.0.
 size 28504152 bytes: control archive=72124 bytes.
     483 байт(а),    13 строк      control              
  282583 байт(а),  2821 строк      md5sums              
     422 байт(а),    15 строк   *  postinst             #!/bin/bash
     297 байт(а),    12 строк   *  postrm               #!/bin/bash
     898 байт(а),    33 строк   *  preinst              #!/bin/bash
     295 байт(а),    12 строк   *  prerm                #!/bin/bash
 Package: linux-image-edge-sunxi64
 Source: linux-5.12.9-sunxi64
 Version: 5.12.9-21.08.0~trunk
 Architecture: arm64
 Maintainer: Igor Pecovnik <igor.pecovnik@****l.com>
 Installed-Size: 126265
 Provides: armbian-edge, linux-image, linux-image-armbian
 Section: kernel
 Priority: optional
 Homepage: https://www.kernel.org/
 Description: Linux kernel, armbian version 5.12.9-sunxi64 edge
  This package contains the Linux kernel, modules and corresponding other
  files, version: 5.12.9-sunxi64.

 

P.S. I am waiting for healthy criticism and suggestions.

Link to post
Share on other sites

 Share

3 3