On Tue, May 11, 2010 at 06:15:05PM +0100, Matthew Booth wrote:
RHEL 3 has XF86Config instead of xorg.conf. The configs are
sufficiently similar
to be matched by the same augeas lens, so switch based on whichever is present.
---
lib/Sys/VirtV2V/GuestOS/RedHat.pm | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/lib/Sys/VirtV2V/GuestOS/RedHat.pm b/lib/Sys/VirtV2V/GuestOS/RedHat.pm
index 1920468..7c41ff6 100644
--- a/lib/Sys/VirtV2V/GuestOS/RedHat.pm
+++ b/lib/Sys/VirtV2V/GuestOS/RedHat.pm
@@ -173,6 +173,17 @@ sub _init_augeas
"/boot/grub/menu.lst");
}
+ # If we have XF86Config instead of xorg.conf, use that instead.
+ if (! $g->exists('/etc/X11/xorg.conf') &&
+ $g->exists('/etc/X11/XF86Config'))
+ {
+ $g->aug_set('/augeas/load/Xorg/incl[last()+1]',
+ '/etc/X11/XF86Config');
+ $self->{xorg} = '/etc/X11/XF86Config';
+ } else {
+ $self->{xorg} = '/etc/X11/xorg.conf';
+ }
+
# Make augeas pick up the new configuration
$g->aug_load();
};
@@ -287,7 +298,7 @@ sub update_display_driver
# Update the display driver if it exists
eval {
foreach my $path
- ($g->aug_match('/files/etc/X11/xorg.conf/Device/Driver'))
+
($g->aug_match('/files'.$self->{xorg}.'/Device/Driver'))
{
$g->aug_set($path, $driver);
}
ACK.
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines. Boot with a
live CD or over the network (PXE) and turn machines into Xen guests.
http://et.redhat.com/~rjones/virt-p2v