Ironic: Add pxe boot support for centos image

Current pxe init script does not support pxe for centos distro as
base image. Different folders were checked for centos to copy
pxe/ipxe files to tftpboot folder.

Change-Id: I4911825193d75aaaed24e8b71ba43efa2fc78fe8
Signed-off-by: Mingyuan Qi <mingyuan.qi@intel.com>
This commit is contained in:
Mingyuan Qi 2019-04-11 14:59:11 +08:00
parent 4d9c91cc3e
commit 5f37a88a14

View File

@ -35,7 +35,7 @@ elif [ "x$ID" == "xcentos" ]; then
if ! yum list installed ipxe-bootimgs >/dev/null 2>&1; then if ! yum list installed ipxe-bootimgs >/dev/null 2>&1; then
yum update --nogpgcheck -y yum update --nogpgcheck -y
yum install ipxe-bootimgs --nogpgcheck -y yum install ipxe-bootimgs syslinux-tftpboot --nogpgcheck -y
fi fi
FILEPATH=/usr/share/ipxe FILEPATH=/usr/share/ipxe
@ -45,8 +45,18 @@ fi
mkdir -p /var/lib/openstack-helm/tftpboot mkdir -p /var/lib/openstack-helm/tftpboot
mkdir -p /var/lib/openstack-helm/tftpboot/master_images mkdir -p /var/lib/openstack-helm/tftpboot/master_images
for FILE in undionly.kpxe ipxe.efi; do for FILE in undionly.kpxe ipxe.efi pxelinux.0; do
if [ -f /usr/lib/ipxe/$FILE ]; then if [ -f /usr/lib/ipxe/$FILE ]; then
cp -v /usr/lib/ipxe/$FILE /var/lib/openstack-helm/tftpboot cp -v /usr/lib/ipxe/$FILE /var/lib/openstack-helm/tftpboot
fi fi
# ipxe and pxe support for CentOS
if [ "x$ID" == "xcentos" ]; then
if [ -f /var/lib/tftpboot/$FILE ]; then
cp -v /var/lib/tftpboot/$FILE /var/lib/openstack-helm/tftpboot
fi
if [ -f /usr/share/ipxe/$FILE ]; then
cp -v /usr/share/ipxe/$FILE /var/lib/openstack-helm/tftpboot
fi
fi
done done