augeas now supports securetty. This resolves a failure when securetty isn't
present in the guest.
Resolves RHBZ#639413
---
lib/Sys/VirtV2V/Converter/Linux.pm | 14 ++++----------
1 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/lib/Sys/VirtV2V/Converter/Linux.pm
b/lib/Sys/VirtV2V/Converter/Linux.pm
index b2eb774..22aa03f 100644
--- a/lib/Sys/VirtV2V/Converter/Linux.pm
+++ b/lib/Sys/VirtV2V/Converter/Linux.pm
@@ -218,20 +218,14 @@ sub _configure_console
}
# Replace any mention of xvc0 or hvc0 in /etc/securetty with ttyS0
- my $size = 0;
- my @lines = ();
+ foreach my $augpath ($g->aug_match('/files/etc/securetty/*')) {
+ my $tty = $g->aug_get($augpath);
- foreach my $line ($g->read_lines('/etc/securetty')) {
- if($line eq "xvc0" || $line eq "hvc0") {
- $line = "ttyS0";
+ if($tty eq "xvc0" || $tty eq "hvc0") {
+ $g->aug_set($augpath, 'ttyS0');
}
-
- $size += length($line) + 1;
- push(@lines, $line);
}
- $g->write_file('/etc/securetty', join("\n",
@lines)."\n", $size);
-
# Update any kernel console lines
foreach my $augpath
($g->aug_match("/files/boot/grub/menu.lst/title/kernel/console"))
--
1.7.2.3
Richard W.M. Jones
2010-Oct-13 14:30 UTC
[Libguestfs] [PATCH] Use augeas to update securetty
On Wed, Oct 13, 2010 at 11:52:56AM +0100, Matthew Booth wrote:> augeas now supports securetty. This resolves a failure when securetty isn't > present in the guest.ACK. We need to update Augeas, or add a lens? Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones New in Fedora 11: Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 70 libraries supprt'd http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw