[Ovirt-devel] [PATCH] ovirt-host-image RPM

Alan Pevec apevec at redhat.com
Tue Jun 3 13:39:25 UTC 2008


ovirt-host-image RPM

packages PXE boot image so it can be conveniently distributed in a YUM repository

Signed-off-by: Alan Pevec <apevec at redhat.com>
---
 ovirt-host-creator/Makefile              |   51 ++++++++++++++++++++++++++++
 ovirt-host-creator/ovirt-host-image.spec |   53 ++++++++++++++++++++++++++++++
 ovirt-host-creator/version               |    1 +
 wui-appliance/common-pkgs.ks             |    1 +
 wui-appliance/wui-devel-x86_64.ks        |    9 +----
 5 files changed, 107 insertions(+), 8 deletions(-)
 create mode 100644 ovirt-host-creator/Makefile
 create mode 100644 ovirt-host-creator/ovirt-host-image.spec
 create mode 100644 ovirt-host-creator/version

diff --git a/ovirt-host-creator/Makefile b/ovirt-host-creator/Makefile
new file mode 100644
index 0000000..49e7946
--- /dev/null
+++ b/ovirt-host-creator/Makefile
@@ -0,0 +1,51 @@
+VERSION		= $(shell echo `awk '{ print $$1 }' version`)
+RELEASE		= $(shell echo `awk '{ print $$2 }' version`)
+NEWRELEASE	= $(shell echo $$(($(RELEASE) + 1)))
+X		= $(shell echo `awk '{ if (split($$2,r,".") >= 2) { if (r[1]=="0") {print r[2]+1} else print 1 } else print 1 }' version`)
+GITRELEASE	= $(shell echo 0.$(X).`date --utc +%Y%m%d%H%M`git`git show-ref --heads --hash=7 $$(git branch|awk '$$1="*" {print $$2}')`)
+DIST		= $(shell rpm --eval '%{dist}')
+ARCH		= $(shell uname -i)
+
+SPEC_FILE	= ovirt-host-image.spec
+NAME		= ovirt-host-image
+
+NV		= $(NAME)-$(VERSION)
+RPM_FLAGS	=	--define "_topdir	%(pwd)/rpm-build" \
+			--define "_builddir	%{_topdir}" \
+			--define "_rpmdir	%{_topdir}" \
+			--define "_srcrpmdir	%{_topdir}" \
+			--define '_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm' \
+			--define "_specdir	%{_topdir}" \
+			--define "_sourcedir	%{_topdir}"
+
+all: rpms
+
+bumpgit:
+	-echo "$(VERSION) $(GITRELEASE)" > version
+
+bumprelease:
+	-echo "$(VERSION) $(NEWRELEASE)" > version
+
+setversion:
+	-echo "$(VERSION) $(RELEASE)" > version
+
+clean:
+	-rm -rf ovirt-host-image-* ovirt-pxe.log
+
+tftpboot: ovirt-$(ARCH).ks common-install.ks common-pkgs.ks common-post.ks repos.ks
+	-rm -rf tftpboot/
+	./ovirt-pxe.sh > ovirt-pxe.log 2>&1
+
+tar: clean tftpboot
+	mkdir -p $(NV)
+	cp -a ovirt-host-image.spec tftpboot/* $(NV)
+	mkdir -p rpm-build
+	tar zcvf rpm-build/$(NV).tar.gz $(NV)
+	cp version rpm-build/
+	rm -rf $(NV)
+
+new-rpms: bumprelease rpms
+
+rpms: tar
+	rpmbuild $(RPM_FLAGS) -ba $(SPEC_FILE)
+
diff --git a/ovirt-host-creator/ovirt-host-image.spec b/ovirt-host-creator/ovirt-host-image.spec
new file mode 100644
index 0000000..fa0050d
--- /dev/null
+++ b/ovirt-host-creator/ovirt-host-image.spec
@@ -0,0 +1,53 @@
+Summary: oVirt Managed Node PXE boot image
+Name: ovirt-host-image
+Source1: version
+Version: %(echo `awk '{ print $1 }' %{SOURCE1}`)
+Release: %(echo `awk '{ print $2 }' %{SOURCE1}`)%{?dist}
+Source0: %{name}-%{version}.tar
+License: Fedora
+Group: Applications/System
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
+URL: http://ovirt.org/
+
+%define tftpboot %{_var}/lib/tftpboot
+
+#  disable debuginfo, makes no sense for boot image and it is created empty anyway
+%define debug_package %{nil}
+
+%description
+The PXE boot image for oVirt Managed Node network boot from oVirt Admin Node.
+At the moment, this RPM just packages prebuilt tftpboot folder from %{SOURCE0}.
+
+%prep
+%setup -q
+
+%build
+
+%install
+%{__rm} -rf %{buildroot}
+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}
+
+
+%clean
+%{__rm} -rf %{buildroot}
+
+
+%files
+%defattr(-,root,root)
+%config(noreplace) %{tftpboot}/pxelinux.cfg/default
+%{tftpboot}/pxelinux.0
+%{tftpboot}/initrd0.img
+%{tftpboot}/vmlinuz0
+
+
+%changelog
+* Tue Jun 03 2008 Alan Pevec <apevec at redhat.com>  0.0.5-1
+- Initial build.
+
diff --git a/ovirt-host-creator/version b/ovirt-host-creator/version
new file mode 100644
index 0000000..d4480df
--- /dev/null
+++ b/ovirt-host-creator/version
@@ -0,0 +1 @@
+0.0.5 1
diff --git a/wui-appliance/common-pkgs.ks b/wui-appliance/common-pkgs.ks
index eb70651..95eef75 100644
--- a/wui-appliance/common-pkgs.ks
+++ b/wui-appliance/common-pkgs.ks
@@ -24,6 +24,7 @@ collectd
 ruby-libvirt
 ruby-postgres
 ovirt-wui
+ovirt-host-image
 firefox
 xorg-x11-xauth
 virt-viewer
diff --git a/wui-appliance/wui-devel-x86_64.ks b/wui-appliance/wui-devel-x86_64.ks
index 96dd539..f3fdf9c 100644
--- a/wui-appliance/wui-devel-x86_64.ks
+++ b/wui-appliance/wui-devel-x86_64.ks
@@ -194,7 +194,7 @@ start() {
         -W _ipa._tcp,management.priv.ovirt.org,80 \
         -W _ldap._tcp,management.priv.ovirt.org,389 \
         -W _collectd._tcp,management.priv.ovirt.org,25826 \
-        --enable-tftp --tftp-root=/tftpboot -M pxelinux.0 \
+        --enable-tftp --tftp-root=/var/lib/tftpboot -M pxelinux.0 \
         -O option:router,192.168.50.2 -O option:ntp-server,192.168.50.2 \
         -R --local /priv.ovirt.org/ --server 192.168.122.1
     
@@ -260,11 +260,4 @@ EOF
 chmod +x /etc/init.d/ovirt-wui-dev
 chkconfig ovirt-wui-dev on
 
-# get the PXE boot image; this can take a while
-PXE_URL=http://ovirt.org/download
-IMAGE=ovirt-pxe-host-image-x86_64-0.5.tar.bz2
-wget ${PXE_URL}/$IMAGE -O /tmp/$IMAGE
-tar -C / -jxvf /tmp/$IMAGE
-rm -f /tmp/$IMAGE
-
 %end
-- 
1.5.4.1




More information about the ovirt-devel mailing list