tbsdtv / linux_media

TBS linux open source drivers
https://github.com/tbsdtv/linux_media/wiki
Other
169 stars 79 forks source link

Build fails on Raspberry Pi 4 32-bit #319

Closed LukeLR closed 9 months ago

LukeLR commented 10 months ago

Hi everyone,

after a kernel update, my TBS5580 stopped showing up, so I tried building the modules again. Both updating my old build environment with git pull as well as following the installation steps in the wiki, make allyesconfig fails with:

File not found: /lib/modules/6.1.47-v8+/build/.config at ./scripts/make_kconfig.pl line 33, <IN> line 4.

So I copy my media_build/v4l/.config there, then it fails with

pi@mediapi:~/git/media_build $ make allyesconfig
make -C /home/pi/git/media_build/v4l allyesconfig
make[1]: Entering directory '/home/pi/git/media_build/v4l'
make[2]: Entering directory '/home/pi/git/media_build/linux'
Syncing with dir ../../media
Patches for 6.1.47-v8+ already applied.
make[2]: Leaving directory '/home/pi/git/media_build/linux'
./scripts/make_kconfig.pl /lib/modules/6.1.47-v8+/build /lib/modules/6.1.47-v8+/build 1
Preparing to compile for kernel version 6.1.47
You appear to have loadable modules turned off in your kernel.  You can
not compile the v4l-dvb drivers, as modules, and use them with a kernel
that has modules disabled.

If you want to compile these drivers into your kernel, you should
use 'make kernel-links' to link the source for these drivers into
your kernel tree.  Then configure and compile the kernel.
make[1]: *** [Makefile:376: allyesconfig] Error 255
make[1]: Leaving directory '/home/pi/git/media_build/v4l'
make: *** [Makefile:26: allyesconfig] Error 2

Any ideas what "loadable modules turned off" means? I'm running the stock Raspbian updated to the latest version, so I don't understand where this is coming from. Am I missing something? Thanks!

crazycat69 commented 10 months ago

maybe old kernel 6.1.47-v8+ deleted ?

tmn505 commented 10 months ago

Remove media_build/v4l/.version or change SRCDIR path to new kernel in that file. And don't forget to remove Your .config.

LukeLR commented 9 months ago

I completely wiped and reinstalled raspbian on the Pi 4, the error about the missing .config appears again, but this time, I copied the config over from a Pi 3 which apparently has such a config in /lib/modules/6.1.21-v7+/build/. However, now it's failing with

make[2]: Entering directory '/usr/lib/modules/6.1.21-v8+/build'
make[2]: *** No rule to make target 'modules'.  Stop.

So while I'm not sure if the loadable modules problem is fixed, or if it's just a new error that's occurring first. However, it still doesn't build. Any ideas?

tmn505 commented 9 months ago

It appears as if You don't have any linux-headers installed?

LukeLR commented 9 months ago

Thanks for the suggeetion. however, raspberry-kernel-headers is installed and up-to-Date, so that's probably not the cause. Any other ideas?

On 10. Sep 2023, at 13:56, tmn505 @.***> wrote:

 It appears as if You don't have any linux-headers installed?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.

tmn505 commented 9 months ago

Without whole console output at which this occurs it's hard to guess. Anyway, clone media_build to new dir and run ./build (You'll probably have to install packages it asks).

LukeLR commented 9 months ago

E-Mail replies don't support markdown, see output below.

LukeLR commented 9 months ago

Same error message when running ./build from a fresh media_build clone. See the full output attached:

