<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>12803</bug_id>
          
          <creation_ts>2018-06-20 10:19:47 +0000</creation_ts>
          <short_desc>[Yocto-2.6_M1.RC1]  Building a kernel module on target image fails</short_desc>
          <delta_ts>2018-06-22 11:58:05 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>Meta-yocto</product>
          <component>meta-yocto</component>
          <version>2.6</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>NOTABUG</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.6 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="pankaj yadav">pankaj-y</reporter>
          <assigned_to name="Apoorv">apoorv.sangal</assigned_to>
          <cc>manish.das</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>richard.purdie</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>80844</commentid>
    <comment_count>0</comment_count>
    <who name="pankaj yadav">pankaj-y</who>
    <bug_when>2018-06-20 10:19:47 +0000</bug_when>
    <thetext>Test Case ID : https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=316
poky commit ddbd7b0cd6580ee26e11aa87e426fb294b372d64

Please find the logs for the same : 
root@qemux86-64:/usr/src/kernel# cd /home/root/
root@qemux86-64:~# make
make -C /usr/src/kernel M=/home/root modules
make[1]: Entering directory &apos;/usr/src/kernel&apos;
make[2]: *** No rule to make target &apos;tools/objtool/objtool&apos;, needed by &apos;/home/root/hello.o&apos;. Stop.
make[1]: *** [Makefile:1522: _module_/home/root] Error 2
make[1]: Leaving directory &apos;/usr/src/kernel&apos;
make: *** [Makefile:6: all] Error 2

Steps to reproduce : 
1.Create a QEMU(x86 or x86-64) core-image-sato-sdk image. 
2.Run &apos;make scripts&apos; in /usr/src/kernel
3. cd /home/root and create hello.c with the following content:
#undef _KERNEL_
#define _KERNEL_
#undef MODULE
#define MODULE
#include &lt;linux/module.h&gt;	
#include &lt;linux/kernel.h&gt;	
#include &lt;linux/init.h&gt;	
static int __init hello_init(void)

{ printk(KERN_INFO &quot;Hello world!\n&quot;); return 0;	}
static void __exit hello_cleanup(void)

{ printk(KERN_INFO &quot;Cleaning up module.\n&quot;); }
module_init(hello_init);
module_exit(hello_cleanup);
4. Create a Makefile with the following content and run &apos;make&apos;
obj-m := hello.o
KDIR := /usr/src/kernel
PWD := $(shell pwd)
all:
$(MAKE) -C $(KDIR) M=$(PWD) modules
clean:
$(MAKE) -C $(KDIR) M=$(PWD) clean</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80859</commentid>
    <comment_count>1</comment_count>
    <who name="pankaj yadav">pankaj-y</who>
    <bug_when>2018-06-21 08:19:00 +0000</bug_when>
    <thetext>While Regression, I unable to see this issue with below mentioned cofiguration :
Branch: master
Build name: yocto-2.5_M1.rc1
poky commit: b73e96e7f3f5d1ba3a221d99792a7a3c7ef42c21  
Architecture : x86-64</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80867</commentid>
    <comment_count>2</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2018-06-21 09:11:49 +0000</bug_when>
    <thetext>As far as I can tell this is an automated test case:

http://git.yoctoproject.org/cgit.cgi/poky/tree/meta/lib/oeqa/runtime/cases/kernelmodule.py

a) Why are QA running this manually?
b) If it really does need to be run manually, the steps need updating, as already done in the above code:

http://git.yoctoproject.org/cgit.cgi/poky/commit/meta/lib/oeqa/runtime/cases/kernelmodule.py?id=0f85563eacf5138d98b826343cdfc3833d1c5c8e

i.e. &quot;make scripts prepare&quot; instead of &quot;make scripts&quot;

I still wonder why this is being run manually though?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80868</commentid>
    <comment_count>3</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2018-06-21 09:12:43 +0000</bug_when>
    <thetext>Also, one part of the bug says yocto-2.5_M1.rc1 the other says yocto-2.6_M1.rc1, I&apos;ll assume the latter is correct...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80887</commentid>
    <comment_count>4</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2018-06-21 15:00:44 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; Also, one part of the bug says yocto-2.5_M1.rc1 the other says
&gt; yocto-2.6_M1.rc1, I&apos;ll assume the latter is correct...

I realise now you&apos;re highlighting this is a regression, thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80898</commentid>
    <comment_count>5</comment_count>
    <who name="pankaj yadav">pankaj-y</who>
    <bug_when>2018-06-22 07:41:12 +0000</bug_when>
    <thetext>Issue has gone with &quot;make scripts prepare&quot; instead of &quot;make scripts&quot;.
Hence please help to close this issue.

Configuration :
Architecture : x86-64
Release : 2.6_M1.RC1

