R28.1 kernel build fail "Cannot find usr/initramfs_data.o"

Hi guys,

I can’t seem to build the kernel using a cross compile, I keep getting the error “Cannot find usr/initramfs_data.o” No such file or directory.

compile output

CC init/noinitramfs.o
CC init/initramfs.o 
LD init/built-in.o 
LD usr/built-in.o
/../aarch64-linux-gnu-ld: cannot find usr/initramfs_data.o : No such file or directory /../kernel-4.4/scripts/Makefile.build:340: recipe for target 'usr/build-in.o' failed

What I’m using

  1. Host machine - 64 bit ubuntu 16.04 + 14.04 (both on a Virtual Machine) using the linaro toolset (ver 5.3-2016.02-x86_64..) and the provided toolset from nvidia

What I’m calling

  1. cd /../kernel-4.4
  2. CROSS_COMPILE=$HOME/crosstools/../bin/aarch64-linux-gnu-
  3. CROSS32CC=$HOME/crosstools/../bin/arm-linux-gnueabihf-gcc
  4. ARCH=arm64
  5. sudo make mrproper
  6. sudo make O=$kernel_out tegra21_def_config
  7. sudo make O=$kernel_out zImage

I’ve traced it back to /kernel_sources/kernel-4.4/usr/Makefile

obj-$(CONFIG_BLK_DEV_INITRD) := initramfs_data.o

I believe it should be appearing in my $kernel_out/usr/ folder (the gen_init_cpio application + initramfs_data.cpio.gz archive both appear in the $kernel_out/usr/ folder.

Using clean R28.1 sources

Any help is appreciated.

Note: Under R28.1 I see in the NVIDIA docs they no longer set CROSS32CC. There are some changes in docs since R27.1 and previous, you may want to check the kernel customization info in docs of:

Try without CROSS32CC if possible. Also try with a running system’s “/proc/config.gz” in case defconfig differs.

Hi, Lucasruela.

Apologies, ARCH has also been set to arm64, that is fine.

Hi, Linuxdev.

I haven’t tried that, all examples have shown using both compilers. I will try your suggestions in the morning.


Hi david_evans_g,

List my steps for you reference:
[Building toolchain]

  1. Download gcc-4.8.5-aarch64.tgz
  2. tar gcc-4.8.5-aarch64.tgz

[Building the Tegra Kernel]
export CROSS_COMPILE=<your gcc-4.8.5 link>/TX2_R27.1_build-kernel/Linux_for_Tegra/install/bin/aarch64-unknown-linux-gnu- export TEGRA_KERNEL_OUT=/TX2_R27.1_build-kernel/Linux_for_Tegra/kernel/out
$ export ARCH=arm64

tar xpf source_release.tbz2 cd sources/
tar xpf kernel_src-tx1.tbz2 cd kernel/kernel-4.4
make mrproper make O=TEGRA_KERNEL_OUT tegra21_defconfig make O=TEGRA_KERNEL_OUT zImage make O=TEGRA_KERNEL_OUT dtbs make O=TEGRA_KERNEL_OUT modules make O=$TEGRA_KERNEL_OUT modules_install INSTALL_MOD_PATH=<your_destination>

You can refer “Building the NVIDIA Kernel” document guide:
Tegra Linux Driver Package Development Guide.html -> Advanced Setup and Customization -> Building the NVIDIA Kernel

Hi, carolyuu, linuxdev.

Thank you very much for your help, I’ve figured out what was going wrong. It turns out something (still unknown) happened when extracting/moving the sources (source_release.tbz2) from the Nvidia download to my machine’s Change Management. I should have confirmed the initial download worked before asking, I’m very sorry for troubling you.