mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kevin Fenzi <kevin@tummy.com>
To: linux-kernel@vger.kernel.org
Subject: PATCH: scripts/package/mkspec
Date: Thu, 30 Dec 2004 20:33:20 -0700	[thread overview]
Message-ID: <20041231033323.1CBB4CB130@voldemort.scrye.com> (raw)


This is a patch against 2.6.10's mkspec script. 
This patch adds %post and a %preun sections to the rpm spec that
mkspec generates for the kernel (for 'make rpm'). 

So, after installing the kernel rpm it checks for /sbin/mkinitrd and
makes an initrd file for the newly installed kernel rpm. It also
checks for a /sbin/new-kernel-package command and runs it on the new
kernel if it exists to add the new kernel/initrd to grub/lilo. 

For preun, before the kernel rpm is removed, /sbin/new-kernel-package
is called to remove the kernel from the lilo or grub config and to
remove the initrd (if any). 

I am using Fedora Core based machines, so I don't know how well these
translate to {mandrake|suse|connectiva|others}. Anyone using those
systems care to comment?

This patch works fine for me on Fedora based systems, and shouldn't
harm any machines without /sbin/mkinitrd and
/sbin/new-kernel-package. 

Comments?

kevin
--
diff -Nru linux-2.6.10.orig/scripts/package/mkspec linux-2.6.10/scripts/package/mkspec
--- linux-2.6.10.orig/scripts/package/mkspec    2004-12-24 14:33:49.000000000 -0700
+++ linux-2.6.10/scripts/package/mkspec 2004-12-30 20:19:04.954634842 -0700
@@ -73,6 +73,14 @@
 echo ""
 echo "%clean"
 echo '#echo -rf $RPM_BUILD_ROOT'
+
+echo "%post"
+echo '[ -x /sbin/mkinitrd ] && /sbin/mkinitrd /boot/initrd-'"$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION"'.img '"$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION"
+echo '[ -x /sbin/new-kernel-pkg ] && /sbin/new-kernel-pkg --install --initrdfile=/boot/initrd-'"$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION"'.img --make-default '"$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION"
+echo ""
+echo "%preun"
+echo '[ -x /sbin/new-kernel-pkg ] && /sbin/new-kernel-pkg --remove '"$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION"
+
 echo ""
 echo "%files"
 echo '%defattr (-, root, root)'

             reply	other threads:[~2004-12-31  3:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-31  3:33 Kevin Fenzi [this message]
2004-12-31 10:48 ` Wichert Akkerman
2005-01-01 22:18   ` Kevin Fenzi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041231033323.1CBB4CB130@voldemort.scrye.com \
    --to=kevin@tummy.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®