You are not logged in.

#1 2019-02-01 12:46:30

dmg1337
Member
Registered: 2019-01-28
Posts: 13

Config changes are revert after recompile(arch build system)

Hi everyone, I am trying to recompile my kernel for it to support some debugging options(kgdb, debug symbols and etc). I follow the guide in the wiki, for some reason the changes to the config get canceled, and I don`t have the debug symbols\the kgdb support. I tried it a few times, to see if I configured something wrong in the first time, but each and every time the config defaults back to its old form. My estimation for the cause of the problem, is that my prepare function have make oldefconfig before the make menuconfig/nconfig(tried with both) . My guess, is that is somehow causes the kernel to compile the old config no matter what changes I do after it. I even tried to add vim .config to the prepare function too see if the make menuconfig/nconfig really works, and in both cases the changes were there. But somehow after the process finished it dosen`t have the new features I set in the .config. My question is: what do I need to change, or might cause the problem, and if it is indeed the make olddefconfig, how can I edit my new config  based on the old config/arch default config as a template?

Offline

#2 2019-02-01 13:10:14

loqs
Member
Registered: 2014-03-06
Posts: 17,378

Re: Config changes are revert after recompile(arch build system)

What is the PKGBUILD.  What is the .config with your changes.  What is the .config after that has been processed by make olddefconfig?

Offline

#3 2019-02-01 13:19:31

dmg1337
Member
Registered: 2019-01-28
Posts: 13

Re: Config changes are revert after recompile(arch build system)

loqs wrote:

What is the PKGBUILD.  What is the .config with your changes.  What is the .config after that has been processed by make olddefconfig?

This is the PKGBUILD https://pastebin.com/qNf8UXcR (the vim .config is for debugging purposes, I added it after the first fail). The old .config had the (DEBUG_SYMBOLS, kgdb(options), readable assembly, and magic sysreq as 0x1). The new .config, after the makepkg is done is just the same as it was before, with the default arch config.

Offline

#4 2019-02-01 13:29:29

loqs
Member
Registered: 2014-03-06
Posts: 17,378

Re: Config changes are revert after recompile(arch build system)

I need to see the .config before and after.  DEBUG_SYMBOLS or CONFIG_DEBUG_SYMBOLS would be invalid.

Offline

#5 2019-02-01 16:44:07

dmg1337
Member
Registered: 2019-01-28
Posts: 13

Re: Config changes are revert after recompile(arch build system)

loqs wrote:

I need to see the .config before and after.  DEBUG_SYMBOLS or CONFIG_DEBUG_SYMBOLS would be invalid.

Well it seems this is the root of the problem. When the prepare function shows me the config (using the vim .config), it has all the setting I set. But if I put it in the background and check the config, it dosen`t have the changes (https://pastebin.com/DyC0iwGg). Do you have any idea what can cause this problem ?

Offline

#6 2019-02-01 17:19:39

loqs
Member
Registered: 2014-03-06
Posts: 17,378

Re: Config changes are revert after recompile(arch build system)

  msg2 "Setting config..."
  cp ../config .config
  make olddefconfig
  make menuconfig
  vim .config
  make -s kernelrelease > ../version
  msg2 "Prepared %s version %s" "$pkgbase" "$(<../version)"

You save the contents in vim but keep do not exit vim and compare the contents with src/arch-linux/.config and they are not the same?

Offline

#7 2019-02-01 19:07:17

dmg1337
Member
Registered: 2019-01-28
Posts: 13

Re: Config changes are revert after recompile(arch build system)

loqs wrote:
  msg2 "Setting config..."
  cp ../config .config
  make olddefconfig
  make menuconfig
  vim .config
  make -s kernelrelease > ../version
  msg2 "Prepared %s version %s" "$pkgbase" "$(<../version)"

You save the contents in vim but keep do not exit vim and compare the contents with src/arch-linux/.config and they are not the same?


I just looked and I have a config file in /build/linux/trunk and in /build/linux/trunk/src that they are both the config without the changes the link I sent before(https://pastebin.com/DyC0iwGg), and a .config(that starts with a dot) file in  /build/linux/trunk/src/archlinux-linux that is the custom config,, that I want to compile the kernel by it(https://pastebin.com/uPE9HYBy). If you have any idea, how to solve this problem, and compile the kernel by the current config, I will be grateful.

Offline

#8 2019-02-01 19:16:59

loqs
Member
Registered: 2014-03-06
Posts: 17,378

Re: Config changes are revert after recompile(arch build system)

If you boot the custom kernel what is the output of

zgrep CONFIG_DEBUG_INFO /proc/config.gz

Offline

#9 2019-02-01 19:19:45

dmg1337
Member
Registered: 2019-01-28
Posts: 13

Re: Config changes are revert after recompile(arch build system)

loqs wrote:

If you boot the custom kernel what is the output of

zgrep CONFIG_DEBUG_INFO /proc/config.gz

It`s not set, I checked every time I compiled, and its just the old config. The exact message right now with the command is "# CONFIG_DEBUG_INFO is not set".

Offline

#10 2019-02-01 19:26:21

loqs
Member
Registered: 2014-03-06
Posts: 17,378

Re: Config changes are revert after recompile(arch build system)

What is the output of (this should be the config that was used for last build)

grep CONFIG_DEBUG_INFO /build/linux/trunk/src/archlinux-linux/.config

Offline

#11 2019-02-01 19:29:38

dmg1337
Member
Registered: 2019-01-28
Posts: 13

Re: Config changes are revert after recompile(arch build system)

loqs wrote:

What is the output of (this should be the config that was used for last build)

