Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

armv7l-linux: add a beagleboard.org kernel + platform. #31110

Merged
merged 4 commits into from Nov 9, 2017
Merged

armv7l-linux: add a beagleboard.org kernel + platform. #31110

merged 4 commits into from Nov 9, 2017

Conversation

dhess
Copy link
Contributor

@dhess dhess commented Nov 1, 2017

Motivation for this change

/cc @dezgeg

beagleboard.org maintains a kernel fork for its armv7l-based BeagleBone platforms, maintained by @RobertCNelson. The fork adds support for BeagleBone-specific pinmuxes, DTSes, etc., and does a good job of tracking upstream.

I have been using kernels built from this kernel tree with NixOS on a BeagleBone Black for the past 5 months with great success. The device has maintained 100% uptime in an outdoor environment, running several services that read and write GPIO pins.

(Note: Robert maintains several kernel versions in this fork. I have only tested the 4.9 version, so that is the version used by this derivation.)

Things done

This patch adds a derivation for the beagleboard.org kernel; and a new variant of the existing beaglebone platform which uses the bb.org_defconfig defconfig from the kernel fork.

Alternatively, you could drop the new platform and simply modify the existing beaglebone platform to use this defconfig.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@Mic92
Copy link
Member

Mic92 commented Nov 2, 2017

Maybe @dezgeg for review? I cannot compile this architecture at the moment. The expressions looks good to me though. I would be great if you also could add some instructions how to get a bootable beagleboard here (or maybe even an image).

@dhess
Copy link
Contributor Author

dhess commented Nov 2, 2017

Pretty sure the instructions on the wiki for BeagleBone boards already have this covered. @dezgeg’s generic armv7l install image worked out of the box when I used it a few months ago. This kernel simply adds some functionality that upstream Linux doesn’t support on this hardware, mainly related to GPIO.

edit: but once this is merged, I can add a comment on the wiki explaining how to switch to this kernel.


kernelPatches = args.kernelPatches;

features.iwlwifi = true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this features section needs to be:

  features = {
    efiBootStub = false;
  } // (args.features or {});

if CONFIG_EFI_STUB is not enabled, or dropped if not (since the default is 'true'). This was changed in commit 8525b78

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I wrote this several months ago and didn't catch the change.

@dhess
Copy link
Contributor Author

dhess commented Nov 2, 2017

@dezgeg what are your thoughts on the extra platform? Keep it, or should the existing beaglebone platform use the defconfig from the platform-specific kernel, like the RPi platforms do?

@dezgeg
Copy link
Contributor

dezgeg commented Nov 3, 2017

Yeah, you could just update the beaglebone in-place.

On my TODO list is to eventually figure out a way to move the platform-specific defconfig names to the kernel expressions themselves (i.e. linux-rpi.nix', linux-beagleboard.nix`) so that you don't need to do both:

    nixpkgs.config.platform = lib.systems.platforms.raspberrypi2;
    boot.kernelPackages = pkgs.linuxPackages_rpi;

... because typically if you specify only one of those lines, the end result is something unexpected.

@dhess
Copy link
Contributor Author

dhess commented Nov 3, 2017

Yeah, the most intuitive thing would be to specify a default, overridable kernel in the platform config.

Anyway, I will make these changes and update the PR.

@dhess
Copy link
Contributor Author

dhess commented Nov 9, 2017

OK, I made the suggested fixes, including updating the existing beaglebone platform so that it depends on the linux_beagleboard kernel by way of the bb.org_defconfig.

I normally don't need to amend a PR, so I just pushed the changes on top of the original ones, which makes this kind of messy; but I think you all can fix that on your end when you merge it, right? Or do I need to rebase?

@dezgeg dezgeg merged commit 67ba83a into NixOS:master Nov 9, 2017
@dhess dhess deleted the beaglebone branch November 9, 2017 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants