Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sat, 3 Feb 2018 20:28:40 +0100
From: Adam Zabrocki <pi3@....com.pl>
To: lkrg-users@...ts.openwall.com
Cc: Solar Designer <solar@...nwall.com>
Subject: Re: How to compile?

Hi,

> 
> without sudo:
> 
> $ make
> make -C /lib/modules/4.4.111/build M=/home/horizn/Downloads/lkrg-0.0 modules
> make[1]: Entering directory '/usr/src/linux-4.4.111'
>    CC [M] /home/horizn/Downloads/lkrg-0.0/src/modules/wrap/p_struct_wrap.o
> /home/horizn/Downloads/lkrg-0.0/src/modules/wrap/p_struct_wrap.c: In 
> function 'p_module_core':
> /home/horizn/Downloads/lkrg-0.0/src/modules/wrap/p_struct_wrap.c:88:16: 
> error: 'struct module' has no member named 'core_layout'
>      return p_mod->core_layout.base;
>                  ^
> /home/horizn/Downloads/lkrg-0.0/src/modules/wrap/p_struct_wrap.c: In 
> function 'p_core_size':
> /home/horizn/Downloads/lkrg-0.0/src/modules/wrap/p_struct_wrap.c:92:16: 
> error: 'struct module' has no member named 'core_layout'
>      return p_mod->core_layout.size;
>                  ^
> /home/horizn/Downloads/lkrg-0.0/src/modules/wrap/p_struct_wrap.c: In 
> function 'p_core_text_size':
> /home/horizn/Downloads/lkrg-0.0/src/modules/wrap/p_struct_wrap.c:96:16: 
> error: 'struct module' has no member named 'core_layout'
>      return p_mod->core_layout.text_size;
>                  ^
> /home/horizn/Downloads/lkrg-0.0/src/modules/wrap/p_struct_wrap.c: In 
> function 'p_init_text_size':
> /home/horizn/Downloads/lkrg-0.0/src/modules/wrap/p_struct_wrap.c:100:16: 
> error: 'struct module' has no member named 'init_layout'
>      return p_mod->init_layout.text_size;
>                  ^
> /home/horizn/Downloads/lkrg-0.0/src/modules/wrap/p_struct_wrap.c: In 
> function 'p_module_core':
> /home/horizn/Downloads/lkrg-0.0/src/modules/wrap/p_struct_wrap.c:89:1: 
> warning: control reaches end of non-void function [-Wreturn-type]
>   }
>   ^
> /home/horizn/Downloads/lkrg-0.0/src/modules/wrap/p_struct_wrap.c: In 
> function 'p_core_size':
> /home/horizn/Downloads/lkrg-0.0/src/modules/wrap/p_struct_wrap.c:93:1: 
> warning: control reaches end of non-void function [-Wreturn-type]
>   }
>   ^
> /home/horizn/Downloads/lkrg-0.0/src/modules/wrap/p_struct_wrap.c: In 
> function 'p_core_text_size':
> /home/horizn/Downloads/lkrg-0.0/src/modules/wrap/p_struct_wrap.c:97:1: 
> warning: control reaches end of non-void function [-Wreturn-type]
>   }
>   ^
> /home/horizn/Downloads/lkrg-0.0/src/modules/wrap/p_struct_wrap.c: In 
> function 'p_init_text_size':
> /home/horizn/Downloads/lkrg-0.0/src/modules/wrap/p_struct_wrap.c:101:1: 
> warning: control reaches end of non-void function [-Wreturn-type]
>   }
>   ^
> scripts/Makefile.build:258: recipe for target 
> '/home/horizn/Downloads/lkrg-0.0/src/modules/wrap/p_struct_wrap.o' failed
> make[2]: *** 
> [/home/horizn/Downloads/lkrg-0.0/src/modules/wrap/p_struct_wrap.o] Error 1
> Makefile:1408: recipe for target 
> '_module_/home/horizn/Downloads/lkrg-0.0' failed
> make[1]: *** [_module_/home/horizn/Downloads/lkrg-0.0] Error 2
> make[1]: Leaving directory '/usr/src/linux-4.4.111'
> Makefile:63: recipe for target 'all' failed
> make: *** [all] Error 2
> 
> with sudo:
> 
> ...
> 
>    IHEX2FW firmware/whiteheat.fw
>    IHEX2FW firmware/keyspan_pda/keyspan_pda.fw
>    IHEX2FW firmware/keyspan_pda/xircom_pgs.fw
>    IHEX    firmware/cpia2/stv0672_vp4.bin
>    IHEX    firmware/yam/1200.bin
>    IHEX    firmware/yam/9600.bin
> make[1]: Leaving directory '/usr/src/linux-4.4.111'
> mkdir -p "output"
> mv /p_lkrg.ko "output"
> mv: cannot stat '/p_lkrg.ko': No such file or directory
> Makefile:63: recipe for target 'all' failed
> make: *** [all] Error 1
> 
> Slackware 14.2 64bit with stock kernel 4.4.111
> 
> -- 
> skype. kamil.kapturkiewicz
> tel/signal. +44 758 306 8467
> 

You are hitting problem with backporting some of the kernel patches and each 
distro handles it differently. Linux kernel changed the layout of 'struct 
module' via dollowing patch:

http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/diff/include/linux/module.h?id=7523e4dc5057 

(among other for better caching) but many distros may or may not backport this 
patch to own kernel tree for other kernels as well. LKRG takes this into 
account and this patch is handled by comparing which version of the kernel tree 
supports it via:

file "lkrg-main/src/modules/kmod/p_kmod_wrapper.c"

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 6)
...
#else
...
#endif

It look like your kernel tree doesn't have that patch yet, so the easiest 
option is to change this line:

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 6)

to be e.g.:

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0)

and it should compile correctly. We can't do it for the official LKRG 
repository because other kernel will have opposite problem.

Thanks,
Adam

-- 
pi3 (pi3ki31ny) - pi3 (at) itsec pl
http://pi3.com.pl

Powered by blists - more mailing lists

Your e-mail address:

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.