Can't build official ArchlinuxARM armv7 kernel / uImage

This forum is for topics dealing with problems with software specifically in the ARMv7h repo.

Can't build official ArchlinuxARM armv7 kernel / uImage

Postby psiegl » Sun Mar 06, 2022 4:54 pm

Hi,

I am trying to compile an unmodified, official ArchlinuxARM armv7 kernel, but the compilation always fails. Googling did not provide me any hints how to fix the issue.

My setup is an Odroid XU4 that got installed as described here: https://archlinuxarm.org/platforms/armv ... odroid-xu4
On top of the default image, I updated all packages, got the `base-devel` packages as well as the ones required for building kernels:
$this->bbcode_second_pass_code('', '# pacman -Syu --noconfirm
# pacman -S --needed --noconfirm git vim base-devel
# pacman -S --needed --noconfirm xmlto docbook-xsl kmod inetutils bc git uboot-tools vboot-utils dtc')
Next step, get the PKGBUILDs:
$this->bbcode_second_pass_code('', '$ git clone https://github.com/archlinuxarm/PKGBUILDs
$ cd PKGBUILDs/core/linux-armv7')
Well, and then the obvious last step:
$this->bbcode_second_pass_code('', '$ makepkg')

My assumption would be, that there shouldn't be issues as the Odroid XU4 is an armv7 host, hence no need for an cross-compilation or anything that makes it harder to build the official ArchlinuxARM kernel. But the system tells me after the compilation:
$this->bbcode_second_pass_code('', 'make[4]: *** No rule to make target 'firmware/regulatory.db', needed by 'drivers/base/firmware_loader/builtin/regulatory.db.gen.o'. Stop.
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [scripts/Makefile.build:549: drivers/base/firmware_loader/builtin] Error 2
make[2]: *** [scripts/Makefile.build:549: drivers/base/firmware_loader] Error 2
make[1]: *** [scripts/Makefile.build:549: drivers/base] Error 2
make: *** [Makefile:1846: drivers] Error 2
make: *** Waiting for unfinished jobs....
==> ERROR: A failure occurred in build().
Aborting...')

For troubleshooting:
$this->bbcode_second_pass_code('', '$ git log')
tells me:
$this->bbcode_second_pass_code('', 'commit e300d87f78f2cf683ebf0f1cbad6635ebef76dc2 (HEAD -> master, origin/master, origin/HEAD)
Author: Kevin Mihelich <kevin@archlinuxarm.org>
Date: Sun Mar 6 04:47:34 2022 +0000

community/openimageio: fix
...')
So code is completely upstream.

Am I missing any packages that I need to install for compiling the linux kernel on an ArchlinuxARM?
Last edited by psiegl on Sun Mar 06, 2022 9:10 pm, edited 2 times in total.
psiegl
 
Posts: 2
Joined: Sun Mar 06, 2022 4:23 pm

Re: Can't build official ArchlinuxARM armv7 kernel / uImage

Postby robg » Sun Mar 06, 2022 6:25 pm

This is merely a guess (an educated one, hopefully): The file "firmware/regulatory.db" is not meant to be "built", but rather to be downloaded on https://kernel.org/pub/software/network/wireless-regdb/ (see the explanation here.) If it is not downloaded automatically as part of the package building process, it seems that you should provide it yourself prior to building.

Hope this gives you a new lead, but I suggest you also wait for an expert to weigh in her/his opinion.

Appendum: The file is provided by the "wireless-regdb" package; not sure if this helps in the build process though.
robg
 
Posts: 186
Joined: Tue Jan 05, 2021 8:22 am

Re: Can't build official ArchlinuxARM armv7 kernel / uImage

Postby psiegl » Sun Mar 06, 2022 10:19 pm

Thanks for the hint. I installed
$this->bbcode_second_pass_code('', '# pacman -S --noconfirm wireless-regdb')
And modified the following:
$this->bbcode_second_pass_code('', 'diff --git a/core/linux-armv7/PKGBUILD b/core/linux-armv7/PKGBUILD
index cd1238d51..1529ac1b6 100644
--- a/core/linux-armv7/PKGBUILD
+++ b/core/linux-armv7/PKGBUILD
@@ -14,7 +14,7 @@ rcnrel=armv7-x15
arch=('armv7h')
url="http://www.kernel.org/"
license=('GPL2')
-makedepends=('xmlto' 'docbook-xsl' 'kmod' 'inetutils' 'bc' 'git' 'uboot-tools' 'vboot-utils' 'dtc')
+makedepends=('xmlto' 'docbook-xsl' 'kmod' 'inetutils' 'bc' 'git' 'uboot-tools' 'vboot-utils' 'dtc' 'wireless-regdb')
options=('!strip')
source=("https://www.kernel.org/pub/linux/kernel/v5.x/${_srcname}.tar.xz"
"https://www.kernel.org/pub/linux/kernel/v5.x/patch-${pkgver}.xz"
@@ -47,7 +47,7 @@ md5sums=('e6680ce7c989a3efe58b51e3f3f0bf93'
'd23f935b23d571cb8895fac5bd3c713b'
'7a8781dc078b105aeaf725a7a2e4c385'
'892ad2ffda3f3fe02a3108ed7767f542'
- '521dff5b91c9496c0ca1e96e1742f315'
+ 'SKIP'
'0963ff6490be16935370812fc75fa065'
'61c5ff73c136ed07a7aadbf58db3d96a'
'584777ae88bce2c5659960151b64c7d8'
diff --git a/core/linux-armv7/config b/core/linux-armv7/config
index 9001fa1a2..48c28e55c 100644
--- a/core/linux-armv7/config
+++ b/core/linux-armv7/config
@@ -2154,7 +2154,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
CONFIG_FW_LOADER=y
CONFIG_FW_LOADER_PAGED_BUF=y
CONFIG_EXTRA_FIRMWARE="regulatory.db regulatory.db.p7s am335x-pm-firmware.elf am335x-bone-scale-data.bin am335x-evm-scale-data.bin am43x-evm-scale-data.bin"
-CONFIG_EXTRA_FIRMWARE_DIR="firmware"
+CONFIG_EXTRA_FIRMWARE_DIR="/usr/lib/firmware"
CONFIG_FW_LOADER_USER_HELPER=y
# CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
CONFIG_FW_LOADER_COMPRESS=y')
Now the makepkg fails here:
$this->bbcode_second_pass_code('', 'make[4]: *** No rule to make target '/usr/lib/firmware/am335x-pm-firmware.elf', needed by 'drivers/base/firmware_loader/builtin/am335x-pm-firmware.elf.gen.o'. Stop.
UPD drivers/base/firmware_loader/builtin/am335x-pm-firmware.elf.gen.S
make[3]: *** [scripts/Makefile.build:549: drivers/base/firmware_loader/builtin] Error 2
make[2]: *** [scripts/Makefile.build:549: drivers/base/firmware_loader] Error 2
make[1]: *** [scripts/Makefile.build:549: drivers/base] Error 2
make: *** [Makefile:1846: drivers] Error 2
make: *** Waiting for unfinished jobs....')
I found someone stating the same issue as well: viewtopic.php?f=48&t=5777
This person also wonders, why a PKGBUILD does not contain all dependencies properly?

For the am335x-pm-firmware.elf I do not even find an Archlinux package. How come PKGBUILD does not download this file then? I even wonder how this package builds in Archlinux CI system?


EDIT: It seems that the missing files are located here: https://git.ti.com/cgit/processor-firmw ... 5852b8eea7 It also seems, that the highlighted binary is tight to the BeagleBoard (https://github.com/beagleboard/am33x-cm ... master/bin). Especially by analysing:
$this->bbcode_second_pass_code('', ' CONFIG_EXTRA_FIRMWARE="regulatory.db regulatory.db.p7s am335x-pm-firmware.elf am335x-bone-scale-data.bin am335x-evm-scale-data.bin am43x-evm-scale-data.bin"')
It seems that the am*-files are a bit outdated, as the newer release of TI provide solely am335x-pm-firmware.elf and am335x-pm-firmware.bin (See https://git.ti.com/cgit/processor-firmw ... e/tree/bin and https://github.com/beagleboard/am33x-cm ... master/bin).

EDIT2: It seems as if the binaries for the beagleboard are a branch of TIs most recent repository:
$this->bbcode_second_pass_code('', 'commit 6a849767df85ce9399494f53fb5c753665396653 (HEAD, origin/ti-v4.1.y-next)
Author: Dave Gerlach <d-gerlach@ti.com>
Date: Mon May 8 14:50:46 2017 -0500

CM3: Firmware release 0x193

This version, 0x193, includes the following changes:
- Fix hwo the EMIF gets configured during system resume so that
it is not enabled twice and make sure it always gets enabled
from withint the firmware path for lpddr2 on am437x.
- Fix a typo in the VTP enable sequence so that the VTP filter
value is not mistakenly cleared during programming.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
')
$this->bbcode_second_pass_code('', '[ti-amx3-cm3-pm-firmware]$ ls bin/
am335x-bone-scale-data.bin am335x-pm-firmware.bin am43x-evm-scale-data.bin
am335x-evm-scale-data.bin am335x-pm-firmware.elf')


EDIT3: Created a MR to fix the issue: https://github.com/archlinuxarm/PKGBUILDs/pull/1906
psiegl
 
Posts: 2
Joined: Sun Mar 06, 2022 4:23 pm

Re: Can't build official ArchlinuxARM armv7 kernel / uImage

Postby JVital » Thu Mar 17, 2022 2:34 am

It looks like we went down this road at almost the same time - you just beat me to it by a few days.

I found the answer buried in your Github issue at https://github.com/archlinuxarm/PKGBUILDs/pull/1906. The key is his statement "Don't build inside the git clone, the 'git apply' statements for the patches won't work if you do that."

He's right - when you do the git clone, you then need to copy the linux-armv7 folder somewhere else. Then, cd into the folder and run "git status" just to make triple sure you're not still in a git repo. Finally, run makepkg and it will build like magic.

Maybe I'm blind, illiterate, or just plain dumb, but I didn't see this documented anywhere.
JVital
 
Posts: 2
Joined: Thu Mar 17, 2022 2:00 am


Return to ARMv7h

Who is online

Users browsing this forum: No registered users and 7 guests