You are not logged in.

#1 2020-04-19 18:43:43

vitaliy.kuzmich
Member
Registered: 2015-11-29
Posts: 64

[SOLVED]Advice to merge old .config with new one?

I have a custom kernel, can anybody give me some advice how to simplify merge of old config with new?

Last edited by vitaliy.kuzmich (2020-04-19 19:29:12)

Offline

#2 2020-04-19 19:20:50

loqs
Member
Registered: 2014-03-06
Posts: 18,230

Re: [SOLVED]Advice to merge old .config with new one?

How was the new config generated?
You can update an old .config for a newer kernel with `make oldconfig` or `make olddefconfig` the latter setting new options to their recomended default.

Offline

#3 2020-04-19 19:27:01

vitaliy.kuzmich
Member
Registered: 2015-11-29
Posts: 64

Re: [SOLVED]Advice to merge old .config with new one?

loqs wrote:

How was the new config generated?
You can update an old .config for a newer kernel with `make oldconfig` or `make olddefconfig` the latter setting new options to their recomended default.

Thank you! I will use it. Also I have some difficulties during migrating to the newer kernel version by using standard https://wiki.archlinux.org/index.php/Ke … ild_System, sometimes it just does not update checksum. So have to do everything from step 1. Any advice on this ? Or maybe just use plain compilation ?

Offline

#4 2020-04-19 20:48:53

loqs
Member
Registered: 2014-03-06
Posts: 18,230

Re: [SOLVED]Advice to merge old .config with new one?

Could you provide the more details on when the checksum is not updated?

Offline

#5 2020-04-20 16:12:59

vitaliy.kuzmich
Member
Registered: 2015-11-29
Posts: 64

Re: [SOLVED]Advice to merge old .config with new one?

loqs wrote:

Could you provide the more details on when the checksum is not updated?

just checked, it works fine, have no idea what went wrong last time.

Offline

#6 2020-04-20 18:34:51

Ropid
Member
Registered: 2015-03-09
Posts: 1,069

Re: [SOLVED]Advice to merge old .config with new one?

About the PKGBUILD changes, I found that the update for the PKGBUILD works out a lot more often if you don't touch the original "source=(...)" and "sha256sum=(...)" lines and instead put your stuff onto separate lines using "+=" to add to the source/sha256sums arrays. Here is an example about what I mean:

source+=(
  my-config.fragment
  0110-Initialize-ata-before-graphics.patch
  futex-wait-multiple-5.2.1.patch
)
sha256sums+=(
  SKIP
  93344aa64331f7324b5a3647b9e9b15227f6fefc60037305d223d9e1cd273c73  #0110-Initialize-ata-before-graphics.patch
  b8a9225b4b5cbabac26398d11cc26566e4407d150dacb92f3411c9bb8cc23942  #futex-wait-multiple-5.2.1.patch
)

I added these lines in front of the "prepare()" function.

About the config, I first did my customizations using menuconfig etc., and then I did a "diff -u ..." to get a list of what's different between the original Arch config and my own config. I then used that diff as a base to write a "fragment" file that looks like this:

$ cat my-config.fragment 
# CONFIG_KERNEL_XZ is not set
CONFIG_KERNEL_LZ4=y
# CONFIG_NO_HZ_IDLE is not set
CONFIG_NO_HZ_FULL=y
CONFIG_PREEMPT_VOLUNTARY=y
# CONFIG_PREEMPT is not set
CONFIG_VIRT_CPU_ACCOUNTING=y
CONFIG_TREE_RCU=y
CONFIG_RCU_NOCB_CPU=y
# CONFIG_HZ_300 is not set
CONFIG_HZ_1000=y
CONFIG_HZ=1000
CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL is not set

The kernel source comes with a script named "merge-config.sh" to add this kind of fragment file onto an existing config file. I changed the part in the PKGBUILD where the Arch config is copied into this here:

  echo "Setting config..."
  #cp ../config .config
  ./scripts/kconfig/merge_config.sh -m ../config ../my-config.fragment
  make olddefconfig

I commented out the original "cp" line and added the merge-config.sh line. The merge-config.sh script does the same as copying while also applying the changes from the fragment file.

Offline

#7 2020-05-01 17:54:17

vitaliy.kuzmich
Member
Registered: 2015-11-29
Posts: 64

Re: [SOLVED]Advice to merge old .config with new one?

loqs wrote:

Could you provide the more details on when the checksum is not updated?

Yes, it happen again, git asked me to do merge(of the kernel source) manually, which obviously I do not want to do.. It did not happen when I upgrade from 5.6.x, but it happen when I upgrade to 5.6.8 from 5.6.7.

Last edited by vitaliy.kuzmich (2020-05-01 18:09:52)

Offline

#8 2020-05-01 18:13:28

vitaliy.kuzmich
Member
Registered: 2015-11-29
Posts: 64

Re: [SOLVED]Advice to merge old .config with new one?

Ropid wrote:

About the PKGBUILD changes, I found that the update for the PKGBUILD works out a lot more often if you don't touch the original "source=(...)" and "sha256sum=(...)" lines and instead put your stuff onto separate lines using "+=" to add to the source/sha256sums arrays. Here is an example about what I mean:

source+=(
  my-config.fragment
  0110-Initialize-ata-before-graphics.patch
  futex-wait-multiple-5.2.1.patch
)
sha256sums+=(
  SKIP
  93344aa64331f7324b5a3647b9e9b15227f6fefc60037305d223d9e1cd273c73  #0110-Initialize-ata-before-graphics.patch
  b8a9225b4b5cbabac26398d11cc26566e4407d150dacb92f3411c9bb8cc23942  #futex-wait-multiple-5.2.1.patch
)

I added these lines in front of the "prepare()" function.

About the config, I first did my customizations using menuconfig etc., and then I did a "diff -u ..." to get a list of what's different between the original Arch config and my own config. I then used that diff as a base to write a "fragment" file that looks like this:

$ cat my-config.fragment 
# CONFIG_KERNEL_XZ is not set
CONFIG_KERNEL_LZ4=y
# CONFIG_NO_HZ_IDLE is not set
CONFIG_NO_HZ_FULL=y
CONFIG_PREEMPT_VOLUNTARY=y
# CONFIG_PREEMPT is not set
CONFIG_VIRT_CPU_ACCOUNTING=y
CONFIG_TREE_RCU=y
CONFIG_RCU_NOCB_CPU=y
# CONFIG_HZ_300 is not set
CONFIG_HZ_1000=y
CONFIG_HZ=1000
CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL is not set

The kernel source comes with a script named "merge-config.sh" to add this kind of fragment file onto an existing config file. I changed the part in the PKGBUILD where the Arch config is copied into this here:

  echo "Setting config..."
  #cp ../config .config
  ./scripts/kconfig/merge_config.sh -m ../config ../my-config.fragment
  make olddefconfig

I commented out the original "cp" line and added the merge-config.sh line. The merge-config.sh script does the same as copying while also applying the changes from the fragment file.

Thats interesting, so it is different from running make oldconfig ? hmm, are there a chance that make oldconfig would miss something ?

Last edited by vitaliy.kuzmich (2020-05-01 18:17:11)

Offline

#9 2020-05-01 20:46:36

loqs
Member
Registered: 2014-03-06
Posts: 18,230

Re: [SOLVED]Advice to merge old .config with new one?

merge_config.sh merging two configs to produce .config.
make oldconfig is updating .config and will prompt when a required option is not present in .config.
make olddefconfig is updating .config and use the default value when a required option is not present in .config.

Offline

Board footer

Powered by FluxBB