From patchwork Tue Jul 29 10:18:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Weinberger X-Patchwork-Id: 4639581 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A38809F32F for ; Tue, 29 Jul 2014 10:18:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C729E2014A for ; Tue, 29 Jul 2014 10:18:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D540F2012D for ; Tue, 29 Jul 2014 10:18:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752896AbaG2KSj (ORCPT ); Tue, 29 Jul 2014 06:18:39 -0400 Received: from a.ns.miles-group.at ([95.130.255.143]:65276 "EHLO radon.swed.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752171AbaG2KSi (ORCPT ); Tue, 29 Jul 2014 06:18:38 -0400 Received: (qmail 8791 invoked by uid 89); 29 Jul 2014 10:18:37 -0000 Received: by simscan 1.3.1 ppid: 8783, pid: 8787, t: 0.0626s scanners: attach: 1.3.1 clamav: 0.96.5/m: Received: from unknown (HELO ?10.1.1.152?) (richard@nod.at@80.110.11.170) by radon.swed.at with ESMTPA; 29 Jul 2014 10:18:37 -0000 Message-ID: <53D774F9.3090305@nod.at> Date: Tue, 29 Jul 2014 12:18:33 +0200 From: Richard Weinberger User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: mike.marciniszyn@intel.com, Michal Marek CC: "linux-kernel@vger.kernel.org" , linux-kbuild , OpenSUSE Kernel Team Subject: Kernel binrpm produces brokes grub2 config X-Enigmail-Version: 1.6 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi! I'm not sure who to blame, but the below commit breaks the kernel binrpm target for me. It produces a faulty grub2 config. After installing such a kernel grub2 looks for vmlinuz-XY-rpm and initrd-XY-rpm. These files are not existing and the machine does no longer boot. Luckily an addition boot entry without the -rpm suffix exists, if remote access works one can recover the machine. My question is, why do we need these copy of vmlinuz anyway? After calling installkernel on the -rpm variants you delete them again... This happens on openSUSE 13.1, maybe their installkernel script needs fixing. commit 3c9c7a14b6274074cc3af2b83d56a92547188f27 Author: Mike Marciniszyn Date: Mon Jun 24 10:38:22 2013 -0400 rpm-pkg: add %post section to create initramfs and grub hooks /sbin/installkernel is used to insure grub hooks are inserted and the initramfs is created on the target system. The invokation installkernel will work with any kernel as long as: - /sbin/installkernel exists - the kernel and sysem map files are readable Signed-off-by: Mike Marciniszyn Signed-off-by: Michal Marek Thanks, //richard --- To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/scripts/package/mkspec b/scripts/package/mkspec index fdd3fbf..0aa6a24 100755 --- a/scripts/package/mkspec +++ b/scripts/package/mkspec @@ -112,6 +112,15 @@ echo "" echo "%clean" 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 "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 "fi" +echo "" echo "%files" echo '%defattr (-, root, root)' echo "%dir /lib/modules"