[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 1/1] mkrpm: Add some post actions.



After install:

re-run grub2-mkconfig if valid
run ldconfig to fix shared libraries

After uninstall:

re-run grub2-mkconfig if valid
run ldconfig to fix shared libraries

Also stop if rpmbuild fails so info is left around

Signed-off-by: Don Slutz <dslutz@xxxxxxxxxxx>
---
Added George Dunlap, Not found in MAINTAINERS for this.

 tools/misc/mkrpm | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/tools/misc/mkrpm b/tools/misc/mkrpm
index a9aa5e2..3e00be0 100644
--- a/tools/misc/mkrpm
+++ b/tools/misc/mkrpm
@@ -66,10 +66,20 @@ rm -rf \$RPM_BUILD_ROOT
 /*
 
 %post
+if [ -f /sbin/grub2-mkconfig -a -f /boot/grub2/grub.cfg ]; then
+  /sbin/grub2-mkconfig -o /boot/grub2/grub.cfg
+fi
+ldconfig
+
+%postun
+if [ -f /sbin/grub2-mkconfig -a -f /boot/grub2/grub.cfg ]; then
+  /sbin/grub2-mkconfig -o /boot/grub2/grub.cfg
+fi
+ldconfig
 EOF
 
 # Package it up
-rpmbuild --define "_xenroot $xenroot" --define "_topdir $PWD/rpm" -bb 
rpm/SPECS/xen.spec
+rpmbuild --define "_xenroot $xenroot" --define "_topdir $PWD/rpm" -bb 
rpm/SPECS/xen.spec || exit 1
 
 # Tidy up after ourselves
 mv rpm/RPMS/*/*.rpm .
-- 
1.8.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.