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

Build all kernel modules for ARM and Aarch64 #24229

Merged
merged 3 commits into from Apr 9, 2017
Merged

Conversation

abbradar
Copy link
Member

@abbradar abbradar commented Mar 23, 2017

Motivation for this change

Make all kernel modules available for ARM. This includes iptables, accounting (iotop), USB drivers and much more which was absent before.

Also enable initrd in kernel by default (some configurations disable it while we rely on it for most boot sequences excluding containers).

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • 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.

My first approach was to just enable kernelAutoModules. However it turned out that a lot of modules is unknown to udev and it's a huge pain to get a board working. You need to figure out manually which storage (MMC in my case) modules you need, how to get USB working, LEDs etc. This would hugely degrade our multiplatformeness if done now.

Therefore I did something else -- we can now specify that we want all options compiled as modules in a kernel, but if a template config (armv7_multiplatform_defconfig, for example) specifies that something should be compiled it it would be left as is. This gives us the best of both worlds.

While I have tested this on an ARMv7 board I have not tested it on Aarch44. I expect that since all modules now available it's not needed to compile in network adapter drivers for ThunderX -- but this should be tested.

This allows to use kernelAutoModules but still compile in any options that are set so in template config.
It's helpful for ARM and maybe other platforms where defaul configurations are useful because they compile in
modules that we and udev cannot autodetect now.
We don't require initrd in some cases but still most boot sequences including ARM use it.
@mention-bot
Copy link

@abbradar, thanks for your PR! By analyzing the history of the files in this pull request, we identified @edolstra, @dezgeg and @viric to be potential reviewers.

@abbradar abbradar requested a review from dezgeg March 23, 2017 00:16
@edolstra
Copy link
Member

It's not entirely clear to me from the description - what does "prefer builtin" do?

@abbradar
Copy link
Member Author

It's a supplementary flag to "auto modules". Currently if you have auto modules enabled all configuration options that have m alternative are selected as such, regardless of what the default configuration says. For example, if archv7_multiplatform_defconfig hsa CONFIG_FOO=y but we can set it to m it will be overridden. With "prefer builtin" if something has been set as y it will stay so.

Copy link
Contributor

@dezgeg dezgeg left a comment

Choose a reason for hiding this comment

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

Finally managed to compile for ARMv6 RPi, ARMv7 Jetson TK1, aarch64 RPi3 && the Cavium ThunderX box. Seems to work well.

@dezgeg
Copy link
Contributor

dezgeg commented Apr 1, 2017

Regarding @edolstra's comment, maybe scoping the name a bit would make it clearer that it only affects the automodules option/logic. E.g. name it kernelAutoModulesPreferBuiltin or maybe kernelAutoModules could be turned into tristate option of true, false, "preferBuiltin". I don't have strong opinions though.

@abbradar
Copy link
Member Author

abbradar commented Apr 3, 2017

A better name should help, yeah -- but I can't definitely say which option (including current) is better, too. Any little preference from anyone will sway me towards it :D

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