Bug 1375658

Summary: [PATCH] post: Honor KERNEL_INSTALL_NOOP
Product: [Fedora] Fedora Reporter: Colin Walters <walters>
Component: kernelAssignee: Kernel Maintainer List <kernel-maint>
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: gansalmon, ichavero, itamar, jonathan, kernel-maint, madhu.chinakonda, mchehab, walters
Target Milestone: ---Flags: labbott: needinfo? (walters)
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Colin Walters 2016-09-13 15:38:24 UTC
From d606b2059db56ff448cb6d6cafa2525f694b4ae6 Mon Sep 17 00:00:00 2001
From: Colin Walters <walters>
Date: Tue, 13 Sep 2016 09:24:32 -0400
Subject: [PATCH] post: Honor KERNEL_INSTALL_NOOP

This can be used by system imaging tools like rpm-ostree and
lorax which want to control generation of the initramfs,
bootloader configuration, etc.

See
https://github.com/systemd/systemd/pull/4103
for some more information.
---
 kernel.spec | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/kernel.spec b/kernel.spec
index a15cc45..aca502e 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -1932,10 +1932,12 @@ fi\
 # This macro defines a %%posttrans script for a kernel package.
 #      %%kernel_variant_posttrans [<subpackage>]
 # More text can follow to go at the end of this variant's %%post.
+# KERNEL_INSTALL_NOOP may be used by programs like lorax and rpm-ostree
+# which want to install a kernel, but control generation of the initramfs.
 #
 %define kernel_variant_posttrans() \
 %{expand:%%posttrans %{?1:%{1}-}core}\
-/bin/kernel-install add %{KVERREL}%{?1:+%{1}} /lib/modules/%{KVERREL}%{?1:+%{1}}/vmlinuz || exit $?\
+if test -z "${KERNEL_INSTALL_NOOP:-}";then /bin/kernel-install add %{KVERREL}%{?1:+%{1}} /lib/modules/%{KVERREL}%{?1:+%{1}}/vmlinuz || exit $?; fi\
 %{nil}
 
 #
-- 
2.7.4

Comment 1 Laura Abbott 2016-09-13 17:53:38 UTC
The patch seems fine. Once the systemd part gets acked/merged we can apply the patch.

Comment 2 Colin Walters 2016-10-03 15:15:31 UTC
Something like this was merged upstream, but I'd still like to have this patch merged here since the systemd fix requires a new systemd version, but having it here will avoid having to depend on a bleeding edge systemd propagating to Fedora stable branches.

Comment 3 Laura Abbott 2018-04-06 18:16:13 UTC
It looks like this got missed somewhere, is this still something relevant?