linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kbuild/mkspec: fix grub2 installkernel issue
@ 2016-02-26 15:15 Jiri Kosina
  2016-02-26 15:24 ` Michal Marek
  0 siblings, 1 reply; 2+ messages in thread
From: Jiri Kosina @ 2016-02-26 15:15 UTC (permalink / raw)
  To: Michal Marek; +Cc: linux-kbuild, linux-kernel

mkspec is copying built kernel to temporrary location

	/boot/vmlinuz-$KERNELRELEASE-rpm

and runs installkernel on it. This however directly leads to grub2 
menuentry for this suffixed binary being generated as well during the run 
of installkernel script.

Later in the process the temporary -rpm suffixed files are removed, and 
therefore we end up with spurious (and non-functional) grub2 menu entries 
for each installed kernel RPM.

Fix that by using a different temporary name (prefixed by '.'), so that 
the binary is not recognized as an actual kernel binary and no menuentry 
is created for it.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
---
 scripts/package/mkspec | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/scripts/package/mkspec b/scripts/package/mkspec
index 71004da..fe44d68 100755
--- a/scripts/package/mkspec
+++ b/scripts/package/mkspec
@@ -131,11 +131,11 @@ echo 'rm -rf $RPM_BUILD_ROOT'
 echo ""
 echo "%post"
 echo "if [ -x /sbin/installkernel -a -r /boot/vmlinuz-$KERNELRELEASE -a -r /boot/System.map-$KERNELRELEASE ]; then"
-echo "cp /boot/vmlinuz-$KERNELRELEASE /boot/vmlinuz-$KERNELRELEASE-rpm"
-echo "cp /boot/System.map-$KERNELRELEASE /boot/System.map-$KERNELRELEASE-rpm"
+echo "cp /boot/vmlinuz-$KERNELRELEASE /boot/.vmlinuz-$KERNELRELEASE-rpm"
+echo "cp /boot/System.map-$KERNELRELEASE /boot/.System.map-$KERNELRELEASE-rpm"
 echo "rm -f /boot/vmlinuz-$KERNELRELEASE /boot/System.map-$KERNELRELEASE"
-echo "/sbin/installkernel $KERNELRELEASE /boot/vmlinuz-$KERNELRELEASE-rpm /boot/System.map-$KERNELRELEASE-rpm"
-echo "rm -f /boot/vmlinuz-$KERNELRELEASE-rpm /boot/System.map-$KERNELRELEASE-rpm"
+echo "/sbin/installkernel $KERNELRELEASE /boot/.vmlinuz-$KERNELRELEASE-rpm /boot/.System.map-$KERNELRELEASE-rpm"
+echo "rm -f /boot/.vmlinuz-$KERNELRELEASE-rpm /boot/.System.map-$KERNELRELEASE-rpm"
 echo "fi"
 echo ""
 echo "%files"

-- 
Jiri Kosina
SUSE Labs

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] kbuild/mkspec: fix grub2 installkernel issue
  2016-02-26 15:15 [PATCH] kbuild/mkspec: fix grub2 installkernel issue Jiri Kosina
@ 2016-02-26 15:24 ` Michal Marek
  0 siblings, 0 replies; 2+ messages in thread
From: Michal Marek @ 2016-02-26 15:24 UTC (permalink / raw)
  To: 'Jiri Kosina'; +Cc: linux-kbuild, linux-kernel

On 2016-02-26 16:15, Jiri Kosina wrote:
> mkspec is copying built kernel to temporrary location
> 
> 	/boot/vmlinuz-$KERNELRELEASE-rpm
> 
> and runs installkernel on it. This however directly leads to grub2 
> menuentry for this suffixed binary being generated as well during the run 
> of installkernel script.
> 
> Later in the process the temporary -rpm suffixed files are removed, and 
> therefore we end up with spurious (and non-functional) grub2 menu entries 
> for each installed kernel RPM.
> 
> Fix that by using a different temporary name (prefixed by '.'), so that 
> the binary is not recognized as an actual kernel binary and no menuentry 
> is created for it.
> 
> Signed-off-by: Jiri Kosina <jkosina@suse.cz>

Fixes: 3c9c7a14b627 ("rpm-pkg: add %post section to create initramfs and
grub hooks")

Applied to kbuild.git#misc.

Michal

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-02-26 15:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-26 15:15 [PATCH] kbuild/mkspec: fix grub2 installkernel issue Jiri Kosina
2016-02-26 15:24 ` Michal Marek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).