Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation/Makefile: No such file or directory #4

Open
parkerlreed opened this issue Feb 1, 2020 · 9 comments
Open

Documentation/Makefile: No such file or directory #4

parkerlreed opened this issue Feb 1, 2020 · 9 comments

Comments

@parkerlreed
Copy link

5.4.15

[parker@wolfcola gspca-kinect2]$ make -C /lib/modules/`uname -r`/build  SUBDIRS=`pwd` SRCROOT=`pwd` clean modules  
make: Entering directory '/usr/lib/modules/5.4.15-arch1-1/build'
scripts/Makefile.clean:15: Documentation/Makefile: No such file or directory
make[2]: *** No rule to make target 'Documentation/Makefile'.  Stop.
make[1]: *** [Makefile:1657: _clean_Documentation] Error 2
make: *** [Makefile:326: __build_one_by_one] Error 2
make: Leaving directory '/usr/lib/modules/5.4.15-arch1-1/build'
@parkerlreed
Copy link
Author

Arch doesn't ship the entire built kernel tree, just headers. Is there a way to compile this without it compiling the entire kernel?

@parkerlreed
Copy link
Author

Trying this on Ubuntu it prints some messages about what has to be done

parker@p8h77m:~/build/gspca-kinect2$ make -C /lib/modules/`uname -r`/build  SUBDIRS=`pwd` SRCROOT=`pwd` clean modules  
make: Entering directory '/usr/src/linux-headers-5.3.0-28-generic'
Makefile:227: ================= WARNING ================
Makefile:228: 'SUBDIRS' will be removed after Linux 5.3
Makefile:229: 
Makefile:230: If you are building an individual subdirectory
Makefile:231: in the kernel tree, you can do like this:
Makefile:232: $ make path/to/dir/you/want/to/build/
Makefile:233: (Do not forget the trailing slash)
Makefile:234: 
Makefile:235: If you are building an external module,
Makefile:236: Please use 'M=' or 'KBUILD_EXTMOD' instead
Makefile:237: ==========================================
Makefile:227: ================= WARNING ================
Makefile:228: 'SUBDIRS' will be removed after Linux 5.3
Makefile:229: 
Makefile:230: If you are building an individual subdirectory
Makefile:231: in the kernel tree, you can do like this:
Makefile:232: $ make path/to/dir/you/want/to/build/
Makefile:233: (Do not forget the trailing slash)
Makefile:234: 
Makefile:235: If you are building an external module,
Makefile:236: Please use 'M=' or 'KBUILD_EXTMOD' instead
Makefile:237: ==========================================
  CLEAN   /home/parker/build/gspca-kinect2/Module.symvers
Makefile:227: ================= WARNING ================
Makefile:228: 'SUBDIRS' will be removed after Linux 5.3
Makefile:229: 
Makefile:230: If you are building an individual subdirectory
Makefile:231: in the kernel tree, you can do like this:
Makefile:232: $ make path/to/dir/you/want/to/build/
Makefile:233: (Do not forget the trailing slash)
Makefile:234: 
Makefile:235: If you are building an external module,
Makefile:236: Please use 'M=' or 'KBUILD_EXTMOD' instead
Makefile:237: ==========================================
  CC [M]  /home/parker/build/gspca-kinect2/kinect2.o
  LD [M]  /home/parker/build/gspca-kinect2/gspca_kinect2.o
  CC [M]  /home/parker/build/gspca-kinect2/gspca.o
  LD [M]  /home/parker/build/gspca-kinect2/gspca_main.o
  Building modules, stage 2.
  MODPOST 2 modules
  CC      /home/parker/build/gspca-kinect2/gspca_kinect2.mod.o
  LD [M]  /home/parker/build/gspca-kinect2/gspca_kinect2.ko
  CC      /home/parker/build/gspca-kinect2/gspca_main.mod.o
  LD [M]  /home/parker/build/gspca-kinect2/gspca_main.ko
make: Leaving directory '/usr/src/linux-headers-5.3.0-28-generic'

FWIW this fails on 5.3

