summaryrefslogtreecommitdiffstats
path: root/kernel.spec
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2019-03-29 02:26:34 +0000
committerColin Walters <walters@verbum.org>2019-03-29 02:26:34 +0000
commitc5368cf9369d169697a164c9fc0d58a23b916b44 (patch)
tree5663e51d8efe94a0bbc2ec67d591cd6a4afc9d0a /kernel.spec
parentc552794cd500b06b635527d8043eacb60b3bd63d (diff)
downloadkernel-c5368cf9369d169697a164c9fc0d58a23b916b44.tar.gz
kernel-c5368cf9369d169697a164c9fc0d58a23b916b44.tar.xz
kernel-c5368cf9369d169697a164c9fc0d58a23b916b44.zip
devel: Don't run hardlink if rpm-ostree is in use
OSTree is a far, far more sophisticated wrapper around the `link()` system call than the `hardlink` package - it supports using as a mechanism for transactional offline updates, fetching over HTTP with GPG signatures and deltas, etc. rpm-ostree uses it for everything. Having the `kernel-devel` package run `hardlink` just adds latency to `rpm-ostree compose tree` unnecessarily.
Diffstat (limited to 'kernel.spec')
-rw-r--r--kernel.spec5
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel.spec b/kernel.spec
index a4d474f0e..0cee99539 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -1686,6 +1686,9 @@ rm -rf $RPM_BUILD_ROOT/usr/tmp-headers
#
# This macro defines a %%post script for a kernel*-devel package.
# %%kernel_devel_post [<subpackage>]
+# Note we don't run hardlink if ostree is in use, as ostree is
+# a far more sophisticated hardlink implementation.
+# https://github.com/projectatomic/rpm-ostree/commit/58a79056a889be8814aa51f507b2c7a4dccee526
#
%define kernel_devel_post() \
%{expand:%%post %{?1:%{1}-}devel}\
@@ -1693,7 +1696,7 @@ if [ -f /etc/sysconfig/kernel ]\
then\
. /etc/sysconfig/kernel || exit $?\
fi\
-if [ "$HARDLINK" != "no" -a -x /usr/sbin/hardlink ]\
+if [ "$HARDLINK" != "no" -a -x /usr/sbin/hardlink -a ! -e /run/ostree-booted ] \
then\
(cd /usr/src/kernels/%{KVERREL}%{?1:+%{1}} &&\
/usr/bin/find . -type f | while read f; do\