linux icon indicating copy to clipboard operation
linux copied to clipboard

Failed to build due to README file.

Open adminy opened this issue 1 year ago • 9 comments

Describe the bug

Trying to compile the latest 6.10.y kernel gives:

make[3]: *** No rule to make target 
   'arch/arm64/boot/dts/overlays/README', needed by 
   'arch/arm64/boot/dts/overlays/dtbs-list'.  Stop.
make[3]: *** Waiting for unfinished jobs....
make[1]: *** [/tmp/nix-build-linux-rpi-6.10.0-rc5.drv-0/source/Makefile:1405: dtbs] Error 2
make: *** [../Makefile:240: __sub-make] Error 2

Steps to reproduce the behaviour

I'm just trying to normally compile the kernel. no special steps. https://github.com/raspberrypi/linux/blob/f61d3aca8045e70d64b55f7b98f083738f639ad2/arch/arm/boot/dts/overlays/Makefile#L3 I suspect its this piece of code has the README target, causing this to be treated as a dtb downstream

Device (s)

Raspberry Pi 5

System

N/a

Logs

No response

Additional context

No response

adminy avatar Jun 27 '24 20:06 adminy

https://github.com/raspberrypi/linux/pull/6241

adminy avatar Jun 27 '24 20:06 adminy

I'm just trying to normally compile the kernel. no special steps.

List them - my builds are working.

pelwell avatar Jun 27 '24 21:06 pelwell

I'm using the nixpkgs buildLinux derivation with the following flags:

modDirVersion = "6.10.0-rc5";
version = "6.10.0-rc5";
pname = "linux-rpi";
src = rpi-linux-6_10_0-rc5-src;
defconfig = "bcm2712_defconfig";
structuredExtraConfig = with lib.kernel; {
  BACKLIGHT_CLASS_DEVICE = yes;
  KUNIT = no;
};
features.efiBootStub = false;
kernelPatches = [];

with a postconfigure like so:

postConfigure = ''
  sed -i $buildRoot/.config -e 's/^CONFIG_LOCALVERSION=.*/CONFIG_LOCALVERSION=""/'
  sed -i $buildRoot/include/config/auto.conf -e 's/^CONFIG_LOCALVERSION=.*/CONFIG_LOCALVERSION=""/'
'';

The flake builds fine for 6.6.y branch, if you look carefully, that branch does not have the README file.

adminy avatar Jun 27 '24 23:06 adminy

That's not a "normal" Linux build. I want a list of "make" commands that demonstrate the problem.

pelwell avatar Jun 28 '24 08:06 pelwell

This in turn calls the make commands in:

https://github.com/NixOS/nixpkgs/blob/5f24895313965092dbd4a622b85d1986f01e2138/pkgs/os-specific/linux/kernel/generic.nix#L167-L189

Normal is relative. To me its more normal not to make assumptions about which environment your machine is using. Because that leads to "works on my machine" problems. This is why I use the normal nix way of building the kernel, so that other people can replicate it. Anyways it seems like https://github.com/raspberrypi/linux/pull/6241 does actually fix the problem. You're probably not building the dtbs with make.

adminy avatar Jun 28 '24 08:06 adminy

Can you build https://github.com/torvalds/linux ? -- That's the linux source.

by avatar Jun 28 '24 22:06 by

yeah, I can try. Probably won't have the defconfig file though.

adminy avatar Jun 28 '24 22:06 adminy

Alternatively and/or additionally, you will likely need to create a manual config with your environment (i.e., https://github.com/NixOS/nixpkgs/blob/d77bda728d5041c1294a68fb25c79e2d161f62b9/pkgs/os-specific/linux/kernel/manual-config.nix); if this fails, you might want to move your issue to https://github.com/NixOS/nixpkgs, as https://github.com/raspberrypi/linux compiles well according to the official way @ https://www.raspberrypi.com/documentation/computers/linux_kernel.html#build-the-kernel

by avatar Jun 29 '24 14:06 by

To be clear: I'm not saying that there isn't a problem somewhere in the overlay build rules, but unless I can reproduce the failure I won't feel comfortable that I have understood the issue, and therefore that the fix is a good one.

pelwell avatar Jun 29 '24 14:06 pelwell

https://github.com/raspberrypi/linux/pull/6681 - fix: remove README from Makefile

sanderhollaar avatar Feb 22 '25 18:02 sanderhollaar

Fixed with https://github.com/raspberrypi/linux/commit/f9d8731cc63800cd85dfa653099bdc6c8147f474

(I do not have permissions to close with comment)

sanderhollaar avatar Mar 07 '25 09:03 sanderhollaar

That's great but still an issue in 6.12.y and 6.13.y branches. I believe your changes only made it to 6.14.y

adminy avatar Mar 07 '25 09:03 adminy

I can create additional pull requests for 6.12.y and 6.13.y if these kernel versions are still relevant.

sanderhollaar avatar Mar 07 '25 09:03 sanderhollaar

currently raspberrypi/firmware only ships 6.12.y files.

adminy avatar Mar 07 '25 09:03 adminy

It's in progress

pelwell avatar Mar 07 '25 10:03 pelwell