From: Harald Hoyer harald@redhat.com
This patch changes the version of kernel flavor/variants to end in "-$flavor" instead of ".$flavor". This makes it easier to detect a flavor and a parser can separate it from the architecture.
With that change we can correct kernel-install (of systemd) to call new-kernel-package with --package kernel-$flavor, because the $flavor can easily be extracted from the version string. --- kernel.spec | 74 ++++++++++++++++++++++++++++++------------------------------- 1 file changed, 37 insertions(+), 37 deletions(-)
diff --git a/kernel.spec b/kernel.spec index f85ba9a..9e17710 100644 --- a/kernel.spec +++ b/kernel.spec @@ -464,17 +464,17 @@ Summary: The Linux kernel # %define kernel_reqprovconf \ Provides: kernel = %{rpmversion}-%{pkg_release}\ -Provides: kernel-%{_target_cpu} = %{rpmversion}-%{pkg_release}%{?1:.%{1}}\ +Provides: kernel-%{_target_cpu} = %{rpmversion}-%{pkg_release}%{?1:-%{1}}\ Provides: kernel-drm = 4.3.0\ Provides: kernel-drm-nouveau = 16\ Provides: kernel-modeset = 1\ -Provides: kernel-uname-r = %{KVERREL}%{?1:.%{1}}\ +Provides: kernel-uname-r = %{KVERREL}%{?1:-%{1}}\ Provides: kernel-highbank\ -Provides: kernel-highbank-uname-r = %{KVERREL}%{?1:.%{1}}\ +Provides: kernel-highbank-uname-r = %{KVERREL}%{?1:-%{1}}\ Provides: kernel-omap\ -Provides: kernel-omap-uname-r = %{KVERREL}%{?1:.%{1}}\ +Provides: kernel-omap-uname-r = %{KVERREL}%{?1:-%{1}}\ Provides: kernel-tegra\ -Provides: kernel-tegra-uname-r = %{KVERREL}%{?1:.%{1}}\ +Provides: kernel-tegra-uname-r = %{KVERREL}%{?1:-%{1}}\ Requires(pre): %{kernel_prereq}\ Requires(pre): %{initrd_prereq}\ Requires(pre): linux-firmware >= 20120206-0.1.git06c8f81\ @@ -930,7 +930,7 @@ AutoReqProv: no\ %description -n %{name}%{?1:-%{1}}-debuginfo\ This package provides debug information for package %{name}%{?1:-%{1}}.\ This is required to use SystemTap with %{name}%{?1:-%{1}}-%{KVERREL}.\ -%{expand:%%global debuginfo_args %{?debuginfo_args} -p '/.*/%%{KVERREL}%{?1:.%{1}}/.*|/.*%%{KVERREL}%{?1:.%{1}}(.debug)?' -o debuginfo%{?1}.list}\ +%{expand:%%global debuginfo_args %{?debuginfo_args} -p '/.*/%%{KVERREL}%{?1:-%{1}}/.*|/.*%%{KVERREL}%{?1:-%{1}}(.debug)?' -o debuginfo%{?1}.list}\ %{nil}
# @@ -942,9 +942,9 @@ This is required to use SystemTap with %{name}%{?1:-%{1}}-%{KVERREL}.\ Summary: Development package for building kernel modules to match the %{?2:%{2} }kernel\ Group: System Environment/Kernel\ Provides: kernel%{?1:-%{1}}-devel-%{_target_cpu} = %{version}-%{release}\ -Provides: kernel-devel-%{_target_cpu} = %{version}-%{release}%{?1:.%{1}}\ -Provides: kernel-devel = %{version}-%{release}%{?1:.%{1}}\ -Provides: kernel-devel-uname-r = %{KVERREL}%{?1:.%{1}}\ +Provides: kernel-devel-%{_target_cpu} = %{version}-%{release}%{?1:-%{1}}\ +Provides: kernel-devel = %{version}-%{release}%{?1:-%{1}}\ +Provides: kernel-devel-uname-r = %{KVERREL}%{?1:-%{1}}\ AutoReqProv: no\ Requires(pre): /usr/bin/find\ Requires: perl\ @@ -962,11 +962,11 @@ against the %{?2:%{2} }kernel package.\ Summary: Extra kernel modules to match the %{?2:%{2} }kernel\ Group: System Environment/Kernel\ Provides: kernel%{?1:-%{1}}-modules-extra-%{_target_cpu} = %{version}-%{release}\ -Provides: kernel-modules-extra-%{_target_cpu} = %{version}-%{release}%{?1:.%{1}}\ -Provides: kernel-modules-extra = %{version}-%{release}%{?1:.%{1}}\ +Provides: kernel-modules-extra-%{_target_cpu} = %{version}-%{release}%{?1:-%{1}}\ +Provides: kernel-modules-extra = %{version}-%{release}%{?1:-%{1}}\ Provides: installonlypkg(kernel-module)\ -Provides: kernel-modules-extra-uname-r = %{KVERREL}%{?1:.%{1}}\ -Requires: kernel-uname-r = %{KVERREL}%{?1:.%{1}}\ +Provides: kernel-modules-extra-uname-r = %{KVERREL}%{?1:-%{1}}\ +Requires: kernel-uname-r = %{KVERREL}%{?1:-%{1}}\ AutoReqProv: no\ %description -n kernel%{?variant}%{?1:-%{1}}-modules-extra\ This package provides less commonly used kernel modules for the %{?2:%{2} }kernel package.\ @@ -1544,7 +1544,7 @@ BuildKernel() { MakeTarget=$1 KernelImage=$2 Flavour=$3 - Flav=${Flavour:+.${Flavour}} + Flav=${Flavour:+-${Flavour}} InstallName=${4:-vmlinuz}
# Pick the right config file for the kernel we're building @@ -1871,13 +1871,13 @@ find Documentation -type d | xargs chmod u+w %define __modsign_install_post \ if [ "%{signmodules}" -eq "1" ]; then \ if [ "%{with_pae}" -ne "0" ]; then \ - %{modsign_cmd} signing_key.priv.sign.PAE signing_key.x509.sign.PAE $RPM_BUILD_ROOT/lib/modules/%{KVERREL}.PAE/ \ + %{modsign_cmd} signing_key.priv.sign-PAE signing_key.x509.sign-PAE $RPM_BUILD_ROOT/lib/modules/%{KVERREL}-PAE/ \ fi \ if [ "%{with_debug}" -ne "0" ]; then \ - %{modsign_cmd} signing_key.priv.sign.debug signing_key.x509.sign.debug $RPM_BUILD_ROOT/lib/modules/%{KVERREL}.debug/ \ + %{modsign_cmd} signing_key.priv.sign-debug signing_key.x509.sign-debug $RPM_BUILD_ROOT/lib/modules/%{KVERREL}-debug/ \ fi \ if [ "%{with_pae_debug}" -ne "0" ]; then \ - %{modsign_cmd} signing_key.priv.sign.PAEdebug signing_key.x509.sign.PAEdebug $RPM_BUILD_ROOT/lib/modules/%{KVERREL}.PAEdebug/ \ + %{modsign_cmd} signing_key.priv.sign-PAEdebug signing_key.x509.sign-PAEdebug $RPM_BUILD_ROOT/lib/modules/%{KVERREL}-PAEdebug/ \ fi \ if [ "%{with_up}" -ne "0" ]; then \ %{modsign_cmd} signing_key.priv.sign signing_key.x509.sign $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/ \ @@ -2044,7 +2044,7 @@ then\ fi\ if [ "$HARDLINK" != "no" -a -x /usr/sbin/hardlink ]\ then\ - (cd /usr/src/kernels/%{KVERREL}%{?1:.%{1}} &&\ + (cd /usr/src/kernels/%{KVERREL}%{?1:-%{1}} &&\ /usr/bin/find . -type f | while read f; do\ hardlink -c /usr/src/kernels/*.fc*.*/$f $f\ done)\ @@ -2057,7 +2057,7 @@ fi\ # %define kernel_modules_extra_post() \ %{expand:%%post %{?1:%{1}-}modules-extra}\ -/sbin/depmod -a %{KVERREL}%{?1:.%{1}}\ +/sbin/depmod -a %{KVERREL}%{?1:-%{1}}\ %{nil}
# This macro defines a %%posttrans script for a kernel package. @@ -2066,7 +2066,7 @@ fi\ # %define kernel_variant_posttrans() \ %{expand:%%posttrans %{?1}}\ -/bin/kernel-install add %{KVERREL}%{?1:.%{1}} /%{image_install_path}/vmlinuz-%{KVERREL}%{?1:.%{1}} || exit $?\ +/bin/kernel-install add %{KVERREL}%{?1:-%{1}} /%{image_install_path}/vmlinuz-%{KVERREL}%{?1:-%{1}} || exit $?\ %{nil}
# @@ -2092,7 +2092,7 @@ fi}\ # %define kernel_variant_preun() \ %{expand:%%preun %{?1}}\ -/bin/kernel-install remove %{KVERREL}%{?1:.%{1}} /%{image_install_path}/vmlinuz-%{KVERREL}%{?1:.%{1}} || exit $?\ +/bin/kernel-install remove %{KVERREL}%{?1:-%{1}} /%{image_install_path}/vmlinuz-%{KVERREL}%{?1:-%{1}} || exit $?\ %{nil}
%kernel_variant_preun @@ -2217,30 +2217,30 @@ fi %if %{1}\ %{expand:%%files %{?2}}\ %defattr(-,root,root)\ -/%{image_install_path}/%{?-k:%{-k*}}%{!?-k:vmlinuz}-%{KVERREL}%{?2:.%{2}}\ -/%{image_install_path}/.vmlinuz-%{KVERREL}%{?2:.%{2}}.hmac \ +/%{image_install_path}/%{?-k:%{-k*}}%{!?-k:vmlinuz}-%{KVERREL}%{?2:-%{2}}\ +/%{image_install_path}/.vmlinuz-%{KVERREL}%{?2:-%{2}}.hmac \ %ifarch %{arm}\ -/%{image_install_path}/dtb-%{KVERREL}%{?2:.%{2}} \ +/%{image_install_path}/dtb-%{KVERREL}%{?2:-%{2}} \ %endif\ -%attr(600,root,root) /boot/System.map-%{KVERREL}%{?2:.%{2}}\ -/boot/config-%{KVERREL}%{?2:.%{2}}\ -%dir /lib/modules/%{KVERREL}%{?2:.%{2}}\ -/lib/modules/%{KVERREL}%{?2:.%{2}}/kernel\ -/lib/modules/%{KVERREL}%{?2:.%{2}}/build\ -/lib/modules/%{KVERREL}%{?2:.%{2}}/source\ -/lib/modules/%{KVERREL}%{?2:.%{2}}/updates\ +%attr(600,root,root) /boot/System.map-%{KVERREL}%{?2:-%{2}}\ +/boot/config-%{KVERREL}%{?2:-%{2}}\ +%dir /lib/modules/%{KVERREL}%{?2:-%{2}}\ +/lib/modules/%{KVERREL}%{?2:-%{2}}/kernel\ +/lib/modules/%{KVERREL}%{?2:-%{2}}/build\ +/lib/modules/%{KVERREL}%{?2:-%{2}}/source\ +/lib/modules/%{KVERREL}%{?2:-%{2}}/updates\ %ifarch %{vdso_arches}\ -/lib/modules/%{KVERREL}%{?2:.%{2}}/vdso\ -/etc/ld.so.conf.d/kernel-%{KVERREL}%{?2:.%{2}}.conf\ +/lib/modules/%{KVERREL}%{?2:-%{2}}/vdso\ +/etc/ld.so.conf.d/kernel-%{KVERREL}%{?2:-%{2}}.conf\ %endif\ -/lib/modules/%{KVERREL}%{?2:.%{2}}/modules.*\ -%ghost /boot/initramfs-%{KVERREL}%{?2:.%{2}}.img\ +/lib/modules/%{KVERREL}%{?2:-%{2}}/modules.*\ +%ghost /boot/initramfs-%{KVERREL}%{?2:-%{2}}.img\ %{expand:%%files %{?2:%{2}-}devel}\ %defattr(-,root,root)\ -/usr/src/kernels/%{KVERREL}%{?2:.%{2}}\ +/usr/src/kernels/%{KVERREL}%{?2:-%{2}}\ %{expand:%%files %{?2:%{2}-}modules-extra}\ %defattr(-,root,root)\ -/lib/modules/%{KVERREL}%{?2:.%{2}}/extra\ +/lib/modules/%{KVERREL}%{?2:-%{2}}/extra\ %if %{with_debuginfo}\ %ifnarch noarch\ %{expand:%%files -f debuginfo%{?2}.list %{?2:%{2}-}debuginfo}\
Hi!
Me again with another comment:
On 11.06.2013 16:44, harald@redhat.com wrote:
From: Harald Hoyer harald@redhat.com [...] -Provides: kernel-%{_target_cpu} = %{rpmversion}-%{pkg_release}%{?1:.%{1}}\ +Provides: kernel-%{_target_cpu} = %{rpmversion}-%{pkg_release}%{?1:-%{1}}\
Is it really wise to use a "-" here? You can not have a "-" in either %{version} or %{release}, to afaics make sure everything can parse a rpm nvr from right to left: %{version} is between second rightmost dash and the rightmost dash; %{release} follows the rightmost dash.
I'm sure you tested it, so I assume rpm doesn't enforce this rule to virtual provides. But something tells me this might create more problems then is solves. Did anyone ask the rpm and yum guys if this is a good idea?
Cu knurd
On 06/11/2013 08:44 PM, Thorsten Leemhuis wrote:
Hi!
Me again with another comment:
On 11.06.2013 16:44, harald@redhat.com wrote:
From: Harald Hoyer harald@redhat.com [...] -Provides: kernel-%{_target_cpu} = %{rpmversion}-%{pkg_release}%{?1:.%{1}}\ +Provides: kernel-%{_target_cpu} = %{rpmversion}-%{pkg_release}%{?1:-%{1}}\
Is it really wise to use a "-" here? You can not have a "-" in either %{version} or %{release}, to afaics make sure everything can parse a rpm nvr from right to left: %{version} is between second rightmost dash and the rightmost dash; %{release} follows the rightmost dash.
I'm sure you tested it, so I assume rpm doesn't enforce this rule to virtual provides. But something tells me this might create more problems then is solves. Did anyone ask the rpm and yum guys if this is a good idea?
Cu knurd
Hmm... seems to work here. yum and rpm seem to be able to cope with it. Of course we could also use another separation char, if wanted.
$ rpm -qp --provides \ kernel-debug-3.10.0-0.rc4.git0.2.fc20.x86_64.rpm kernel = 3.10.0-0.rc4.git0.2.fc20 kernel-debug = 3.10.0-0.rc4.git0.2.fc20 kernel-debug(x86-64) = 3.10.0-0.rc4.git0.2.fc20 kernel-drm = 4.3.0 kernel-drm-nouveau = 16 kernel-highbank kernel-highbank-uname-r = 3.10.0-0.rc4.git0.2.fc20.x86_64-debug kernel-modeset = 1 kernel-omap kernel-omap-uname-r = 3.10.0-0.rc4.git0.2.fc20.x86_64-debug kernel-tegra kernel-tegra-uname-r = 3.10.0-0.rc4.git0.2.fc20.x86_64-debug kernel-uname-r = 3.10.0-0.rc4.git0.2.fc20.x86_64-debug kernel-x86_64 = 3.10.0-0.rc4.git0.2.fc20-debug linux-gate.so.1 linux-gate.so.1(LINUX_2.5) linux-vdso.so.1()(64bit) linux-vdso.so.1(LINUX_2.6)(64bit)
$ rpm -qp --requires \ kernel-debug-modules-extra 3.10.0-0.rc4.git0.2.fc20.x86_64.rpm kernel-uname-r = 3.10.0-0.rc4.git0.2.fc20.x86_64-debug /bin/sh rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(PayloadIsXz) <= 5.2-1
$ sudo rpm -ivh \ kernel-debug-modules-extra-3.10.0-0.rc4.git0.2.fc20.x86_64.rpm error: Failed dependencies: kernel-uname-r = 3.10.0-0.rc4.git0.2.fc20.x86_64-debug is needed by kernel-debug-modules-extra-3.10.0-0.rc4.git0.2.fc20.x86_64
$ sudo rpm -ivh \ kernel-debug-modules-extra-3.10.0-0.rc4.git0.2.fc20.x86_64.rpm \ kernel-debug-3.10.0-0.rc4.git0.2.fc20.x86_64.rpm Preparing... ################################# [100%] Updating / installing... 1:kernel-debug-3.10.0-0.rc4.git0.2.################################# [ 50%] 2:kernel-debug-modules-extra-3.10.0################################# [100%]
On a side node :), why is kernel-debug.x86_64 providing kernel-tegra and kernel-omap ??? :)
On 06/11/2013 08:44 PM, Thorsten Leemhuis wrote:
Hi!
Me again with another comment:
On 11.06.2013 16:44, harald@redhat.com wrote:
From: Harald Hoyer harald@redhat.com [...] -Provides: kernel-%{_target_cpu} = %{rpmversion}-%{pkg_release}%{?1:.%{1}}\ +Provides: kernel-%{_target_cpu} = %{rpmversion}-%{pkg_release}%{?1:-%{1}}\
Is it really wise to use a "-" here? You can not have a "-" in either %{version} or %{release}, to afaics make sure everything can parse a rpm nvr from right to left: %{version} is between second rightmost dash and the rightmost dash; %{release} follows the rightmost dash.
I'm sure you tested it, so I assume rpm doesn't enforce this rule to virtual provides. But something tells me this might create more problems then is solves. Did anyone ask the rpm and yum guys if this is a good idea?
Cu knurd
Talked to the rpm guys, and yes, it's a problem.
So, any idea for a good separation char here?
kernel@lists.fedoraproject.org