[opensuse-kernel] Creating a new kernel flavor
Hi,
We're working on creating a new kernel flavor here so we can maintain
a few patches against the standard -default kernel without trashing
peoples' installations (i.e. while you can't have -default and -genesi
at the same time because of the cleanup in post-install, at least if
it stops working or there's a weird bug, you can still go back to
-default without forcing packages, and there would be no package
conflicts if someone added our repo, and it had a higher version of
-default..)
However I've stumbled across some real weirdness in kernel-source.src
- which I then gather builds kernel-source.ppc which then can be used
somehow to build kernel-genesi.ppc and .src. For instance, every
kernel-$flavor.spec seems to be built from the same source somewhere,
with identical changelogs and 99% identical code (the difference being
the swapping of the flavor in many places, but that's it). So far I
have just hacked up a kernel-genesi.spec myself which is building fine
now, but I wondered, where do these files get generated and how can I
make my kernel build take part in this process to build an automated
spec file?
Modifying config.conf, series.conf, adding patches is something I've
been doing for a while so that has never been a problem to make a
custom kernel-default, I would just like to move away from it. Is
there any special documentation or a cheat sheet for how to make a new
kernel flavor? What was the process to create kernel-ps3, for example,
a few versions ago, and how does it get maintained with the rest?
--
Matt Sealey
On Wed, Jan 7, 2009 at 3:56 PM, Matt Sealey
Hi,
However I've stumbled across some real weirdness
The other weirdness I found was simply that the spec files by default
refer to a kernel-dummy package - what on earth is this? And where do
I get/build/fake it? It seems a thing for build service, or perhaps
something build-service does not need, but I had to remove the check
for it to get my kernel to build in the end..
Any clues onto where/what I should be doing about this?
--
Matt Sealey
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Matt Sealey wrote:
On Wed, Jan 7, 2009 at 3:56 PM, Matt Sealey
wrote: Hi,
However I've stumbled across some real weirdness
The other weirdness I found was simply that the spec files by default refer to a kernel-dummy package - what on earth is this? And where do I get/build/fake it? It seems a thing for build service, or perhaps something build-service does not need, but I had to remove the check for it to get my kernel to build in the end..
Any clues onto where/what I should be doing about this?
kernel-dummy is indeed a build service thing. It's how we ensure that all kernel flavors have the same version/release numbers. If you're building your own flavor, you can ignore it. - -Jeff - -- Jeff Mahoney SUSE Labs -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAkllJ60ACgkQLPWxlyuTD7KPqwCdHfPStkSjbo/lM0zPmeaAhCou MsYAn0WD2woXjvnlWaAESKGnj6Y5MLqP =iHl+ -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-kernel+help@opensuse.org
On Wed, Jan 7, 2009 at 4:07 PM, Jeff Mahoney
kernel-dummy is indeed a build service thing. It's how we ensure that all kernel flavors have the same version/release numbers.
If you're building your own flavor, you can ignore it.
Install kernel-source.src and rpmbuild -ba SPECS/kernel-source.spec -
it requires kernel-dummy. End of story.
If I'm not in build service what do I do about it other than hacking
kernel-source.spec not to check?
Looking at the commits for kernel-source in December last year (on
opensuse-commit), it definitely looks like most of this kernel package
stuff is magically generated and then committed to CVS as the results.
Where do I get hold of this magic?
--
Matt Sealey
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Matt Sealey wrote:
Hi,
We're working on creating a new kernel flavor here so we can maintain a few patches against the standard -default kernel without trashing peoples' installations (i.e. while you can't have -default and -genesi at the same time because of the cleanup in post-install, at least if it stops working or there's a weird bug, you can still go back to -default without forcing packages, and there would be no package conflicts if someone added our repo, and it had a higher version of -default..)
However I've stumbled across some real weirdness in kernel-source.src - which I then gather builds kernel-source.ppc which then can be used somehow to build kernel-genesi.ppc and .src. For instance, every kernel-$flavor.spec seems to be built from the same source somewhere, with identical changelogs and 99% identical code (the difference being the swapping of the flavor in many places, but that's it). So far I have just hacked up a kernel-genesi.spec myself which is building fine now, but I wondered, where do these files get generated and how can I make my kernel build take part in this process to build an automated spec file?
Yes, they are definitely generated from the same source. We have a kernel-binary.spec.in in the repository that is processed by replacing things like @FLAVOR@ with a real value. There's really no way to add a new flavor to that process since it happens as part of the repository being tarred up into the source RPM. One of my goals is to eliminate as much of that processing as possible. Much of the magic is in scripts that are only part of our repository[1], and that's... suboptimal. In the past month or so I've put some effort into making it easier to do what you're looking to do. The first set of patches remove almost all of the @VAR@ processing in favor of using RPM variables. The result is that you'll be able to add a new flavor by simply changing the %build_flavor variable definition in the beginning of the file and adding a kernel configuration file. Ideally, I'd just like to have a kernel-binary.spec where you do - --define "build_flavor $flavor" on the rpmbuild command line but I'm not sure how we'd go about automating the creation of all the different flavors. For now, you'll have to continue what you're doing. Look for the v2.6.28-staging flavor in the KOTD archive, and you should be able to use the spec files from there once I add those changes in.
Modifying config.conf, series.conf, adding patches is something I've been doing for a while so that has never been a problem to make a custom kernel-default, I would just like to move away from it. Is there any special documentation or a cheat sheet for how to make a new kernel flavor? What was the process to create kernel-ps3, for example, a few versions ago, and how does it get maintained with the rest?
It gets generated from kernel-binary.spec.in, just like everything else. [1] It's not that there's anything particularly sensitive in there, just that we only have so many hours in the day and it's generally better spent fixing bugs. :) - -- Jeff Mahoney SUSE Labs -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAkllLVEACgkQLPWxlyuTD7KY3QCfQGpd3I061lOOmI1wbIxlooNw YpAAn1+WkNcAGGZjtr0XUeOn4gfX2v6O =IwoP -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-kernel+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Matt Sealey wrote:
On Wed, Jan 7, 2009 at 4:07 PM, Jeff Mahoney
wrote: kernel-dummy is indeed a build service thing. It's how we ensure that all kernel flavors have the same version/release numbers.
If you're building your own flavor, you can ignore it.
Install kernel-source.src and rpmbuild -ba SPECS/kernel-source.spec - it requires kernel-dummy. End of story.
If I'm not in build service what do I do about it other than hacking kernel-source.spec not to check?
Use --nodeps or remove the dependency from the spec file.
Looking at the commits for kernel-source in December last year (on opensuse-commit), it definitely looks like most of this kernel package stuff is magically generated and then committed to CVS as the results. Where do I get hold of this magic?
It's currently only in the repository. But, as I mentioned in my other response, we're going to clean that up soon. - -Jeff - -- Jeff Mahoney SUSE Labs -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAkllLdYACgkQLPWxlyuTD7JPRgCfbwgc4u5l16ul/paSn8aJjxXZ ajwAnRt/volPnySRDsiSsTz2lkD8f0k9 =ieWU -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-kernel+help@opensuse.org
Jeff Mahoney wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Matt Sealey wrote:
Ideally, I'd just like to have a kernel-binary.spec where you do - --define "build_flavor $flavor" on the rpmbuild command line but I'm not sure how we'd go about automating the creation of all the different flavors.
Okay. I always did --eval "%define jobs 8" and suchlike, now I find there's a prettier way to do it with less work, awesome :]
For now, you'll have to continue what you're doing. Look for the v2.6.28-staging flavor in the KOTD archive, and you should be able to use the spec files from there once I add those changes in.
Okay. I see the pre/post/preun/postun scripts have the same @BLAH@ processing in it. Do you think this could be changed too? It's really hard to test it without building a kernel, extracting scripts and trying them out manually after installing that kernel. It's kind of a long-winded process.. it takes 10 minutes to build the source RPM here and then another couple of hours to install it, then build the entire thing from scratch (from /SOURCES/kernel-flavor.spec), including all the manual handholding and cigarette breaks.
[1] It's not that there's anything particularly sensitive in there, just that we only have so many hours in the day and it's generally better spent fixing bugs. :)
Okay. Actually I have a prudent question about scripts.. is it possible to insert a set of scripts into an already-built RPM? Since testing them out is a complete bitch without ++hours of kernel building here? -- Matt -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-kernel+help@opensuse.org
Another question. We have some special tasks to run after installing the kernel - the vmlinux is not enough to boot on our hardware (it either needs running through mkzimage which is part of lilo-ppc and some really hideous yast2-bootloader code, or mkimage, which is part of U-Boot and I have created a special package to get working). There are 3 files I need to keep with the kernel when it's installed - two device trees (from arch/powerpc/boot/dts/mpc86??_hpc?.dts) and the arch/powerpc/boot/wrapper script. Would it be better to make a seperate kernel-genesi-tools that includes all this stuff, since if the kernel-genesi.spec is ever autogenerated then we can't go shoving in entries to the %filelist? Thanks. -- Matt -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-kernel+help@opensuse.org
Question 10000 :) Would there be any benefit at all to allowing tar.lzma inside source rpms? The compression benefit is kind of huge for a Linux kernel (it's one-fifth smaller here - 42MB instead of 50MB). For other packages too, while it would take longer (to compress an existing tarball from gz or bz2 to lzma) to WRITE packages, installing the source package would get much faster due to the faster decompression and multicore and what-not.. This kind of stuff is automatic on FreeBSD where the BSD tar (because it's based on libarchive) can work out what to decompress, whereas GNU tar seems a little lame in comparison.. Thanks. -- Matt -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-kernel+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Matt Sealey wrote:
Question 10000 :)
Would there be any benefit at all to allowing tar.lzma inside source rpms? The compression benefit is kind of huge for a Linux kernel (it's one-fifth smaller here - 42MB instead of 50MB). For other packages too, while it would take longer (to compress an existing tarball from gz or bz2 to lzma) to WRITE packages, installing the source package would get much faster due to the faster decompression and multicore and what-not..
This kind of stuff is automatic on FreeBSD where the BSD tar (because it's based on libarchive) can work out what to decompress, whereas GNU tar seems a little lame in comparison..
You could probably do it, but bz2 is what's currently mandated by our build system. - -Jeff - -- Jeff Mahoney SUSE Labs -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAkluO0wACgkQLPWxlyuTD7Io1ACdGf3WGdCcuvjCFuTll98bKX7z zOMAn02ERA7LfgNoHYugRNSfFwwvJMaP =kfxA -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-kernel+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Matt Sealey wrote:
Jeff Mahoney wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Matt Sealey wrote:
Ideally, I'd just like to have a kernel-binary.spec where you do - --define "build_flavor $flavor" on the rpmbuild command line but I'm not sure how we'd go about automating the creation of all the different flavors.
Okay. I always did --eval "%define jobs 8" and suchlike, now I find there's a prettier way to do it with less work, awesome :]
For now, you'll have to continue what you're doing. Look for the v2.6.28-staging flavor in the KOTD archive, and you should be able to use the spec files from there once I add those changes in.
Okay. I see the pre/post/preun/postun scripts have the same @BLAH@ processing in it. Do you think this could be changed too? It's really hard to test it without building a kernel, extracting scripts and trying them out manually after installing that kernel. It's kind of a long-winded process.. it takes 10 minutes to build the source RPM here and then another couple of hours to install it, then build the entire thing from scratch (from /SOURCES/kernel-flavor.spec), including all the manual handholding and cigarette breaks.
[1] It's not that there's anything particularly sensitive in there, just that we only have so many hours in the day and it's generally better spent fixing bugs. :)
Okay. Actually I have a prudent question about scripts.. is it possible to insert a set of scripts into an already-built RPM? Since testing them out is a complete bitch without ++hours of kernel building here?
-- Matt
The @BLAH@ parts of the scripts get generated from the spec file, not from our external scripts. I'm not a fan of it either, but it shouldn't be a problem. I don't believe it's possible to add scripts to an already-built RPM, but then I'm not an RPM guru. - -Jeff - -- Jeff Mahoney SUSE Labs -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAkluO6gACgkQLPWxlyuTD7KImwCcDbOtZ18obcEOEcLyonVlMBEF NO4AoIWcmlG/FgIfRtke9ZZmyQfsWvmx =Nz6o -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-kernel+help@opensuse.org
Jeff Mahoney wrote:
The @BLAH@ parts of the scripts get generated from the spec file, not from our external scripts. I'm not a fan of it either, but it shouldn't be a problem.
Where? :/ I must be not seeing this bit somehow :( -- Matt -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-kernel+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Matt Sealey wrote:
Jeff Mahoney wrote:
The @BLAH@ parts of the scripts get generated from the spec file, not from our external scripts. I'm not a fan of it either, but it shouldn't be a problem.
Where? :/
I must be not seeing this bit somehow :(
-- Matt
for script in preun postun pre post; do sed -e "s:@KERNELRELEASE@:$KERNELRELEASE:g" \ -e "s:@IMAGE@:$image:g" \ -e "s:@FLAVOR""@:%build_flavor:g" \ -e "s:@SUBPACKAGE@:%name$sub:g" \ -e "s:@BASE_PACKAGE@:$base_package:g" \ -e "s:@RPM_VERSION_RELEASE@:%version-%release:g" \ -e "s:@RPM_TARGET_CPU@:%_target_cpu:g" \ %_sourcedir/$script.sh > %my_builddir/$script$sub.sh done - -Jeff - -- Jeff Mahoney SUSE Labs -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAkluPg0ACgkQLPWxlyuTD7JI+gCff7JBxXU3slZczFjHFdE7H6dx fgsAn0roNG/cI49mIm6K/IM35eyVraAq =loZy -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-kernel+help@opensuse.org
Jeff Mahoney wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Matt Sealey wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Matt Sealey wrote:
Ideally, I'd just like to have a kernel-binary.spec where you do - --define "build_flavor $flavor" on the rpmbuild command line but I'm not sure how we'd go about automating the creation of all the different flavors. Okay. I always did --eval "%define jobs 8" and suchlike, now I find
Jeff Mahoney wrote: there's a prettier way to do it with less work, awesome :]
For now, you'll have to continue what you're doing. Look for the v2.6.28-staging flavor in the KOTD archive, and you should be able to use the spec files from there once I add those changes in. Okay. I see the pre/post/preun/postun scripts have the same @BLAH@ processing in it. Do you think this could be changed too? It's really hard to test it without building a kernel, extracting scripts and trying them out manually after installing that kernel. It's kind of a long-winded process.. it takes 10 minutes to build the source RPM here and then another couple of hours to install it, then build the entire thing from scratch (from /SOURCES/kernel-flavor.spec), including all the manual handholding and cigarette breaks.
[1] It's not that there's anything particularly sensitive in there, just that we only have so many hours in the day and it's generally better spent fixing bugs. :) Okay. Actually I have a prudent question about scripts.. is it possible to insert a set of scripts into an already-built RPM? Since testing them out is a complete bitch without ++hours of kernel building here?
-- Matt
The @BLAH@ parts of the scripts get generated from the spec file, not from our external scripts. I'm not a fan of it either, but it shouldn't be a problem.
for script in preun postun pre post; do sed -e "s:@KERNELRELEASE@:$KERNELRELEASE:g" \ -e "s:@IMAGE@:$image:g" \ -e "s:@FLAVOR""@:genesi:g" \ -e "s:@SUBPACKAGE@:kernel-genesi$sub:g" \ -e "s:@BASE_PACKAGE@:$base_package:g" \ -e "s:@RPM_VERSION_RELEASE@:%version-%release:g" \ %_sourcedir/$script.sh > ../$script$sub.sh done Ah I see it's this right? Sigh.. -- Matt -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-kernel+help@opensuse.org
Jeff Mahoney wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Matt Sealey wrote:
Question 10000 :)
You could probably do it, but bz2 is what's currently mandated by our build system.
Even though all built packages on the system are LZMA compress CPIO? :) How odd.. -- Matt -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-kernel+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Matt Sealey wrote:
Jeff Mahoney wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Matt Sealey wrote:
Question 10000 :)
You could probably do it, but bz2 is what's currently mandated by our build system.
Even though all built packages on the system are LZMA compress CPIO? :)
Yep. *shrug* - -Jeff - -- Jeff Mahoney SUSE Labs -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAkluP5YACgkQLPWxlyuTD7K8wwCgol6s0ILia/r5+CLQrBL4niqH DWAAn1joPbXx3tnU9U+TjpElkndNtrjf =4jZT -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-kernel+help@opensuse.org
Jeff Mahoney wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Matt Sealey wrote:
Jeff Mahoney wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Matt Sealey wrote:
Question 10000 :)
You could probably do it, but bz2 is what's currently mandated by our build system. Even though all built packages on the system are LZMA compress CPIO? :)
Yep. *shrug*
I just noticed the kernel packages are built with w9.bzdio set forced, so that it's compatible with older distributions. Is this a hint as to why? Maybe it would be nice for us to override this, for instance --define something in rpmbuild or build or lbuild (build_lzma or something). In our case it doesn't make a great deal of sense to provide a bzip2 kernel for older customers of our kernel builds, since we're not going to support anything lower than 11.0 which is when lzma was introduced and standardized.. I'm currently also looking at all these Obseletes: lines in kernel-blah.spec. Really? Seriously? :D Are you really still supporting 5 year old SUSE installs for customers, based on kernels from 2.2.x and k_athlon stuff? -- Matt -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-kernel+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Matt Sealey wrote:
Jeff Mahoney wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Matt Sealey wrote:
Jeff Mahoney wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Matt Sealey wrote:
Question 10000 :)
You could probably do it, but bz2 is what's currently mandated by our build system. Even though all built packages on the system are LZMA compress CPIO? :)
Yep. *shrug*
I just noticed the kernel packages are built with w9.bzdio set forced, so that it's compatible with older distributions. Is this a hint as to why? Maybe it would be nice for us to override this, for instance --define something in rpmbuild or build or lbuild (build_lzma or something). In our case it doesn't make a great deal of sense to provide a bzip2 kernel for older customers of our kernel builds, since we're not going to support anything lower than 11.0 which is when lzma was introduced and standardized..
On my copy, that looks like: %if %build_vanilla # force bzip2 instead of lzma compression to allow install on older dist versions %define _binary_payload w9.bzdio %endif ... so it only applies to the vanilla flavor.
I'm currently also looking at all these Obseletes: lines in kernel-blah.spec. Really? Seriously? :D
Are you really still supporting 5 year old SUSE installs for customers, based on kernels from 2.2.x and k_athlon stuff?
Are you looking at the spec files I just sent you? I thought I removed all that crap. - -Jeff - -- Jeff Mahoney SUSE Labs -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAkluS0AACgkQLPWxlyuTD7LUYQCdGZj1HzOfxVJGmYQg0/6Niflv gwwAoJZ38LHcG8yxkyhuC5aYzQUivmtF =yR9h -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-kernel+help@opensuse.org
Jeff Mahoney wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On my copy, that looks like: %if %build_vanilla # force bzip2 instead of lzma compression to allow install on older dist versions %define _binary_payload w9.bzdio %endif
... so it only applies to the vanilla flavor.
Ah-ha! Sometimes I get highway hypnosis from all the %#%#%#%%#%#%#%%#%#%%# :D
I'm currently also looking at all these Obseletes: lines in kernel-blah.spec. Really? Seriously? :D
Are you really still supporting 5 year old SUSE installs for customers, based on kernels from 2.2.x and k_athlon stuff?
Are you looking at the spec files I just sent you? I thought I removed all that crap.
Yeah.. kernel-source is nice and clean but the kernel-default is again
full of that crap. Reattached (dragged it right from the old mail :)
I assume this is part of that kernel-flavor.spec.in stuff that you're
trying to get rid of/clean up somehow? Or just the wrong kernel-default?
-- Matt
#
# spec file for package kernel-default (Version 2.6.29)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
%define using_buildservice 0%{?opensuse_bs}
%define variant
%if %using_buildservice
# Strip off the build number ("y") from the "x.y" release number
%define source_rel %(release=%release; echo ${release%.*})
%else
# We don't have build numbers internally
%define source_rel %release
%endif
# Don't use shell commands in build macros, this won't work outside of rpm
%define build_flavor default
%define build_kdump 0
%define build_xen 0
%define build_vanilla 0
%define build_ps3 0
%define srcversion 2.6.28
%define patchversion 2.6.29-rc1
# This works fine, but the build service won't expand it for security reasons
#%define variant %(case %build_flavor in (rt|rt_*) echo -rt ;; (vanilla) echo -vanilla ;; esac)
%if %{build_flavor} == "kdump"
%define build_kdump 1
%endif
%if %{build_flavor} == "xen"
%define build_xen 1
%endif
%if %{build_flavor} == "vanilla"
%define build_vanilla 1
%endif
%if %{build_flavor} == "ps3"
%define build_ps3 1
%endif
%(chmod +x %_sourcedir/{arch-symbols,guards,config-subst,check-for-config-changes,check-supported-list,built-in-where,modversions,symsets.pl})
%define arch_symbols %(%_sourcedir/arch-symbols %_target_cpu)
%define symbols %(set -- %name kernel-%build_flavor $(case %build_flavor in (rt|rt_*) echo RT ;; esac) $([ -e %_sourcedir/extra-symbols ] && cat %_sourcedir/extra-symbols) ; echo $*)
%define cpu_arch_flavor %(%_sourcedir/guards %symbols %arch_symbols < %_sourcedir/config.conf | grep '/%build_flavor$')
# Define some CONFIG variables as rpm macros as well. (rpm cannot handle
# defining them all at once.)
%define config_vars CONFIG_MODULES
%{expand:%(eval "$(test -n "%cpu_arch_flavor" && tar xfj %_sourcedir/config.tar.bz2 --to-stdout config/%cpu_arch_flavor)"; for config in %config_vars; do echo "%%global $config ${!config:-n}"; done)}
%ifarch %ix86 x86_64
%define install_vdso 1
%else
%define install_vdso 0
%endif
%if %build_vanilla || %build_kdump || %CONFIG_MODULES != "y"
%define split_packages 0
%else
%define split_packages 1
%endif
Name: kernel-%build_flavor
Summary: Dummy summary
Version: 2.6.29
%if %using_buildservice
Release: rc1.<RELEASE>
BuildRequires: kernel-source
%else
%define kernel_source_release %(rpm -q kernel-source%variant-%version --qf "%{RELEASE}")
Release: %kernel_source_release
BuildRequires: kernel-source%variant = %version-%kernel_source_release
%endif
License: GPL
Group: System/Kernel
Url: http://www.kernel.org/
AutoReqProv: on
BuildRequires: coreutils module-init-tools sparse
BuildRequires: fdupes
Provides: %{name}_%_target_cpu = %version-%release
%if %split_packages
Requires: %name-base_%_target_cpu = %version-%release
%endif
Requires(pre): coreutils awk
Requires(post): module-init-tools
# This Requires is wrong, because the post/postun scripts have a
# test -x update-bootloader, having perl-Bootloader is not a hard requirement.
# But, there is no way to tell rpm or yast to schedule the installation
# of perl-Bootloader before kernel-binary.rpm if both are in the list of
# packages to install/update. Likewise, this is true for mkinitrd.
# A specific version of perl-Bootloader is not required, because the post/postun
# scripts handle the two API versions of 10.1/SLES10 GA and 10.2/SLES10 SP1
Requires(post): perl-Bootloader
Requires(post): mkinitrd
#!BuildIgnore: perl-Bootloader mkinitrd
%if ! %using_buildservice
BuildRequires: kernel-dummy
%endif
%ifarch ia64
# arch/ia64/scripts/unwcheck.py
BuildRequires: python
%endif
%ifarch s390 s390x
BuildRequires: dwarfextract
%endif
%if %build_xen
%ifarch %ix86
Provides: kernel-xenpae = %version
Obsoletes: kernel-xenpae <= %version
%endif
#!BuildIgnore: xen
%endif
Provides: %name-nongpl
Obsoletes: %name-nongpl
%if %build_vanilla
# force bzip2 instead of lzma compression to allow install on older dist versions
%define _binary_payload w9.bzdio
%endif
# dead network if installed on SLES10, otherwise it will work (mostly)
Conflicts: sysfsutils < 2.0
%if ! %build_vanilla
Conflicts: apparmor-profiles <= 2.1
Conflicts: apparmor-parser < 2.3
# root-lvm only works with newer udevs
Conflicts: udev < 118
Conflicts: lvm2 < 2.02.33
%endif
%ifarch %ix86
Conflicts: libc.so.6()(64bit)
%endif
Provides: kernel = %version-%source_rel
%ifarch %ix86
Provides: k_athlon k_debug k_deflt k_deflt_22 k_deflt_24 k_eide k_laptop k_orig k_pentiu k_pos_ibm k_psmp k_smp k_smp_22 k_smp_24 smp kernel-smp
Obsoletes: k_athlon k_debug k_deflt k_deflt_22 k_deflt_24 k_eide k_laptop k_orig k_pentiu k_pos_ibm k_psmp k_smp k_smp_22 k_smp_24 smp kernel-smp
%else
%ifarch ia64
Provides: k_debug k_deflt k_itanium2 k_itanium2-smp k_smp kernel-sn2
Obsoletes: k_debug k_deflt k_itanium2 k_itanium2-smp k_smp kernel-sn2
%else
%ifarch ppc
Provides: k_chrp k_chrps k_deflt k_pmac k_pmacs k_prep k_preps
Obsoletes: k_chrp k_chrps k_deflt k_pmac k_pmacs k_prep k_preps
%else
%ifarch ppc64
%else
%ifarch s390x
Provides: kernel-64bit k_deflt
Obsoletes: kernel-64bit k_deflt
%else
%ifarch x86_64
Provides: k_deflt k_numa k_smp smp kernel-smp
Obsoletes: k_deflt k_numa k_smp smp kernel-smp
%endif
%endif
%endif
%endif
%endif
%endif
Source10: preun.sh
Source11: postun.sh
Source12: pre.sh
Source13: post.sh
Source20: series.conf
Source21: config.conf
Source22: supported.conf
Source30: arch-symbols
Source31: guards
Source32: config-subst
Source33: check-for-config-changes
Source34: check-supported-list
Source40: build-source-timestamp
Source41: built-in-where
Source44: find-provides
Source45: module-renames
Source46: modversions
Source47: symsets.pl
Source100: config.tar.bz2
Source101: kabi.tar.bz2
%define my_builddir %_builddir/%{name}-%{version}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
ExclusiveArch: %ix86 ia64 ppc ppc64 s390x x86_64
# These files are found in the kernel-source package:
NoSource: 100
NoSource: 101
# The following KMPs have been integrated into the kernel package.
Obsoletes: iwlwifi-kmp
Obsoletes: ipw3945-kmp
Obsoletes: adm8211-kmp
Obsoletes: rt2x00-kmp
Obsoletes: rfswitch-kmp
Obsoletes: uvcvideo-kmp
Obsoletes: atl2-kmp
Obsoletes: wlan-ng-kmp
Obsoletes: et131x-kmp
Obsoletes: ivtv-kmp
Obsoletes: at76_usb-kmp
Obsoletes: pcc-acpi-kmp
Obsoletes: uvcvideo-kmp
Obsoletes: ralink-rt2860-kmp
# Build with bash instead of sh as the shell: this turns on bash
# extensions like <(...).
%define _buildshell /bin/bash
# Provide the exported symbols as "ksym(symbol) = hash"
%define __find_provides %my_builddir/find-provides %name
# Will modules not listed in supported.conf abort the kernel build (0/1)?
%define supported_modules_check 0
%define tolerate_unknown_new_config_options 0
# kABI change tolerance (default in maintenance should be 4, 6, 8 or 15,
# 31 is the maximum; see scripts/kabi-checks)
%define tolerate_kabi_changes 31
%description
Dummy description.
%prep
%setup -q -c -T -a 100 -a 101
supported_conf() {
%_sourcedir/guards %symbols $* < %_sourcedir/supported.conf | sort -u
}
# Generate the list of modules to be marked as supported
{ supported_conf base
for how in external; do
comm -2 -3 <(supported_conf base $how) <(supported_conf base) \
| sed -e 's:$: '"$how"':'
done
} | sed -e 's,.*/,,' -e 's,\.ko$,,' > %my_builddir/Module.supported
# Create grep pattern file for the modules to end up in the base package
comm -2 -3 <(supported_conf base) <(supported_conf) \
| sed -e 's:.*/::' -e 's:^:\\/:' -e 's:$:\.ko$:' \
> %my_builddir/grep-for-base-modules
# Release number without the EXTRAVERSION
RELEASE=%source_rel
while [ "$RELEASE" != "${RELEASE#[^0-9]*.}" ]; do
RELEASE=${RELEASE#[^0-9]*.}
done
if [ -f %_sourcedir/localversion ] ; then
cat %_sourcedir/localversion > %my_builddir/localversion
fi
KERNELRELEASE="%patchversion-$RELEASE-%build_flavor"
SRCDIR="/usr/src/linux-%patchversion-$RELEASE%variant"
BUILDDIR="%buildroot$SRCDIR-obj/%cpu_arch_flavor"
mkdir -p "$BUILDDIR"
cat config/%cpu_arch_flavor \
| %_sourcedir/config-subst CONFIG_LOCALVERSION '"'-$RELEASE-%build_flavor'"' \
| %_sourcedir/config-subst CONFIG_SUSE_KERNEL y \
%if 0%{?__debug_package:1}
| %_sourcedir/config-subst CONFIG_DEBUG_INFO y \
%endif
> %my_builddir/.config
cpu_arch_flavor="%cpu_arch_flavor"
cat >> .rpm-defs <
Matt Sealey wrote:
Jeff Mahoney wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On my copy, that looks like: %if %build_vanilla # force bzip2 instead of lzma compression to allow install on older dist versions %define _binary_payload w9.bzdio %endif
... so it only applies to the vanilla flavor.
Ah-ha!
Sometimes I get highway hypnosis from all the %#%#%#%%#%#%#%%#%#%%# :D
I'm currently also looking at all these Obseletes: lines in kernel-blah.spec. Really? Seriously? :D
Are you really still supporting 5 year old SUSE installs for customers, based on kernels from 2.2.x and k_athlon stuff?
Are you looking at the spec files I just sent you? I thought I removed all that crap.
Yeah.. kernel-source is nice and clean but the kernel-default is again full of that crap. Reattached (dragged it right from the old mail :)
I assume this is part of that kernel-flavor.spec.in stuff that you're trying to get rid of/clean up somehow? Or just the wrong kernel-default?
Ah. It's part of the kernel-flavor.spec stuff. It gets added
automatically. I've cleaned out the list. New spec attached.
-Jeff
--
Jeff Mahoney
SUSE Labs
#
# spec file for package kernel-default (Version 2.6.29)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
%define using_buildservice 0%{?opensuse_bs}
%define variant
%if %using_buildservice
# Strip off the build number ("y") from the "x.y" release number
%define source_rel %(release=%release; echo ${release%.*})
%else
# We don't have build numbers internally
%define source_rel %release
%endif
# Don't use shell commands in build macros, this won't work outside of rpm
%define build_flavor default
%define build_kdump 0
%define build_xen 0
%define build_vanilla 0
%define build_ps3 0
%define srcversion 2.6.28
%define patchversion 2.6.29-rc1
# This works fine, but the build service won't expand it for security reasons
#%define variant %(case %build_flavor in (rt|rt_*) echo -rt ;; (vanilla) echo -vanilla ;; esac)
%if %{build_flavor} == "kdump"
%define build_kdump 1
%endif
%if %{build_flavor} == "xen"
%define build_xen 1
%endif
%if %{build_flavor} == "vanilla"
%define build_vanilla 1
%endif
%if %{build_flavor} == "ps3"
%define build_ps3 1
%endif
%(chmod +x %_sourcedir/{arch-symbols,guards,config-subst,check-for-config-changes,check-supported-list,built-in-where,modversions,symsets.pl})
%define arch_symbols %(%_sourcedir/arch-symbols %_target_cpu)
%define symbols %(set -- %name kernel-%build_flavor $(case %build_flavor in (rt|rt_*) echo RT ;; esac) $([ -e %_sourcedir/extra-symbols ] && cat %_sourcedir/extra-symbols) ; echo $*)
%define cpu_arch_flavor %(%_sourcedir/guards %symbols %arch_symbols < %_sourcedir/config.conf | grep '/%build_flavor$')
# Define some CONFIG variables as rpm macros as well. (rpm cannot handle
# defining them all at once.)
%define config_vars CONFIG_MODULES
%{expand:%(eval "$(test -n "%cpu_arch_flavor" && tar xfj %_sourcedir/config.tar.bz2 --to-stdout config/%cpu_arch_flavor)"; for config in %config_vars; do echo "%%global $config ${!config:-n}"; done)}
%ifarch %ix86 x86_64
%define install_vdso 1
%else
%define install_vdso 0
%endif
%if %build_vanilla || %build_kdump || %CONFIG_MODULES != "y"
%define split_packages 0
%else
%define split_packages 1
%endif
Name: kernel-%build_flavor
Summary: Dummy summary
Version: 2.6.29
%if %using_buildservice
Release: rc1.<RELEASE>
BuildRequires: kernel-source
%else
%define kernel_source_release %(rpm -q kernel-source%variant-%version --qf "%{RELEASE}")
Release: %kernel_source_release
BuildRequires: kernel-source%variant = %version-%kernel_source_release
%endif
License: GPL
Group: System/Kernel
Url: http://www.kernel.org/
AutoReqProv: on
BuildRequires: coreutils module-init-tools sparse
BuildRequires: fdupes
Provides: %{name}_%_target_cpu = %version-%release
%if %split_packages
Requires: %name-base_%_target_cpu = %version-%release
%endif
Requires(pre): coreutils awk
Requires(post): module-init-tools
# This Requires is wrong, because the post/postun scripts have a
# test -x update-bootloader, having perl-Bootloader is not a hard requirement.
# But, there is no way to tell rpm or yast to schedule the installation
# of perl-Bootloader before kernel-binary.rpm if both are in the list of
# packages to install/update. Likewise, this is true for mkinitrd.
# A specific version of perl-Bootloader is not required, because the post/postun
# scripts handle the two API versions of 10.1/SLES10 GA and 10.2/SLES10 SP1
Requires(post): perl-Bootloader
Requires(post): mkinitrd
#!BuildIgnore: perl-Bootloader mkinitrd
%if ! %using_buildservice
BuildRequires: kernel-dummy
%endif
%ifarch ia64
# arch/ia64/scripts/unwcheck.py
BuildRequires: python
%endif
%ifarch s390 s390x
BuildRequires: dwarfextract
%endif
%if %build_xen
%ifarch %ix86
Provides: kernel-xenpae = %version
Obsoletes: kernel-xenpae <= %version
%endif
#!BuildIgnore: xen
%endif
Provides: %name-nongpl
Obsoletes: %name-nongpl
%if %build_vanilla
# force bzip2 instead of lzma compression to allow install on older dist versions
%define _binary_payload w9.bzdio
%endif
# dead network if installed on SLES10, otherwise it will work (mostly)
Conflicts: sysfsutils < 2.0
%if ! %build_vanilla
Conflicts: apparmor-profiles <= 2.1
Conflicts: apparmor-parser < 2.3
# root-lvm only works with newer udevs
Conflicts: udev < 118
Conflicts: lvm2 < 2.02.33
%endif
%ifarch %ix86
Conflicts: libc.so.6()(64bit)
%endif
Provides: kernel = %version-%source_rel
%ifarch %ix86
Provides: smp kernel-smp
Obsoletes: smp kernel-smp
%else
%ifarch ia64
Provides: kernel-sn2
Obsoletes: kernel-sn2
%else
%ifarch ppc
%else
%ifarch ppc64
%else
%ifarch s390x
Provides: kernel-64bit
Obsoletes: kernel-64bit
%else
%ifarch x86_64
Provides: smp kernel-smp
Obsoletes: smp kernel-smp
%endif
%endif
%endif
%endif
%endif
%endif
Source10: preun.sh
Source11: postun.sh
Source12: pre.sh
Source13: post.sh
Source20: series.conf
Source21: config.conf
Source22: supported.conf
Source30: arch-symbols
Source31: guards
Source32: config-subst
Source33: check-for-config-changes
Source34: check-supported-list
Source40: build-source-timestamp
Source41: built-in-where
Source44: find-provides
Source45: module-renames
Source46: modversions
Source47: symsets.pl
Source100: config.tar.bz2
Source101: kabi.tar.bz2
%define my_builddir %_builddir/%{name}-%{version}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
ExclusiveArch: %ix86 ia64 ppc ppc64 s390x x86_64
# These files are found in the kernel-source package:
NoSource: 100
NoSource: 101
# The following KMPs have been integrated into the kernel package.
Obsoletes: iwlwifi-kmp
Obsoletes: ipw3945-kmp
Obsoletes: adm8211-kmp
Obsoletes: rt2x00-kmp
Obsoletes: rfswitch-kmp
Obsoletes: uvcvideo-kmp
Obsoletes: atl2-kmp
Obsoletes: wlan-ng-kmp
Obsoletes: et131x-kmp
Obsoletes: ivtv-kmp
Obsoletes: at76_usb-kmp
Obsoletes: pcc-acpi-kmp
Obsoletes: uvcvideo-kmp
Obsoletes: ralink-rt2860-kmp
# Build with bash instead of sh as the shell: this turns on bash
# extensions like <(...).
%define _buildshell /bin/bash
# Provide the exported symbols as "ksym(symbol) = hash"
%define __find_provides %my_builddir/find-provides %name
# Will modules not listed in supported.conf abort the kernel build (0/1)?
%define supported_modules_check 0
%define tolerate_unknown_new_config_options 0
# kABI change tolerance (default in maintenance should be 4, 6, 8 or 15,
# 31 is the maximum; see scripts/kabi-checks)
%define tolerate_kabi_changes 31
%description
Dummy description.
%prep
%setup -q -c -T -a 100 -a 101
supported_conf() {
%_sourcedir/guards %symbols $* < %_sourcedir/supported.conf | sort -u
}
# Generate the list of modules to be marked as supported
{ supported_conf base
for how in external; do
comm -2 -3 <(supported_conf base $how) <(supported_conf base) \
| sed -e 's:$: '"$how"':'
done
} | sed -e 's,.*/,,' -e 's,\.ko$,,' > %my_builddir/Module.supported
# Create grep pattern file for the modules to end up in the base package
comm -2 -3 <(supported_conf base) <(supported_conf) \
| sed -e 's:.*/::' -e 's:^:\\/:' -e 's:$:\.ko$:' \
> %my_builddir/grep-for-base-modules
# Release number without the EXTRAVERSION
RELEASE=%source_rel
while [ "$RELEASE" != "${RELEASE#[^0-9]*.}" ]; do
RELEASE=${RELEASE#[^0-9]*.}
done
if [ -f %_sourcedir/localversion ] ; then
cat %_sourcedir/localversion > %my_builddir/localversion
fi
KERNELRELEASE="%patchversion-$RELEASE-%build_flavor"
SRCDIR="/usr/src/linux-%patchversion-$RELEASE%variant"
BUILDDIR="%buildroot$SRCDIR-obj/%cpu_arch_flavor"
mkdir -p "$BUILDDIR"
cat config/%cpu_arch_flavor \
| %_sourcedir/config-subst CONFIG_LOCALVERSION '"'-$RELEASE-%build_flavor'"' \
| %_sourcedir/config-subst CONFIG_SUSE_KERNEL y \
%if 0%{?__debug_package:1}
| %_sourcedir/config-subst CONFIG_DEBUG_INFO y \
%endif
> %my_builddir/.config
cpu_arch_flavor="%cpu_arch_flavor"
cat >> .rpm-defs <
On Wednesday 07 January 2009 23:31:45 Jeff Mahoney wrote:
[...] In the past month or so I've put some effort into making it easier to do what you're looking to do. The first set of patches remove almost all of the @VAR@ processing in favor of using RPM variables. The result is that you'll be able to add a new flavor by simply changing the %build_flavor variable definition in the beginning of the file and adding a kernel configuration file.
That change is relatively straightforward, and it already makes is a lot easier to create a new flavor by hand: The current kernel-binary.spec.in already contains a %build_flavor definition; we only need to use this definition instead of the old @NAME@ and @FLAVOR@ (which become kernel-%build_flavor and %build_flavor). Can't we simply change that, even right now? Andreas -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-kernel+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Andreas Gruenbacher wrote:
On Wednesday 07 January 2009 23:31:45 Jeff Mahoney wrote:
[...] In the past month or so I've put some effort into making it easier to do what you're looking to do. The first set of patches remove almost all of the @VAR@ processing in favor of using RPM variables. The result is that you'll be able to add a new flavor by simply changing the %build_flavor variable definition in the beginning of the file and adding a kernel configuration file.
That change is relatively straightforward, and it already makes is a lot easier to create a new flavor by hand: The current kernel-binary.spec.in already contains a %build_flavor definition; we only need to use this definition instead of the old @NAME@ and @FLAVOR@ (which become kernel-%build_flavor and %build_flavor).
Can't we simply change that, even right now?
Sure. Most of the changes I want to implement we could do right now. Michal reviewed them and was fine accepting them. I just didn't want to change them at the 11th hour of the enterprise timetable. I have the patches queued against my v2.6.28-staging tree. One thing I'm not certain of is of the requirements of the build service vs. rpmbuild. I've been using rpmbuild to test. My initial testing with the build service ended up with broken dependencies on kernel-source = MACRO, etc. Now I understand that the build service has a different way of handling that dependency, but I don't know if it can handle macros in Name:. - -Jeff - -- Jeff Mahoney SUSE Labs -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAklyu60ACgkQLPWxlyuTD7JAiwCfWItvADialXlPUy4vWNSzi7Ns EuoAnRtITpJG4rqUicMCr8Acw/1VJXt8 =dWC+ -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-kernel+help@opensuse.org
participants (3)
-
Andreas Gruenbacher
-
Jeff Mahoney
-
Matt Sealey