diff --git a/kernel.spec b/kernel.spec index 4755b89..f68d612 100644 --- a/kernel.spec +++ b/kernel.spec @@ -1,5 +1,6 @@ # We have to override the new %%install behavior because, well... the kernel is special. %global __spec_install_pre %{___build_pre} +%define _lib_modules %{_prefix}/lib/modules Summary: The Linux kernel @@ -485,6 +486,7 @@ Requires(pre): %{initrd_prereq}\ Requires(pre): linux-firmware >= 20100806-2\ Requires(post): /sbin/new-kernel-pkg\ Requires(preun): /sbin/new-kernel-pkg\ +Conflicts: filesystem < 3\ Conflicts: %{kernel_dot_org_conflicts}\ Conflicts: %{package_conflicts}\ %{expand:%%{?kernel%{?1:_%{1}}_conflicts:Conflicts: %%{kernel%{?1:_%{1}}_conflicts}}}\ @@ -1510,7 +1512,8 @@ BuildKernel() { $RPM_BUILD_ROOT/%{image_install_path}/$InstallName-$KernelVer chmod 755 $RPM_BUILD_ROOT/%{image_install_path}/$InstallName-$KernelVer - mkdir -p $RPM_BUILD_ROOT/lib/modules/$KernelVer + [ -e $RPM_BUILD_ROOT/lib ] || ln -fns usr/lib $RPM_BUILD_ROOT/lib + mkdir -p $RPM_BUILD_ROOT%{_lib_modules}/$KernelVer # Override $(mod-fw) because we don't want it to install any firmware # we'll get it from the linux-firmware package and we don't want conflicts make -s ARCH=$Arch INSTALL_MOD_PATH=$RPM_BUILD_ROOT modules_install KERNELRELEASE=$KernelVer mod-fw= @@ -1531,52 +1534,52 @@ BuildKernel() { # * all Makefile/Kconfig files # * all script/ files - rm -f $RPM_BUILD_ROOT/lib/modules/$KernelVer/build - rm -f $RPM_BUILD_ROOT/lib/modules/$KernelVer/source - mkdir -p $RPM_BUILD_ROOT/lib/modules/$KernelVer/build - (cd $RPM_BUILD_ROOT/lib/modules/$KernelVer ; ln -s build source) + rm -f $RPM_BUILD_ROOT%{_lib_modules}/$KernelVer/build + rm -f $RPM_BUILD_ROOT%{_lib_modules}/$KernelVer/source + mkdir -p $RPM_BUILD_ROOT%{_lib_modules}/$KernelVer/build + (cd $RPM_BUILD_ROOT%{_lib_modules}/$KernelVer ; ln -s build source) # dirs for additional modules per module-init-tools, kbuild/modules.txt - mkdir -p $RPM_BUILD_ROOT/lib/modules/$KernelVer/extra - mkdir -p $RPM_BUILD_ROOT/lib/modules/$KernelVer/updates + mkdir -p $RPM_BUILD_ROOT%{_lib_modules}/$KernelVer/extra + mkdir -p $RPM_BUILD_ROOT%{_lib_modules}/$KernelVer/updates # first copy everything - cp --parents `find -type f -name "Makefile*" -o -name "Kconfig*"` $RPM_BUILD_ROOT/lib/modules/$KernelVer/build - cp Module.symvers $RPM_BUILD_ROOT/lib/modules/$KernelVer/build - cp System.map $RPM_BUILD_ROOT/lib/modules/$KernelVer/build + cp --parents `find -type f -name "Makefile*" -o -name "Kconfig*"` $RPM_BUILD_ROOT%{_lib_modules}/$KernelVer/build + cp Module.symvers $RPM_BUILD_ROOT%{_lib_modules}/$KernelVer/build + cp System.map $RPM_BUILD_ROOT%{_lib_modules}/$KernelVer/build if [ -s Module.markers ]; then - cp Module.markers $RPM_BUILD_ROOT/lib/modules/$KernelVer/build + cp Module.markers $RPM_BUILD_ROOT%{_lib_modules}/$KernelVer/build fi # then drop all but the needed Makefiles/Kconfig files - rm -rf $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/Documentation - rm -rf $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/scripts - rm -rf $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include - cp .config $RPM_BUILD_ROOT/lib/modules/$KernelVer/build - cp -a scripts $RPM_BUILD_ROOT/lib/modules/$KernelVer/build + rm -rf $RPM_BUILD_ROOT%{_lib_modules}/$KernelVer/build/Documentation + rm -rf $RPM_BUILD_ROOT%{_lib_modules}/$KernelVer/build/scripts + rm -rf $RPM_BUILD_ROOT%{_lib_modules}/$KernelVer/build/include + cp .config $RPM_BUILD_ROOT%{_lib_modules}/$KernelVer/build + cp -a scripts $RPM_BUILD_ROOT%{_lib_modules}/$KernelVer/build if [ -d arch/$Arch/scripts ]; then - cp -a arch/$Arch/scripts $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/arch/%{_arch} || : + cp -a arch/$Arch/scripts $RPM_BUILD_ROOT%{_lib_modules}/$KernelVer/build/arch/%{_arch} || : fi if [ -f arch/$Arch/*lds ]; then - cp -a arch/$Arch/*lds $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/arch/%{_arch}/ || : + cp -a arch/$Arch/*lds $RPM_BUILD_ROOT%{_lib_modules}/$KernelVer/build/arch/%{_arch}/ || : fi - rm -f $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/scripts/*.o - rm -f $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/scripts/*/*.o + rm -f $RPM_BUILD_ROOT%{_lib_modules}/$KernelVer/build/scripts/*.o + rm -f $RPM_BUILD_ROOT%{_lib_modules}/$KernelVer/build/scripts/*/*.o %ifarch ppc - cp -a --parents arch/powerpc/lib/crtsavres.[So] $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/ + cp -a --parents arch/powerpc/lib/crtsavres.[So] $RPM_BUILD_ROOT%{_lib_modules}/$KernelVer/build/ %endif if [ -d arch/%{asmarch}/include ]; then - cp -a --parents arch/%{asmarch}/include $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/ + cp -a --parents arch/%{asmarch}/include $RPM_BUILD_ROOT%{_lib_modules}/$KernelVer/build/ fi - cp -a include $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include + cp -a include $RPM_BUILD_ROOT%{_lib_modules}/$KernelVer/build/include # Make sure the Makefile and version.h have a matching timestamp so that # external modules can be built - touch -r $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/Makefile $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include/linux/version.h - touch -r $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/.config $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include/linux/autoconf.h + touch -r $RPM_BUILD_ROOT%{_lib_modules}/$KernelVer/build/Makefile $RPM_BUILD_ROOT%{_lib_modules}/$KernelVer/build/include/linux/version.h + touch -r $RPM_BUILD_ROOT%{_lib_modules}/$KernelVer/build/.config $RPM_BUILD_ROOT%{_lib_modules}/$KernelVer/build/include/linux/autoconf.h # Copy .config to include/config/auto.conf so "make prepare" is unnecessary. - cp $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/.config $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include/config/auto.conf + cp $RPM_BUILD_ROOT%{_lib_modules}/$KernelVer/build/.config $RPM_BUILD_ROOT%{_lib_modules}/$KernelVer/build/include/config/auto.conf %if %{with_debuginfo} if test -s vmlinux.id; then - cp vmlinux.id $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/vmlinux.id + cp vmlinux.id $RPM_BUILD_ROOT%{_lib_modules}/$KernelVer/build/vmlinux.id else echo >&2 "*** ERROR *** no vmlinux build ID! ***" exit 1 @@ -1585,11 +1588,11 @@ BuildKernel() { # # save the vmlinux file for kernel debugging into the kernel-debuginfo rpm # - mkdir -p $RPM_BUILD_ROOT%{debuginfodir}/lib/modules/$KernelVer - cp vmlinux $RPM_BUILD_ROOT%{debuginfodir}/lib/modules/$KernelVer + mkdir -p $RPM_BUILD_ROOT%{debuginfodir}%{_lib_modules}/$KernelVer + cp vmlinux $RPM_BUILD_ROOT%{debuginfodir}%{_lib_modules}/$KernelVer %endif - find $RPM_BUILD_ROOT/lib/modules/$KernelVer -name "*.ko" -type f >modnames + find $RPM_BUILD_ROOT%{_lib_modules}/$KernelVer -name "*.ko" -type f >modnames # mark modules executable so that strip-to-file can strip them xargs --no-run-if-empty chmod u+x < modnames @@ -1602,7 +1605,7 @@ BuildKernel() { collect_modules_list() { sed -r -n -e "s/^([^ ]+) \\.?($2)\$/\\1/p" drivers.undef | - LC_ALL=C sort -u > $RPM_BUILD_ROOT/lib/modules/$KernelVer/modules.$1 + LC_ALL=C sort -u > $RPM_BUILD_ROOT%{_lib_modules}/$KernelVer/modules.$1 } collect_modules_list networking \ @@ -1618,7 +1621,7 @@ BuildKernel() { rm -f modinfo while read i do - echo -n "${i#$RPM_BUILD_ROOT/lib/modules/$KernelVer/} " >> modinfo + echo -n "${i#$RPM_BUILD_ROOT%{_lib_modules}/$KernelVer/} " >> modinfo /sbin/modinfo -l $i >> modinfo done < modnames @@ -1631,13 +1634,13 @@ BuildKernel() { # remove files that will be auto generated by depmod at rpm -i time for i in alias alias.bin builtin.bin ccwmap dep dep.bin ieee1394map inputmap isapnpmap ofmap pcimap seriomap symbols symbols.bin usbmap do - rm -f $RPM_BUILD_ROOT/lib/modules/$KernelVer/modules.$i + rm -f $RPM_BUILD_ROOT%{_lib_modules}/$KernelVer/modules.$i done # Move the devel headers out of the root file system mkdir -p $RPM_BUILD_ROOT/usr/src/kernels - mv $RPM_BUILD_ROOT/lib/modules/$KernelVer/build $RPM_BUILD_ROOT/$DevelDir - ln -sf ../../..$DevelDir $RPM_BUILD_ROOT/lib/modules/$KernelVer/build + mv $RPM_BUILD_ROOT%{_lib_modules}/$KernelVer/build $RPM_BUILD_ROOT/$DevelDir + ln -sf ../../..$DevelDir $RPM_BUILD_ROOT%{_lib_modules}/$KernelVer/build # prune junk from kernel-devel find $RPM_BUILD_ROOT/usr/src/kernels -name ".*.cmd" -exec rm -f {} \; @@ -1816,8 +1819,8 @@ mv cpupower.lang ../ cd - %endif chmod 0755 %{buildroot}%{_libdir}/libcpupower.so* -mkdir -p %{buildroot}%{_unitdir} %{buildroot}%{_sysconfdir}/sysconfig -install -m644 %{SOURCE2000} %{buildroot}%{_unitdir}/cpupower.service + mkdir -p %{buildroot}%{_unitdir} %{buildroot}%{_sysconfdir}/sysconfig + install -m644 %{SOURCE2000} %{buildroot}%{_prefix}/lib/systemd/cpupower.service install -m644 %{SOURCE2001} %{buildroot}%{_sysconfdir}/sysconfig/cpupower %endif @@ -1827,6 +1830,7 @@ install -m644 %{SOURCE2001} %{buildroot}%{_sysconfdir}/sysconfig/cpupower make DESTDIR=$RPM_BUILD_ROOT bootwrapper_install WRAPPER_OBJDIR=%{_libdir}/kernel-wrapper WRAPPER_DTSDIR=%{_libdir}/kernel-wrapper/dts %endif +rm $RPM_BUILD_ROOT/lib ### ### clean @@ -1988,7 +1992,7 @@ fi %{_bindir}/powernow-k8-decode %{_libdir}/libcpupower.so.0 %{_libdir}/libcpupower.so.0.0.0 -%{_unitdir}/cpupower.service +%{_prefix}/lib/systemd/cpupower.service %{_mandir}/man[1-8]/cpupower* %config(noreplace) %{_sysconfdir}/sysconfig/cpupower %endif @@ -2021,17 +2025,17 @@ fi /%{image_install_path}/%{?-k:%{-k*}}%{!?-k:vmlinuz}-%{KVERREL}%{?2:.%{2}}\ %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}}/extra\ -/lib/modules/%{KVERREL}%{?2:.%{2}}/updates\ +%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}}/extra\ +%{_lib_modules}/%{KVERREL}%{?2:.%{2}}/updates\ %ifarch %{vdso_arches}\ -/lib/modules/%{KVERREL}%{?2:.%{2}}/vdso\ +%{_lib_modules}/%{KVERREL}%{?2:.%{2}}/vdso\ /etc/ld.so.conf.d/kernel-%{KVERREL}%{?2:.%{2}}.conf\ %endif\ -/lib/modules/%{KVERREL}%{?2:.%{2}}/modules.*\ +%{_lib_modules}/%{KVERREL}%{?2:.%{2}}/modules.*\ %ghost /boot/initramfs-%{KVERREL}%{?2:.%{2}}.img\ %{expand:%%files %{?2:%{2}-}devel}\ %defattr(-,root,root)\