Subject: Re: The PCMCIA and kernel packages

From: Manoj Srivastava <[email-masked]>
Date: 14 Jun 1996 13:21:27 -0400

Hi,
The Proposal:

>>"Brian" == Brian Mays <[email-masked]> writes:
Brian> Sounds great.  Let me check the details.  A stand-alone modules
Brian> (SAM) package (e.g., pcmcia-cs) would have a binary deb file
Brian> (pcmcia-cs<version and arch>.deb) and a source deb file
Brian> (pcmcia-source<version and arch>.deb).  The source deb file
Brian> would unpack itself into the /usr/src directory and
Brian> symbolically link its directory into the /usr/src/modules
Brian> directory.

	Exactly.

Brian> When the kernel debian.rules is given the target "modules," it
Brian> would build new binary packages for all of the packages in
Brian> subdirectories of the /usr/src/modules directory.  The rule
Brian> given above should work fine except that I would suggest that
Brian> "KVERSION" be used as the variable for the kernel version, to
Brian> distinguish it from the package version, and the "binary" rule
Brian> (or perhaps a "kernel" rule to indicate that it is being
Brian> compiled for a specific kernel source) be used instead of
Brian> "dist."  There is no need to make a new tar and diff file,
Brian> since all that needs to be done is recompile the modules so
Brian> that they will be compatible with the new version of the
Brian> kernel.

	I agree about the version and the target name, but I think
 that the tar and diff files may be required, maybe there should be
 two sets of targets, one for just the binary .deb file, and another
 for the whole shebang (what is the etymology of this word?) -- and
 what about the version number of the module packages produced? should
 it not also be bumped up? The scenario could be 
   Day 1: module X created with verion 3.1.2-0 and uploaded to master.
   Day 3: the kernel version changes, and a new module package is
          created. No changes made to the module; so what should the
          version be? if it the same, then there will be confusion on
          the archives.

 Workaround? put the kernel version in the module name. So, we have
 pcmcia-cs-2.0.0_3.1.2-0_i386.deb, no confusion about which kernel it
 belongs to, and the preinstall scripts warn if the running kernel is
 not the correct one.

Brian> Since the kernel version number is being passed to the
Brian> debian.rules makefile, the SAM package would know to use the
Brian> kernel source in the
Brian> /usr/src/kernel-source-$(KVERSION) directory when compiling its
Brian> modules.  However, when no KVERSION variable is provided,
Brian> (when, for example, a user wants to add a stand-alone module
Brian> package to his own custom compiled kernel, so he simply types
Brian> "./debian.rules binary") the SAM package would use the kernel
Brian> source in the /usr/src/linux directory.

	Hmm, you can't really make an assumption about the location of
 the sources. How about this where KVERS contains the kernel version,
 and KSRC the full path name of the top level kernel source directory.

# only generate module image packages
modules_image:
        for $$module in $(MODULE_LOC)/* ; do \
            (cd $$module; \
              ./debian.rules KVERS=$(version) KSRC=$(SRCTOP) kdist_image; ) \
        done

# generate the modules package and sign them with dchanges
modules:
        for $$module in $(MODULE_LOC)/* ; do \
            (cd $$module; \
              ./debian.rules KVERS=$(version) KSRC=$(SRCTOP) kdist; ) \
        done

	manoj
-- 
 Any clod can have the facts, but having opinions is an Art. Mencken
 [Having the facts is hard.  --ed]
Manoj Srivastava               Systems Research Programmer, Project Pilgrim,
Phone: (413) 545-3918                A143B Lederle Graduate Research Center,
Fax:   (413) 545-1249         University of Massachusetts, Amherst, MA 01003
<[email-masked]> <URL:http://www.pilgrim.umass.edu/%7Esrivasta/>

---

From: Brian Mays <[email-masked]>
Date: Fri, 14 Jun 96 14:02:34 -0500

>>>>> "Manoj" == Manoj Srivastava <[email-masked]> writes:

    Manoj>  Workaround? put the kernel version in the module name. So,
    Manoj> we have pcmcia-cs-2.0.0_3.1.2-0_i386.deb, no confusion
    Manoj> about which kernel it belongs to, and the preinstall
    Manoj> scripts warn if the running kernel is not the correct one.

    Manoj> # only generate module image packages
    Manoj> modules_image:
    Manoj>         for $$module in $(MODULE_LOC)/* ; do \
    Manoj>             (cd $$module; \
    Manoj>               ./debian.rules KVERS=$(version) KSRC=$(SRCTOP) \
    Manoj>               kdist_image; ) \
    Manoj>         done
    Manoj> 
    Manoj> # generate the modules package and sign them with dchanges
    Manoj> modules:
    Manoj>         for $$module in $(MODULE_LOC)/* ; do \
    Manoj>             (cd $$module; \
    Manoj>               ./debian.rules KVERS=$(version) KSRC=$(SRCTOP) \
    Manoj>               kdist; ) \
    Manoj>         done

This is good; things are much clearer now.  So dchanges should be run
with the -n (no edit) option and perhaps a cs="New kernel version
$(KVERS)." override?

--
Brian Mays <[email-masked]>

---

From: Manoj Srivastava <[email-masked]>
Date: 14 Jun 1996 18:55:10 -0400

Hi,

Brian> This is good; things are much clearer now.  So dchanges should
Brian> be run with the -n (no edit) option and perhaps a cs="New
Brian> kernel version $(KVERS)." override?

	Right.  Hmmm.  You also need to know who is going to sign the
 modules produced (and is unlikely to be the primary maintainer for
 the module, espescially since all the modules have different
 maintainers anyway ;-)

	So, I need to send in the name of the person running the
 kernel build, to be used in the dchanges pgp=XXX option.

	Also, (this is a user interface issue), where should the
 finished module files be produced by the target kdist* in the
 module's debian.rules?

 (1) /usr/src/module-X-$(KVERS)_$(version)_$(arch).deb ?
	or in 
 (2) $(KSRC)/../module-X-$(KVERS)_$(version)_$(arch).deb?

	My /usr/src is on a tiny, ancient partition; all my free space
 happens to reside on /var, so I put my kernel sources there, and
 would like the built things to be produced there as well.

	Also, all the resulting packages will be in one place if we
 use option (2) above, and allows the user to dictate where the files
 are ceated, to an extent. In the default case, KSRC=/usr/src/linux,
 and everything *will* be created into /usr/src/, but we are not
 locked into that directory.

So, This is what I have now:
 ...
 ...
# only generate module image packages modules_image: for
$$module in $(MODULE_LOC)/* ; do \ (cd $$module; \
   ./debian.rules KVERS=$(version) KSRC=$(SRCTOP) \ 
                  KMAINT=$(maintainer) kdist_image; )\
 done

# generate the modules package and sign them with dchanges
modules: for $$module in $(MODULE_LOC)/* ; do \ (cd $$module; \
   ./debian.rules KVERS=$(version) KSRC=$(SRCTOP) \
                  KMAINT=$(maintainer)  kdist; ) \
done

	Have I missed any other information that might be needed by
 the modules?

	Hmm.  This proposal should probably be gathered together and put
 into a coherent document, destined ultimately to be put into
 /usr/doc/debian/package-developer/ or something like that, after its
 blessed by Brian/Simon/Bruce/Ian. (I've saved the last few  messages,
 thankfully). 

	manoj

-- 
 "Standards committees are not the best ways to create a standard.
 Standards meetings and standards themselves are horribly political
 things.  One thing that people forget is that many standards are made
 by rather small groups of people.  A few good people can really save
 the day, and a few idiots can really make it miserable for years to
 come." Dennis Ritchie, coinventor of Unix
Manoj Srivastava               Systems Research Programmer, Project Pilgrim,
Phone: (413) 545-3918                A143B Lederle Graduate Research Center,
Fax:   (413) 545-1249         University of Massachusetts, Amherst, MA 01003
<[email-masked]> <URL:http://www.pilgrim.umass.edu/%7Esrivasta/>

---

From: Brian Mays <[email-masked]>
Date: Sat, 15 Jun 1996 23:45:19 -0400

>>>>> "Manoj" == Manoj Srivastava <[email-masked]> writes:

    Manoj> 	Right.  Hmmm.  You also need to know who is going to
    Manoj> sign the modules produced (and is unlikely to be the
    Manoj> primary maintainer for the module, espescially since all
    Manoj> the modules have different maintainers anyway ;-)

    Manoj> 	So, I need to send in the name of the person running
    Manoj> the kernel build, to be used in the dchanges pgp=XXX
    Manoj> option.

Good point.

    Manoj> 	Also, (this is a user interface issue), where should
    Manoj> the finished module files be produced by the target kdist*
    Manoj> in the module's debian.rules?

    Manoj>  (1) /usr/src/module-X-$(KVERS)_$(version)_$(arch).deb ?
    Manoj> 	or in 
    Manoj>  (2) $(KSRC)/../module-X-$(KVERS)_$(version)_$(arch).deb?

    Manoj> 	Also, all the resulting packages will be in one place
    Manoj> if we use option (2) above, and allows the user to dictate
    Manoj> where the files are ceated, to an extent. In the default
    Manoj> case, KSRC=/usr/src/linux, and everything *will* be created
    Manoj> into /usr/src/, but we are not locked into that directory.

I agree that no (2) sounds like the best choice for maximum flexibility.

    Manoj> 	Have I missed any other information that might be
    Manoj> needed by the modules?

I can't think of anything right now.  If I come up with any more as
I'm working on the pcmcia package, I'll let you know.

    Manoj> 	Hmm.  This proposal should probably be gathered
    Manoj> together and put into a coherent document, destined
    Manoj> ultimately to be put into
    Manoj> /usr/doc/debian/package-developer/ or something like that,
    Manoj> after its blessed by Brian/Simon/Bruce/Ian. (I've saved the
    Manoj> last few messages, thankfully).

Agreed.

--
Brian