#!/bin/sh
. /opt/hmc/bin/functions
mkdir -p /tmp/mnt
mount -t ext3 /dev/${HDP}2 /tmp/mnt
cver=`cat /tmp/mnt/etc/HmcBase | cut -d':' -f2`
if [[ "$cver" == "V7"* ]]; then
    echo "Upgrading from V7, preserve the solid.ini file in /data/soliddb/config"
    vgchange -ay HMCDataVG
    mount -t ext4 /dev/HMCDataVG/DataLV /tmp/mnt/data
    mkdir -p /tmp/mnt/data/soliddb/config
    cp /tmp/mnt/opt/pmc/database/solid.ini /tmp/mnt/data/soliddb/config/.
    umount /tmp/mnt/data
    vgchange -an HMCDataVG
fi
umount /tmp/mnt


