From 5f37a88a1443f74d687628d1d8fcc6d9d26c8170 Mon Sep 17 00:00:00 2001 From: Mingyuan Qi Date: Thu, 11 Apr 2019 14:59:11 +0800 Subject: [PATCH] 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 --- .../bin/_ironic-conductor-pxe-init.sh.tpl | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ironic/templates/bin/_ironic-conductor-pxe-init.sh.tpl b/ironic/templates/bin/_ironic-conductor-pxe-init.sh.tpl index 2f41d16447..48b6e937bc 100644 --- a/ironic/templates/bin/_ironic-conductor-pxe-init.sh.tpl +++ b/ironic/templates/bin/_ironic-conductor-pxe-init.sh.tpl @@ -35,7 +35,7 @@ elif [ "x$ID" == "xcentos" ]; then if ! yum list installed ipxe-bootimgs >/dev/null 2>&1; then yum update --nogpgcheck -y - yum install ipxe-bootimgs --nogpgcheck -y + yum install ipxe-bootimgs syslinux-tftpboot --nogpgcheck -y fi FILEPATH=/usr/share/ipxe @@ -45,8 +45,18 @@ fi mkdir -p /var/lib/openstack-helm/tftpboot 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 cp -v /usr/lib/ipxe/$FILE /var/lib/openstack-helm/tftpboot 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