Logs are given below for the same :

root@qemux86-64:/usr/src/kernel# make scripts prepare
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/basic/bin2c
  CC      scripts/mod/empty.o
  HOSTCC  scripts/mod/mk_elfconfig
  MKELF   scripts/mod/elfconfig.h
  HOSTCC  scripts/mod/modpost.o
  CC      scripts/mod/devicetable-offsets.s
  CHK     scripts/mod/devicetable-offsets.h
  UPD     scripts/mod/devicetable-offsets.h
  HOSTCC  scripts/mod/file2alias.o
  HOSTCC  scripts/mod/sumversion.o
  HOSTLD  scripts/mod/modpost
  HOSTCC  scripts/kallsyms
  HOSTCC  scripts/conmakehash
  HOSTCC  scripts/recordmcount
  HOSTCC  scripts/sortextable
  HOSTCC  arch/x86/tools/relocs_32.o
  HOSTCC  arch/x86/tools/relocs_64.o
  HOSTCC  arch/x86/tools/relocs_common.o
  HOSTLD  arch/x86/tools/relocs
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  CC      kernel/bounds.s
  CHK     include/generated/bounds.h
  CHK     include/generated/timeconst.h
  CC      arch/x86/kernel/asm-offsets.s
  CHK     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh
  DESCEND  objtool
  HOSTCC   /usr/src/kernel/tools/objtool/fixdep.o
  HOSTLD   /usr/src/kernel/tools/objtool/fixdep-in.o
  LINK     /usr/src/kernel/tools/objtool/fixdep
  CC       /usr/src/kernel/tools/objtool/exec-cmd.o
  CC       /usr/src/kernel/tools/objtool/help.o
  CC       /usr/src/kernel/tools/objtool/pager.o
  CC       /usr/src/kernel/tools/objtool/parse-options.o
  CC       /usr/src/kernel/tools/objtool/run-command.o
  CC       /usr/src/kernel/tools/objtool/sigchain.o
  CC       /usr/src/kernel/tools/objtool/subcmd-config.o
  LD       /usr/src/kernel/tools/objtool/libsubcmd-in.o
  AR       /usr/src/kernel/tools/objtool/libsubcmd.a
  CC       /usr/src/kernel/tools/objtool/arch/x86/decode.o
  LD       /usr/src/kernel/tools/objtool/arch/x86/objtool-in.o
  CC       /usr/src/kernel/tools/objtool/builtin-check.o
  CC       /usr/src/kernel/tools/objtool/builtin-orc.o
  CC       /usr/src/kernel/tools/objtool/check.o
  CC       /usr/src/kernel/tools/objtool/orc_gen.o
  CC       /usr/src/kernel/tools/objtool/orc_dump.o
  CC       /usr/src/kernel/tools/objtool/elf.o
  CC       /usr/src/kernel/tools/objtool/special.o
  CC       /usr/src/kernel/tools/objtool/objtool.o
  CC       /usr/src/kernel/tools/objtool/libstring.o
  CC       /usr/src/kernel/tools/objtool/str_error_r.o
  LD       /usr/src/kernel/tools/objtool/objtool-in.o
Warning: synced file at &apos;tools/objtool/arch/x86/tools/gen-insn-attr-x86.awk&apos; differs from latest kernel version at &apos;arch/x86/tools/gen-insn-attr-x86.awk&apos;
  LINK     /usr/src/kernel/tools/objtool/objtool
root@qemux86-64:/usr/src/kernel# cd

root@qemux86-64:~# make
make -C /usr/src/kernel M=/home/root modules
make[1]: Entering directory &apos;/usr/src/kernel&apos;
  CC [M]  /home/root/hello.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /home/root/hello.mod.o
  LD [M]  /home/root/hello.ko
make[1]: Leaving directory &apos;/usr/src/kernel&apos;

root@qemux86-64:~# insmod hello.ko
root@qemux86-64:~# lsmod
Module                  Size  Used by
hello                  16384  0
nfsd                  258048  11
bnep                   20480  2
uvesafb                28672  1 

root@qemux86-64:~#  dmesg | grep -i hello
[  856.655544] hello: loading out-of-tree module taints kernel.
[  856.657533] hello: module license &apos;unspecified&apos; taints kernel.
[  856.688530] Hello world!
root@qemux86-64:~#</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80904</commentid>
    <comment_count>6</comment_count>
    <who name="Manish Das">manish.das</who>
    <bug_when>2018-06-22 11:58:05 +0000</bug_when>
    <thetext>Re running the test case with &quot;make scripts prepare&quot; instead of &quot;make scripts&quot; as suggested by Richard, resolved the issue.

Since this test case is already automated, this test care will be removed from the manual execution test suite.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>