git.iko.soy/typeable/nixpkgs
on master help sign in
tests/boot-stage1: Fix build of kcanary module

In bfe9c928c18583d3adfb5978a55b48c392649ef5 the default kernel has been updated to version 4.14 and the declarations for allow_signal() and signal_pending() are no longer exposed via kthread.h, so let's actually use the right header files. I've added a condition for kernel 4.10 and upwards to include the linux/sched/signal.h header file, because that got introduced in version 4.10. Even if the declaration would still reside in kthread.h (I haven't checked) for version 4.10 it won't hurt and the compilation will still succeed. Tested against kernel 4.9 and 4.14 and the build now succeeds. Signed-off-by: aszlig <aszlig@nix.build>

commitf6ae3948bc6aeac8aba70ce28c347c8882d8bf47 authoraszlig <aszlig@nix.build> dateTue 14 Nov 2017, 04:30 (9 years ago) parentba45205
1 file changed+5
nixos/tests/boot-stage1.nix+5
nixos/tests/boot-stage1.nix+5
@@ -21,11 +21,16 @@ import ./make-test.nix ({ pkgs, ... }: {
2121 # the boot process kills any kthread by accident, like what happened in
2222 # issue #15226.
2323 kcanary = compileKernelModule "kcanary" ''
24+ #include <linux/version.h>
2425 #include <linux/init.h>
2526 #include <linux/module.h>
2627 #include <linux/kernel.h>
2728 #include <linux/kthread.h>
2829 #include <linux/sched.h>
30+ #include <linux/signal.h>
31+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
32+ #include <linux/sched/signal.h>
33+ #endif
2934
3035 struct task_struct *canaryTask;
3136