Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   CentOS Development (http://www.linux-archive.org/centos-development/)
-   -   kmod packaging guideline (http://www.linux-archive.org/centos-development/215406-kmod-packaging-guideline.html)

Farkas Levente 12-20-2008 12:43 PM

kmod packaging guideline
 
hi,
it'd be nice to write some kind of docs about how to write kmod packages
for centos. as i wrote in one of my earlier post there are two problems
currently with the weak-updates kmods:

kmodtool shouldn't have to add to all packages rather use the
/usr/lib/rpm/redhat/kmodtool from redhat-rpm-config ie:
----------------------------------------------
@@ -1,7 +1,6 @@
-Source10: kmodtool
Source11: find-requires
Source12: find-requires.ksyms
-%define kmodtool bash %{SOURCE10}
+%define kmodtool bash /usr/lib/rpm/redhat/kmodtool
----------------------------------------------
and add:
BuildRequires: redhat-rpm-config

the other problem is the these new kmod gives warning during install. ie
if someone create a kickstart file which contains these kmods then
anaconda warning about it:
"Bad kmod package 'kmod-....' does not require a kernel"
the reason for this is /usr/lib/anaconda/fedorakmod.py which has a check
in resolveVersions. so hack the current find-requires.ksym to also
requires at least kernel-%{arch} would be useful.
at the same time write a newer short howto write kmods for centos-5.
just my 2c.
yours.

--
Levente "Si vis pacem para bellum!"
_______________________________________________
CentOS-devel mailing list
CentOS-devel@centos.org
http://lists.centos.org/mailman/listinfo/centos-devel

Ned Slider 12-20-2008 11:08 PM

kmod packaging guideline
 
Farkas Levente wrote:
> hi,
> it'd be nice to write some kind of docs about how to write kmod packages
> for centos. as i wrote in one of my earlier post there are two problems
> currently with the weak-updates kmods:
>
> kmodtool shouldn't have to add to all packages rather use the
> /usr/lib/rpm/redhat/kmodtool from redhat-rpm-config ie:
> ----------------------------------------------
> @@ -1,7 +1,6 @@
> -Source10: kmodtool
> Source11: find-requires
> Source12: find-requires.ksyms
> -%define kmodtool bash %{SOURCE10}
> +%define kmodtool bash /usr/lib/rpm/redhat/kmodtool
> ----------------------------------------------
> and add:
> BuildRequires: redhat-rpm-config
>

Hi Farkas,

There is some information on building kABI tracking kmod packages in the
BuildingKernelModules page on the Wiki:

http://wiki.centos.org/HowTos/BuildingKernelModules#head-b86b6eec08d5719cf1838929f26a64af88e2b7f0

Unless I misunderstand your proposal above, one reason I have found for
including a custom kmodtool-foo source script with your kmod is for
satisfying Requires. For example, putting:

Requires: foo-bar >= 1.2.3

in the SPEC file for a kmod doesn't work. The Require needs to be added
to the kmodtool script:

Requires(post): /sbin/depmod
Requires(postun): /sbin/depmod
*Requires: foo-bar >= 1.2.3*
EOF

I came across this problem building some kmods that required a later
version of lm_sensors. An example can be seen in this kmod package for
the coretemp module:

http://www.pperry.f2s.com/linux/coretemp/

I'll admit I'm not an expert kmod packager, but placing the Requires in
the kmodtool script was the only solution I found (actually either
Johnny or Karanbir suggested it on IRC IIRC). In my case kmodtool-foo
was simply a copy of /usr/lib/rpm/redhat/kmodtool with the necessary
Requires added. If there's a simpler or more elegant solution then
please do enlighten me :)

My next question would be if Requires: doesn't work in a kmod SPEC file,
will

BuildRequires: redhat-rpm-config

work?



_______________________________________________
CentOS-devel mailing list
CentOS-devel@centos.org
http://lists.centos.org/mailman/listinfo/centos-devel

"Akemi Yagi" 12-20-2008 11:37 PM

kmod packaging guideline
 
On Sat, Dec 20, 2008 at 4:08 PM, Ned Slider <ned@unixmail.co.uk> wrote:

> I'll admit I'm not an expert kmod packager, but placing the Requires in
> the kmodtool script was the only solution I found (actually either
> Johnny or Karanbir suggested it on IRC IIRC). In my case kmodtool-foo
> was simply a copy of /usr/lib/rpm/redhat/kmodtool with the necessary
> Requires added. If there's a simpler or more elegant solution then
> please do enlighten me :)

