about summary refs log tree commit diff
path: root/pkgs/os-specific/linux/kernel/generate-config.pl
AgeCommit message (Collapse)AuthorFilesLines
2022-03-10linux.configfile: fix alts containing "/m"Alyssa Ross1-1/+1
generate-config.pl's auto modules feature answers "m" to any Kconfig question it thinks supports being a module. It detected this by seeing if the help shown by make config (called "alts" by the script) contained the string "/m", which it would in the case of e.g a tristate option, where alts would be "N/m/y/?". But then along came CONFIG_MODPROBE_PATH in Linux 5.13, with a default value, shown in the make config help, of "/sbin/modprobe". generate-config.pl would see the "/m" substring, and answer "m" to the question, meaning (I think) that the built kernel would expect the modprobe binary to be at /m. This broke the (non-NixOS) VM images I build with Nix. NixOS was unaffected because it uses a different mechanism to set the modprobe path. With the current architecture, we can't 100% determine whether a Kconfig option is a string or a tristate, but we can get a lot closer by using a better regex. My new regex only accepts single word characters, separated by slashes, with a "/?" at the end. This is much less likely to ever end up as the default value of a string option. Tested by building linux_latest.configfile before and after my changes, and checking the only difference is the correct default for CONFIG_MODPROBE_PATH.
2021-07-12buildLinux: apply hostPlatform.linux-kernel.makeFlags to generate-config.plBernardo Meurer1-1/+2
This enforces that the configuration generated will obey any/all flags set in the platform/stdenv configuration. This is crucial, for example, if you'd like to build a kernel using clang. Without this patch, anything you set in `stdenv.hostPlatform.linux-kernel.makeFlags` is wholly ignored during config generation, causing (for example) any changes in the desired toolchain (e.g. `LLVM`, `LLVM_IAS`) to not be reflected in the generated config, and for the subsequent build to fail.
2021-05-10linux: improve cross compilation with clangMichael Roitzsch1-1/+1
set HOST* variables for host build tools * do not assume the host compiler is gcc * pass all build tools to make
2020-12-19linux: fix generate-config's handling of "no-choice" optionsLinus Heckemann1-0/+6
Prior to this change, the script could potentially get confused by "menus" containing only one valid option. Thus, with CPU_BIG_ENDIAN = no; CPU_LITTLE_ENDIAN = yes; ARM64_PA_BITS_48 = yes; the endianness would be set incorrectly: GOT: Physical address space size GOT: > 1. 48-bit (ARM64_PA_BITS_48) GOT: choice[1]: 1 GOT: Endianness GOT: 1. Build big-endian kernel (CPU_BIG_ENDIAN) GOT: > 2. Build little-endian kernel (CPU_LITTLE_ENDIAN) CHOICE: 1-2?, ANSWER: 1 This commit fixes this error by forgetting previous menu choices if a line that follows a menu option is neither another menu option nor the prompt for choosing one of the options.
2019-12-08kernel generate-config.pl: Show all errors, not just the firstAnders Kaseorg1-1/+3
This makes it less frustrating to add a large group of kernel options via boot.kernelPatches.*.extraConfig. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2019-08-12kernel generate-config.pl: Allow whitespace in valuesEric Culp1-1/+1
In particular, this allows setting CONFIG_CMDLINE to a value with multiple space-seperated parameters. Other variables also take free-form strings and might similarly benefit.
2018-02-07kernel: buildLinux replaces import ./generic.nixMatthieu Coudron1-7/+7
- defined buildLinux as generic.nix instead of manual-config.nix. This makes kernel derivations a tad more similar to your typical derivations. - moved $buildRoot to within the source folder, this way it doesn't have to be created before the unpackPhase and make it easier to work on kernel source without running the unpackPhase
2017-04-09linux: add kernelPreferBuiltin platform optionNikolay Amiantov1-1/+2
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.
2016-09-13kernel generate-config.pl: Properly support string optionsTuomas Tynkkynen1-1/+4
Or we get something like: option not set correctly: NLS_DEFAULT (wanted 'utf8', got '"utf8"')
2016-09-13kernel generate-config.pl: Be more verbose on errorsTuomas Tynkkynen1-4/+4
2016-08-06generate-config.pl: Be more verbose about missing optionsTuomas Tynkkynen1-1/+1
For instance, the current 3.10 kernel build fails at the end with: unused option: BRCMFMAC_PCIE unused option: FW_LOADER_USER_HELPER_FALLBACK unused option: KEXEC_FILE unused option: RANDOMIZE_BASE However, it's not obvious that only the _last_ one is actually fatal to the build. After this change it's at least somewhat better: warning: unused option: BRCMFMAC_PCIE warning: unused option: FW_LOADER_USER_HELPER_FALLBACK warning: unused option: KEXEC_FILE error: unused option: RANDOMIZE_BASE
2014-01-01Implement generic kernel build via manual-configShea Levy1-1/+4
This has three major benefits: 1. We no longer have two kernel build processes to maintain 2. The build process is (IMO) cleaner and cleaves more closely to upstream. In partuclar, we use make install to install the kernel and development source/build trees, eliminating the guesswork about which files to copy. 3. The derivation has multiple outputs: the kernel and modules are in the default `out' output, while the build and source trees are in a `dev' output. This makes it possible for the full source and build tree to be kept (which is expected by out-of-tree modules) without bloating the closure of the system derivation. In addition, if a solution for how to handle queries in the presence of imports from derivations ever makes it into nix, a framework for querying the full configuration of the kernel in nix expressions is already in place. Signed-off-by: Shea Levy <shea@shealevy.com>
2013-08-06linux: properly parse config choice when it's newRicardo M. Correia1-2/+2
2010-08-14Allow override options being required in kernel configuration.. Otherwise ↵Michael Raskin1-1/+1
modifying significantly config via extraConfig becomes practically impossible. svn path=/nixpkgs/trunk/; revision=23171
2010-02-16Made the kernel generate-config "build as modules as you can" an option.Lluís Batlle i Rossell1-1/+2
Sepcifically, a nixpkgs "platform" option. So, for PC all remained the same as it was. svn path=/nixpkgs/trunk/; revision=20059
2010-01-27* Strangely, running "make defconfig" before the generator causesEelco Dolstra1-1/+2
"make config" to print an additional question that the script doesn't know how to answer ("Audio Excel DSP 16 [N/y] (NEW) ###"). Just ignore it. svn path=/nixpkgs/branches/stdenv-updates/; revision=19713
2009-12-14* Doh!Eelco Dolstra1-1/+0
svn path=/nixpkgs/branches/kernel-config/; revision=18944
2009-12-14* Get User-Mode Linux to build with a newer kernel. Yes, SHELL reallyEelco Dolstra1-1/+3
has to be "/bin/sh" - other values such as "sh" or "bash" or "$(type -tP sh)" cause a build error: LD .tmp_vmlinux1 /nix/store/1yv8i1m76cvwk5w5i5wrk4gj5zyfj6vh-binutils-2.19.1/bin/ld:arch/um/kernel/vmlinux.lds:1: ignoring invalid character `#' in expression /nix/store/1yv8i1m76cvwk5w5i5wrk4gj5zyfj6vh-binutils-2.19.1/bin/ld:arch/um/kernel/vmlinux.lds:1: syntax error collect2: ld returned 1 exit status This is caused by Bash 4.0 (http://bugzilla.kernel.org/show_bug.cgi?id=13343). svn path=/nixpkgs/branches/kernel-config/; revision=18941
2009-12-14* Allow options to be ignored if they don't exist by marking them withEelco Dolstra1-5/+10
a "?". svn path=/nixpkgs/branches/kernel-config/; revision=18931
2009-12-12* Get fbcondecor to work.Eelco Dolstra1-1/+1
* Barf on ignored options. svn path=/nixpkgs/branches/kernel-config/; revision=18914
2009-12-12* Added a script to generate the kernel configuration.Eelco Dolstra1-0/+130
`generate-config.pl' runs `make config' to generate a Linux kernel configuration file. For each question (i.e. kernel configuration option), unless an override is provided, it answers "m" if possible, and otherwise uses the default answer (as determined by the default config for the architecture). This is safer than allmodconfig, which answers "y" everywhere it can't answer "m" and thus ends up enabling a lot of experimental or debug options. (For this reason, a configuration generated by allmodconfig must be carefully checked with every new release to ensure that nothing dangerous is enabled. The default config should be safer wrt new kernel releases.) Overrides are specified in the `config' argument to generic.nix, which is a string that contains lines such as `EXT2_FS_POSIX_ACL y'. The script warns about ignored options, and aborts if `make config' selects an answer inconsistent with the one in `config'. This allows us to be sure that `make config' doesn't silently override our configuration values (e.g., depending on other options, it will set FB_TILEBLITTING to "y" even if we want it to be "n"). svn path=/nixpkgs/branches/kernel-config/; revision=18910