在运行 Ubuntu Pi 22.04 服务器的 arm64 Pi 4 上安装 Rpi-Userland

在运行 Ubuntu Pi 22.04 服务器的 arm64 Pi 4 上安装 Rpi-Userland

我正在尝试在 Ubuntu Pi 22.04 上构建 tvheadend。

ubuntu@ubuntu:~/build/tvheadend/master$ uname -a
Linux ubuntu 5.15.0-1015-raspi #17-Ubuntu SMP PREEMPT Mon Sep 12 13:14:51 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux
ubuntu@ubuntu:~/build/tvheadend/master$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.1 LTS"

但最后我收到了错误:

...
.....
.......
Markdown: docs/wizard/network.md
Markdown: docs/wizard/status.md
CC              src/docs.o
CC              tvheadend
/usr/bin/ld: cannot find -lprofiler: No such file or directory
/usr/bin/ld: cannot find -ltcmalloc: No such file or directory
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:712: /usr/local/src/tvheadend/build.linux/tvheadend] Error 1
make[3]: Leaving directory '/usr/local/src/tvheadend'
make[2]: *** [Makefile:110: ffmpeg_all] Error 2

当我搜索这些文件时,似乎我没有它们:

ubuntu@ubuntu:~$ ls -l /usr/lib | grep profiler
ubuntu@ubuntu:~$ ls -l /usr/lib | grep malloc  
ubuntu@ubuntu:~$ ls -l /opt/vc/lib | grep profiler
ubuntu@ubuntu:~$ ls -l /opt/vc/lib | grep malloc  
ubuntu@ubuntu:~$

我的理解是它们是 rpi-userland 文件/实用程序,我需要 64 位版本的 Pi 4 (arm64)。有一种方法可以使用 snap 命令安装 rpiuserland,但这对我来说不起作用:

ubuntu@ubuntu:~$ sudo snap install rpi-userland --edge
error: snap "rpi-userland" is not available on edge for this architecture (arm64) but exists on
       other architectures (amd64, armhf).

我搜索了一下并尝试使用这个脚本构建一个 rpi-userland,但它在我的系统上不起作用: https://gist.github.com/satmandu/c462ab301cbe09bd6e7cf4db7f626727

看起来这里的 Jammy 中有一个 raspberrypi-userland 源包…… https://launchpad.net/ubuntu/jammy/+source/raspberrypi-userland
但我不知道该怎么办?

有人知道如何在 arm64 Ubuntu Pi 服务器 22.04 上安装 rpi-userland 文件吗?

任何帮助都非常感谢!

柔性

答案1

事实证明这些错误与它们所属的 rpi-userland 文件无关Google's gperftools profiler

我的选择是使用--disable-gperftools构建选项构建 tvheadend,或者安装对它们的支持:

# sudo apt install gperftools libgoogle-perftools-dev

在 Pi 4 上运行的 Ubuntu 22.04 64 位上安装 rpi-userland
如上所述,SNAP 命令目前无法在此环境中安装 rpi-userland。

此外,目前 rpi-userland 不支持在 Pi 4 上运行的任何 64 位操作系统。

您可以下载并交叉编译32 位 rpi-userland 源代码在你的 64 位系统上。这个 GitHub 页面有一个脚本build_arm64_rpi_userland.sh可以做到这一点。它会生成一个 .deb 文件,然后你可以像这样安装它:

# sudo dpkg -i /home/ubuntu/workdir/output/rpiuserland_54fd97a_arm64.deb

最初我遇到了一些问题,需要运行以下命令:

# sudo apt --fix-broken install

• 然后再次尝试...

# sudo apt install libgcc1-armhf-cross
# sudo apt install libc6-armhf-cross
# sudo apt install libstdc++6-armhf-cross
# sudo dpkg -i rpiuserland_54fd97a_arm64.deb

问题是您无法获得完整的 rpi-userland 功能,部分库可以工作,但不是全部。例如,不支持 mmal。

ubuntu@ubuntu:~$ dpkg -L rpiuserland | grep mmal 
/opt/vc/lib/pkgconfig/mmal.pc 
/opt/vc/src/hello_pi/hello_mmal_encode 
/opt/vc/src/hello_pi/hello_mmal_encode/Makefile 
/opt/vc/src/hello_pi/hello_mmal_encode/mmal_encode.c 

ubuntu@ubuntu:~$ dpkg -L rpiuserland | grep bcm 
/opt/vc/include/bcm_host.h 
/opt/vc/lib/libbcm_host.so 
/opt/vc/lib/pkgconfig/bcm_host.pc

ubuntu@ubuntu:~$ ls -l /opt/vc/lib/ | grep mmal 
ubuntu@ubuntu:~$ 

例如,/opt/vc/lib 中没有可用的 mmal 库

libmmal_components.so
libmmal_core.so
libmmal.so
libmmal_util.so
libmmal_vc_client.so

就我而言,我尝试构建具有 mmal 支持的 tvheadend,但构建仍然失败: ERROR: mmal not found 这是因为 mmal 内容从未移植到 64 位内核,并且据我所知已被弃用。

相关内容