From a7e3e9ec2ab051d2de91092777c0906431416b15 Mon Sep 17 00:00:00 2001 From: xq2005 Date: Mon, 5 Aug 2013 01:26:15 -0700 Subject: [PATCH] load sha.pm on ubuntu instand of sha1.pm --- perl-xCAT/xCAT/Utils.pm | 11 +++++++---- xCAT-server/debian/postinst | 13 +------------ 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/perl-xCAT/xCAT/Utils.pm b/perl-xCAT/xCAT/Utils.pm index 69764b121..9d1da5e9c 100644 --- a/perl-xCAT/xCAT/Utils.pm +++ b/perl-xCAT/xCAT/Utils.pm @@ -21,10 +21,13 @@ use File::Path; use Socket; use strict; use Symbol; -my $sha1support = eval { - require Digest::SHA1; - 1; -}; +my $sha1support; +if ( -f "/etc/debian_version" ){ + $sha1support = eval {require Digest::SHA; 1;}; +} +else { + $sha1support = eval { require Digest::SHA1; 1;}; +} use IPC::Open3; use IO::Select; use xCAT::GlobalDef; diff --git a/xCAT-server/debian/postinst b/xCAT-server/debian/postinst index 5988fcf27..b9f5c07f0 100644 --- a/xCAT-server/debian/postinst +++ b/xCAT-server/debian/postinst @@ -21,12 +21,7 @@ set -e case "$1" in configure) . /etc/profile.d/xcat.sh - if [ ! -e "/etc/rc0.d/K60xcatd" ];then - update-rc.d xcatd start 85 2 3 4 5 . stop 60 0 1 6 . - update-rc.d xcatd enable 2 - else - update-rc.d xcatd enable - fi + update-rc.d xcatd defaults if [ -f /tmp/xCAT-server_upgrade.tmp ]; then if [ -f "/proc/cmdline" ]; then # prevent running it during install into chroot image /etc/init.d/xcatd reload @@ -36,12 +31,6 @@ case "$1" in ln -sf /opt/xcat/sbin/xcatd /usr/sbin/xcatd #SHA1 has been get rid of after Squeeze released. Its functionality is also provided by Digest::SHA (which is in core). #but ipmi.pm need SHA1.pm, so create this link - shalocate=`find /usr/lib/perl -name "SHA.pm"` - shalocate=${shalocate%SHA.pm} - cd $shalocate - if [ ! -e SHA1.pm ];then - ln -s SHA.pm SHA1.pm - fi cd - ;;