Re: Problem in compiling a kernel module
On Sun, Jul 10, 2011 at 10:09 PM, Niamathullah sharief wrote: > Dear Kumaran, > > Try to compile with the below makefile > > *" > > obj-m += hello-1.o > > all: > make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules > > clean: > make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean" > > *This was the one I tried first, but it didn't work. The code suggested by > Prashant worked. I just want to know why the above code doesn't work. > > Regards > Sharief > > Thanks sir, It worked. But still I couldn't understand what is the wrong in > the makefile given in TLDP.org, also the if statements as said in the > previous mail. > One more thing can I install the new kernel in a virtual machine like > virtual box? if so how can I do it? coz I can't access Internet from that > kernel. Suggesting some measures will be helpful. > > -- > thanks, > kumaran > > ___ >> Kernelnewbies mailing list >> Kernelnewbies@kernelnewbies.org >> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies >> >> > -- thanks, kumaran ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Problem in compiling a kernel module
On Sun, Jul 10, 2011 at 12:15 PM, Prashant Shah wrote: > Hi, > > On Sun, Jul 10, 2011 at 11:36 AM, Ponkumaran Annadurai > wrote: > > > > Also I couldn't understand the script (particularly $(MAKE) - what does > the > > variable stands for? also the rest of the code after > "depend.depend.dep"). > > If you can explain the script, I shall know how to edit the script for my > > file. > > Edit the Makefile and add the following echo's > > `default: >echo $(MAKE) >echo $(KERNELDIR) >echo $(PWD) > $(MAKE) -C $(KERNELDIR) M=$(PWD) > > You can try echoing the values of the variables. The $(MAKE) is the > make command used. > Thanks sir, It worked. But still I couldn't understand what is the wrong in the makefile given in TLDP.org, also the if statements as said in the previous mail. One more thing can I install the new kernel in a virtual machine like virtual box? if so how can I do it? coz I can't access Internet from that kernel. Suggesting some measures will be helpful. -- thanks, kumaran ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Problem in compiling a kernel module
On Sun, Jul 10, 2011 at 11:03 AM, Prashant Shah wrote: > Hi, > > On Sun, Jul 10, 2011 at 10:07 AM, Ponkumaran Annadurai > wrote: > > I am trying to compile a sample hello world module, but when issue make > > command, it says that "make: Nothing to be done for `all'.". > > > > --- Makefile -- > obj-m += testmod.o > > KERNELDIR ?= /lib/modules/$(shell uname -r)/build > PWD := $(shell pwd) > > default: >$(MAKE) -C $(KERNELDIR) M=$(PWD) > > clean: >rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions > > depend .depend dep: >$(CC) $(CFLAGS) -M *.c > .depend > > ifeq (.depend,$(wildcard .depend)) >include .depend > endif > > -- > when I tried your script it prompted that there might be tab instead of eight spaces. So I inserted 8 spaces there, but it still prompted the same. Also I couldn't understand the script (particularly $(MAKE) - what does the variable stands for? also the rest of the code after "depend.depend.dep"). If you can explain the script, I shall know how to edit the script for my file. -- kumaran ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Problem in compiling a kernel module
I am trying to compile a sample hello world module, but when issue make command, it says that "make: Nothing to be done for `all'.". Also I tried the command "make hello", then it is showing that "linux/module.h no such file". But I am in the newly compiled kernel. What might be the problem? -- thanks, kumaran ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Problem in compiling kernel
On Wed, Jun 29, 2011 at 12:42 PM, Daniel Baluta wrote: > >>> I got struck in making initrd file, I got the following error > >>> > >>> > >>> root@rocker:/boot# mkinitramfs -o initrd.img-2.6.39.1 2.6.39.1Y > >> > >> 2.6.39.1Y? - shouldn't it be 2.6.39.1. > > > > Daniel, I guess Ponkumaran did something (wrong) with extra > > version...what do you think? > > > Mulyadi, I don't see how he could have changed EXTRA_VERSION from Makefile. > > No, I didn do anything in the Makefile > Ponkumaran, could you try running: > # mkinitramfs -o initrd.img-2.6.39.1 2.6.39.1 > > I tried this one first but I was prompted that the folder 2.6.39.1 is not found in /lib/modules. Then I found a folder named 2.6.39.1Y thats why I used this name. But now I guess that this Y is given by me during configuration in the place for local version option. Is that any problem with that? > thanks, > Daniel. > -- thanks, kumaran ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Problem in compiling kernel
I got struck in making initrd file, I got the following error root@rocker:/boot# mkinitramfs -o initrd.img-2.6.39.1 2.6.39.1Y W: Possible missing firmware /lib/firmware/rtl_nic/rtl8105e-1.fw for module r8169 W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168d-2.fw for module r8169 W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168d-1.fw for module r8169 can you suggest me the proper ways to compile a kernel? -- thanks, kumaran ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Problem in compiling kernel
On Tue, Jun 28, 2011 at 4:59 PM, Daniel Baluta wrote: > On Tue, Jun 28, 2011 at 2:07 PM, Ponkumaran Annadurai > wrote: > > > > > > On Tue, Jun 28, 2011 at 1:13 PM, Daniel Baluta > > wrote: > >> > >> >> Have you tried to setup some sort of cross-compilation environment? > >> >> Could you check CROSS_COMPILE env variable? > >> > >> > Yes, I have given yes for that option during configuration > >> > >> OK, then that's your problem. CROSS_COMPILE is a string > >> pointing to your cross compiler prefix. > >> > >> thanks, > >> Daniel. > > > > > > Yes, It worked. Thank you sir. But I couldn't understand the reason. Can > you > > explain this to me? > > Please keep kernelnewbies to CC:, so that other can read about this problem > if they hit it. > > The reason for which it didn't work is that you haven't set a valid > cross-compiler > prefix in CROSS_COMPILE > > When you set a cross-compiler prefix, the value stored in CROSS_COMPILE is > concatenated with the name of each tool used to compile your kernel. > > For example, objdump will be used as ${CROSS_COMPILE}objdump. You set > CROSS_COMPILE=Y, and the tool to be used is now named Yobjdump, which > obviously doesn't exist. > > Valid values for CROSS_COMPILE look like this: CROSS_COMPILE= > mips64-octeon-linux-gnu-. > > Hope that things are now more clear. > > thanks, > Daniel > Yes, they are clear. Thank you sir. -- regards, kumaran ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Problem in compiling kernel
Hello, I encountered the following error while compiling the kernel version linux-2.6.39.1. So I am giving here what I got on my screen. root@rocker:/usr/src/linux-2.6.39.1# make CHK include/linux/version.h CHK include/generated/utsrelease.h CC kernel/bounds.s GEN include/generated/bounds.h CC arch/x86/kernel/asm-offsets.s GEN include/generated/asm-offsets.h CALLscripts/checksyscalls.sh HOSTCC scripts/genksyms/genksyms.o SHIPPED scripts/genksyms/lex.c SHIPPED scripts/genksyms/parse.h SHIPPED scripts/genksyms/keywords.c HOSTCC scripts/genksyms/lex.o SHIPPED scripts/genksyms/parse.c HOSTCC scripts/genksyms/parse.o HOSTLD scripts/genksyms/genksyms CC scripts/mod/empty.o /bin/sh: Yobjdump: not found HOSTCC scripts/mod/mk_elfconfig MKELF scripts/mod/elfconfig.h HOSTCC scripts/mod/file2alias.o HOSTCC scripts/mod/modpost.o HOSTCC scripts/mod/sumversion.o HOSTLD scripts/mod/modpost HOSTCC scripts/selinux/genheaders/genheaders HOSTCC scripts/selinux/mdp/mdp HOSTCC scripts/kallsyms HOSTCC scripts/conmakehash HOSTCC scripts/recordmcount CC init/main.o /bin/sh: Yobjdump: not found CHK include/generated/compile.h UPD include/generated/compile.h CC init/version.o /bin/sh: Yobjdump: not found CC init/do_mounts.o /bin/sh: Yobjdump: not found CC init/do_mounts_rd.o /bin/sh: Yobjdump: not found CC init/do_mounts_initrd.o /bin/sh: Yobjdump: not found CC init/do_mounts_md.o /bin/sh: Yobjdump: not found LD init/mounts.o /bin/sh: Yld: not found make[1]: *** [init/mounts.o] Error 127 make: *** [init] Error 2 Please help me to figure the problem and the way to get out of it. Thank you. -- With regards, kumaran ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies