diff --git a/xCAT-buildkit/share/xcat/kits/kit_template/scripts/sample/genimage_post.sh b/xCAT-buildkit/share/xcat/kits/kit_template/scripts/sample/genimage_post.sh index af4636987..98829792d 100644 --- a/xCAT-buildkit/share/xcat/kits/kit_template/scripts/sample/genimage_post.sh +++ b/xCAT-buildkit/share/xcat/kits/kit_template/scripts/sample/genimage_post.sh @@ -1,3 +1,21 @@ +#!/bin/sh -echo "running sample-comp1 genimage_post script" +rpmdir="/opt/xcat/kits/<<>>/<<>>" +if [[ ! -z "$installroot" ]]; then + if [ -n "`ls $installroot$rpmdir/*.deb 2> /dev/null`" ] ; then + dpkg -i --force-all --instdir=$installroot $installroot$rpmdir/*.deb + + elif [ -n "`ls $installroot$rpmdir/*.rpm 2> /dev/null`" ] ; then + rpm --force --root $installroot -Uvh $installroot$rpmdir/*.rpm + fi +else + if [ -n "`ls $rpmdir/*.deb 2> /dev/null`" ] ; then + dpkg -i --force-all $rpmdir/*.deb + + elif [ -n "`ls $rpmdir/*.rpm 2> /dev/null`" ] ; then + rpm --force -Uvh $rpmdir/*.rpm + fi +fi + +exit 0