kernel.spec: xz compress modules on i686 and x86_64
Pretty grody, but it seems to be working... it has to happen after module signing (obviously) and after find-debuginfo.sh runs as well, so tacking it onto the end seems sensible, and then just fixing up the file lists as we go. Provides a nice tidy savings to the disk footprint: kyle@dreadnought:~% for i in kernel-core-3.15.0-0.rc3.git4.1.fc21.x86_64.rpm \ kernel-core-3.15.0-0.rc3.git4.1.fc21.x86_64.rpm.1; do \ rpm -qip $i | grep '^Size'; done Size : 43011603 Size : 81106737 kmod has handed .xz and .gz modules for a long time now, and can cope. I was thinking we might also %ghost the .ko, and have a %post install script that un-xz the modules in /proc/modules, but none of them are big enough for that to be worthwhile I think (maybe XFS, but I doubt it.) --Kyle
This commit is contained in:
parent
54a9e1a9cf
commit
8922622858
15
kernel.spec
15
kernel.spec
@ -12,8 +12,14 @@ Summary: The Linux kernel
|
|||||||
# architectures are added.
|
# architectures are added.
|
||||||
%ifarch %{ix86} x86_64
|
%ifarch %{ix86} x86_64
|
||||||
%global signmodules 1
|
%global signmodules 1
|
||||||
|
%global zipmodules 1
|
||||||
%else
|
%else
|
||||||
%global signmodules 0
|
%global signmodules 0
|
||||||
|
%global zipmodules 0
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%if %{zipmodules}
|
||||||
|
%global zipsed -e 's/\.ko$/\.ko.xz/'
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
# % define buildid .local
|
# % define buildid .local
|
||||||
@ -1703,9 +1709,9 @@ BuildKernel() {
|
|||||||
|
|
||||||
# Make sure the files lists start with absolute paths or rpmbuild fails.
|
# Make sure the files lists start with absolute paths or rpmbuild fails.
|
||||||
# Also add in the dir entries
|
# Also add in the dir entries
|
||||||
sed -e 's/^lib*/\/lib/' $RPM_BUILD_ROOT/k-d.list > ../kernel${Flavour:+-${Flavour}}-modules.list
|
sed -e 's/^lib*/\/lib/' %{?zipsed} $RPM_BUILD_ROOT/k-d.list > ../kernel${Flavour:+-${Flavour}}-modules.list
|
||||||
sed -e 's/^lib*/%dir \/lib/' $RPM_BUILD_ROOT/module-dirs.list > ../kernel${Flavour:+-${Flavour}}-core.list
|
sed -e 's/^lib*/%dir \/lib/' %{?zipsed} $RPM_BUILD_ROOT/module-dirs.list > ../kernel${Flavour:+-${Flavour}}-core.list
|
||||||
sed -e 's/^lib*/\/lib/' $RPM_BUILD_ROOT/modules.list >> ../kernel${Flavour:+-${Flavour}}-core.list
|
sed -e 's/^lib*/\/lib/' %{?zipsed} $RPM_BUILD_ROOT/modules.list >> ../kernel${Flavour:+-${Flavour}}-core.list
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
rm -f $RPM_BUILD_ROOT/k-d.list
|
rm -f $RPM_BUILD_ROOT/k-d.list
|
||||||
@ -1826,6 +1832,9 @@ popd
|
|||||||
%{modsign_cmd} signing_key.priv.sign signing_key.x509.sign $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/ \
|
%{modsign_cmd} signing_key.priv.sign signing_key.x509.sign $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/ \
|
||||||
fi \
|
fi \
|
||||||
fi \
|
fi \
|
||||||
|
if [ "%{zipmodules}" -eq "1" ]; then \
|
||||||
|
find $RPM_BUILD_ROOT/lib/modules/ -type f -name '*.ko' | xargs xz; \
|
||||||
|
fi \
|
||||||
%{nil}
|
%{nil}
|
||||||
|
|
||||||
###
|
###
|
||||||
|
Loading…
Reference in New Issue
Block a user