FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 02-09-2011, 03:43 PM
Ales Kozumplik
 
Default For x86_64 init must manually load virtio_console.

On i386 the module is built-in. Without the module virtio logging doesn't
work.

Resolves: rhbz#672527
---
loader/init.c | 35 ++++++++++++++++++++++++++---------
scripts/mk-images | 2 +-
2 files changed, 27 insertions(+), 10 deletions(-)

diff --git a/loader/init.c b/loader/init.c
index fb18113..7f49256 100644
--- a/loader/init.c
+++ b/loader/init.c
@@ -51,6 +51,7 @@
#include <glib.h>

#include "init.h"
+#include "../pyanaconda/isys/log.h"
#include "copy.h"
#include "devt.h"
#include "devices.h"
@@ -345,24 +346,40 @@ static int getSyslog(gchar **addr, gchar **virtiolog) {

if (onQEMU()) {
/* look for virtio-serial logging on a QEMU machine. */
- printf("Loading virtio_pci module... ");
+ printf("Loading virtio modules.
");
+
+ if (mlLoadModule("virtio_console", NULL)) {
+ /* not really an error: it is built in on i386 */
+ printf("Can't load virtio_console module (built-in?).
");
+ }
+
if (mlLoadModule("virtio_pci", NULL)) {
+ /* this is necessary though */
fprintf(stderr, "Error loading virtio_pci module.
");
- sleep(5);
} else {
- printf("done.
");
- }
- if (!access(VIRTIO_PORT, W_OK)) {
- /* that means we really have virtio-serial logging */
- *virtiolog = VIRTIO_PORT;
- ++ret;
+ int wait = 0;
+ while (access(VIRTIO_PORT, W_OK) && wait < 3) {
+ /* wait up to 3 seconds for the port to appear */
+ sleep(1);
+ ++wait;
+ }
+ if (access(VIRTIO_PORT, W_OK)) {
+ /* still can't see */
+ fprintf(stderr, "Not initializing virtio logging "
+ "though we are on a kvm virt machine "
+ "(waited for %d seconds).
", wait);
+ } else {
+ /* that means we really have virtio-serial logging */
+ *virtiolog = VIRTIO_PORT;
+ ++ret;
+ }
}
}

return ret;
}

-/*
+/*
* Use anything you can find to determine if we are running on a QEMU virtual
* machine.
*/
diff --git a/scripts/mk-images b/scripts/mk-images
index 7d842f4..5f239fe 100755
--- a/scripts/mk-images
+++ b/scripts/mk-images
@@ -100,7 +100,7 @@ fi
TOPDIR=$(cd $TOPDIR; pwd)

# modules that are needed. this is the generic "needed for every arch" stuff
-COMMONMODS="fat vfat nfs sunrpc lockd floppy cramfs loop edd pcspkr squashfs ipv6 8021q virtio_pci netconsole"
+COMMONMODS="fat vfat nfs sunrpc lockd floppy cramfs loop edd pcspkr squashfs ipv6 8021q virtio_pci virtio_console netconsole"
UMSMODS="ums-jumpshot ums-datafab ums-freecom ums-usbat ums-sddr55 ums-onetouch ums-alauda ums-karma ums-sddr09 ums-cypress"
USBMODS="$UMSMODS ohci-hcd uhci-hcd ehci-hcd usbhid mousedev usb-storage sd_mod sr_mod ub appletouch bcm5974"
FIREWIREMODS="ohci1394 sbp2 fw-ohci fw-sbp2 firewire-sbp2 firewire-ohci"
--
1.7.3.3

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 09:33 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org