[Ovirt-devel] [PATCH] Move building of PXE image into RPM build step

Perry Myers pmyers at redhat.com
Wed Jul 2 18:17:22 UTC 2008


Old ovirt-host-image rpm used to store a copy of the ISO and the
tftpboot directory.  This is redundant.  Source file for RPM is now
just the ISO and build step uses livecd-tools to build the tftpboot
directory from the ISO

Signed-off-by: Perry Myers <pmyers at redhat.com>
---
 ovirt-host-creator/.gitignore            |    1 +
 ovirt-host-creator/Makefile              |    6 +++---
 ovirt-host-creator/ovirt-cd.sh           |    1 +
 ovirt-host-creator/ovirt-host-image.spec |   17 ++++++++++++-----
 4 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/ovirt-host-creator/.gitignore b/ovirt-host-creator/.gitignore
index 455b5f7..9adce7e 100644
--- a/ovirt-host-creator/.gitignore
+++ b/ovirt-host-creator/.gitignore
@@ -3,4 +3,5 @@ iso-file
 tftpboot
 rpm-build
 ovirt-pxe.log
+ovirt-cd.log
 repos.ks
diff --git a/ovirt-host-creator/Makefile b/ovirt-host-creator/Makefile
index 6f862f3..c522851 100644
--- a/ovirt-host-creator/Makefile
+++ b/ovirt-host-creator/Makefile
@@ -4,7 +4,7 @@ all: rpms
 include ../common/release.mk
 
 clean:
-	rm -rf ovirt-host-image-* ovirt-pxe.log
+	rm -rf ovirt-host-image-* ovirt-pxe.log ovirt-cd.log
 
 distclean: clean
 	rm -rf *.iso tftpboot repos.ks rpm-build iso-file
@@ -14,12 +14,12 @@ repos.ks: repos.ks.in
 
 build: ovirt.ks common-install.ks common-pkgs.ks common-post.ks repos.ks
 	rm -rf tftpboot/
-	./ovirt-pxe.sh > ovirt-pxe.log 2>&1
+	./ovirt-cd.sh > ovirt-cd.log 2>&1
 
 tar: clean build
 	mv $$(cat iso-file) ovirt.iso
 	mkdir -p $(NV)
-	cp -a ovirt-host-image.spec ovirt.iso tftpboot/* $(NV)
+	cp -a ovirt-host-image.spec ovirt.iso $(NV)
 	mkdir -p rpm-build
 	tar zcvf rpm-build/$(NV).tar $(NV)
 	cp version rpm-build/
diff --git a/ovirt-host-creator/ovirt-cd.sh b/ovirt-host-creator/ovirt-cd.sh
index a4e4cff..0469e6a 100755
--- a/ovirt-host-creator/ovirt-cd.sh
+++ b/ovirt-host-creator/ovirt-cd.sh
@@ -29,3 +29,4 @@ else
 fi
 
 ISO=`create_iso $ISO`
+echo $ISO > iso-file
diff --git a/ovirt-host-creator/ovirt-host-image.spec b/ovirt-host-creator/ovirt-host-image.spec
index 91ca6af..a4aacc2 100644
--- a/ovirt-host-creator/ovirt-host-image.spec
+++ b/ovirt-host-creator/ovirt-host-image.spec
@@ -22,15 +22,19 @@ At the moment, this RPM just packages prebuilt ISO.
 %package pxe
 Summary: oVirt Managed Node boot PXE image
 Group: Applications/System
+BuildRequires: livecd-tools >= 017.1-1
 
 %description pxe
 The PXE boot image for oVirt Managed Node network boot from oVirt Admin Node.
-At the moment, this RPM just packages prebuilt tftpboot folder.
 
 %prep
 %setup -q
 
 %build
+/usr/bin/livecd-iso-to-pxeboot ovirt.iso
+# append BOOTIF with PXE MAC info
+f=tftpboot/pxelinux.cfg/default
+grep -q 'IPAPPEND 2' $f || sed -i '/KERNEL/a \\tIPAPPEND 2' $f
 
 %install
 %{__rm} -rf %{buildroot}
@@ -38,10 +42,10 @@ mkdir %{buildroot}
 
 %{__install} -d -m0755 %{buildroot}%{tftpboot}
 %{__install} -d -m0755 %{buildroot}%{tftpboot}/pxelinux.cfg
-%{__install} -p -m0644 pxelinux.cfg/default %{buildroot}%{tftpboot}/pxelinux.cfg/default
-%{__install} -p -m0644 pxelinux.0 %{buildroot}%{tftpboot}
-%{__install} -p -m0644 initrd0.img %{buildroot}%{tftpboot}
-%{__install} -p -m0644 vmlinuz0 %{buildroot}%{tftpboot}
+%{__install} -p -m0644 tftpboot/pxelinux.cfg/default %{buildroot}%{tftpboot}/pxelinux.cfg/default
+%{__install} -p -m0644 tftpboot/pxelinux.0 %{buildroot}%{tftpboot}
+%{__install} -p -m0644 tftpboot/initrd0.img %{buildroot}%{tftpboot}
+%{__install} -p -m0644 tftpboot/vmlinuz0 %{buildroot}%{tftpboot}
 %{__install} -d -m0755 %{buildroot}%{app_root}
 %{__install} -p -m0644 ovirt.iso %{buildroot}%{app_root}
 
@@ -60,5 +64,8 @@ mkdir %{buildroot}
 %{tftpboot}/vmlinuz0
 
 %changelog
+* Wed Jul 02 2008 Perry Myers <pmyers at redhat.com> 0.92-0
+- Only store ISO in SRPM, and generate PXE from that during build
+
 * Tue Jun 03 2008 Alan Pevec <apevec at redhat.com>  0.0.5-1
 - Initial build.
-- 
1.5.5.1




More information about the ovirt-devel mailing list