[Fedora-xen] fedora-xen-ia64 integration, step 1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Dave and Juan,

I'd like to get started on the path to integrating the fedora-xen-ia64
work into fedora.  There are a number of pieces that I'll be trying to
pull together over the next few days.  The biggest/hardest piece is
the kernel rpm.

I've split the changes into two parts:
    1. generic fixes and enablement
    2. ia64 xen integration

This mail contains the first part.  For the second part, I'd like to
request that Juan updates his patch to the most recent xen-unstable
first.  Then I'll work on making it build on ia64 and send back
whatever changes are necessary, including the ia64-xen[0U] configs.

Once the kernel rpm is working, it should be a relatively simple
matter to make the remainder of modifications to "turn on" xen-ia64.
Sound reasonable?

Regards,
Aron

--
This patch makes the following changes to the kernel specfile:

    - abstract xenlinux build using xen_flags, xen_target and
      xen_image instead of assuming x86 behavior

    - add xen_* overrides to %ifarch ia64, won't be used until
      buildxen is flipped on for ia64

    - run the xen-mkbuildtree-pre hook following applying the xen
      patch.  This touches a couple files on ia64 but doesn't
      interfere with any patching down the line.  (I and others have
      been submitting patches to xen-ia64-devel and xen-devel to
      further reduce its function, but it should be harmless as-is.)

    - update numerous hardcoded references to /boot to use
      %{image_install_path} instead.  But make an exception for the
      xenU kernels which never need to be available for system
      boot.

    - build the hypervisor with %{?_smp_mflags} (it works fine)

Signed-off-by: Aron Griffis <aron@xxxxxx>

--- kernel-2.6.spec.orig	2006-06-01 19:12:59.000000000 -0400
+++ kernel-2.6.spec	2006-06-02 11:18:33.000000000 -0400
@@ -32,6 +32,9 @@
 %define xen_version 20060524
 %define make_target bzImage
 %define kernel_image x86
+%define xen_flags verbose=y debug=y crash_debug=y
+%define xen_target vmlinuz
+%define xen_image vmlinuz
 
 %define KVERREL %{PACKAGE_VERSION}-%{PACKAGE_RELEASE}
 
@@ -127,11 +130,15 @@
 %endif
 
 %ifarch ia64
-%define all_arch_configs $RPM_SOURCE_DIR/kernel-%{kversion}-ia64.config
+%define all_arch_configs $RPM_SOURCE_DIR/kernel-%{kversion}-ia64*.config
 %define image_install_path boot/efi/EFI/redhat
 %define signmodules 1
 %define make_target compressed
 %define kernel_image vmlinux.gz
+# ia64 doesn't building with debug=y at the moment
+%define xen_flags verbose=y crash_debug=y
+%define xen_target compressed
+%define xen_image vmlinux.gz
 %endif
 
 #
@@ -834,6 +841,15 @@
 # Delete the rest of the backup files, they just confuse the build later
 find -name "*.p.xen" | xargs rm -f
 
+# Run the xen-mkbuildtree-pre hook, if it exists for this architecture.
+# Hopefully this is kept clean (or non-existent) so that patches aren't confused
+# further down the line.  Presently it's used only for ia64, and only for files
+# that we aren't interested in patching.
+if [[ -f "arch/%{_arch}/xen-mkbuildtree-pre" ]]; then
+    chmod +x arch/%{_arch}/xen-mkbuildtree-pre
+    arch/%{_arch}/xen-mkbuildtree-pre
+fi
+
 #
 # Xen includes a patch which moves the vsyscall fixmap into a user-space VA,
 # freeing user-space from reliance on an absolute fixmap area and so allowing
@@ -1157,7 +1173,13 @@
     mkdir -p $RPM_BUILD_ROOT/%{image_install_path}
     install -m 644 .config $RPM_BUILD_ROOT/boot/config-$KernelVer
     install -m 644 System.map $RPM_BUILD_ROOT/boot/System.map-$KernelVer
-    cp $KernelImage $RPM_BUILD_ROOT/%{image_install_path}/vmlinuz-$KernelVer
+    if [[ "$Flavour" == *xenU* ]]; then
+      # xenU kernels should always install to /boot
+      # because they're never needed for system boot
+      cp $KernelImage $RPM_BUILD_ROOT/boot/vmlinuz-$KernelVer
+    else
+      cp $KernelImage $RPM_BUILD_ROOT/%{image_install_path}/vmlinuz-$KernelVer
+    fi
     if [ -f arch/$Arch/boot/zImage.stub ]; then
       cp arch/$Arch/boot/zImage.stub $RPM_BUILD_ROOT/%{image_install_path}/zImage.stub-$KernelVer || :
     fi
@@ -1293,15 +1315,15 @@
 %if %{includexen}
 %if %{buildxen}
   cd xen
-  mkdir -p $RPM_BUILD_ROOT/%{image_install_path}
+  mkdir -p $RPM_BUILD_ROOT/%{image_install_path} $RPM_BUILD_ROOT/boot
 %if %{buildxenPAE}
-  make debug=y verbose=y crash_debug=y pae=y
-  install -m 644 xen.gz $RPM_BUILD_ROOT/boot/xen.gz-%{KVERREL}-PAE
+  make %{xen_flags} pae=y
+  install -m 644 xen.gz $RPM_BUILD_ROOT/%{image_install_path}/xen.gz-%{KVERREL}-PAE
   install -m 755 xen-syms $RPM_BUILD_ROOT/boot/xen-syms-%{KVERREL}-PAE
   make clean
 %endif
