mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-08-22 11:10:24 +00:00
Merge pull request #2394 from xcat2/master
Merge master to 2.13 branch for 2.13.1 release.(2)
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,2 +1,4 @@
|
||||
# ignore the documentation build files
|
||||
docs/build
|
||||
# Ignore the temporary file for creating the Release version
|
||||
Release.save*
|
||||
|
19
buildcore.sh
19
buildcore.sh
@@ -35,6 +35,9 @@
|
||||
# The following environment variables can be modified if you need
|
||||
#
|
||||
|
||||
SCRIPT=$(readlink -f $0)
|
||||
SCRIPTPATH=`dirname $SCRIPT`
|
||||
|
||||
UPLOADUSER=litingt
|
||||
USER=xcat
|
||||
SERVER=xcat.org
|
||||
@@ -190,7 +193,7 @@ function setversionvars {
|
||||
echo "$XCAT_RELEASE" >Release
|
||||
}
|
||||
|
||||
RELEASE_FILE="Release"
|
||||
RELEASE_FILE="${SCRIPTPATH}/Release"
|
||||
RELEASE_FILE_SAVE="${RELEASE_FILE}.save.998"
|
||||
|
||||
function internal_backup()
|
||||
@@ -240,7 +243,6 @@ else
|
||||
echo "Error: Could not determine rpmbuild's root directory."
|
||||
exit 2
|
||||
fi
|
||||
#echo "source=$source"
|
||||
fi
|
||||
|
||||
#
|
||||
@@ -253,20 +255,15 @@ if [ "$GIT" = "1" ]; then
|
||||
# To enable local sandbox build, GITPULL is disabled by default.
|
||||
#
|
||||
if [ "$GITPULL" = "1" ] || [ ${PWD} == *"autobuild"* ]; then
|
||||
# TODO: This is really not necessary since the autobuild scripts
|
||||
# are building the xcat code in a new directory each time
|
||||
# Do some checking for modified files
|
||||
MODIFIED_FILES=`git ls-files --modified | tr '\n' ', '`
|
||||
if [ $MODIFIED_FILES ]; then
|
||||
echo "The following files have been modified in the local repository: $MODIFIED_FILES..."
|
||||
echo "Not a clean build, aborting..."
|
||||
exit 3
|
||||
echo "WARNING: The following files have been modified in the local repository: $MODIFIED_FILES..."
|
||||
fi
|
||||
# check if there's any modifications to git current repo
|
||||
# Do some checking for untracked files
|
||||
UNTRACKED_FILES=`git ls-files --others | tr '\n' ', '`
|
||||
if [ -n "$UNTRACKED_FILES" ]; then
|
||||
echo "The following files are not tracked in git: $UNTRACKED_FILES..."
|
||||
echo "Not a clean build, aborting..."
|
||||
exit 3
|
||||
echo "WARNING: The following files are not tracked in git: $UNTRACKED_FILES..."
|
||||
fi
|
||||
if [ -z "$GITUP" ]; then
|
||||
if [ ! -z "$COMMITID" ]; then
|
||||
|
@@ -309,11 +309,17 @@ sub process_request {
|
||||
}
|
||||
}
|
||||
|
||||
my $os = xCAT::Utils->osver("all");
|
||||
|
||||
#for sles, /var/lib/ntp/drift is a dir
|
||||
if (xCAT::Utils->isAIX()) {
|
||||
print CFGFILE "driftfile /etc/ntp.drift\n";
|
||||
print CFGFILE "tracefile /etc/ntp.trace\n";
|
||||
print CFGFILE "disable auth\n";
|
||||
print CFGFILE "broadcastclient\n";
|
||||
} elsif ($os =~ /sles/) {
|
||||
print CFGFILE "driftfile /var/lib/ntp/drift/ntp.drift\n";
|
||||
print CFGFILE "disable auth\n";
|
||||
} else {
|
||||
print CFGFILE "driftfile /var/lib/ntp/drift\n";
|
||||
print CFGFILE "disable auth\n";
|
||||
@@ -325,7 +331,6 @@ sub process_request {
|
||||
|
||||
close CFGFILE;
|
||||
|
||||
my $os = xCAT::Utils->osver("all");
|
||||
my $ntp_service = "ntpserver";
|
||||
|
||||
#stop ntpd
|
||||
@@ -384,17 +389,23 @@ sub process_request {
|
||||
|
||||
#setup the RTC is UTC format, which will be used by os
|
||||
if ($os =~ /sles/) {
|
||||
`sed -i 's/.*HWCLOCK.*/HWCLOCK="-u"/' /etc/sysconfig/clock`;
|
||||
$grep_cmd = "grep -i HWCLOCK /etc/sysconfig/clock";
|
||||
$rc = xCAT::Utils->runcmd($grep_cmd, 0);
|
||||
if ($::RUNCMD_RC == 0) {
|
||||
`sed -i 's/.*HWCLOCK.*/HWCLOCK=\"-u\"/' /etc/sysconfig/clock`;
|
||||
} else {
|
||||
`echo HWCLOCK=\"-u\" >> /etc/sysconfig/clock`;
|
||||
}
|
||||
} elsif (-f "/etc/debian_version") {
|
||||
`sed -i "s/.*UTC.*/UTC=yes/" /etc/default/rcS`;
|
||||
`sed -i 's/.*UTC.*/UTC=\"yes\"/' /etc/default/rcS`;
|
||||
} else {
|
||||
if (-f "/etc/sysconfig/clock") {
|
||||
$grep_cmd = "grep -i utc /etc/sysconfig/clock";
|
||||
$rc = xCAT::Utils->runcmd($grep_cmd, 0);
|
||||
if ($::RUNCMD_RC != 0) {
|
||||
`sed -i 's/.*UTC.*/UTC=yes/' /etc/sysconfig/clock`;
|
||||
if ($::RUNCMD_RC == 0) {
|
||||
`sed -i 's/.*UTC.*/UTC=\"yes\"/' /etc/sysconfig/clock`;
|
||||
} else {
|
||||
`echo "UTC=yes" >> /etc/sysconfig/clock`;
|
||||
`echo UTC=\"yes\" >> /etc/sysconfig/clock`;
|
||||
}
|
||||
} else {
|
||||
`type -P timedatectl >/dev/null 2>&1`;
|
||||
@@ -406,11 +417,15 @@ sub process_request {
|
||||
if (-f "/etc/sysconfig/ntpd") {
|
||||
$grep_cmd = "grep -i SYNC_HWCLOCK /etc/sysconfig/ntpd";
|
||||
$rc = xCAT::Utils->runcmd($grep_cmd, 0);
|
||||
if ($::RUNCMD_RC != 0) {
|
||||
`sed -i "s/.*SYNC_HWCLOCK.*/SYNC_HWCLOCK=yes/" /etc/sysconfig/ntpd`;
|
||||
if ($::RUNCMD_RC == 0) {
|
||||
`sed -i 's/.*SYNC_HWCLOCK.*/SYNC_HWCLOCK=\"yes\"/' /etc/sysconfig/ntpd`;
|
||||
} else {
|
||||
`echo "SYNC_HWCLOCK=yes" >> /etc/sysconfig/ntpd`;
|
||||
`echo SYNC_HWCLOCK=\"yes\" >> /etc/sysconfig/ntpd`;
|
||||
}
|
||||
} elsif (-f "/etc/sysconfig/ntp") {
|
||||
`sed -i 's/.*SYNC_HWCLOCK.*/NTPD_FORCE_SYNC_HWCLOCK_ON_STARTUP=\"yes\"/' /etc/sysconfig/ntp`;
|
||||
`sed -i 's/^NTPD_FORCE_SYNC_ON.*/NTPD_FORCE_SYNC_ON_STARTUP=\"yes\"/' /etc/sysconfig/ntp`;
|
||||
`sed -i 's/.*RUN_CHROOTED.*/NTPD_RUN_CHROOTED=\"yes\"/' /etc/sysconfig/ntp`;
|
||||
} else {
|
||||
my $cron_file = "/etc/cron.daily/xcatsethwclock";
|
||||
if (!-f "$cron_file") {
|
||||
|
@@ -99,9 +99,13 @@ OS_TYPE=`uname`
|
||||
if [ $OS_TYPE = Linux ]; then
|
||||
mkdir -p /var/lib/ntp
|
||||
chown ntp /var/lib/ntp
|
||||
echo "driftfile /var/lib/ntp/drift
|
||||
disable auth
|
||||
restrict 127.0.0.1" >>$conf_file
|
||||
if ( pmatch $OSVER "sles*" ) || ( pmatch $OSVER "suse*" ) || [ -f /etc/SuSE-release ];then
|
||||
echo "driftfile /var/lib/ntp/drift/ntp.drift" >>$conf_file
|
||||
else
|
||||
echo "driftfile /var/lib/ntp/drift" >>$conf_file
|
||||
fi
|
||||
echo "disable auth" >>$conf_file
|
||||
echo "restrict 127.0.0.1" >>$conf_file
|
||||
|
||||
#ntpdate/sntp conflict with ntpd, stop the service first
|
||||
checkservicestatus ntpserver
|
||||
@@ -140,16 +144,21 @@ restrict 127.0.0.1" >>$conf_file
|
||||
|
||||
#setup the RTC is UTC format, which will be used by os
|
||||
if ( pmatch $OSVER "sles*" ) || ( pmatch $OSVER "suse*" ) || [ -f /etc/SuSE-release ];then
|
||||
sed -i 's/.*HWCLOCK.*/HWCLOCK="-u"/' /etc/sysconfig/clock
|
||||
grep -i "HWCLOCK" /etc/sysconfig/clock
|
||||
if [ $? -eq 0 ];then
|
||||
sed -i 's/.*HWCLOCK.*/HWCLOCK=\"-u\"/' /etc/sysconfig/clock
|
||||
else
|
||||
echo HWCLOCK=\"-u\" >> /etc/sysconfig/clock
|
||||
fi
|
||||
elif [ -f "/etc/debian_version" ];then
|
||||
sed -i 's/.*UTC.*/UTC=yes/' /etc/default/rcS
|
||||
sed -i 's/.*UTC.*/UTC=\"yes\"/' /etc/default/rcS
|
||||
else
|
||||
if [ -f "/etc/sysconfig/clock" ];then
|
||||
grep -i "utc" /etc/sysconfig/clock
|
||||
if [ $? -eq 0 ];then
|
||||
sed -i 's/.*UTC.*/UTC=yes/' /etc/sysconfig/clock
|
||||
sed -i 's/.*UTC.*/UTC=\"yes\"/' /etc/sysconfig/clock
|
||||
else
|
||||
echo "UTC=yes" >> /etc/sysconfig/clock
|
||||
echo UTC=\"yes\" >> /etc/sysconfig/clock
|
||||
fi
|
||||
elif type -P timedatectl >/dev/null 2>&1 ;then
|
||||
timedatectl set-local-rtc 0
|
||||
@@ -160,18 +169,18 @@ restrict 127.0.0.1" >>$conf_file
|
||||
if [ -f "/etc/sysconfig/ntpd" ];then
|
||||
grep -i "SYNC_HWCLOCK" /etc/sysconfig/ntpd
|
||||
if [ $? -eq 0 ];then
|
||||
sed -i 's/.*SYNC_HWCLOCK.*/SYNC_HWCLOCK=yes/' /etc/sysconfig/ntpd
|
||||
sed -i 's/.*SYNC_HWCLOCK.*/SYNC_HWCLOCK=\"yes\"/' /etc/sysconfig/ntpd
|
||||
else
|
||||
echo "SYNC_HWCLOCK=yes" >> /etc/sysconfig/ntpd
|
||||
echo "SYNC_HWCLOCK=\"yes\"" >> /etc/sysconfig/ntpd
|
||||
fi
|
||||
elif [ -f /etc/sysconfig/ntp ];then
|
||||
grep -i "NTPD_FORCE_SYNC_ON_STARTUP" /etc/sysconfig/ntp
|
||||
if [ $? -eq 0 ];then
|
||||
sed -i 's/NTPD_FORCE_SYNC_ON_STARTUP="no"/NTPD_FORCE_SYNC_ON_STARTUP="yes"/' /etc/sysconfig/ntp
|
||||
sed -i 's/NTPD_FORCE_SYNC_ON_STARTUP=\"no\"/NTPD_FORCE_SYNC_ON_STARTUP=\"yes\"/' /etc/sysconfig/ntp
|
||||
fi
|
||||
grep -i "NTPD_FORCE_SYNC_HWCLOCK_ON_STARTUP" /etc/sysconfig/ntp
|
||||
if [ $? -eq 0 ];then
|
||||
sed -i 's/NTPD_FORCE_SYNC_HWCLOCK_ON_STARTUP="no"/NTPD_FORCE_SYNC_HWCLOCK_ON_STARTUP="yes"/' /etc/sysconfig/ntp
|
||||
sed -i 's/NTPD_FORCE_SYNC_HWCLOCK_ON_STARTUP=\"no\"/NTPD_FORCE_SYNC_HWCLOCK_ON_STARTUP=\"yes\"/' /etc/sysconfig/ntp
|
||||
fi
|
||||
else
|
||||
cron_file="/etc/cron.daily/xcatsethwclock"
|
||||
|
Reference in New Issue
Block a user