[f16-branch 4/5] loader: set virtpconsole flag (not serial!) when using virt consoles

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

 



More untangling of previous refactoring work. Virtualized systems with
fancy consoles usually end up with 'console=XXX' on the boot
commandline. This gets passed along through the 'virtpconsole' flag, so
set it appropriately in loader so we can use it inside anaconda.
---
 loader/loader.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/loader/loader.c b/loader/loader.c
index 56c0718..69f1e4e 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -1936,6 +1936,7 @@ int main(int argc, char ** argv) {
     struct loaderData_s loaderData;
     struct termios orig_cmode;
     int orig_flags;
+    char *virtpcon = NULL;
 
     char *path, *fmt;
     GSList *dd, *dditer;
@@ -2008,8 +2009,17 @@ int main(int argc, char ** argv) {
 
     logMessage(INFO, "anaconda version %s on %s starting", VERSION, getProductArch());
 
-    if (init_serial(&orig_cmode, &orig_flags, cmdline))
-        flags |= LOADER_FLAGS_SERIAL;
+    if (init_serial(&orig_cmode, &orig_flags, cmdline)) {
+        /* init_serial replaces fd(0,1,2) with one of three things:
+         * /dev/ttyS0, /dev/console, or a fancy virtual console. */
+        virtpcon = ttyname(0);
+        if (virtpcon != NULL) {
+            if (!strcmp(virtpcon, "/dev/ttyS0") || !strcmp(virtpcon, "/dev/console"))
+                flags |= LOADER_FLAGS_SERIAL;
+            else
+                flags |= LOADER_FLAGS_VIRTPCONSOLE;
+        }
+    }
 
     if ((FL_SERIAL(flags) || FL_VIRTPCONSOLE(flags)) && 
         !hasGraphicalOverride()) {
@@ -2338,12 +2348,10 @@ int main(int argc, char ** argv) {
         else if (FL_SELINUX(flags))
             *argptr++ = "--selinux";
 
-        /*
         if (FL_VIRTPCONSOLE(flags)) {
             *argptr++ = "--virtpconsole";
             *argptr++ = virtpcon;
         }
-        */
 
         if (loaderData.updatessrc && FL_UPDATES(flags)) {
             *argptr++ = "--updates";
-- 
1.7.7.4

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


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux