2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-29 09:13:08 +00:00

fix #1083, redhat sles, diskless, enable the diskless installation can be forwarded to MN when xcatdebugmode=2

This commit is contained in:
penguhyang 2016-05-24 06:44:05 -04:00
parent fd4666a09e
commit 0a0f1d76d7
5 changed files with 72 additions and 74 deletions

View File

@ -1131,7 +1131,7 @@ use xCAT::ExtTab;
" currently supported values:\n".
" '0': disable debug mode\n".
" '1': enable basic debug mode\n".
" '2': enalbe expert debug mode\n".
" '2': enable expert debug mode\n".
" For the details on 'basic debug mode' and 'expert debug mode',\n".
" please refer to xCAT documentation.\n\n".
" --------------------\n" .

View File

@ -745,24 +745,24 @@ sub mknetboot
$kcmdline .= " nonodestatus ";
}
if($::XCATSITEVALS{xcatdebugmode} eq "1"){
if (($::XCATSITEVALS{xcatdebugmode} eq "1") or ($::XCATSITEVALS{xcatdebugmode} eq "2")) {
my ($host, $ipaddr) = xCAT::NetworkUtils->gethostnameandip($xcatmaster);
if($ipaddr){
#for use in postscript and postbootscript in xcatdsklspost in the rootimg
$kcmdline .=" LOGSERVER=$ipaddr ";
#for use in syslog dracut module in the initrd
$kcmdline .=" syslog.server=$ipaddr syslog.type=rsyslogd syslog.filter=*.* ";
}else{
#for use in postscript and postbootscript in xcatdsklspost in the rootimg
$kcmdline .=" LOGSERVER=$xcatmaster ";
my ($host, $ipaddr) = xCAT::NetworkUtils->gethostnameandip($xcatmaster);
if ($ipaddr) {
#for use in postscript and postbootscript in xcatdsklspost in the rootimg
$kcmdline .=" LOGSERVER=$ipaddr ";
#for use in syslog dracut module in the initrd
$kcmdline .=" syslog.server=$xcatmaster syslog.type=rsyslogd syslog.filter=*.* ";
}
#for use in syslog dracut module in the initrd
$kcmdline .=" syslog.server=$ipaddr syslog.type=rsyslogd syslog.filter=*.* ";
}
else {
#for use in postscript and postbootscript in xcatdsklspost in the rootimg
$kcmdline .=" LOGSERVER=$xcatmaster ";
$kcmdline .= " xcatdebugmode=1 ";
#for use in syslog dracut module in the initrd
$kcmdline .=" syslog.server=$xcatmaster syslog.type=rsyslogd syslog.filter=*.* ";
}
$kcmdline .= " xcatdebugmode=$::XCATSITEVALS{xcatdebugmode} ";
}
# Add kernel parameters to specify the boot network interface

View File

@ -576,28 +576,26 @@ sub mknetboot
$kcmdline .= " nonodestatus ";
}
if (($::XCATSITEVALS{xcatdebugmode} eq "1") or ($::XCATSITEVALS{xcatdebugmode} eq "2")) {
if($::XCATSITEVALS{xcatdebugmode} eq "1"){
my ($host, $ipaddr) = xCAT::NetworkUtils->gethostnameandip($xcatmaster);
if ($ipaddr) {
#for use in postscript and postbootscript in xcatdsklspost in the rootimg
$kcmdline .=" LOGSERVER=$ipaddr ";
my ($host, $ipaddr) = xCAT::NetworkUtils->gethostnameandip($xcatmaster);
if($ipaddr){
#for use in postscript and postbootscript in xcatdsklspost in the rootimg
$kcmdline .=" LOGSERVER=$ipaddr ";
#for use in syslog dracut module in the initrd
$kcmdline .=" syslog.server=$ipaddr syslog.type=rsyslogd syslog.filter=*.* ";
}
else {
#for use in postscript and postbootscript in xcatdsklspost in the rootimg
$kcmdline .=" LOGSERVER=$xcatmaster ";
#for use in syslog dracut module in the initrd
$kcmdline .=" syslog.server=$ipaddr syslog.type=rsyslogd syslog.filter=*.* ";
}else{
#for use in postscript and postbootscript in xcatdsklspost in the rootimg
$kcmdline .=" LOGSERVER=$xcatmaster ";
#for use in syslog dracut module in the initrd
$kcmdline .=" syslog.server=$xcatmaster syslog.type=rsyslogd syslog.filter=*.* ";
}
$kcmdline .= " xcatdebugmode=1 ";
#for use in syslog dracut module in the initrd
$kcmdline .=" syslog.server=$xcatmaster syslog.type=rsyslogd syslog.filter=*.* ";
}
$kcmdline .= " xcatdebugmode=$::XCATSITEVALS{xcatdebugmode} ";
}
$kcmdline .= "NODE=$node ";
# add flow control setting
$kcmdline .= "FC=$useflowcontrol ";

View File

@ -22,12 +22,12 @@ fi
xcatdebugmode="$(getarg xcatdebugmode=)"
[ "$xcatdebugmode" = "1" ] && logger -t xcat -p debug "running xcatroot...."
[ "$xcatdebugmode" = "1" ] && logger -t xcat -p debug "MASTER=$MASTER XCATIPORT=$XCATIPORT"
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "running xcatroot...."
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "MASTER=$MASTER XCATIPORT=$XCATIPORT"
if [ $NODESTATUS -ne 0 ];then
[ "$xcatdebugmode" = "1" ] && logger -t xcat -p debug "nodestatus: netbooting,reporting..."
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "nodestatus: netbooting,reporting..."
/tmp/updateflag $MASTER $XCATIPORT "installstatus netbooting"
fi
@ -36,10 +36,10 @@ if [ ! -z "$imgurl" ]; then
NFS=0
FILENAME=${imgurl##*/}
while [ ! -r "$FILENAME" ]; do
[ "$xcatdebugmode" = "1" ] && logger -t xcat -p debug "downloading $imgurl...."
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "downloading $imgurl...."
echo Getting $imgurl...
if ! wget $imgurl; then
[ "$xcatdebugmode" = "1" ] && logger -t xcat -p debug "downloading $imgurl failed,retrying...."
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "downloading $imgurl failed,retrying...."
rm -f $FILENAME
sleep 27
fi
@ -70,7 +70,7 @@ if [ -r /rootimg.sfs ]; then
mount --move /ro $NEWROOT/ro
mount --move /rw $NEWROOT/rw
elif [ -r /rootimg.gz ]; then
[ "$xcatdebugmode" = "1" ] && logger -t xcat -p debug "rootimg.gz downloaded,setting up RAM-root tmpfs...."
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "rootimg.gz downloaded,setting up RAM-root tmpfs...."
echo Setting up RAM-root tmpfs.
if [ -z $rootlimit ];then
mount -t tmpfs -o mode=755 rootfs $NEWROOT
@ -79,7 +79,7 @@ elif [ -r /rootimg.gz ]; then
fi
cd $NEWROOT
[ "$xcatdebugmode" = "1" ] && logger -t xcat -p debug "Extracting root filesystem:"
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "Extracting root filesystem:"
echo -n "Extracting root filesystem:"
if [ -x /bin/cpio ]; then
gzip -cd /rootimg.gz |/bin/cpio -idum
@ -87,7 +87,7 @@ elif [ -r /rootimg.gz ]; then
gzip -cd /rootimg.gz |cpio -idum
fi
$NEWROOT/etc/init.d/localdisk
[ "$xcatdebugmode" = "1" ] && logger -t xcat -p debug "Done...."
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "Done...."
echo Done
elif [ -r /rootimg.txz ]; then
echo Setting up RAM-root tmpfs.
@ -225,17 +225,17 @@ elif [ -r /rootimg-statelite.gz ]; then
mount -n --bind /sys $NEWROOT/sys
else
[ "$xcatdebugmode" = "1" ] && logger -t xcat -p debug "Failed to download image, panicing in 5..."
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "Failed to download image, panicing in 5..."
echo -n Failed to download image, panicing in 5...
for i in 4 3 2 1 0; do
/bin/sleep 1
[ "$xcatdebugmode" = "1" ] && logger -t xcat -p debug "$i..."
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "$i..."
echo -n $i...
done
[ "$xcatdebugmode" = "1" ] && logger -t xcat -p debug "You're dead. rpower nodename reset to play again."
[ "$xcatdebugmode" = "1" ] && logger -t xcat -p debug "* Did you packimage with -m cpio, -m squashfs, or -m nfs?"
[ "$xcatdebugmode" = "1" ] && logger -t xcat -p debug "* If using -m squashfs did you include aufs.ko with geninitrd? e.g.: -n tg3,squashfs,aufs,loop"
[ "$xcatdebugmode" = "1" ] && logger -t xcat -p debug "If using -m nfs did you export NFS and sync rootimg? And did you include the aufs and nfs modules in the proper order: e.g.: -n tg3,aufs,loop,sunrpc,lockd,nfs_acl,nfs"
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "You're dead. rpower nodename reset to play again."
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "* Did you packimage with -m cpio, -m squashfs, or -m nfs?"
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "* If using -m squashfs did you include aufs.ko with geninitrd? e.g.: -n tg3,squashfs,aufs,loop"
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "If using -m nfs did you export NFS and sync rootimg? And did you include the aufs and nfs modules in the proper order: e.g.: -n tg3,aufs,loop,sunrpc,lockd,nfs_acl,nfs"
echo
echo "You're dead. rpower nodename reset to play again.
@ -277,7 +277,7 @@ if [ -z $STATEMNT ]; then
netif=${lf#*.}
netif=${netif%.*}
cp $lf "$NEWROOT/var/lib/dhclient/dhclient-$netif.leases"
[ "$xcatdebugmode" = "1" ] && logger -t xcat -p debug "saving $NEWROOT/var/lib/dhclient/dhclient-$netif.leases"
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "saving $NEWROOT/var/lib/dhclient/dhclient-$netif.leases"
done
if [ ! -z "$ifname" ]; then
@ -296,10 +296,10 @@ if [ -z $STATEMNT ]; then
if [ ! -z "$MACX" ] && [ ! -z "$ETHX" ]; then
if [ ! -e $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX ]; then
[ "$xcatdebugmode" = "1" ] && logger -t xcat -p debug "creating $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX"
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "creating $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX"
touch $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX
fi
[ "$xcatdebugmode" = "1" ] && logger -t xcat -p debug "writing $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX: DEVICE=$ETHX;BOOTPROTO=dhcp;HWADDR=$MACX;ONBOOT=yes"
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "writing $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX: DEVICE=$ETHX;BOOTPROTO=dhcp;HWADDR=$MACX;ONBOOT=yes"
echo "DEVICE=$ETHX" > $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX
echo "BOOTPROTO=dhcp" >> $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX
echo "HWADDR=$MACX" >> $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX
@ -307,15 +307,15 @@ if [ -z $STATEMNT ]; then
fi
fi
[ "$xcatdebugmode" = "1" ] && logger -t xcat -p debug "saving $NEWROOT/etc/resolv.conf"
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "saving $NEWROOT/etc/resolv.conf"
cp /etc/resolv.conf "$NEWROOT/etc/"
if [ -d "$NEWROOT/etc/sysconfig" -a ! -e "$NEWROOT/etc/sysconfig/selinux" ]; then
[ "$xcatdebugmode" = "1" ] && logger -t xcat -p debug "disable selinux ..."
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "disable selinux ..."
echo "SELINUX=disabled" >> "$NEWROOT/etc/sysconfig/selinux"
fi
[ "$xcatdebugmode" = "1" ] && logger -t xcat -p debug "exiting xcatroot..."
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "exiting xcatroot..."
# inject new exit_if_exists
echo 'settle_exit_if_exists="--exit-if-exists=/dev/root"; rm "$job"' > $hookdir/initqueue/xcat.sh
# force udevsettle to break

View File

@ -20,12 +20,12 @@ fi
xcatdebugmode="$(getarg xcatdebugmode=)"
[ "$xcatdebugmode" = "1" ] && logger -t xcat -p debug "running xcatroot...."
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "running xcatroot...."
[ "$xcatdebugmode" = "1" ] && logger -t xcat -p debug "MASTER=$MASTER XCATIPORT=$XCATIPORT"
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "MASTER=$MASTER XCATIPORT=$XCATIPORT"
if [ $NODESTATUS -ne 0 ];then
[ "$xcatdebugmode" = "1" ] && logger -t xcat -p debug "nodestatus: netbooting,reporting..."
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "nodestatus: netbooting,reporting..."
/tmp/updateflag $MASTER $XCATIPORT "installstatus netbooting"
fi
@ -34,10 +34,10 @@ if [ ! -z "$imgurl" ]; then
NFS=0
FILENAME=${imgurl##*/}
while [ ! -r "$FILENAME" ]; do
[ "$xcatdebugmode" = "1" ] && logger -t xcat -p debug "downloading $imgurl...."
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "downloading $imgurl...."
echo Getting $imgurl...
if ! wget $imgurl; then
[ "$xcatdebugmode" = "1" ] && logger -t xcat -p debug "downloading $imgurl failed,retrying...."
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "downloading $imgurl failed,retrying...."
rm -f $FILENAME
sleep 27
fi
@ -68,7 +68,7 @@ if [ -r /rootimg.sfs ]; then
mount --move /ro $NEWROOT/ro
mount --move /rw $NEWROOT/rw
elif [ -r /rootimg.gz ]; then
[ "$xcatdebugmode" = "1" ] && logger -t xcat -p debug "rootimg.gz downloaded,setting up RAM-root tmpfs...."
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "rootimg.gz downloaded,setting up RAM-root tmpfs...."
echo Setting up RAM-root tmpfs.
if [ -z $rootlimit ];then
mount -t tmpfs -o mode=755 rootfs $NEWROOT
@ -77,7 +77,7 @@ elif [ -r /rootimg.gz ]; then
fi
cd $NEWROOT
[ "$xcatdebugmode" = "1" ] && logger -t xcat -p debug "Extracting root filesystem:"
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "Extracting root filesystem:"
echo -n "Extracting root filesystem:"
if [ -x /bin/cpio ]; then
gzip -cd /rootimg.gz |/bin/cpio -idum
@ -85,7 +85,7 @@ elif [ -r /rootimg.gz ]; then
gzip -cd /rootimg.gz |cpio -idum
fi
$NEWROOT/etc/init.d/localdisk
[ "$xcatdebugmode" = "1" ] && logger -t xcat -p debug "Done...."
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "Done...."
echo Done
elif [ -r /rootimg-statelite.gz ]; then
echo Setting up RAM-root tmpfs for statelite mode.
@ -210,18 +210,18 @@ elif [ -r /rootimg-statelite.gz ]; then
mount -n --bind /sys $NEWROOT/sys
else
[ "$xcatdebugmode" = "1" ] && logger -t xcat -p debug "Failed to download image, panicing in 5..."
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "Failed to download image, panicing in 5..."
echo -n Failed to download image, panicing in 5...
for i in 4 3 2 1 0; do
/bin/sleep 1
[ "$xcatdebugmode" = "1" ] && logger -t xcat -p debug "$i..."
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "$i..."
echo -n $i...
done
[ "$xcatdebugmode" = "1" ] && logger -t xcat -p debug "You're dead. rpower nodename reset to play again."
[ "$xcatdebugmode" = "1" ] && logger -t xcat -p debug "* Did you packimage with -m cpio, -m squashfs, or -m nfs?"
[ "$xcatdebugmode" = "1" ] && logger -t xcat -p debug "* If using -m squashfs did you include aufs.ko with geninitrd? e.g.: -n tg3,squashfs,aufs,loop"
[ "$xcatdebugmode" = "1" ] && logger -t xcat -p debug "If using -m nfs did you export NFS and sync rootimg? And did you include the aufs and nfs modules in the proper order: e.g.: -n tg3,aufs,loop,sunrpc,lockd,nfs_acl,nfs"
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "You're dead. rpower nodename reset to play again."
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "* Did you packimage with -m cpio, -m squashfs, or -m nfs?"
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "* If using -m squashfs did you include aufs.ko with geninitrd? e.g.: -n tg3,squashfs,aufs,loop"
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "If using -m nfs did you export NFS and sync rootimg? And did you include the aufs and nfs modules in the proper order: e.g.: -n tg3,aufs,loop,sunrpc,lockd,nfs_acl,nfs"
echo
echo "You're dead. rpower nodename reset to play again.
@ -262,7 +262,7 @@ if [ -z $STATEMNT ]; then
netif=${lf#*.}
netif=${netif%.*}
cp $lf "$NEWROOT/var/lib/dhclient/dhclient-$netif.leases"
[ "$xcatdebugmode" = "1" ] && logger -t xcat -p debug "saving $NEWROOT/var/lib/dhclient/dhclient-$netif.leases"
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "saving $NEWROOT/var/lib/dhclient/dhclient-$netif.leases"
done
if [ ! -z "$ifname" ]; then
@ -278,10 +278,10 @@ if [ -z $STATEMNT ]; then
if [ ! -z "$MACX" ] && [ ! -z "$ETHX" ]; then
if [ ! -e $NEWROOT/etc/sysconfig/network/ifcfg-$ETHX ]; then
[ "$xcatdebugmode" = "1" ] && logger -t xcat -p debug "creating $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX"
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "creating $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX"
touch $NEWROOT/etc/sysconfig/network/ifcfg-$ETHX
fi
[ "$xcatdebugmode" = "1" ] && logger -t xcat -p debug "writing $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX: DEVICE=$ETHX;BOOTPROTO=dhcp;HWADDR=$MACX;ONBOOT=yes"
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "writing $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX: DEVICE=$ETHX;BOOTPROTO=dhcp;HWADDR=$MACX;ONBOOT=yes"
echo "DEVICE=$ETHX" > $NEWROOT/etc/sysconfig/network/ifcfg-$ETHX
echo "BOOTPROTO=dhcp" >> $NEWROOT/etc/sysconfig/network/ifcfg-$ETHX
echo "HWADDR=$MACX" >> $NEWROOT/etc/sysconfig/network/ifcfg-$ETHX
@ -289,18 +289,18 @@ if [ -z $STATEMNT ]; then
fi
fi
[ "$xcatdebugmode" = "1" ] && logger -t xcat -p debug "saving $NEWROOT/etc/resolv.conf"
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "saving $NEWROOT/etc/resolv.conf"
cp /etc/resolv.conf "$NEWROOT/etc/"
if [ -d "$NEWROOT/etc/sysconfig" -a ! -e "$NEWROOT/etc/sysconfig/selinux" ]; then
[ "$xcatdebugmode" = "1" ] && logger -t xcat -p debug "disable selinux ..."
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "disable selinux ..."
echo "SELINUX=disabled" >> "$NEWROOT/etc/sysconfig/selinux"
fi
[ "$xcatdebugmode" = "1" ] && logger -t xcat -p debug "setting hostname..."
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "setting hostname..."
echo `hostname` > $NEWROOT/etc/hostname
[ "$xcatdebugmode" = "1" ] && logger -t xcat -p debug "exiting xcatroot..."
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "exiting xcatroot..."
# inject new exit_if_exists
echo 'settle_exit_if_exists="--exit-if-exists=/dev/root"; rm "$job"' > $hookdir/initqueue/xcat.sh