title: Deb package from kernel module
body: <p>I slightly modified the cp210x.c, compiled it, and copied the cp210x.ko to the right place, everything went fine. Now I would like to create a .deb package from it, but I'm stucked. I followed the tutorial, I found here: <a href="http://www.webupd8.org/2010/01/how-to-create-deb-package-ubuntu-debian.html" rel="nofollow">http://www.webupd8.org/2010/01/how-to-create-deb-package-ubuntu-debian.html</a></p>
  
  <p>In Step 3. I selected "kernel module" instead of "single binary".
  Before Step 3. I only had a <em>Makefile</em> and the <em>cp210x.c</em> in the <em>mydriver-1.0</em> folder. The Makefile is very simpe:</p>
  
  <p><code>
      obj-m += cp210x.o
      KVERSION = $(shell uname -r)
      all:
          make -C /lib/modules/$(KVERSION)/build M=$(PWD) modules
      clean:
          make -C /lib/modules/$(KVERSION)/build M=$(PWD) clean</code></p>
  
  <p>After Step 3. I have the following structure:</p>
  
  <p><code>
      mydriver-1.0/
      ├── build-arch-stamp
      ├── build-indep-stamp
      ├── configure-stamp
      ├── cp210x.c
      ├── debian
      │   ├── changelog
      │   ├── compat
      │   ├── control
      │   ├── control.modules.in
      │   ├── copyright
      │   ├── docs
      │   ├── mydriver.cron.d.ex
      │   ├── mydriver.default.ex
      │   ├── mydriver.doc-base.EX
      │   ├── mydriver-modules-_KVERS_.postinst.modules.in.ex
      │   ├── mydriver-source
      │   │   └── usr
      │   │       └── src
      │   │           └── modules
      │   │               └── mydriver
      │   │                   └── debian
      │   ├── mydriver-source.debhelper.log
      │   ├── mydriver-utils
      │   ├── mydriver-utils.debhelper.log
      │   ├── init.d.ex
      │   ├── manpage.1.ex
      │   ├── manpage.sgml.ex
      │   ├── manpage.xml.ex
      │   ├── menu.ex
      │   ├── postinst.ex
      │   ├── postrm.ex
      │   ├── preinst.ex
      │   ├── prerm.ex
      │   ├── README.Debian
      │   ├── README.source
      │   ├── rules
      │   └── source
      │       └── format
      └── Makefile</code></p>
  
  <p>In Step 5 when I try enter </p>
  
  <p><code>dpkg-buildpackage -rfakeroot</code></p>
  
  <p>After a while I get this error:</p>
  
  <p><code>
      ...
      # Copy only the driver source to the proper location
      cp -s driver/*  debian/mydriver-source/usr/src/modules/mydriver
      cp: cannot stat driver/*: No such file or directory
      debian/rules:130: recipe for target 'install' failed
      make: *** [install] Error 1
      dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2</code></p>
  
  <p>Here I'm stuckedI have no clue what is the "driver" folder, should I create it or not and what should I put in it. Google did not help me neither, so I'm grateful for any help.</p>