From bb0a6b58f7e086054b3250777d568bee5ef8c3a5 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Fri, 25 Apr 2008 17:21:55 +0000 Subject: [PATCH] Have perl-xCAT auto-migrate schema changes git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1206 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT-2.0/perl-xCAT.spec | 37 ++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/perl-xCAT-2.0/perl-xCAT.spec b/perl-xCAT-2.0/perl-xCAT.spec index fd6fbdb07..52c103f0e 100644 --- a/perl-xCAT-2.0/perl-xCAT.spec +++ b/perl-xCAT-2.0/perl-xCAT.spec @@ -79,6 +79,43 @@ rm -rf $RPM_BUILD_ROOT # Just package everything that has been copied into RPM_BUILD_ROOT %{prefix} +%post +if [ "$1" -gt 1 ]; then #Ugrade only, restart daemon and migrate settings + if [ -x /etc/init.d/xcatd ]; then + . /etc/profile.d/xcat.sh + /etc/init.d/xcatd restart + #THE NEXT BIT SHOULD NOT BE RELEVANT TO RELEASE, IT SHOULD HELP A BETA INSTALL UPDATE GRACEFULLY + BOOTPCHECK=`tabdump bootparams|grep -v '^#node'` + if [ -z "$BOOTPCHECK" ]; then + echo -n "Old schema use detected, migrating settings, may take a while..." + for node in `nodels`; do + MIGSETTING=`nodels $node noderes.serialport|sed -e 's/^.*:.*:\s*//'` + nodech $node noderes.serialport= + if [ ! -z "$MIGSETTING" ]; then + nodech $node "nodehm.serialport=$MIGSETTING" + fi + MIGSETTING=`nodels $node noderes.kernel|sed -e 's/^.*:.*:\s*//'` + nodech $node noderes.kernel= + if [ ! -z "$MIGSETTING" ]; then + nodech $node "bootparams.kernel=$MIGSETTING" + fi + MIGSETTING=`nodels $node noderes.initrd|sed -e 's/^.*:.*:\s*//'` + nodech $node noderes.initrd= + if [ ! -z "$MIGSETTING" ]; then + nodech $node "bootparams.initrd=$MIGSETTING" + fi + MIGSETTING=`nodels $node noderes.kcmdline|sed -e 's/^.*:.*:\s*//'` + nodech $node noderes.kcmdline= + if [ ! -z "$MIGSETTING" ]; then + nodech $node "bootparams.kcmdline=$MIGSETTING" + fi + done + echo "Done" + fi + fi +fi + + %changelog * Wed May 2 2007 - Norm Nott nott@us.ibm.com - Made changes to make this work on AIX