autokernel icon indicating copy to clipboard operation
autokernel copied to clipboard

Does not work with older kernels

Open lovesegfault opened this issue 2 years ago • 1 comments

While working on #2, I found that autokernel will not work on some older kernel releases:

all versions Get this warning:

linux-config> scripts/kconfig/autokernel_bridge.c: In function 'init':
linux-config> scripts/kconfig/autokernel_bridge.c:80:9: warning: ignoring return value of 'getcwd' declared with attribute 'warn_unused_result' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-result-Wunused-result8;;]
linux-config>    80 |         getcwd(saved_working_directory, 2048);

5.10

linux-config> building
linux-config> scripts/kconfig/autokernel_bridge.c: In function 'init':
linux-config> scripts/kconfig/autokernel_bridge.c:80:9: warning: ignoring return value of 'getcwd' declared with attribute 'warn_unused_result' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-result-Wunused-result8;;]
linux-config>    80 |         getcwd(saved_working_directory, 2048);
linux-config>       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
linux-config>        Built bridge for . in 3.54s
linux-config> sh: ./scripts/ld-version.sh: not found
linux-config> init/Kconfig:39: syntax error
linux-config> init/Kconfig:38: invalid statement

4.19

linux-config> building
linux-config> scripts/kconfig/autokernel_bridge.c: In function 'init':
linux-config> scripts/kconfig/autokernel_bridge.c:80:9: warning: ignoring return value of 'getcwd' declared with attribute 'warn_unused_result' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-result-Wunused-result8;;]
linux-config>    80 |         getcwd(saved_working_directory, 2048);
linux-config>       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
linux-config>        Built bridge for . in 3.32s
linux-config> error: ./scripts/kconfig/autokernel_bridge.so: undefined symbol: sym_get_range_prop

4.14

linux-config> building
linux-config> scripts/kconfig/autokernel_bridge.c: In function 'init':
linux-config> scripts/kconfig/autokernel_bridge.c:80:9: warning: ignoring return value of 'getcwd' declared with attribute 'warn_unused_result' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-result-Wunused-result8;;]
linux-config>    80 |         getcwd(saved_working_directory, 2048);
linux-config>       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
linux-config>        Built bridge for . in 3.29s
linux-config> error: ./scripts/kconfig/autokernel_bridge.so: undefined symbol: sym_get_range_prop

The last two failures seem to be due to a breaking change to the kconfig api at some point?

lovesegfault avatar Mar 07 '23 22:03 lovesegfault

all versions Get this warning:

Thanks, I've added a check in case that statement fails. But as you've noticed this is just a warning, so unrelated to the issues you are having.

5.10 [...] 4.19 [...] 4.14 [...]

Hmm, these seems to be tooling related. I just tested all of them (freshly downloaded from kernel.org) and they work fine for me - both on NixOS with the tooling outlined in #2 and on my WSL. As far as I can remember I also tested all supported minor versions locally at least once (Probably should add that to the integration tests though...).

linux-config> sh: ./scripts/ld-version.sh: not found
linux-config> init/Kconfig:39: syntax error
linux-config> init/Kconfig:38: invalid statement

This looks like a typical nix issue where the interpreter for ./scripts/ld-version.sh (or a nested script) wasn't found. That's what I was asking about in my last reply to #2 regarding how nix solves this issue currently.

linux-config> error: ./scripts/kconfig/autokernel_bridge.so: undefined symbol: sym_get_range_prop

This is more concerning, especially because I cannot reproduce this. sym_get_range_prop is in the kernel's Kconfig API, also for 4.14 and 4.19:

~/linux-4.19 $ rg sym_get_range_prop
scripts/kconfig/symbol.c
91:static struct property *sym_get_range_prop(struct symbol *sym)

Are you using a modified kernel tarball?

oddlama avatar Mar 08 '23 00:03 oddlama