Hi all, I tried, as beginner, to compile a simple module downloaded by internet, hello_printk, I am using ArchLinux and I followed the simplest way for compile a new kernel tree from here : https://wiki.archlinux.org/index.php/Kernels/Compilation/Arch_Build_System But when I try to compile I catch these errors: echo >&2 " ERROR: Kernel configuration is invalid."; \ echo >&2 " include/generated/autoconf.h or include/config/auto.conf are missing.";\ echo >&2 " Run 'make oldconfig && make prepare' on kernel src to fix it."; \ echo >&2 ; \ /bin/false) Of course I checked the path of the kernel and under the directory wrote on the error messages I can find the files autoconf.h and auto.conf that I really don't understand what could be wrong, the makefile is really really simple then I can post it: obj-m := hello_printk.o KDIR ?= mypersonalpath/core/linux/src/linux-3.7 PWD := $(shell pwd) default: $(MAKE) -C $(KDIR) M=$(PWD) modules Someone can help me ? Pietro Paolini pulsarpietro@aol.com
On Tue, Mar 5, 2013 at 7:48 AM, Pietro Paolini <pulsarpietro@aol.com> wrote:
Hi all,
I tried, as beginner, to compile a simple module downloaded by internet, hello_printk, I am using ArchLinux and I followed the simplest way for compile a new kernel tree from here :
https://wiki.archlinux.org/index.php/Kernels/Compilation/Arch_Build_System
But when I try to compile I catch these errors:
echo >&2 " ERROR: Kernel configuration is invalid."; \ echo >&2 " include/generated/autoconf.h or include/config/auto.conf are missing.";\ echo >&2 " Run 'make oldconfig && make prepare' on kernel src
try the suggested above step. IIRC, those commands will do things like preparing the neccessary object files, headers and so on, so it is ready for you to be used on your kernel programming. Apologize since I can't provide deeper details about this. -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com
On Tue, 05 Mar 2013 09:07:51 +0700, Mulyadi Santosa said:
On Tue, Mar 5, 2013 at 7:48 AM, Pietro Paolini <pulsarpietro@aol.com> wrote:
echo >&2 " Run 'make oldconfig && make prepare' on kernel src
try the suggested above step. IIRC, those commands will do things like preparing the neccessary object files, headers and so on, so it is ready for you to be used on your kernel programming.
In addition, note that 'make oldconfig' followed by 'make prepare' will only do the right thing and result in a usable module if the source tree matches your running kernel. Doing 'make prepare' on a 3.7.2 source tree and then building a module against it will result in a module that loads in a 3.7.2 kernel with the same .config - but a different .config and/or release will have anything from a module that simply won't load to one that blows up the system for mysterious reasons. It's *highly* recommended that you first learn how to build, install, and boot a self-compiled kernel (and remember to keep your distro kernel around), and then once you got that down, *then* start building external modules against it.
participants (3)
-
Mulyadi Santosa -
Pietro Paolini -
Valdis.Kletnieks@vt.edu