diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index 311644d6a..fd0a96e1c 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -574,8 +574,21 @@ sub mknetboot } } $kcmdline .= $statemnt ." "; + my $xcatmasterip; + # if xcatmaster is hostname, convert it to ip address + if (xCAT::Utils->validate_ip($xcatmaster)) { + # Using XCAT= will cause problems rc.statelite.ppc.redhat + # when trying to run chroot command + $xcatmasterip = xCAT::NetworkUtils->getipaddr($xcatmaster); + if (!$xcatmasterip) + { + $xcatmasterip = $xcatmaster; + } + } else { + $xcatmasterip = $xcatmaster; + } $kcmdline .= - "XCAT=$xcatmaster:$xcatdport "; + "XCAT=$xcatmasterip:$xcatdport "; if ($rootfstype ne "ramdisk") { # BEGIN service node my $isSV = xCAT::Utils->isServiceNode(); diff --git a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite index 373b70ba1..83f86be42 100755 --- a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite +++ b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite @@ -533,9 +533,11 @@ ResolveLinks # make sure mtab points to the right place: /bin/ln -sf /proc/mounts ${TMPFS}/etc/mtab -/bin/cat /etc/resolv.conf > $MNTDIR/etc/resolv.conf - # catch all hack for debugging: #cp -r -a ${DEFAULT}/* /.snapshot/tmpfs/ # foo +# If the resolv.conf is not setup in rootimg, copy the dhcp generated one into rootimg +if grep --quiet --no-messages "Dummy resolv.conf" "$MNTDIR/etc/resolv.conf"; then +/bin/cat /etc/resolv.conf > $MNTDIR/etc/resolv.conf +fi diff --git a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite.ppc.redhat b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite.ppc.redhat index 6216a37ac..297b7c211 100755 --- a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite.ppc.redhat +++ b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite.ppc.redhat @@ -536,3 +536,8 @@ ResolveLinks # catch all hack for debugging: #cp -r -a ${DEFAULT}/* /.snapshot/tmpfs/ # foo + +# If the resolv.conf is not setup in rootimg, copy the dhcp generated one into rootimg +if grep --quiet --no-messages "Dummy resolv.conf" "$MNTDIR/etc/resolv.conf"; then +/bin/cat /etc/resolv.conf > $MNTDIR/etc/resolv.conf +fi