It was Johnny Hughes. (excerpt)

[Sat Jul 12 2008] [05:38:02] <NedSlider> can anyone help with a
SPEC file problem please?
[Sat Jul 12 2008] [05:38:15] <NedSlider> I was making a kmod
module rpm...
[Sat Jul 12 2008] [05:38:24] * toracat looks at hughesjr
[Sat Jul 12 2008] [05:38:32] <NedSlider> and was trying to do
dependencies...
[Sat Jul 12 2008] [05:39:00] <NedSlider> added: Requires:
package >= x.y.x
[Sat Jul 12 2008] [05:39:12] <NedSlider> and it gets ignored by rpm
[Sat Jul 12 2008] [05:40:00] <NedSlider> Requires: lm_sensors >= 2.10.2
[Sat Jul 12 2008] [05:44:10] <hughesjr> NedSlider: it should not be ignored
[Sat Jul 12 2008] [05:44:41] <hughesjr> and that format looks OK
<snip>
[Sat Jul 12 2008] [05:47:53] <hughesjr> you will need to add the
Require: to the script and not the
SPEC
[Sat Jul 12 2008] [05:48:23] <hughesjr> is it named kmodtool.sh or some such
[Sat Jul 12 2008] [05:48:28] <hughesjr> let me check
<snip>
[Sat Jul 12 2008] [06:02:43] <hughesjr> NedSlider: if you edit the
file kmodtool and add your require there it will fix the issue

Akemi / toracat
_______________________________________________
CentOS-devel mailing list
CentOS-devel@centos.org
http://lists.centos.org/mailman/listinfo/centos-devel

Ned Slider 12-20-2008 11:51 PM

kmod packaging guideline
 
Ned Slider wrote:
>
> My next question would be if Requires: doesn't work in a kmod SPEC file,
> will
>
> BuildRequires: redhat-rpm-config
>
> work?
>

Replying to my own thread after a quick investigation...

I added a fake BuildRequires (non-existent centos-rpm-config) to a kmod
package spec file and tried to build it:

$ rpmbuild -ba --target=`uname -m` --define 'kversion 2.6.18-92.el5'
--define 'kvariants ""' coretemp-kmod.spec
Building target platforms: x86_64
Building for target x86_64
error: Failed build dependencies:
centos-rpm-config is needed by coretemp-1.1-3.el5.x86_64

and it fails to build as expected, so yes, BuildRequires does work.

But when I add the same fake Requires the package builds fine but
there's no sign of the fake Requires:

# rpm -Uvh --test kmod-coretemp-1.1-3.el5.x86_64.rpm
Preparing... ###########################################
[100%]
# rpm -qp --requires kmod-coretemp-1.1-3.el5.x86_64.rpm
rpmlib(VersionedDependencies) <= 3.0.3-1
/sbin/depmod
/sbin/depmod
lm_sensors >= 2.10.2
/bin/sh
/bin/sh
/bin/sh
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(CompressedFileNames) <= 3.0.4-1


It just gets ignored (but note the dependency for lm_sensors from the
custom kmodtool script is there).

I have no idea why this is so.



_______________________________________________
CentOS-devel mailing list
CentOS-devel@centos.org
http://lists.centos.org/mailman/listinfo/centos-devel

Ned Slider 12-20-2008 11:53 PM

kmod packaging guideline
 
Akemi Yagi wrote:
> On Sat, Dec 20, 2008 at 4:08 PM, Ned Slider <ned@unixmail.co.uk> wrote:
>
>> I'll admit I'm not an expert kmod packager, but placing the Requires in
>> the kmodtool script was the only solution I found (actually either
>> Johnny or Karanbir suggested it on IRC IIRC). In my case kmodtool-foo
>> was simply a copy of /usr/lib/rpm/redhat/kmodtool with the necessary
>> Requires added. If there's a simpler or more elegant solution then
>> please do enlighten me :)
>
> It was Johnny Hughes. (excerpt)
>

Thank you Akemi (who has logs of everything!) :)


_______________________________________________
CentOS-devel mailing list
CentOS-devel@centos.org
http://lists.centos.org/mailman/listinfo/centos-devel

"Alan Bartlett" 12-21-2008 01:50 PM

kmod packaging guideline
 
2008/12/20 Farkas Levente <lfarkas@lfarkas.org>




kmodtool shouldn't have to add to all packages rather use the

/usr/lib/rpm/redhat/kmodtool from redhat-rpm-config ie:

----------------------------------------------

@@ -1,7 +1,6 @@

-Source10: kmodtool

*Source11: find-requires

*Source12: find-requires.ksyms

-%define * kmodtool bash %{SOURCE10}

+%define * kmodtool bash /usr/lib/rpm/redhat/kmodtool

----------------------------------------------

and add:

BuildRequires: *redhat-rpm-config
Quick question. Have you considered how you proposal can be used with CentOS-4 rather than CentOS-5?

There is no C-4 /usr/lib/rpm/redhat/kmodtool -- unless I am mistaken. So to implement what you have proposed will cause a divergence of technique -- C-4 this way, C-5 that way. Not a good idea. :-(



Alan.
_______________________________________________
CentOS-devel mailing list
CentOS-devel@centos.org
http://lists.centos.org/mailman/listinfo/centos-devel

Farkas Levente 12-21-2008 08:10 PM

kmod packaging guideline
 
Ned Slider wrote:
> Farkas Levente wrote:
>> hi,
>> it'd be nice to write some kind of docs about how to write kmod packages
>> for centos. as i wrote in one of my earlier post there are two problems
>> currently with the weak-updates kmods:
>>
>> kmodtool shouldn't have to add to all packages rather use the
>> /usr/lib/rpm/redhat/kmodtool from redhat-rpm-config ie:
>> ----------------------------------------------
>> @@ -1,7 +1,6 @@
>> -Source10: kmodtool
>> Source11: find-requires
>> Source12: find-requires.ksyms
>> -%define kmodtool bash %{SOURCE10}
>> +%define kmodtool bash /usr/lib/rpm/redhat/kmodtool
>> ----------------------------------------------
>> and add:
>> BuildRequires: redhat-rpm-config
>>
>
> Hi Farkas,
>
> There is some information on building kABI tracking kmod packages in the
> BuildingKernelModules page on the Wiki:
>
> http://wiki.centos.org/HowTos/BuildingKernelModules#head-b86b6eec08d5719cf1838929f26a64af88e2b7f0

the only problem it's outdated.

> Unless I misunderstand your proposal above, one reason I have found for
> including a custom kmodtool-foo source script with your kmod is for
> satisfying Requires. For example, putting:
>
> Requires: foo-bar >= 1.2.3
>
> in the SPEC file for a kmod doesn't work. The Require needs to be added
> to the kmodtool script:
>
> Requires(post): /sbin/depmod
> Requires(postun): /sbin/depmod
> *Requires: foo-bar >= 1.2.3*
> EOF

no it can be use with both kmodtool (redhat and included), the problem
comes from the weak-updates style of kmod and the:
%global _use_internal_dependency_generator 0
anyway it's another problem how to solve.


> I came across this problem building some kmods that required a later
> version of lm_sensors. An example can be seen in this kmod package for
> the coretemp module:
>
> http://www.pperry.f2s.com/linux/coretemp/
>
> I'll admit I'm not an expert kmod packager, but placing the Requires in
> the kmodtool script was the only solution I found (actually either
> Johnny or Karanbir suggested it on IRC IIRC). In my case kmodtool-foo
> was simply a copy of /usr/lib/rpm/redhat/kmodtool with the necessary
> Requires added. If there's a simpler or more elegant solution then
> please do enlighten me :)
>
> My next question would be if Requires: doesn't work in a kmod SPEC file,
> will
>
> BuildRequires: redhat-rpm-config
>
> work?

