How to specify a custom defconfig file in Android 10 Kernel compilation

Search This thread

gardeimasei

Member
Mar 26, 2020
15
2
I wanted to enable certain kernel features and in my Android 10 build for Pixel 3. I downloaded and built the correct msm kernel and successfully flashed it on the Pixel. To build the kernel I'm using the build/build.sh from the kernel source. I tried adding a custom defconfig file in private/msm-google/arch/arm64/configs/ and changing the DEFCONFIG variable in build.config to that file. When I compile I get following error:
Code:
++ echo ERROR: savedefconfig does not match private/msm-google/arch/arm64/configs/sdm845_defconfig
ERROR: savedefconfig does not match private/msm-google/arch/arm64/configs/sdm845_defconfig

How can I compile the kernel with a custom defconfig? It doesn't have to be through the build.sh method (although it would be preferable)
 
  • Like
Reactions: hjellinek

gerard_f

Senior Member
Sep 25, 2008
463
1,436
Catalunya
I wanted to enable certain kernel features and in my Android 10 build for Pixel 3. I downloaded and built the correct msm kernel and successfully flashed it on the Pixel. To build the kernel I'm using the build/build.sh from the kernel source. I tried adding a custom defconfig file in private/msm-google/arch/arm64/configs/ and changing the DEFCONFIG variable in build.config to that file. When I compile I get following error:
Code:
++ echo ERROR: savedefconfig does not match private/msm-google/arch/arm64/configs/sdm845_defconfig
ERROR: savedefconfig does not match private/msm-google/arch/arm64/configs/sdm845_defconfig

How can I compile the kernel with a custom defconfig? It doesn't have to be through the build.sh method (although it would be preferable)

I don't know if it's solved, but I solved the problem removing the "check defconfig" in build.config (the symlink in the root which points to the kernel build.config).

Change
Code:
POST_DEFCONFIG_CMDS="check_defconfig"
to
Code:
POST_DEFCONFIG_CMDS=""
 

hjellinek

New member
Mar 2, 2010
1
2
I've been working with a Google engineer who showed me the fix for my savedefconfig problem. Maybe it will fix yours, too.

The key is to set ARCH:
Code:
$ export ARCH=arm64

Here's the context and full procedure. My work is based on the b1c1_defconfig config. Your directory names may vary.

Code:
$ cd private/msm-google
$ export ARCH=arm64      # this is the magic line
$ make b1c1_defconfig    # This sets up the config for my hardware. Yours is probably different.
$ make menuconfig
Now edit the kernel configuration and save it as ".config", the default.
When you're done:
Code:
$ make savedefconfig
$ cp defconfig arch/arm64/configs/b1c1_defconfig # or whatever your hardware configuration is
$ make mrproper
With luck, you won't see any savedefconfig problems.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    I've been working with a Google engineer who showed me the fix for my savedefconfig problem. Maybe it will fix yours, too.

    The key is to set ARCH:
    Code:
    $ export ARCH=arm64

    Here's the context and full procedure. My work is based on the b1c1_defconfig config. Your directory names may vary.

    Code:
    $ cd private/msm-google
    $ export ARCH=arm64      # this is the magic line
    $ make b1c1_defconfig    # This sets up the config for my hardware. Yours is probably different.
    $ make menuconfig
    Now edit the kernel configuration and save it as ".config", the default.
    When you're done:
    Code:
    $ make savedefconfig
    $ cp defconfig arch/arm64/configs/b1c1_defconfig # or whatever your hardware configuration is
    $ make mrproper
    With luck, you won't see any savedefconfig problems.
    1
    I wanted to enable certain kernel features and in my Android 10 build for Pixel 3. I downloaded and built the correct msm kernel and successfully flashed it on the Pixel. To build the kernel I'm using the build/build.sh from the kernel source. I tried adding a custom defconfig file in private/msm-google/arch/arm64/configs/ and changing the DEFCONFIG variable in build.config to that file. When I compile I get following error:
    Code:
    ++ echo ERROR: savedefconfig does not match private/msm-google/arch/arm64/configs/sdm845_defconfig
    ERROR: savedefconfig does not match private/msm-google/arch/arm64/configs/sdm845_defconfig

    How can I compile the kernel with a custom defconfig? It doesn't have to be through the build.sh method (although it would be preferable)