rpms/kvm/devel kvm-fix-pc-bios-make-install-missing-files.patch, 1.1, 1.2 kvm.spec, 1.71, 1.72

Glauber Costa glommer at fedoraproject.org
Wed Oct 22 14:07:18 UTC 2008


Author: glommer

Update of /cvs/pkgs/rpms/kvm/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv27596

Modified Files:
	kvm.spec 
Added Files:
	kvm-fix-pc-bios-make-install-missing-files.patch 
Log Message:
- Remove all prebuilt qemu/pc-bios binaries before building
- Use symlinks to etherboot files for the pxe roms
- Based on the work by Eduardo Habkost



kvm-fix-pc-bios-make-install-missing-files.patch:

Index: kvm-fix-pc-bios-make-install-missing-files.patch
===================================================================
RCS file: kvm-fix-pc-bios-make-install-missing-files.patch
diff -N kvm-fix-pc-bios-make-install-missing-files.patch
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ kvm-fix-pc-bios-make-install-missing-files.patch	22 Oct 2008 14:07:17 -0000	1.2
@@ -0,0 +1,34 @@
+From c93f589fc1f51e4bdb7ba79935cb5b85d8c50ca2 Mon Sep 17 00:00:00 2001
+From: Eduardo Habkost <ehabkost at redhat.com>
+Date: Fri, 3 Oct 2008 11:44:08 -0300
+Subject: [PATCH] Fix pc-bios 'make install' rules when files doesn't exist
+
+make doesn't like if the command execute has a non-zero exit code, and the
+'[ -f "$file" ] && install' line will return a non-zero exit code if the
+file doesn't exist (despite of 'set -e' ignoring the exit status of the
+'&&' line).
+
+Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
+---
+ qemu/Makefile |    5 +++--
+ 1 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/qemu/Makefile b/qemu/Makefile
+index 7a79b9d..78b4d16 100644
+--- a/qemu/Makefile
++++ b/qemu/Makefile
+@@ -242,8 +242,9 @@ endif
+ 		pxe-rtl8139.bin pxe-pcnet.bin pxe-e1000.bin extboot.bin \
+ 		bamboo.dtb; \
+         do \
+-		[ -f $(SRC_PATH)/pc-bios/$$x ] && \
+-		$(INSTALL) -m 644 $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \
++		if [ -f $(SRC_PATH)/pc-bios/$$x ];then \
++			$(INSTALL) -m 644 $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \
++		fi; \
+ 	done
+ ifndef CONFIG_WIN32
+ 	mkdir -p "$(DESTDIR)$(datadir)/keymaps"
+-- 
+1.5.5.GIT
+


Index: kvm.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kvm/devel/kvm.spec,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -r1.71 -r1.72
--- kvm.spec	15 Sep 2008 21:07:56 -0000	1.71
+++ kvm.spec	22 Oct 2008 14:07:17 -0000	1.72
@@ -1,7 +1,7 @@
 Summary: Kernel-based Virtual Machine
 Name: kvm
 Version: 74
-Release: 4%{?dist}
+Release: 5%{?dist}
 License: GPLv2+ and LGPLv2+
 Group: Development/Tools
 URL: http://%{name}.sf.net
@@ -12,6 +12,7 @@
 Patch1: %{name}-62-block-rw-range-check.patch
 Patch2: %{name}-74-pxe-boot.patch
 Patch3: %{name}-74-page-find.patch
+Patch4: %{name}-fix-pc-bios-make-install-missing-files.patch
 # patches from upstream qemu
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: SDL-devel
@@ -28,6 +29,10 @@
 ExclusiveArch: %{ix86} x86_64 ia64
 Requires: initscripts >= 8.08-1
 
+# We use the roms on /usr/share/etherboot
+Requires: etherboot-roms-kvm
+
+
 %description
 KVM (for Kernel-based Virtual Machine) is a full virtualization solution
 for Linux on x86 hardware.
@@ -42,9 +47,12 @@
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
+%patch4 -p1
+# we must not use any of the binaries from the qemu/pc-bios/ directory,
+# as they don't have the corresponding sources shipped with them
+rm -f qemu/pc-bios/*
 
 %build
-
 # systems like rhel build system does not have a recent enough linker so 
 # --build-id works. this option is used fedora 8 onwards for giving info
 # to the debug packages.
@@ -64,6 +72,12 @@
 ./configure --with-patched-kernel --kerneldir=$(pwd)/kernel --prefix=%{_prefix} --qemu-ldflags=$qemuldflags \
 --audio-drv-list=oss,alsa
 
+# build the bios, and fix it's makefile
+sed -i 's/gcc -m32/gcc/' bios/Makefile
+make bios
+
+make vgabios
+
 # we can't use RPM_OPT_FLAGS for the same reasons as qemu (#208026) for the
 # qemu bits.  so let's set it for the other pieces.  this requires some
 # manual keeping up of what is in the kvm tree.
@@ -71,9 +85,6 @@
 echo "CFLAGS=$RPM_OPT_FLAGS" >> user/config.mak
 make %{?_smp_mflags}
 
-# build the bios, and fix it's makefile
-sed -i 's/gcc -m32/gcc/' bios/Makefile
-make bios
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -100,6 +111,21 @@
 mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/modules
 install -m 0755 %{SOURCE1} $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/modules/kvm.modules
 
+
+# the pxe etherboot images will be symlinks to the images on
+# /usr/share/etherboot, as KVM doesn't know how to look
+# for other paths, yet.
+pxe_link() {
+  ln -s ../etherboot/$2.rom %{buildroot}/usr/share/kvm/pxe-$1.bin
+}
+
+pxe_link e1000 e1000-82542
+pxe_link ne2k_pci ne
+pxe_link pcnet pcnet32
+pxe_link rtl8139 rtl8139
+pxe_link virtio virtio-net
+
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -112,6 +138,11 @@
 %{_sysconfdir}/sysconfig/modules/%{name}.modules
 
 %changelog
+* Tue Oct 22 2008 Glauber Costa <glommer at redhat.com> - 74-5
+- Remove all prebuilt qemu/pc-bios binaries before building
+- Use symlinks to etherboot files for the pxe roms
+- Based on the work by Eduardo Habkost
+
 * Mon Sep 15 2008 Glauber Costa <glommer at redhat.com> - 74-4
 - fix page_find out of bounds access - #462380
 




More information about the scm-commits mailing list