i hope so.

--
Levente "Si vis pacem para bellum!"
_______________________________________________
CentOS-devel mailing list
CentOS-devel@centos.org
http://lists.centos.org/mailman/listinfo/centos-devel

"Akemi Yagi" 12-21-2008 08:37 PM

kmod packaging guideline
 
On Sun, Dec 21, 2008 at 1:10 PM, Farkas Levente <lfarkas@lfarkas.org> wrote:
> Ned Slider wrote:

>> There is some information on building kABI tracking kmod packages in the
>> BuildingKernelModules page on the Wiki:
>>
>> http://wiki.centos.org/HowTos/BuildingKernelModules#head-b86b6eec08d5719cf1838929f26a64af88e2b7f0
>
> the only problem it's outdated.

It would help if you are more specific and tell us which part of it is
outdated. You can see the edit history of that article here:

http://wiki.centos.org/HowTos/BuildingKernelModules?action=info

Alan has been actively and constantly working on it as you can see.
So, any info/note that helps updating the content would be
appreciated.

Akemi
_______________________________________________
CentOS-devel mailing list
CentOS-devel@centos.org
http://lists.centos.org/mailman/listinfo/centos-devel

"Alan Bartlett" 12-22-2008 12:21 PM

kmod packaging guideline
 
On 21/12/2008, Alan Bartlett <ajb.stxsl@googlemail.com> wrote:
2008/12/20 Farkas Levente <lfarkas@lfarkas.org>





kmodtool shouldn't have to add to all packages rather use the

/usr/lib/rpm/redhat/kmodtool from redhat-rpm-config ie:
<snip>


Quick question. Have you considered how you proposal can be used with CentOS-4 rather than CentOS-5?

There is no C-4 /usr/lib/rpm/redhat/kmodtool -- unless I am mistaken. So to implement what you have proposed will cause a divergence of technique -- C-4 this way, C-5 that way. Not a good idea. :-(

Will you please answer my question, above -- or do you consider CentOS-4 "outdated"?

Alan.


_______________________________________________
CentOS-devel mailing list
CentOS-devel@centos.org
http://lists.centos.org/mailman/listinfo/centos-devel

Farkas Levente 12-22-2008 09:26 PM

kmod packaging guideline
 
Alan Bartlett wrote:
> On 21/12/2008, *Alan Bartlett* <ajb.stxsl@googlemail.com
> <mailto:ajb.stxsl@googlemail.com>> wrote:
>
> 2008/12/20 Farkas Levente <lfarkas@lfarkas.org
> <mailto:lfarkas@lfarkas.org>>
>
>
> kmodtool shouldn\'t have to add to all packages rather use the
> /usr/lib/rpm/redhat/kmodtool from redhat-rpm-config ie:
>
>
> <snip>
>
> Quick question. Have you considered how you proposal can be used
> with CentOS-4 rather than CentOS-5?
>
> There is no C-4 /usr/lib/rpm/redhat/kmodtool -- unless I am
> mistaken. So to implement what you have proposed will cause a
> divergence of technique -- C-4 this way, C-5 that way. Not a good
> idea. :-(
>
>
> Will you please answer my question, above -- or do you consider CentOS-4
> "outdated"?

no actually i only has centos-5 so i can\'t check it.
anyway the best probably would ba a centos specific kmodtool packages in
extras with spec template etc.
the question the main kmod packager interesting about it or not?

--
Levente "Si vis pacem para bellum!"
_______________________________________________
CentOS-devel mailing list
CentOS-devel@centos.org
http://lists.centos.org/mailman/listinfo/centos-devel


All times are GMT. The time now is 01:39 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.