内核模块在 Android 设备上找不到固件文件;它应该在哪里?

发布于 2024-11-07 13:03:05 字数 461 浏览 9 评论 0原文

我在 Android 设备上正确放置固件时遇到问题,我不断收到:

<3>[ 3590.997375] usb 3-1.4: ath9k_htc: Firmware - htc_7010.fw not found

如果在运行 Ubuntu 的标准 Linux 机器上,我将 htc_7010.fw 放在 /lib/firmware 中,则不会收到此错误。

但是,如果我将此固件放在 Android 上的 /lib/firmware 中,我仍然会收到错误。我已尝试了以下所有目录,但仍然收到错误:

/lib/firmware
/etc/firmware
/system/lib/modules
/system/lib/firmware
/system/etc

没有这样的运气...什么决定了固件应该在哪里,以及如何确定它正在扫描哪些目录以查找固件?

I am having trouble placing firmware properly on an Android device, I keep getting:

<3>[ 3590.997375] usb 3-1.4: ath9k_htc: Firmware - htc_7010.fw not found

If on a standard linux machine running Ubuntu, I place htc_7010.fw in /lib/firmware then I do not get this error.

However, if I place this firmware in /lib/firmware on Android, I still get the error. I have tried all of the following directories and still receive the error:

/lib/firmware
/etc/firmware
/system/lib/modules
/system/lib/firmware
/system/etc

No such luck... what dictates where the firmware should be, and how could I determine which directories it is scanning for the firmware?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

Hello爱情风 2024-11-14 13:03:05

在 Android 上(无论如何 ICS),它有自己的守护进程/服务(或者任何你想调用的名称)来管理热插拔事件,包括固件请求。在 /system/core/init/devices.c 中,有两个 #define 指定检查固件的位置:

#define FIRMWARE_DIR1   "/etc/firmware"
#define FIRMWARE_DIR2   "/vendor/firmware"

在我的初始构建中ICS 文件系统,/etc/firmware 不存在(etc 目录似乎是在启动/初始化时创建的符号链接)。我必须将固件放置在 NFS 安装的 rootfs 上的目录是 /system/etc/firmware

执行此操作后,来自我的模块的 request_firmware() 调用成功完成。

On Android (ICS anyways) it has its own daemon/service (or whatever you want to call it) to manage hotplug events, including firmware requests. In <android>/system/core/init/devices.c, there are two #defines that specify locations where firmware will be checked:

#define FIRMWARE_DIR1   "/etc/firmware"
#define FIRMWARE_DIR2   "/vendor/firmware"

On my initial build of the ICS filesystem, /etc/firmware didn't exist (and the etc directory seems to be a symbolic link created at boot/init time). The directory I had to place firmware in on my NFS mounted rootfs was <mount point>/system/etc/firmware

After doing this, request_firmware() calls from my module successfully completed.

无边思念无边月 2024-11-14 13:03:05

我的固件也有类似的问题:down3.bin
(之前,我当然已经用 # insmod 插入了我的模块 "io_ti.ko"

当我插入我的设备(USB-RS232 转换器,Digi International EdgeportTI1端口适配器)在我的 Android 平板电脑(Samsung Galaxy Tab 2)上,他无法在“linux android 适配目录”中找到他的固件。
所以,像你一样,我尝试将我的 "down3.bin" 放入:

/lib/firmware
/etc/firmware
/system/lib/modules
/system/lib/firmware
/system/etc

with :# dmesg 我仍然有错误:

<6>[00000.00000] io_ti 1-1:1.0:检测到 Edgeport TI 1 端口适配器转换器
<6>[00000.00000] 无法加载图像“edgeport/down3.bin”err-2
<6>[00000.00000] io_ti:1-1:1.0 的探测失败,错误为 -5
err -2 = [ENOENT] = No such file or directory.

事实上,就像你提到的:

/system/core/init/devices.c中,有两个#define
指定检查固件的位置:

#define FIRMWARE_DIR1 "/etc/firmware"
#define FIRMWARE_DIR2“/供应商/固件”

- 因此您必须将固件放入这些目录之一。它
希望对我来说工作正常。


I had a similar problem with my firmware named : down3.bin
(Beforehand, I had insert my module "io_ti.ko" with # insmod of course)

When I plugged my device (USB-RS232 converter, Digi International EdgeportTI1 port adapter) on my Android tablet (Samsung Galaxy Tab 2), he was unable to find his firmware in "linux android adapted directories".
So, like you, I tried to put my "down3.bin" in:

/lib/firmware
/etc/firmware
/system/lib/modules
/system/lib/firmware
/system/etc

with :# dmesg I still had error :

<6>[00000.00000] io_ti 1-1:1.0 : Edgeport TI 1 port adapter converter detected
<6>[00000.00000] Failed to load image "edgeport/down3.bin" err-2
<6>[00000.00000] io_ti:probe of 1-1:1.0 failed with error -5
err -2 = [ENOENT] = No such file or directory.

In fact, like you mentionned :

In <android>/system/core/init/devices.c, there are two #defines
that specify locations where firmware will be checked:

#define FIRMWARE_DIR1   "/etc/firmware"
#define FIRMWARE_DIR2   "/vendor/firmware"

- So you have to put your firmware in one of these directories. It
worked properly for me, hopefully.


千柳 2024-11-14 13:03:05

内核执行用户空间脚本来加载固件。
检查脚本是否位于正确的位置。

  1. 检查内核在哪个位置查找脚本。
    / # cat /proc/sys/kernel/hotplug.默认位置是“/sbin/hotplug”。
  2. 检查此位置是否有内核正在寻找的脚本。
    在 Android 上,脚本应该是“/system/busybox/sbin/mdev”,因此如果不是,您可以将“/proc/sys/kernel/hotplug”设置为此。

The kernel executes a user-space script to load the firmware.
Check if you have the script on the right location.

  1. Check the which location the kernel looks for the script.
    / # cat /proc/sys/kernel/hotplug. The default location is "/sbin/hotplug".
  2. Check if you have the script, the kernel is looking for, in this location.
    On android the script should be "/system/busybox/sbin/mdev", so you can set "/proc/sys/kernel/hotplug" to this, if it is not.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文