[  151.337115] videodev: Linux video capture interface: v2.00
[  158.063023] gspca_main: loading out-of-tree module taints kernel.
[  158.063075] gspca_main: module verification failed: signature and/or required key missing - tainting kernel
[  158.063131] gspca_main: Unknown symbol vb2_queue_init (err -2)
[  158.063169] gspca_main: Unknown symbol vb2_ioctl_streamoff (err -2)
[  158.063196] gspca_main: Unknown symbol vb2_ioctl_expbuf (err -2)
[  158.063224] gspca_main: Unknown symbol vb2_ops_wait_finish (err -2)
[  158.063254] gspca_main: Unknown symbol vb2_ioctl_querybuf (err -2)
[  158.063296] gspca_main: Unknown symbol vb2_queue_error (err -2)
[  158.063322] gspca_main: Unknown symbol vb2_fop_release (err -2)
[  158.063348] gspca_main: Unknown symbol vb2_ioctl_dqbuf (err -2)
[  158.063375] gspca_main: Unknown symbol vb2_ioctl_create_bufs (err -2)
[  158.063402] gspca_main: Unknown symbol vb2_buffer_done (err -2)
[  158.063427] gspca_main: Unknown symbol vb2_plane_vaddr (err -2)
[  158.063461] gspca_main: Unknown symbol vb2_ioctl_qbuf (err -2)
[  158.063486] gspca_main: Unknown symbol vb2_fop_mmap (err -2)
[  158.063512] gspca_main: Unknown symbol vb2_vmalloc_memops (err -2)
[  158.063542] gspca_main: Unknown symbol vb2_fop_read (err -2)
[  158.063574] gspca_main: Unknown symbol vb2_ops_wait_prepare (err -2)
[  158.063603] gspca_main: Unknown symbol vb2_ioctl_streamon (err -2)
[  158.063628] gspca_main: Unknown symbol vb2_fop_poll (err -2)
[  158.063666] gspca_main: Unknown symbol vb2_ioctl_reqbufs (err -2)
[  174.689337] gspca_kinect2: Unknown symbol gspca_frame_add (err -2)
[  174.689367] gspca_kinect2: Unknown symbol gspca_debug (err -2)
[  174.689408] gspca_kinect2: Unknown symbol gspca_dev_probe2 (err -2)
[  174.689434] gspca_kinect2: Unknown symbol gspca_disconnect (err -2)
[  174.689460] gspca_kinect2: Unknown symbol gspca_resume (err -2)
[  174.689487] gspca_kinect2: Unknown symbol gspca_suspend (err -2)

@aanno
Copy link

aanno commented Apr 26, 2020

Same here! This is what happens on Fedora 32:

gspca-kinect2]$ make -C /lib/modules/`uname -r`/build  SUBDIRS=`pwd` SRCROOT=`pwd` modules make: Entering directory '/usr/src/kernels/5.6.6-300.fc32.x86_64'
scripts/kconfig/conf  --syncconfig Kconfig
Kconfig:34: can't open file "Documentation/Kconfig"
make[2]: *** [scripts/kconfig/Makefile:75: syncconfig] Error 1
make[1]: *** [Makefile:568: syncconfig] Error 2
make: *** [Makefile:678: include/config/auto.conf.cmd] Error 2
make: Leaving directory '/usr/src/kernels/5.6.6-300.fc32.x86_64'

@aanno
Copy link

aanno commented Apr 26, 2020

The following works for kernel 5.6.6 on fedora 32:

make -C /lib/modules/`uname -r`/build  M=`pwd` SRCROOT=`pwd` modules

@aenertia
Copy link

aenertia commented Apr 29, 2020

I get unknown symbols when compiling with that on fc32:

Linux kiorewha-3d-ae-net-nz 5.6.7-300.fc32.x86_64 #1 SMP Thu Apr 23 14:13:50 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

