简体   繁体   English

如何将交叉编译的 linux 模块安装到 ARM 板上

[英]How to install cross-compiled linux modules to ARM board

I know how to corss-compile Linux kernel and modules on an x86 host for an ARM board.我知道如何在 x86 主机上为 ARM 板编译 Linux 内核和模块。

However, I'm wondering if I can install the corss-compiled linux modules onto the ARM board?但是,我想知道是否可以将 corss 编译的 linux 模块安装到 ARM 板上?

I don't want to cherry-pick each module and copy it to the board.我不想挑选每个模块并将其复制到板上。 I'm wondering if there is some command, like make modules_install in x86 that can install the cross-compiled linux modules into the target ARM board?我想知道是否有一些命令,例如 x86 中的make modules_install可以将交叉编译的 linux 模块安装到目标 ARM 板中?

Thank you very much!非常感谢!

You can compile/build a single module but you need a all dependent Linux module. 您可以编译/构建单个模块,但需要一个所有相关的Linux模块。 So tell me how you will resolve this dependency. 因此,告诉我您将如何解决这种依赖性。

For Building/compiling a single module. 用于构建/编译单个模块。 once We need to build all Linux module. 一次,我们需要构建所有Linux模块。 Then comment or remove " make distclean ". 然后注释或删除“ make distclean ”。 make distclean (does not work on ALL programs but most) will remove ALL files made by ./configure and ALL files made by make. make distclean (不适用于所有程序,但大多数情况下)将删除./configure创建的所有文件和make创建的所有文件。 So if you will remove make distclean . 因此,如果要删除make distclean It will build only modified module. 它将仅构建修改后的模块。

you can not build single module in ARM. 您不能在ARM中构建单个模块。 you will get dependency error. 你会得到依赖错误。 For resolving these kind to error you will have to add other Linux module. 为了解决这些错误,您将不得不添加其他Linux模块。

I know I'm a few years late, but as I was just wondering myself if an easy built-in solution would exist for this, I think a solution may still be interesting.我知道我晚了几年,但因为我只是想知道是否有一个简单的内置解决方案可以解决这个问题,我认为一个解决方案可能仍然很有趣。

I know 2 possibilities to do it:我知道有两种可能性:

Use a temporary folder使用临时文件夹

As 0andriy suggested, create a temporary folder, install modules in it, then copy to its real destination.正如 0andriy 建议的那样,创建一个临时文件夹,在其中安装模块,然后复制到其真正的目的地。 For the copy, we have to do a trick to prevent symlink from being copied as full folder content:对于副本,我们必须做一个技巧来防止符号链接被复制为完整的文件夹内容:

mkdir /tmp/dist
make modules_install INSTALL_MOD_PATH=/tmp/dist/
cd /tmp/dist
tar cfp - * | ssh root@distant.board '(cd / && tar xfp - )'

Note : if you did not run make modules_install as root , you will have to chown -R root:root /tmp/dist before the copy.注意:如果您没有以root身份运行make modules_install ,则必须在复制之前chown -R root:root /tmp/dist

Use sshfs使用sshfs

Use sshfs to mount distant board locally.使用sshfs在本地安装远程板。

If you don't have sshfs , install it first.如果您没有sshfs ,请先安装它。 If on Debian or derivative:如果在 Debian 或衍生版本上:

apt-get install sshfs

Then, mount the distant board on a local folder:然后,将远程板安装在本地文件夹上:

mkdir /mnt/dist
sshfs root@distant.board:/ /mnt/dist

There you are.你在那里。 You can now access the distant file system in /mnt/dist .您现在可以在/mnt/dist访问远程文件系统。 So to install modules:所以要安装模块:

make modules_install INSTALL_MOD_PATH=/mnt/dist/

When finished working on your board, unmount the folder:在您的板上完成工作后,卸载文件夹:

umount /mnt/dist

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将交叉编译的杯子安装到目标板上? - How to install cross compiled cups to target board? 如果内核是交叉编译的,是否必须交叉编译模块? - Must I cross-compile modules if the kernel is cross-compiled? 如何在 Android 应用程序中调用共享库中定义的函数(在 linux 上交叉编译)? - How to call a function defined in shared library (cross-compiled on linux) in Android App? 调试交叉编译代码:Linux->Windows - Debugging cross-compiled code: Linux->Windows Linux lib / include组织交叉编译的库? - Linux lib / include organization for cross-compiled libraries? 在 Linux 上查找 Win exe 所需的 DLL(使用 mingw 交叉编译)? - Finding DLLs required of a Win exe on Linux (cross-compiled with mingw)? 如何在 xemacs 中为交叉编译代码运行 gdb? - How can I run gdb in xemacs for cross-compiled code? 来自Windows的交叉编译GNU ARM(BeagleBoneBlack)。 * .elf上的运行时错误:“没有这样的文件或目录” - Cross-Compiled GNU ARM (BeagleBoneBlack) from Windows. Runtime Error on *.elf: “No such file or directory” 交叉编译的Python无法找到基本模块(数学,运算符等) - Cross-compiled Python can't find basic modules (math, operator, etc) cmake不会使用pthreads构建Linux c ++ 11交叉编译程序 - cmake won't build a Linux c++11 cross-compiled program with pthreads
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM