diff --git a/perl-xCAT/xCAT/Schema.pm b/perl-xCAT/xCAT/Schema.pm index 3a46009fe..b4a1ed04e 100755 --- a/perl-xCAT/xCAT/Schema.pm +++ b/perl-xCAT/xCAT/Schema.pm @@ -1118,6 +1118,8 @@ site => { " 'all' means that the management as well as the service nodes\n". " are all using a common shared filesystem. The default is 'no'.\n". " xcatconfdir: Where xCAT config data is (default /etc/xcat).\n\n". + " xcatdebugmode: the value of xcat debug mode. Currently supported values: \n". + " 0: off(default); 1: on \n\n". " --------------------\n". "REMOTESHELL ATTRIBUTES\n". " --------------------\n". diff --git a/xCAT-server/lib/perl/xCAT/Template.pm b/xCAT-server/lib/perl/xCAT/Template.pm index fff570b7e..3e799006e 100644 --- a/xCAT-server/lib/perl/xCAT/Template.pm +++ b/xCAT-server/lib/perl/xCAT/Template.pm @@ -336,7 +336,11 @@ sub subvars { $inc =~ s/#SHORTNAME#/$shortname/g; $inc =~ s/#GETNODEDOMAIN:([^#]+)#/get_node_domain($1)/eg; $inc =~ s/#GETPRINICMAC:([^#]+)#/xCAT::Utils::parseMacTabEntry(tabdb("mac",$1,"mac"),$1)/eg; - + + if($::XCATSITEVALS{xcatdebugmode} eq "1"){ + $inc =~ s/#UNCOMMENONXCATDEBUGMODE#/ /g; + } + my $nrtab = xCAT::Table->new("noderes"); my $tftpserver = $nrtab->getNodeAttribs($node, ['tftpserver']); my $sles_sdk_media = "http://" . $tftpserver->{tftpserver} . $media_dir . "/sdk1"; diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index 2a2e43f7b..e5ac5122c 100755 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -1479,7 +1479,32 @@ sub mkinstall $kcmdline .= " $net_params->{ip} "; } } + + if($::XCATSITEVALS{xcatdebugmode} eq "1"){ + unless($instserver eq '!myipfn!'){ + my($host,$ip)=xCAT::NetworkUtils->gethostnameandip($instserver); + $instserver=$ip; + } + + if (xCAT::Utils->version_cmp($kversion,"7.0") >= 0){ + #enable ssh access during installation + $kcmdline .= " inst.sshd"; + + #set minimum level of messages to be logged on the console + #to be "debug" + $kcmdline .=" inst.loglevel=debug"; + + #all the logs during installation will be forwarded to xcatmster + $kcmdline .=" inst.syslog=$instserver"; + }else{ + $kcmdline .= " sshd=1"; + $kcmdline .=" syslog=$instserver"; + } + + } + + #TODO: dd= for driver disks if (defined($sent->{serialport})) { diff --git a/xCAT-server/lib/xcat/plugins/sles.pm b/xCAT-server/lib/xcat/plugins/sles.pm index 84f586189..ec35796c6 100755 --- a/xCAT-server/lib/xcat/plugins/sles.pm +++ b/xCAT-server/lib/xcat/plugins/sles.pm @@ -1196,7 +1196,18 @@ sub mkinstall } + if($::XCATSITEVALS{xcatdebugmode} eq "1"){ + unless($netserver eq '!myipfn!'){ + my($host,$ip)=xCAT::NetworkUtils->gethostnameandip($netserver); + $netserver=$ip; + } + + #enable ssh access during installation,the password is set to "cluster" + $kcmdline .=" UseSSH=1 SSHPassword=cluster"; + + $kcmdline .=" Loghost=$netserver"; + } if (defined $sent->{serialport}) diff --git a/xCAT-server/share/xcat/install/scripts/pre.rh b/xCAT-server/share/xcat/install/scripts/pre.rh index dac9f1fbe..95363f798 100644 --- a/xCAT-server/share/xcat/install/scripts/pre.rh +++ b/xCAT-server/share/xcat/install/scripts/pre.rh @@ -138,13 +138,13 @@ try: line = "installing prep" newSocket.send(line) break -# if(command[0] == "sh"): #DEBUG purposes only, wide open root priv command here. -# newcommand = "" -# for i in command[1:]: -# newcommand = newcommand + i + " " -# output = os.popen(newcommand).read() -# newSocket.send(output) -# break +#UNCOMMENONXCATDEBUGMODE# if(command[0] == "sh"): #DEBUG purposes only, wide open root priv command here. +#UNCOMMENONXCATDEBUGMODE# newcommand = "" +#UNCOMMENONXCATDEBUGMODE# for i in command[1:]: +#UNCOMMENONXCATDEBUGMODE# newcommand = newcommand + i + " " +#UNCOMMENONXCATDEBUGMODE# output = os.popen(newcommand).read() +#UNCOMMENONXCATDEBUGMODE# newSocket.send(output) +#UNCOMMENONXCATDEBUGMODE# break if(command[0] == "screendump"): newcommand = "cat /dev/vcs" for i in command[1:]: diff --git a/xCAT-server/share/xcat/install/scripts/pre.rh.rhels7 b/xCAT-server/share/xcat/install/scripts/pre.rh.rhels7 index b373a9164..94fec22d9 100755 --- a/xCAT-server/share/xcat/install/scripts/pre.rh.rhels7 +++ b/xCAT-server/share/xcat/install/scripts/pre.rh.rhels7 @@ -102,13 +102,13 @@ try: line = "installing prep" newSocket.send(line) break -# if(command[0] == "sh"): #DEBUG purposes only, wide open root priv command here. -# newcommand = "" -# for i in command[1:]: -# newcommand = newcommand + i + " " -# output = os.popen(newcommand).read() -# newSocket.send(output) -# break +#UNCOMMENONXCATDEBUGMODE# if(command[0] == "sh"): #DEBUG purposes only, wide open root priv command here. +#UNCOMMENONXCATDEBUGMODE# newcommand = "" +#UNCOMMENONXCATDEBUGMODE# for i in command[1:]: +#UNCOMMENONXCATDEBUGMODE# newcommand = newcommand + i + " " +#UNCOMMENONXCATDEBUGMODE# output = os.popen(newcommand).read() +#UNCOMMENONXCATDEBUGMODE# newSocket.send(output) +#UNCOMMENONXCATDEBUGMODE# break if(command[0] == "screendump"): newcommand = "cat /dev/vcs" for i in command[1:]: diff --git a/xCAT-server/share/xcat/install/scripts/pre.sles b/xCAT-server/share/xcat/install/scripts/pre.sles index 82337a568..d54fa2387 100644 --- a/xCAT-server/share/xcat/install/scripts/pre.sles +++ b/xCAT-server/share/xcat/install/scripts/pre.sles @@ -50,14 +50,14 @@ BEGIN { while(1) { ns |& getline -# if(\$1 == "sh") { #TODO: ENABLE IF DEBUG -# sub(/^sh +/,"",\$0) -# output = \$0 -# while((output | getline) > 0) -# print \$0 |& ns -# print "EOO" |& ns -# close(output) -# } +#UNCOMMENONXCATDEBUGMODE# if(\$1 == "sh") { #TODO: ENABLE IF DEBUG +#UNCOMMENONXCATDEBUGMODE# sub(/^sh +/,"",\$0) +#UNCOMMENONXCATDEBUGMODE# output = \$0 +#UNCOMMENONXCATDEBUGMODE# while((output | getline) > 0) +#UNCOMMENONXCATDEBUGMODE# print \$0 |& ns +#UNCOMMENONXCATDEBUGMODE# print "EOO" |& ns +#UNCOMMENONXCATDEBUGMODE# close(output) +#UNCOMMENONXCATDEBUGMODE# } if(\$1 == "screendump") { output = "chvt " \$2 ";cat /dev/vcs" diff --git a/xCAT-server/share/xcat/install/scripts/pre.ubuntu b/xCAT-server/share/xcat/install/scripts/pre.ubuntu index 1fc63dfb6..0ee54f33e 100644 --- a/xCAT-server/share/xcat/install/scripts/pre.ubuntu +++ b/xCAT-server/share/xcat/install/scripts/pre.ubuntu @@ -90,11 +90,11 @@ fi read cmd arg remainder case "\$cmd" in -# "sh") #TODO: ENABLE IF DEBUG -# output=\$(eval \$arg \$remainder) -# echo "\$output" -# echo "EOO" -# ;; +#UNCOMMENONXCATDEBUGMODE# "sh") #TODO: ENABLE IF DEBUG +#UNCOMMENONXCATDEBUGMODE# output=\$(eval \$arg \$remainder) +#UNCOMMENONXCATDEBUGMODE# echo "\$output" +#UNCOMMENONXCATDEBUGMODE# echo "EOO" +#UNCOMMENONXCATDEBUGMODE# ;; "screendump") output=\$(eval chvt \$arg; cat /dev/vcs) diff --git a/xCAT-server/share/xcat/install/scripts/pre.ubuntu.ppc64 b/xCAT-server/share/xcat/install/scripts/pre.ubuntu.ppc64 index 45637333d..9a92ba14a 100644 --- a/xCAT-server/share/xcat/install/scripts/pre.ubuntu.ppc64 +++ b/xCAT-server/share/xcat/install/scripts/pre.ubuntu.ppc64 @@ -90,11 +90,11 @@ fi read cmd arg remainder case "\$cmd" in -# "sh") #TODO: ENABLE IF DEBUG -# output=\$(eval \$arg \$remainder) -# echo "\$output" -# echo "EOO" -# ;; +#UNCOMMENONXCATDEBUGMODE# "sh") #TODO: ENABLE IF DEBUG +#UNCOMMENONXCATDEBUGMODE# output=\$(eval \$arg \$remainder) +#UNCOMMENONXCATDEBUGMODE# echo "\$output" +#UNCOMMENONXCATDEBUGMODE# echo "EOO" +#UNCOMMENONXCATDEBUGMODE# ;; "screendump") output=\$(eval chvt \$arg; cat /dev/vcs) diff --git a/xCAT-server/share/xcat/install/ubuntu/compute.tmpl b/xCAT-server/share/xcat/install/ubuntu/compute.tmpl index 336c15872..e052c4835 100644 --- a/xCAT-server/share/xcat/install/ubuntu/compute.tmpl +++ b/xCAT-server/share/xcat/install/ubuntu/compute.tmpl @@ -7,6 +7,18 @@ d-i localechooser/supported-locales multiselect en_US.UTF-8 d-i console-setup/ask_detect boolean false d-i keyboard-configuration/layoutcode string en + + +# Use the following settings if you wish to make use of the network-console +# component for remote installation over SSH. This only makes sense if you +# intend to perform the remainder of the installation manually. +#UNCOMMENONXCATDEBUGMODE# d-i anna/choose_modules string network-console +#d-i network-console/authorized_keys_url string http://10.0.0.1/openssh-key +#UNCOMMENONXCATDEBUGMODE# d-i network-console/password password cluster +#UNCOMMENONXCATDEBUGMODE# d-i network-console/password-again password cluster + + + ### Network Configuration d-i netcfg/get_hostname string unassigned-hostname