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>
Signed-off-by: Perry Myers <pmyers at redhat.com>
---
ovirt-host-creator/.gitignore | 1 +
ovirt-host-creator/Makefile | 52 ++++++++++++++++++++++++
ovirt-host-creator/ovirt-host-image.spec | 64 ++++++++++++++++++++++++++++++
ovirt-host-creator/ovirt-pxe.sh | 2 +
ovirt-host-creator/version | 1 +
wui-appliance/common-pkgs.ks | 1 +
wui-appliance/wui-devel-x86_64.ks | 9 +----
7 files changed, 122 insertions(+), 8 deletions(-)
create mode 100644 ovirt-host-creator/.gitignore
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/.gitignore b/ovirt-host-creator/.gitignore
new file mode 100644
index 0000000..6b93e0c
--- /dev/null
+++ b/ovirt-host-creator/.gitignore
@@ -0,0 +1 @@
+iso-file
diff --git a/ovirt-host-creator/Makefile b/ovirt-host-creator/Makefile
new file mode 100644
index 0000000..b98ef7f
--- /dev/null
+++ b/ovirt-host-creator/Makefile
@@ -0,0 +1,52 @@
+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
+
+build: 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 build
+ mv $(shell cat iso-file) ovirt.iso
+ mkdir -p $(NV)
+ cp -a ovirt-host-image.spec ovirt.iso 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..471240e
--- /dev/null
+++ b/ovirt-host-creator/ovirt-host-image.spec
@@ -0,0 +1,64 @@
+Summary: oVirt Managed Node boot ISO image
+Name: ovirt-host-image
+Source1: version
+Version: %(echo `awk '{ print $1 }' %{SOURCE1}`)
+Release: %(echo `awk '{ print $2 }' %{SOURCE1}`)%{?dist}
+Source0: %{name}-%{version}.tar.gz
+License: Fedora
+Group: Applications/System
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
+URL: http://ovirt.org/
+
+%define app_root %{_datadir}/%{name}
+%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 ISO boot image for oVirt Managed Node booting from CDROM device.
+At the moment, this RPM just packages prebuilt ISO from %{SOURCE0}.
+
+%package pxe
+Summary: oVirt Managed Node boot PXE image
+Group: Applications/System
+
+%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 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}
+%{__install} -d -m0755 %{buildroot}%{app_root}
+%{__install} -p -m0644 ovirt.iso %{buildroot}%{app_root}
+
+%clean
+%{__rm} -rf %{buildroot}
+
+%files
+%defattr(-,root,root)
+%{app_root}/ovirt.iso
+
+%files pxe
+%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/ovirt-pxe.sh b/ovirt-host-creator/ovirt-pxe.sh
index 7191fc7..624ac78 100755
--- a/ovirt-host-creator/ovirt-pxe.sh
+++ b/ovirt-host-creator/ovirt-pxe.sh
@@ -28,6 +28,7 @@ else
exit 1
fi
+rm -f iso-file
ISO=`create_iso $ISO` || exit 1
livecd-iso-to-pxeboot $ISO
@@ -36,3 +37,4 @@ livecd-iso-to-pxeboot $ISO
f=tftpboot/pxelinux.cfg/default
grep -q 'IPAPPEND 2' $f || sed -i '/KERNEL/a \\tIPAPPEND 2' $f
+echo $ISO > iso-file
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..ab4c5da 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-pxe
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.5.1