0
votes

I know how to corss-compile Linux kernel and modules on an x86 host for an ARM board.

However, I'm wondering if I can install the corss-compiled linux modules onto the ARM board?

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?

Thank you very much!

1
Most of the developers do in this way. You have to provide ARCH and CROSS_COMPILE variables to your make command. Be sure that toolchain is accessible via PATH. So, basically you have to run, for example, make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- modules. This part you know. But installation to the board is done either through ssh or uart channel your have connected to. If you want to reboot with initrd you may prepare it and provide to bootloader. - 0andriy
which ARM board is it ? how do you populate the image ? buildroot / yocto ? linaro? - stdcall
@AndyShevchenko, is there a pointer about how to install it through ssh or uart channel? I have configured both connection, however, I'm unaware how to run make modules_install to install all modules onto the board through ssh or uart... - Mike
I didn't use yocto. I just flash the disk with an OS and then copy the zImage into /boot - Mike
@MikeXu, just run normal ssh transfer initiated from any side: mkdir /tmp/modules; make INSTALL_MOD_PATH=/tmp/modules modules_install; scp -R /tmp/modules 192.168.0.10:/. Something like that if you have ssh server running. Otherwise do the scp from target side directly. - 0andriy

1 Answers

0
votes

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. 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 [email protected] '(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.

Use sshfs

Use sshfs to mount distant board locally.

If you don't have sshfs, install it first. If on Debian or derivative:

apt-get install sshfs

Then, mount the distant board on a local folder:

mkdir /mnt/dist
sshfs [email protected]:/ /mnt/dist

There you are. You can now access the distant file system in /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