Ironic: Add pxe boot support for centos image

Current script does not consider centos distro as base image.
Different folder was checked to copy pxe files to tftpboot folder.

Story: 2004760
Task: 30280

Change-Id: I288d7e6bc0e3570f6a6bb7a9587e120ab4501736
Signed-off-by: Mingyuan Qi <mingyuan.qi@intel.com>
This commit is contained in:
Mingyuan Qi 2019-04-11 15:42:27 +08:00
parent 1f83a9573c
commit c4bed237e9
2 changed files with 62 additions and 0 deletions

View File

@ -28,6 +28,7 @@ Patch06: 0006-Nova-chart-Support-ephemeral-pool-creation.patch
Patch07: 0007-Horizon-Disable-apache2-status_module.patch
Patch08: 0008-Neutron-Add-support-for-disabling-Readiness-Liveness.patch
Patch09: 0009-Nova-Add-support-for-disabling-Readiness-Liveness-pr.patch
Patch10: 0010-Ironic-Add-pxe-boot-support-for-centos-image.patch
BuildRequires: helm
BuildRequires: openstack-helm-infra
@ -47,6 +48,7 @@ Openstack Helm charts
%patch07 -p1
%patch08 -p1
%patch09 -p1
%patch10 -p1
%build
# initialize helm and build the toolkit

View File

@ -0,0 +1,60 @@
From 8b52fcc187dcb2da5fd7453dbb564d24d475dd49 Mon Sep 17 00:00:00 2001
From: Mingyuan Qi <mingyuan.qi@intel.com>
Date: Thu, 11 Apr 2019 14:59:11 +0800
Subject: [PATCH 10/10] Ironic: Add pxe boot support for centos image
Current script does not consider centos distro as base image.
Different folder was checked to copy pxe files to tftpboot folder.
Signed-off-by: Mingyuan Qi <mingyuan.qi@intel.com>
---
.../bin/_ironic-conductor-pxe-init.sh.tpl | 25 +++++++++++++++++-----
1 file changed, 20 insertions(+), 5 deletions(-)
diff --git a/ironic/templates/bin/_ironic-conductor-pxe-init.sh.tpl b/ironic/templates/bin/_ironic-conductor-pxe-init.sh.tpl
index b8c4c4c..5fe595f 100644
--- a/ironic/templates/bin/_ironic-conductor-pxe-init.sh.tpl
+++ b/ironic/templates/bin/_ironic-conductor-pxe-init.sh.tpl
@@ -16,19 +16,34 @@ See the License for the specific language governing permissions and
limitations under the License.
*/}}
+DISTRO_UBUNTU=$(cat /etc/*release | grep Ubuntu)
+DISTRO_CENTOS=$(cat /etc/*release | grep CentOS)
+
set -ex
-#NOTE(portdirect): this works round a limitation in Kolla images
-if ! dpkg -l ipxe; then
- apt-get update
- apt-get install ipxe -y
+if [[ ! -z $DISTRO_UBUNTU ]]; then
+ #NOTE(portdirect): this works round a limitation in Kolla images
+ if ! dpkg -l ipxe; then
+ apt-get update
+ apt-get install ipxe -y
+ fi
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
+
+ # For CentOS
+ if [[ ! -z $DISTRO_CENTOS ]]; 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
--
1.8.3.1