Output ``` raspberrypi:~/git/media_build $ ./build Checking if the needed tools for Raspbian GNU/Linux 11 (bullseye) are available Needed package dependencies are met. ************************************************************ * This script will download the latest tarball and build it* * Assuming that your kernel is compatible with the latest * * drivers. If not, you'll need to add some extra backports,* * ./backports/ directory. * * It will also update this tree to be sure that all compat * * bits are there, to avoid compilation failures * ************************************************************ ************************************************************ * All drivers and build system are under GPLv2 License * * Firmware files are under the license terms found at: * * https://github.com/tbsdtv/media_build/releases/download/latest * * Please abort in the next 5 secs if you don't agree with * * the license * ************************************************************ Not aborted. It means that the licence was agreed. Proceeding... **************************** Updating the building system **************************** hint: Pulling without specifying how to reconcile divergent branches is hint: discouraged. You can squelch this message by running one of the following hint: commands sometime before your next pull: hint: hint: git config pull.rebase false # merge (the default strategy) hint: git config pull.rebase true # rebase hint: git config pull.ff only # fast-forward only hint: hint: You can replace "git config" with "git config --global" to set a default hint: preference for all repositories. You can also pass --rebase, --no-rebase, hint: or --ff-only on the command line to override the configured default per hint: invocation. From https://github.com/tbsdtv/media_build * branch master -> FETCH_HEAD Already up to date. make: Entering directory '/home/lukas/git/media_build/linux' wget https://github.com/tbsdtv/media_build/releases/download/latest/linux-media.tar.bz2.md5 -O linux-media.tar.bz2.md5.tmp --2023-09-11 01:26:35-- https://github.com/tbsdtv/media_build/releases/download/latest/linux-media.tar.bz2.md5 Resolving github.com (github.com)... 140.82.121.3 Connecting to github.com (github.com)|140.82.121.3|:443... connected. HTTP request sent, awaiting response... 302 Found Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/61525972/f43f6471-805c-47ad-b55f-14c3825d8a46?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230911%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230911T002636Z&X-Amz-Expires=300&X-Amz-Signature=9bb8d1bae4b5d99733c0644ce7ebc49bc4105fed3490b53585702c164eff3566&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=61525972&response-content-disposition=attachment%3B%20filename%3Dlinux-media.tar.bz2.md5&response-content-type=application%2Foctet-stream [following] --2023-09-11 01:26:36-- https://objects.githubusercontent.com/github-production-release-asset-2e65be/61525972/f43f6471-805c-47ad-b55f-14c3825d8a46?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230911%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230911T002636Z&X-Amz-Expires=300&X-Amz-Signature=9bb8d1bae4b5d99733c0644ce7ebc49bc4105fed3490b53585702c164eff3566&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=61525972&response-content-disposition=attachment%3B%20filename%3Dlinux-media.tar.bz2.md5&response-content-type=application%2Foctet-stream Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.111.133, 185.199.110.133, 185.199.109.133, ... Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.111.133|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 91 [application/octet-stream] Saving to: ‘linux-media.tar.bz2.md5.tmp’ linux-media.tar. 100%[==========>] 91 --.-KB/s in 0s 2023-09-11 01:26:36 (2.14 MB/s) - ‘linux-media.tar.bz2.md5.tmp’ saved [91/91] cat: linux-media.tar.bz2.md5: No such file or directory --2023-09-11 01:26:36-- https://github.com/tbsdtv/media_build/releases/download/latest/linux-media.tar.bz2 Resolving github.com (github.com)... 140.82.121.3 Connecting to github.com (github.com)|140.82.121.3|:443... connected. HTTP request sent, awaiting response... 302 Found Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/61525972/bdb19af2-8772-4909-8a95-b33acd0fa789?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230911%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230911T002636Z&X-Amz-Expires=300&X-Amz-Signature=ebe6d28a6df9047faff9217dbf3ff2b79b6487b6324cd2d9f5c902f58389cb02&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=61525972&response-content-disposition=attachment%3B%20filename%3Dlinux-media.tar.bz2&response-content-type=application%2Foctet-stream [following] --2023-09-11 01:26:36-- https://objects.githubusercontent.com/github-production-release-asset-2e65be/61525972/bdb19af2-8772-4909-8a95-b33acd0fa789?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230911%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230911T002636Z&X-Amz-Expires=300&X-Amz-Signature=ebe6d28a6df9047faff9217dbf3ff2b79b6487b6324cd2d9f5c902f58389cb02&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=61525972&response-content-disposition=attachment%3B%20filename%3Dlinux-media.tar.bz2&response-content-type=application%2Foctet-stream Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.111.133, 185.199.110.133, 185.199.109.133, ... Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.111.133|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 8269421 (7.9M) [application/octet-stream] Saving to: ‘linux-media.tar.bz2’ linux-media.tar. 100%[==========>] 7.89M 9.07MB/s in 0.9s 2023-09-11 01:26:37 (9.07 MB/s) - ‘linux-media.tar.bz2’ saved [8269421/8269421] make: Leaving directory '/home/lukas/git/media_build/linux' make: Entering directory '/home/lukas/git/media_build/linux' tar xfj linux-media.tar.bz2 rm -f .patches_applied .linked_dir .git_log.md5 make: Leaving directory '/home/lukas/git/media_build/linux' ********************************************************** * Downloading firmwares from linuxtv.org. * ********************************************************** --2023-09-11 01:26:44-- https://github.com/tbsdtv/media_build/releases/download/latest/dvb-firmwares.tar.bz2 Resolving github.com (github.com)... 140.82.121.3 Connecting to github.com (github.com)|140.82.121.3|:443... connected. HTTP request sent, awaiting response... 302 Found Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/61525972/e798a0da-6b8a-461c-850f-845a851b88c6?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230911%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230911T002644Z&X-Amz-Expires=300&X-Amz-Signature=2e6c37dd72dbba2188a3f56ba68ff413fbce7f44d1e900f966ef4bdec3af54ae&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=61525972&response-content-disposition=attachment%3B%20filename%3Ddvb-firmwares.tar.bz2&response-content-type=application%2Foctet-stream [following] --2023-09-11 01:26:44-- https://objects.githubusercontent.com/github-production-release-asset-2e65be/61525972/e798a0da-6b8a-461c-850f-845a851b88c6?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230911%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230911T002644Z&X-Amz-Expires=300&X-Amz-Signature=2e6c37dd72dbba2188a3f56ba68ff413fbce7f44d1e900f966ef4bdec3af54ae&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=61525972&response-content-disposition=attachment%3B%20filename%3Ddvb-firmwares.tar.bz2&response-content-type=application%2Foctet-stream Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.108.133, 185.199.111.133, 185.199.110.133, ... Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.108.133|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 1175964 (1.1M) [application/octet-stream] Saving to: ‘dvb-firmwares.tar.bz2’ dvb-firmwares.ta 100%[==========>] 1.12M 6.39MB/s in 0.2s 2023-09-11 01:26:45 (6.39 MB/s) - ‘dvb-firmwares.tar.bz2’ saved [1175964/1175964] dvb-demod-avl6882.fw dvb-demod-drxk-pctv.fw dvb-demod-gx1503B.fw dvb-demod-m88ds3103b.fw dvb-demod-m88ds3103.fw dvb-demod-m88rs6000.fw dvb-demod-m88rs6060.fw dvb-demod-mn88472-02.fw dvb-demod-mn88473-01.fw dvb-demod-si2168-01.fw dvb-demod-si2168-02.fw dvb-demod-si2168-a20-01.fw dvb-demod-si2168-a30-01.fw dvb-demod-si2168-b40-01.fw dvb-demod-si2168-d60-01.fw dvb-demod-si2183-b60-01.fw dvb-fe-bcm3510-01.fw dvb-fe-cx24116.fw dvb-fe-cx24117.fw dvb-fe-drxj-mc-1.0.8.fw dvb-fe-drxj-mc-vsb-1.0.8.fw dvb-fe-drxj-mc-vsb-qam-1.0.8.fw dvb-fe-ds3000.fw dvb-fe-ds300x.fw dvb-fe-ds3103.fw dvb-fe-mxl58x.fw dvb-fe-mxl5xx.fw dvb-fe-or51132-qam.fw dvb-fe-or51132-vsb.fw dvb-fe-or51211.fw dvb-fe-rs6000.fw dvb-fe-tda10045.fw dvb-fe-tda10046.fw dvb-fe-tda10048-1.0.fw dvb-fe-tda10071.fw dvb-fe-xc4000-1.4.1.fw dvb-fe-xc5000-1.6.114.fw dvb-fe-xc5000c-4.1.30.7.fw dvb-tuner-si2141-a10-01.fw dvb-tuner-si2157-a30-01.fw dvb-tuner-si2157-a30-05.fw dvb-tuner-si2158-a20-01.fw dvb-usb-avertv-a800-02.fw dvb-usb-bluebird-01.fw dvb-usb-dib0700-1.20.fw dvb-usb-dibusb-5.0.0.11.fw dvb-usb-dibusb-6.0.0.8.fw dvb-usb-dtt200u-01.fw dvb-usb-dw2101.fw dvb-usb-dw2102.fw dvb-usb-dw2104.fw dvb-usb-dw3101.fw dvb-usb-id5230.fw dvb-usb-id5301.fw dvb-usb-id5520se.fw dvb-usb-id5530.fw dvb-usb-id5580.fw dvb-usb-id5590.fw dvb-usb-id5930.fw dvb-usb-id5931.fw dvb-usb-it9135-01.fw dvb-usb-it9135-02.fw dvb-usb-p1100.fw dvb-usb-p1100-old.fw dvb-usb-p7500.fw dvb-usb-pctv-400e-01.fw dvb-usb-pctv-450e-01.fw dvb-usb-pctv-452e-01.fw dvb-usb-s620.fw dvb-usb-s630.fw dvb-usb-s660.fw dvb-usb-sb340.fw dvb-usb-SkyStar_USB_HD_FW_v17_63.HEX.fw dvb-usb-tbsqbox-dvbc.fw dvb-usb-tbsqbox-id2601.fw dvb-usb-tbsqbox-id5220.fw dvb-usb-tbsqbox-id5520.fw dvb-usb-tbsqbox-id5521.fw dvb-usb-tbsqbox-id5680.fw dvb-usb-tbsqbox-id5880.fw dvb-usb-tbsqbox-id5881.fw dvb-usb-tbsqbox-id5910.fw dvb-usb-tbsqbox-id5920.fw dvb-usb-tbsqbox-id5921.fw dvb-usb-tbsqbox-id5922.fw dvb-usb-tbsqbox-id5925.fw dvb-usb-tbsqbox-id5927.fw dvb-usb-tbsqbox-id5928.fw dvb-usb-tbsqbox-id5980.fw dvb-usb-terratec-h5-drxk.fw dvb-usb-terratec-h7-az6007.fw dvb-usb-terratec-h7-drxk.fw dvb-usb-tt-s2400-01.fw dvb-usb-umt-010-02.fw dvb-usb-vp702x-01.fw dvb-usb-vp7045-01.fw dvb-usb-wt220u-01.fw dvb-usb-wt220u-02.fw sms1xxx-hcw-55xxx-dvbt-02.fw sms1xxx-hcw-55xxx-isdbt-02.fw sms1xxx-nova-a-dvbt-01.fw sms1xxx-nova-b-dvbt-01.fw sms1xxx-stellar-dvbt-01.fw v4l-cx231xx-avcore-01.fw v4l-cx23418-apu.fw v4l-cx23418-cpu.fw v4l-cx23418-dig.fw v4l-cx23885-avcore-01.fw v4l-cx23885-enc-broken.fw v4l-cx23885-enc.fw v4l-cx25840.fw ****************** * Start building * ****************** make -C /home/lukas/git/media_build/v4l allyesconfig make[1]: Entering directory '/home/lukas/git/media_build/v4l' No version yet, using 6.1.21-v8+ make[2]: Entering directory '/home/lukas/git/media_build/linux' Applying patches for kernel 6.1.21-v8+ patch -s -f -N -p1 -i ../backports/api_version.patch patch -s -f -N -p1 -i ../backports/pr_fmt.patch patch -s -f -N -p1 -i ../backports/debug.patch patch -s -f -N -p1 -i ../backports/drx39xxj.patch patch -s -f -N -p1 -i ../backports/ccs.patch patch -s -f -N -p1 -i ../backports/rc-cec.patch patch -s -f -N -p1 -i ../backports/v6.4_pin_user_pages.patch patch -s -f -N -p1 -i ../backports/v6.3_class_create.patch patch -s -f -N -p1 -i ../backports/v6.3_check_endpoint.patch patch -s -f -N -p1 -i ../backports/v6.2_class.patch patch -s -f -N -p1 -i ../backports/v6.2_remove.patch patch -s -f -N -p1 -i ../backports/v6.2_probe.patch patch -s -f -N -p1 -i ../backports/v6.2_v4l2-core.patch patch -s -f -N -p1 -i ../backports/v6.1_class.patch patch -s -f -N -p1 -i ../backports/v6.1_i2c_probe.patch patch -s -f -N -p1 -i ../backports/v6.1_videobuf2.patch patch -s -f -N -p1 -i ../backports/v6.1_timer.patch patch -s -f -N -p1 -i ../backports/v6.1_ipu3.patch Patched drivers/media/dvb-core/dvbdev.c Patched drivers/media/v4l2-core/v4l2-dev.c Patched drivers/media/rc/rc-main.c make[2]: Leaving directory '/home/lukas/git/media_build/linux' ./scripts/make_kconfig.pl /lib/modules/6.1.21-v8+/build /lib/modules/6.1.21-v8+/build 1 Preparing to compile for kernel version 6.1.21 ***WARNING:*** You do not have the full kernel sources installed. This does not prevent you from building the v4l-dvb tree if you have the kernel headers, but the full kernel source may be required in order to use make menuconfig / xconfig / qconfig. If you are experiencing problems building the v4l-dvb tree, please try building against a vanilla kernel before reporting a bug. Vanilla kernels are available at http://kernel.org. On most distros, this will compile a newly downloaded kernel: cp /boot/config-`uname -r` /.config cd make all modules_install install Please see your distro's web site for instructions to build a new kernel. WARNING: This is the V4L/DVB backport tree, with experimental drivers backported to run on legacy kernels from the development tree at: http://git.linuxtv.org/media-tree.git. It is generally safe to use it for testing a new driver or feature, but its usage on production environments is risky. Don't use it in production. You've been warned. VIDEO_ROCKCHIP_ISP1: Requires at least kernel 9.255.255 VIDEO_XILINX: Requires at least kernel 9.255.255 VIDEO_OV772X: Requires at least kernel 9.255.255 VIDEO_OV9650: Requires at least kernel 9.255.255 VIDEO_TC358746: Requires at least kernel 9.255.255 INTEL_ATOMISP: Requires at least kernel 9.255.255 VIDEO_IPU3_IMGU: Requires at least kernel 9.255.255 Created default (all yes) .config file ./scripts/fix_kconfig.pl make[1]: Leaving directory '/home/lukas/git/media_build/v4l' make -C /home/lukas/git/media_build/v4l make[1]: Entering directory '/home/lukas/git/media_build/v4l' scripts/make_makefile.pl ./scripts/make_myconfig.pl [ ! -f "./config-mycompat.h" ] && echo "/* empty config-mycompat.h */" > "./config-mycompat.h" || true perl scripts/make_config_compat.pl /lib/modules/6.1.21-v8+/build ./.myconfig ./config-compat.h make -C firmware prep creating symbolic links... make[2]: Entering directory '/home/lukas/git/media_build/v4l/firmware' make[2]: Nothing to be done for 'prep'. make[2]: Leaving directory '/home/lukas/git/media_build/v4l/firmware' make -C firmware make[2]: Entering directory '/home/lukas/git/media_build/v4l/firmware' make[2]: Nothing to be done for 'default'. make[2]: Leaving directory '/home/lukas/git/media_build/v4l/firmware' Kernel build directory is /lib/modules/6.1.21-v8+/build make -C ../linux apply_patches make[2]: Entering directory '/home/lukas/git/media_build/linux' Patches for 6.1.21-v8+ already applied. make[2]: Leaving directory '/home/lukas/git/media_build/linux' make -C /lib/modules/6.1.21-v8+/build M=/home/lukas/git/media_build/v4l modules make[2]: Entering directory '/usr/lib/modules/6.1.21-v8+/build' make[2]: *** No rule to make target 'modules'. Stop. make[2]: Leaving directory '/usr/lib/modules/6.1.21-v8+/build' make[1]: *** [Makefile:53: default] Error 2 make[1]: Leaving directory '/home/lukas/git/media_build/v4l' make: *** [Makefile:26: all] Error 2 build failed at ./build line 554 ```
LukeLR commented 9 months ago

Solved it! The issue was that the 32 bit Raspberry Pi OS does not supply kernel headers for the ARMv8 architecture used by Raspberry Pi 4, although being the default option. Switching to 64 bit Raspberry Pi OS fixed the issue, as now the /lib/modules/$(uname -r)/build folder exists. Filed an upstream issue on that: raspberrypi/linux#5601 Thanks for all your help!