I successfully cross-compiled the current Raspi Kernel on my 64-bit machine to the target architecture arm64. I went through all the necessary steps for inserting the newly built kernel into my Dietpi image. Now the only step left is cross-compiling the kernel modules into the target image. When I run

make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- INSTALL_MOD_PATH=/mnt/img modules_install

Sadly, this returns the following:

/bin/sh: 1: Syntax error: "(" unexpected
  DEPMOD 4.14.79-v8+

What can I do about that?

  • I'm guessing that error wasn't fatal as depmod is still applied. Does /mnt/img/lib/modules/4.14.78-v8+ exist with content (directory w/ ~75 MB of modules) ? The Pi kernel (as default configured) actually doesn't require any modules to boot (although it will not have wifi). You can then tell whether any are available by checking lsmod -- if you see nothing, it hasn't found anything acceptable. Otherwise you are probably okay.
    – goldilocks
    Commented Nov 12, 2018 at 15:11
  • @goldilocks Oh, wow, it doesn't need additional modules? That's great, I will try booting.
    – Akito
    Commented Nov 12, 2018 at 15:13
  • It doesn't if you applied one of the pi specific defconfigs properly. Otherwise it may not boot at all, whether the modules built correctly or not. It's different from normal kernels in that because it is intended for a very specific piece of hardware, it doesn't need an initramfs containing a bunch of optional modules -- no kernel can access the stuff in /lib/modules until it has mounted the filesystem, and to do that it will require appropriate hardware drivers. These are normally in the initramfs. On the pi they are just built-in.
    – goldilocks
    Commented Nov 12, 2018 at 15:18
  • @goldilocks I remember, that I actually applied the proper defconfigs already. The device still won't boot, though.
    – Akito
    Commented Nov 12, 2018 at 15:38
  • @goldilocks Okay, seems like there was a file-system related problem when copying the kernel files from device to device. The original device installs the modules without any problem.
    – Akito
    Commented Nov 12, 2018 at 15:42

1 Answer 1


My error was to copy the compiled files to different devices instead of copying it directly from source to destination. The process is completed and everything works now.

  • Please accept your own answer with a click on the tick on its left side. Only this will finish the question and it will not pop up again year for year.
    – Ingo
    Commented Mar 4, 2020 at 12:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.