grep CONFIG_DEBUG_INFO /build/linux/trunk/src/archlinux-linux/.config

I just rebuild only the config, to try to find if it was the bug, so I don`t have it. Is there other way, I can try debug this other then getting this file. Or should I rebuild the kernel and get back to you. Right now this is the current setting, but something might cause it to change while building.

Offline

#12 2019-02-01 19:31:45

loqs
Member
Registered: 2014-03-06
Posts: 17,378

Re: Config changes are revert after recompile(arch build system)

Run makepkg until it reaches the build() function then abort it and check then.
Edit:
Please do not use makepkg -o as I want the build function to invoke make and see if that changes the .config.

Last edited by loqs (2019-02-01 19:34:06)

Offline

#13 2019-02-01 19:43:57

dmg1337
Member
Registered: 2019-01-28
Posts: 13

Re: Config changes are revert after recompile(arch build system)

loqs wrote:

Run makepkg until it reaches the build() function then abort it and check then.
Edit:
Please do not use makepkg -o as I want the build function to invoke make and see if that changes the .config.

So that what I already did and this is the correct config (https://pastebin.com/uPE9HYBy).

Offline

#14 2019-02-01 19:45:36

loqs
Member
Registered: 2014-03-06
Posts: 17,378

Re: Config changes are revert after recompile(arch build system)

Run makepkg -e let that build continue install it and check the kernel package produced.

Offline

#15 2019-02-01 19:48:09

dmg1337
Member
Registered: 2019-01-28
Posts: 13

Re: Config changes are revert after recompile(arch build system)

dmg1337 wrote:
loqs wrote:

Run makepkg until it reaches the build() function then abort it and check then.
Edit:
Please do not use makepkg -o as I want the build function to invoke make and see if that changes the .config.

So that what I already did and this is the correct config (https://pastebin.com/uPE9HYBy).

I get an error that the package group has already been built, its from the last kernel built. I think that if I force(-f) it will produce the same result.

Offline

#16 2019-02-01 19:57:29

loqs
Member
Registered: 2014-03-06
Posts: 17,378

Re: Config changes are revert after recompile(arch build system)

I can only suggest testing with makepkg  -ef.  I can not explain how the .config at /build/linux/trunk/src/archlinux-linux/.config can not match the one from the package.
You could use /build/linux/trunk/src/archlinux-linux/scripts/extract-ikconfig to extract the config from /build/linux/trunk/pkg/linux/boot/vmlinuz-linux and check that.
Edit:
Or use bsdtar to extract the contents of the .pkg if makepkg has already cleaned the pkg directory.
Edit:
From dmesg the Linux version string matches the kernel you just built?  Trying to rule out the possibility the package is built correctly but the generated kernel is not the one being booted.

Last edited by loqs (2019-02-01 20:11:12)

Offline

#17 2019-02-02 13:23:52

dmg1337
Member
Registered: 2019-01-28
Posts: 13

Re: Config changes are revert after recompile(arch build system)

loqs wrote:

I can only suggest testing with makepkg  -ef.  I can not explain how the .config at /build/linux/trunk/src/archlinux-linux/.config can not match the one from the package.
You could use /build/linux/trunk/src/archlinux-linux/scripts/extract-ikconfig to extract the config from /build/linux/trunk/pkg/linux/boot/vmlinuz-linux and check that.
Edit:
Or use bsdtar to extract the contents of the .pkg if makepkg has already cleaned the pkg directory.
Edit:
From dmesg the Linux version string matches the kernel you just built?  Trying to rule out the possibility the package is built correctly but the generated kernel is not the one being booted.

How can I check if the iinux version string matches the kernel (I checked uname -r, but I am not sure this is how I do it)? I just recompiled the kernel using makepkg -ef, and it didn`t change the config, so I am kind of clueless how should I proceed.

Offline

#18 2019-02-02 13:31:26

loqs
Member
Registered: 2014-03-06
Posts: 17,378

Re: Config changes are revert after recompile(arch build system)

In the first few lines of dmesg should be an entry similar to this one (this one is for a custom kernel I am using)

[    0.000000] Linux version 4.20.6-1-stable (builduser@buildbox) (gcc version 8.2.1 20181127 (GCC)) #1 SMP Thu Jan 31 14:24:10 UTC 2019

You could also get the build time from `uname -a`.

Offline

#19 2019-02-02 14:40:17

dmg1337
Member
Registered: 2019-01-28
Posts: 13

Re: Config changes are revert after recompile(arch build system)

loqs wrote:

In the first few lines of dmesg should be an entry similar to this one (this one is for a custom kernel I am using)

[    0.000000] Linux version 4.20.6-1-stable (builduser@buildbox) (gcc version 8.2.1 20181127 (GCC)) #1 SMP Thu Jan 31 14:24:10 UTC 2019

You could also get the build time from `uname -a`.

  Sorry to have waste your time, but it seems part of the problem was a stupid mistake of my own. But I couldn`t have figured that out without your help. The guide in the wiki tells that the installationshould be done by # pacman -U kernel-headers_package
# pacman -U kernel_package. Those command didn`t work and due to my own stupidity  I thought they weren't necessary, so each time I just compiled the kernel, reconfigured the boot, but didn't install the damn kernel. But even now, when the config in /proc/config.gz is the updated config, the changes I made still dont apply(heres the config in /rpoc/config.gz: https://pastebin.com/gjisxrWL), gdb cant use symbols, and I cant use kgdb.

Last edited by dmg1337 (2019-02-02 15:20:49)

Offline

Board footer

Powered by FluxBB