``[  924.477003] gspca_main: Unknown symbol vb2_queue_init (err -2)
[  924.477023] gspca_main: Unknown symbol vb2_ioctl_streamoff (err -2)
[  924.477036] gspca_main: Unknown symbol vb2_ioctl_expbuf (err -2)
[  924.477050] gspca_main: Unknown symbol vb2_ops_wait_finish (err -2)
[  924.477065] gspca_main: Unknown symbol vb2_ioctl_querybuf (err -2)
[  924.477085] gspca_main: Unknown symbol vb2_queue_error (err -2)
[  924.477098] gspca_main: Unknown symbol vb2_fop_release (err -2)
[  924.477113] gspca_main: Unknown symbol vb2_ioctl_dqbuf (err -2)
[  924.477126] gspca_main: Unknown symbol vb2_ioctl_create_bufs (err -2)
[  924.477140] gspca_main: Unknown symbol vb2_buffer_done (err -2)
[  924.477152] gspca_main: Unknown symbol vb2_plane_vaddr (err -2)
[  924.477169] gspca_main: Unknown symbol vb2_ioctl_qbuf (err -2)
[  924.477182] gspca_main: Unknown symbol vb2_fop_mmap (err -2)
[  924.477195] gspca_main: Unknown symbol vb2_vmalloc_memops (err -2)
[  924.477210] gspca_main: Unknown symbol vb2_fop_read (err -2)
[  924.477226] gspca_main: Unknown symbol vb2_ops_wait_prepare (err -2)
[  924.477241] gspca_main: Unknown symbol vb2_ioctl_streamon (err -2)
[  924.477253] gspca_main: Unknown symbol vb2_fop_poll (err -2)
[  924.477272] gspca_main: Unknown symbol vb2_ioctl_reqbufs (err -2)
[aenertia@kiorewha-3d-ae-net-nz gspca-kinect2]$ sudo /sbin/insmod ./gspca_main.ko  
insmod: ERROR: could not insert module ./gspca_main.ko: Unknown symbol in module

@olinorwell
Copy link

The following works for kernel 5.6.6 on fedora 32:

make -C /lib/modules/`uname -r`/build  M=`pwd` SRCROOT=`pwd` modules

This worked for me on Arch too after I ran: sudo pacman -S linux-headers

@BOFH2k
Copy link

BOFH2k commented May 31, 2020

See insmod sequence in #7 for fix.

@bjeanes
Copy link

bjeanes commented Oct 6, 2021

Anyone else seeing error: redefinition of 'struct request'?

❯ make -C /lib/modules/`uname -r`/build M=`pwd` SRCROOT=`pwd` clean modules
make: Entering directory '/usr/lib/modules/5.14.8-arch1-1/build'
  CC [M]  /home/bjeanes/Code/gspca-kinect2/kinect2.o
/home/bjeanes/Code/gspca-kinect2/kinect2.c:55:8: error: redefinition of ‘struct request’
   55 | struct request {
      |        ^~~~~~~
In file included from ./include/linux/blk-cgroup.h:23,
                 from ./include/linux/writeback.h:14,
                 from ./include/linux/memcontrol.h:22,
                 from ./include/linux/swap.h:9,
                 from ./include/linux/suspend.h:5,
                 from ./include/linux/regulator/consumer.h:35,
                 from ./include/linux/i2c.h:18,
                 from ./include/media/v4l2-common.h:105,
                 from /home/bjeanes/Code/gspca-kinect2/gspca.h:9,
                 from /home/bjeanes/Code/gspca-kinect2/kinect2.c:30:
./include/linux/blkdev.h:123:8: note: originally defined here
  123 | struct request {
      |        ^~~~~~~
make[2]: *** [scripts/Makefile.build:271: /home/bjeanes/Code/gspca-kinect2/kinect2.o] Error 1
make[1]: *** [Makefile:1858: /home/bjeanes/Code/gspca-kinect2] Error 2
make: *** [Makefile:351: __build_one_by_one] Error 2
make: Leaving directory '/usr/lib/modules/5.14.8-arch1-1/build'

I get that error for both this fork and @grandchild's.

@Jenni32222
Copy link

Same error as above, has anyone found a fix after all this time?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants