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

Add bin/menuconfig to configure kernels #109

Merged
merged 6 commits into from Mar 28, 2020

Conversation

samueldr
Copy link
Member

@samueldr samueldr commented Mar 27, 2020

Had an epiphany about ways to co-opt the binary from out of a source tree.

TODO

  • Figure out why on recent kernels (e.g. asus-dumo) it fails find ncurses through pkgconfig.
  • Add documentation

Fixes #108

@samueldr samueldr added the 4. type: enhancement New feature or request label Mar 27, 2020
@samueldr
Copy link
Member Author

samueldr commented Mar 27, 2020

This wasn't a trivial thing to figure out.

  1. Recent kernels can (and prefer?) to use pkg-config to figure out where the libraries are.
  2. A recent change to ncurses has a nasty regression with its pkgs-config --libs output.

With those combined, make nconfig is not able to find the libraries. ncurses will not output -L/nix/store/... to the expected directory anymore.

The fix I have started working on will be continued tomorrow. Though I'm not sure if the blame lies entirely within ncurses' court.


As nothing else within Nixpkgs broke, I think the issue lies within how the kernel links applications. Still looking into it.

Important, otherwise we lose additional options that may have been
patched-in!
While staying compatible with older ones.

These changes are required since recent kernels' nconfig expect that the
Makefile will have setup the environment for *many* things.

We can't simply run nconfig directly anymore.

What's that about `run-nconfig`?

Well, `make nconfig` tries to build again, in a situation where it won't
be able to build. *sigh*. With this, we take the assumedly-fine-to-run
nconfig that is already in our botched up source tree.
This does present the drawback of not validating the kernel builds.
Though I expect the user will build the kernel anyway after.
@samueldr
Copy link
Member Author

samueldr commented Mar 27, 2020

Testing this latest revision with all kernel trees, it looks like there is one issue, kind of breaking, but we can't do much else for now.

Some kernels will hang when saving changes. It looks like there is something broken giving a long "OK" button to the top left.

I can't reproduce this anymore :/.

@samueldr samueldr merged commit 0700295 into NixOS:master Mar 28, 2020
@samueldr samueldr deleted the feature/menuconfig branch March 28, 2020 02:15
@fb87
Copy link

fb87 commented Jul 14, 2020

Hello @samueldr, ./bin/menuconfig pine64-pinephone-braveheart is still broken (while others such xiaomi-begonia are working fine), check with change set ce29cd6.

Is there any workaround for now?

Thanks

Ref. log:

configuring
building
  $ export PKG_CONFIG_PATH=/nix/store/m6d11hkf27283ph9d3hi1mbik08mzy0q-ncurses-6.2-dev/lib/pkgconfig
  $ PKG_CONFIG_PATH=/nix/store/m6d11hkf27283ph9d3hi1mbik08mzy0q-ncurses-6.2-dev/lib/pkgconfig
  $ '[' -e scripts/kconfig/nconf-cfg.sh ']'
  $ sed -i -e 's/$(pkg-config --libs $PKG)/-L $(pkg-config --variable=libdir ncursesw) $(pkg-config --libs $PKG)/' scripts/kconfig/nconf-cfg.sh
  $ cat
  $ cp scripts/kconfig/Makefile scripts/kconfig/Makefile.old
  $ sed -i -e 's/$< .*$(Kconfig)/echo "no-op"/' scripts/kconfig/Makefile
  $ make nconfig V=1
make -f ./scripts/Makefile.build obj=scripts/basic
  gcc -Wp,-MD,scripts/basic/.fixdep.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89         -o scripts/basic/fixdep scripts/basic/fixdep.c
rm -f .tmp_quiet_recordmcount
make -f ./scripts/Makefile.build obj=scripts/kconfig nconfig
set -e; mkdir -p scripts/kconfig/; { sh scripts/kconfig/nconf-cfg.sh; } > scripts/kconfig/nconf-cfg.tmp; if [ -r scripts/kconfig/nconf-cfg ] && cmp -s scripts/kconfig/nconf-cfg scripts/kconfig/nconf-cfg.tmp; then rm -f scripts/kconfig/nconf-cfg.tmp; else : '  UPD     scripts/kconfig/nconf-cfg'; mv -f scripts/kconfig/nconf-cfg.tmp scripts/kconfig/nconf-cfg; fi
*
* Unable to find the ncurses package.
* Install ncurses (ncurses-devel or libncurses-dev
* depending on your distribution).
*
* You may also need to install pkg-config to find the
* ncurses installed in a non-default location.
*
make[1]: *** [scripts/kconfig/Makefile:212: scripts/kconfig/nconf-cfg] Error 1
make: *** [Makefile:568: nconfig] Error 2
builder for '/nix/store/rwv3km726mvrfm0mhhyb7nx1nz64cljx-linux-5.5.0-aarch64-unknown-linux-gnu.drv' failed with exit code 2
error: build of '/nix/store/rwv3km726mvrfm0mhhyb7nx1nz64cljx-linux-5.5.0-aarch64-unknown-linux-gnu.drv' failed

@samueldr
Copy link
Member Author

I assume this is a new failure coming from the recent changes in pkg-config. Looking into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. type: enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Get make menuconfig working nicely
2 participants