Getting module name and version from a DKMS package
Gary_Lerhaupt@Dell.com
Gary_Lerhaupt@Dell.com
Wed Sep 10 11:57:01 2003
Thanks Cyril. gmodconfig is pretty slick, and I could see that these could
be stumbling blocks for you.
I'm going to go ahead and implement PACKAGE_NAME= and PACKAGE_VERSION= to
the list of directives parsed for in a dkms.conf. Even though dkms will not
make direct use of them, I will make this a strict requirement such that
dkms will refuse to function without some value for these. I should note
that this means an added responsibility for developers as they will not just
be able to take a dkms.conf from one version of their module and directly
copy it to the next version. They'll need to now bump the PACKAGE_VERSION.
Of course, if they fail to do this, I'm not sure there is much recourse for
gmodconfig as you'll depend on them for this.
As for unpack, this is interesting but perhaps more complicated than it
seems. Depending on how the tarball is put together, there are various ways
it may decompress. In the end, dkms will expect the source to be in
/usr/src/<PACKAGE_NAME>-<PACKAGE_VERSION>/ but untarring it in that
directory won't necessarily assure this.
Gary
> -----Original Message-----
> From: Cyril Bortolato [mailto:borto@users.sourceforge.net]
> Sent: Wednesday, September 10, 2003 1:11 AM
> To: dkms-devel@dell.com
> Subject: Getting module name and version from a DKMS package
>
>
> Hi,
> I'm writing a tool called gmodconfig which uses DKMS as
> a back-end to install kernel modules.
>
> Once a DKMS package has been downloaded (for details on how
> gmodconfig does that see http://gmodconfig.sourceforge.net/),
> the right thing to do would be to execute these commands:
>
> dkms add -m <module> -v <version>
> dkms build -m <module> -v <version> -k <kernel-version>
> dkms install -m <module> -v <version> -k <kernel-version>
>
> However once a DKMS tarball has been downloaded, I don't
> have a way to extract the module name and version from it.
> As a result I can't run the above dkms commands which
> require these 2 pieces of informations.
>
> I could parse the name of the package file, but it may or
> may not be reliable. Your example package is called
> qla2x00-clariion_dkms-v6.04.00.tar.gz but in the install.sh
> the DKMS module name appears to be "qla2x00", and not
> "qla2x00-clariion".
>
> Gmodconfig might be able to infer the module name and version
> if users initiate a DKMS install from the "Updates" tab of
> a module (see screenshots or doc). But it might not always
> work: your example package really contains 2 modules "qla2200"
> and "qla2300", and the DKMS module is called "qla2x00".
> And users are given the ability to install any DKMS package
> they want, out of the blue (see Install menu).
>
> My suggestion is to store the DKMS module name and the version
> inside the dkms.conf file of a package. That way I can have
> access to these data reliably.
>
> Actually it'll be nice to provide a new command e.g. "unpack"
> whose syntax would be something like:
> dkms unpack <package file>
>
> This command would create the /usr/src/<module>-<version>
> directory, do the gunzip and tar extraction of the sources
> and copy the dkms.conf file, i.e basically do what lines 15-25
> in the install.sh script of the qla2x00-clariion_dkms-v6.04.00
> package do. These commands can really be automated and grouped
> together into one DKMS command, IMHO.
>
> Cyril
>
> _______________________________________________
> DKMS-devel mailing list
> DKMS-devel@dell.com
> http://lists.us.dell.com/mailman/listinfo/dkms-devel
>