-  make debug=y verbose=y crash_debug=y
-  install -m 644 xen.gz $RPM_BUILD_ROOT/boot/xen.gz-%{KVERREL}
+  make %{?_smp_mflags} %{xen_flags}
+  install -m 644 xen.gz $RPM_BUILD_ROOT/%{image_install_path}/xen.gz-%{KVERREL}
   install -m 755 xen-syms $RPM_BUILD_ROOT/boot/xen-syms-%{KVERREL}
   cd ..
 %endif
@@ -1310,31 +1332,31 @@
 cd linux-%{kversion}.%{_target_cpu}
 
 %if %{buildup}
-BuildKernel %make_target %kernel_image
+BuildKernel %{make_target} %{kernel_image}
 %endif
 
 %if %{buildpae}
-BuildKernel %make_target %kernel_image PAE
+BuildKernel %{make_target} %{kernel_image} PAE
 %endif
 
 %if %{buildsmp}
-BuildKernel %make_target %kernel_image smp
+BuildKernel %{make_target} %{kernel_image} smp
 %endif
 
 %if %{includexen}
 %if %{buildxenPAE}
-BuildKernel vmlinuz vmlinuz xen0-PAE
-BuildKernel vmlinuz vmlinuz xenU-PAE
+BuildKernel %{xen_target} %{xen_image} xen0-PAE
+BuildKernel %{xen_target} %{xen_image} xenU-PAE
 %endif
 
 %if %{buildxen}
-BuildKernel vmlinuz vmlinuz xen0
-BuildKernel vmlinuz vmlinuz xenU
+BuildKernel %{xen_target} %{xen_image} xen0
+BuildKernel %{xen_target} %{xen_image} xenU
 %endif
 %endif
 
 %if %{buildkdump}
-BuildKernel %make_target %kernel_image kdump
+BuildKernel %{make_target} %{kernel_image} kdump
 %endif
 
 ###
@@ -1443,7 +1465,7 @@
 
 %post xen0
 [ ! -x /usr/sbin/module_upgrade ] || /usr/sbin/module_upgrade %{rpmversion}-%{release}-xen0
-/sbin/new-kernel-pkg --package kernel-xen0 --mkinitrd --depmod --install --multiboot=/boot/xen.gz-%{KVERREL} %{KVERREL}xen0
+/sbin/new-kernel-pkg --package kernel-xen0 --mkinitrd --depmod --install --multiboot=/%{image_install_path}/xen.gz-%{KVERREL} %{KVERREL}xen0
 [ ! -x /sbin/ldconfig ] || /sbin/ldconfig -X
 
 %post xen0-devel
@@ -1469,7 +1491,7 @@
 
 %post xen0-PAE
 [ ! -x /usr/sbin/module_upgrade ] || /usr/sbin/module_upgrade %{rpmversion}-%{release}-xen0-PAE
-/sbin/new-kernel-pkg --package kernel-xen0-PAE --mkinitrd --depmod --install --multiboot=/boot/xen.gz-%{KVERREL}-PAE %{KVERREL}xen0-PAE
+/sbin/new-kernel-pkg --package kernel-xen0-PAE --mkinitrd --depmod --install --multiboot=/%{image_install_path}/xen.gz-%{KVERREL}-PAE %{KVERREL}xen0-PAE
 [ ! -x /sbin/ldconfig ] || /sbin/ldconfig -X
 
 %post xen0-PAE-devel
@@ -1611,7 +1633,7 @@
 /%{image_install_path}/vmlinuz-%{KVERREL}xen0
 /boot/System.map-%{KVERREL}xen0
 /boot/config-%{KVERREL}xen0
-/boot/xen.gz-%{KVERREL}
+/%{image_install_path}/xen.gz-%{KVERREL}
 /boot/xen-syms-%{KVERREL}
 %dir /lib/modules/%{KVERREL}xen0
 /lib/modules/%{KVERREL}xen0/kernel
@@ -1628,7 +1650,7 @@
 
 %files xenU
 %defattr(-,root,root)
-/%{image_install_path}/vmlinuz-%{KVERREL}xenU
+/boot/vmlinuz-%{KVERREL}xenU
 /boot/System.map-%{KVERREL}xenU
 /boot/config-%{KVERREL}xenU
 %dir /lib/modules/%{KVERREL}xenU
@@ -1651,7 +1673,7 @@
 /%{image_install_path}/vmlinuz-%{KVERREL}xen0-PAE
 /boot/System.map-%{KVERREL}xen0-PAE
 /boot/config-%{KVERREL}xen0-PAE
-/boot/xen.gz-%{KVERREL}-PAE
+/%{image_install_path}/xen.gz-%{KVERREL}-PAE
 /boot/xen-syms-%{KVERREL}-PAE
 %dir /lib/modules/%{KVERREL}xen0-PAE
 /lib/modules/%{KVERREL}xen0-PAE/kernel
@@ -1668,7 +1690,7 @@
 
 %files xenU-PAE
 %defattr(-,root,root)
-/%{image_install_path}/vmlinuz-%{KVERREL}xenU-PAE
+/boot/vmlinuz-%{KVERREL}xenU-PAE
 /boot/System.map-%{KVERREL}xenU-PAE
 /boot/config-%{KVERREL}xenU-PAE
 %dir /lib/modules/%{KVERREL}xenU-PAE

Attachment: pgpQF5362GuFZ.pgp
Description: PGP signature


[Index of Archives]     [Fedora General]     [Fedora Music]     [Linux Kernel]     [Fedora Desktop]     [Fedora Directory]     [PAM]     [Big List of Linux Books]     [Gimp]     [Yosemite News]

  Powered by Linux