Unverified Commit ea94f6b8 authored by Valentin Gagarin's avatar Valentin Gagarin Committed by GitHub
Browse files

doc: update the kernel config documentation to use `nix-shell` (#265057)



this also slightly improves the instructions after working through them
to check that they do what one would expect.

Co-authored-by: default avataralex <source@proof.construction>
parent 3c28778a
Loading
Loading
Loading
Loading
+25 −11
Original line number Diff line number Diff line
@@ -4,19 +4,33 @@

2.  Add the new kernel to the `kernels` attribute set in [`linux-kernels.nix`](./linux-kernels.nix) (e.g., create an attribute `kernel_2_6_22`).

3.  Update the kernel configuration. First unpack the kernel. Then for each supported platform (`i686`, `x86_64`, `uml`) do the following:
3.  Update the kernel configuration:

    1. While in the Nixpkgs repository, enter the development shell for that kernel:

       ```console
       $ nix-shell -A linuxKernel.kernels.linux_2_6_22
       ```

    2. Unpack the kernel:

       ```console
       [nix-shell]$ pushd $(mktemp -d)
       [nix-shell]$ unpackPhase
       ```

    3. For each supported platform (`i686`, `x86_64`, `uml`) do the following:

       1. Make a copy from the old config (e.g., `config-2.6.21-i686-smp`) to the new one (e.g., `config-2.6.22-i686-smp`).

    2.  Copy the config file for this platform (e.g., `config-2.6.22-i686-smp`) to `.config` in the kernel source tree.
       2. Copy the config file for this platform (e.g., `config-2.6.22-i686-smp`) to `.config` in the unpacked kernel source tree.

       3. Run `make oldconfig ARCH={i386,x86_64,um}` and answer all questions. (For the uml configuration, also add `SHELL=bash`.) Make sure to keep the configuration consistent between platforms (i.e., don’t enable some feature on `i686` and disable it on `x86_64`).

       4. If needed, you can also run `make menuconfig`:

          ```ShellSession
        $ nix-env -f "<nixpkgs>" -iA ncurses
        $ export NIX_CFLAGS_LINK=-lncurses
          $ nix-shell -p ncurses pkg-config
          $ make menuconfig ARCH=arch
          ```