fix for bug 3496130: resolve hostname to ip address in /tftpboot/etc/<node>, copy resolv.conf from initrd into rootimg

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@13037 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
ligc 2012-06-08 09:00:26 +00:00
parent 8cc73753da
commit 6258e5505f
3 changed files with 23 additions and 3 deletions

View File

@ -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=<hostname> 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();

View File

@ -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

View File

@ -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