Changes between Version 3 and Version 4 of Linux/Ubuntu/Kernel/BuildDebianDKMSPackages


Ignore:
Timestamp:
22/07/08 22:55:03 (9 years ago)
Author:
tj
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Linux/Ubuntu/Kernel/BuildDebianDKMSPackages

    v3 v4  
    6161FWDIR ?= /lib/firmware 
    6262 
    63 FWFILES = r5u870_1830.fw r5u870_1832.fw r5u870_1833.fw r5u870_1834.fw r5u870_1835.fw r5u870_1836.fw r5u870_1870_1.fw r5u870_1870.fw r5u870_1810.fw r5u870_183a.fw r5u870_183b.fw r5u870_1839.fw  
     63FWFILES = r5u870_1830.fw r5u870_1832.fw r5u870_1833.fw r5u870_1834.fw r5u870_1835.fw \ 
     64 r5u870_1836.fw r5u870_1870_1.fw r5u870_1870.fw r5u870_1810.fw r5u870_183a.fw r5u870_183b.fw r5u870_1839.fw  
    6465 
    6566ifneq ($(PATCHLEVEL),) 
     
    134135'''CLEAN''' defines the command to use to clean the build location. '''AUTOINSTALL''' ensures that DKMS will both build ''and install'' the module when the package is installed using the package manager. 
    135136 
    136 Because DKMS will do a manual out-of-tree build the existing `Makefile` targets (all, install, etc.) are not used. Therefore, '''''for each kernel module''''' in the package (in this case `usbcam.ko` and `r5u870.ko`) a set of build directives is required that are assigned to array elements in each variable. In this case element [0] is the usbcam module and [1] is the r5u870 module. They should be ordered with prerequisites first (hence [0] is usbcam). 
    137  
    138 Because `usbcam` is in a sub-directory this is reflected with '''BUILT_MODULE_LOCATION[0]'''. Both modules have a '''DEST_MODULE_LOCATION[...]''' that defines where the package's own `Makefile` `install` target would install them (/lib/modules/<kernel-version>/extra in this case). 
    139  
    140 The '''MAKE[1]''' directive defines the make command and options and accompanying Makefile variables to set. In this case '''KVER''' and '''src''' are set so that the current Makefile variable assignments will operate correctly. DKMS provides and sets the variables '''$kernelver''' and '''$dkms_tree''' to enable the `Makefile` to figure out the correct locations, if necessary. 
     137Because DKMS will do a manual out-of-tree build the existing `Makefile` targets (all, install, etc.) are not used. Therefore, '''''for each kernel module''''' in the package (in this case `usbcam.ko` and `r5u870.ko`) a set of build directives is required that are assigned to array elements in each variable. In this case element ![0] is the usbcam module and ![1] is the r5u870 module. They should be ordered with prerequisites first (hence ![0] is usbcam). 
     138 
     139Because `usbcam` is in a sub-directory this is reflected with '''BUILT_MODULE_LOCATION![0]'''. Both modules have a '''DEST_MODULE_LOCATION![...]''' that defines where the package's own `Makefile` `install` target would install them (/lib/modules/<kernel-version>/extra in this case). 
     140 
     141The '''MAKE![1]''' directive defines the make command and options and accompanying Makefile variables to set. In this case '''KVER''' and '''src''' are set so that the current Makefile variable assignments will operate correctly. DKMS provides and sets the variables '''$kernelver''' and '''$dkms_tree''' to enable the `Makefile` to figure out the correct locations, if necessary. 
    141142 
    142143=== Customise Debian Files === 
     
    283284{{{ 
    284285.TH R5U870 8 2008-07-22 "r5u870" "Ricoh r5u870 kernel module" 
    285  
    286286.SH NAME 
    287  
    288287r5u870 \-   Ricoh r5u870 video camera driver 
    289  
    290288.SH DESCRIPTION 
    291  
    292289.I  r5u870 
    293  
    294290 Kernel driver for a range of Sony Vaio Motion Eye, HP Pavilion and other 
    295291 integrated Ricoh r5u870 cameras: 
    296   
     292 
    297293 05ca:1810      HP Pavilion Webcam - UVC                OK 
    298294 05ca:1812      HP Pavilion Webcam - UVC        Pavilion DV6502AU       In-progress 
     
    309305 05ca:183b      Sony Visual Communication Camera VGP-VCC8       VAIO FZ         OK 
    310306 05ca:1870      HP Pavilion Webcam / HP Webcam 1000             OK  
    311  
    312  
    313307.TP 
    314  
    315308.B More information 
    316  
    317309r5u870 maintainer: http://wiki.mediati.org/R5u870 
    318  
    319  
    320310.SH AUTHORS 
    321311Alex Hixon, TJ, Sam Revitch 
     
    346336In the case of DKMS however, the package needs to install `debian/dkms.conf`. This is the reason for the final set of instructions. the `binary-install/r5u870-kernel-source` target causes the file to be copied into the correct installation location after `dh_install` ignored it. 
    347337 
    348   '''Note:''' If you want to find out other debhelper dh_* script variables to over-ride you'll need to read the CDBS script in `/usr/share/cdbs/1/rules/debhelper.mk`. It is quite simple then to figure out which variables need setting for each aspect of the debhelper processes. Here's a snippet: 
    349   {{{ 
     338 '''Note:''' If you want to find out other debhelper dh_* script variables to over-ride you'll need to read the CDBS script in `/usr/share/cdbs/1/rules/debhelper.mk`. It is quite simple then to figure out which variables need setting for each aspect of the debhelper processes. Here's a snippet: 
     339 {{{ 
    350340dh_installdocs -p$(cdbs_curpkg) $(DEB_INSTALL_DOCS_ALL) $(DEB_INSTALL_DOCS_$(cdbs_curpkg))  
    351341dh_installexamples -p$(cdbs_curpkg) $(DEB_INSTALL_EXAMPLES_$(cdbs_curpkg)) 
     
    354344dh_installmenu -p$(cdbs_curpkg) $(DEB_DH_INSTALL_MENU_ARGS) 
    355345dh_installcron -p$(cdbs_curpkg) $(DEB_DH_INSTALL_CRON_ARGS) 
    356 dh_installinit -p$(cdbs_curpkg) $(if $(DEB_UPDATE_RCD_PARAMS),--update-rcd-params="$(call cdbs_strip_quotes,$(DEB_UPDATE_RCD_PARAMS))",$(if $(DEB_UPDATE_RCD_PARAMS_$(cdbs_curpkg)),--update-rcd-params="$(call cdbs_strip_quotes,$(DEB_UPDATE_RCD_PARAMS_$(cdbs_curpkg)))")) $(DEB_DH_INSTALLINIT_ARGS)  
     346dh_installinit -p$(cdbs_curpkg) $(if $(DEB_UPDATE_RCD_PARAMS),--update-rcd-params="$(call cdbs_strip_quotes, \ 
     347  $(DEB_UPDATE_RCD_PARAMS))",$(if $(DEB_UPDATE_RCD_PARAMS_$(cdbs_curpkg)), \ 
     348  --update-rcd-params="$(call cdbs_strip_quotes,$(DEB_UPDATE_RCD_PARAMS_$(cdbs_curpkg)))")) \ 
     349  $(DEB_DH_INSTALLINIT_ARGS)  
    357350dh_installdebconf -p$(cdbs_curpkg) $(DEB_DH_INSTALLDEBCONF_ARGS) 
    358 dh_installemacsen -p$(cdbs_curpkg) $(if $(DEB_EMACS_PRIORITY),--priority=$(DEB_EMACS_PRIORITY)) $(if $(DEB_EMACS_FLAVOR),--flavor=$(DEB_EMACS_FLAVOR)) $(DEB_DH_INSTALLEMACSEN_ARGS) 
     351dh_installemacsen -p$(cdbs_curpkg) $(if $(DEB_EMACS_PRIORITY),--priority=$(DEB_EMACS_PRIORITY)) $(if $(DEB_EMACS_FLAVOR), \ 
     352  --flavor=$(DEB_EMACS_FLAVOR)) $(DEB_DH_INSTALLEMACSEN_ARGS) 
    359353dh_installcatalogs -p$(cdbs_curpkg) $(DEB_DH_INSTALLCATALOGS_ARGS) 
    360354dh_installpam -p$(cdbs_curpkg) $(DEB_DH_INSTALLPAM_ARGS) 
     
    362356dh_installlogcheck -p$(cdbs_curpkg) $(DEB_DH_INSTALLLOGCHECK_ARGS) 
    363357dh_installmime -p$(cdbs_curpkg) $(DEB_DH_INSTALLMIME_ARGS) 
    364 dh_installchangelogs -p$(cdbs_curpkg) $(DEB_DH_INSTALLCHANGELOGS_ARGS) $(DEB_INSTALL_CHANGELOGS_ALL) $(DEB_INSTALL_CHANGELOGS_$(cdbs_curpkg)) 
     358dh_installchangelogs -p$(cdbs_curpkg) $(DEB_DH_INSTALLCHANGELOGS_ARGS) $(DEB_INSTALL_CHANGELOGS_ALL) \ 
     359  $(DEB_INSTALL_CHANGELOGS_$(cdbs_curpkg)) 
    365360$(if $(wildcard /usr/bin/dh_installudev),dh_installudev -p$(cdbs_curpkg) $(DEB_DH_INSTALLUDEV_ARGS)) 
    366361dh_install -p$(cdbs_curpkg) $(if $(DEB_DH_INSTALL_SOURCEDIR),--sourcedir=$(DEB_DH_INSTALL_SOURCEDIR)) $(DEB_DH_INSTALL_ARGS) 
    367362dh_link -p$(cdbs_curpkg) $(DEB_DH_LINK_ARGS) $(DEB_DH_LINK_$(cdbs_curpkg)) 
    368   }}} 
    369  
    370 [[hr]] 
     363 }}} 
    371364 
    372365== Build Package == 
     
    412405Upload the package to the PPA: 
    413406{{{ 
    414 dput intuitivenipple-ppa ../ r5u870_0.11.1-0ubuntu1~ppa1h_source.changes 
     407dput intuitivenipple-ppa ../r5u870_0.11.1-0ubuntu1~ppa1h_source.changes 
    415408}}} 
    416409== Check the PPA Build Status == 
    417 On the PPA status page (in my case [https://launchpad.net/~intuitivenipple/+archive]) you'll see the status of the package. Whilst building it will confusingly report it is only doing the i386 package. This is a ''bugette' - it should report building ''all'' since the source is architecture-agnostic. Once the build has finished the package details will correctly show that the `_all.deb` has been created: 
     410On the PPA status page (in my case [https://launchpad.net/~intuitivenipple/+archive]) you'll see the status of the package. It will confusingly report only doing the i386 build. This is a ''bugette' - it should report building ''all'' since the source is architecture-agnostic. Once the build has finished the package details will correctly show that the `_all.deb` has been created: 
    418411{{{ 
    419412Publishing details