diff options
author | Jeremy Katz <katzj@redhat.com> | 2004-09-13 15:12:37 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2004-09-13 15:12:37 +0000 |
commit | 010819b761d5ff458ec0b075bff3ea80e20d21c9 (patch) | |
tree | 09a66aaafb18581d342d19ed804fbf8febc70de7 | |
parent | 01308c1183ca820a00dab84b0c11e3b29f97bf4b (diff) | |
download | anaconda-010819b761d5ff458ec0b075bff3ea80e20d21c9.tar.gz anaconda-010819b761d5ff458ec0b075bff3ea80e20d21c9.tar.xz anaconda-010819b761d5ff458ec0b075bff3ea80e20d21c9.zip |
add flags.virtpconsole to be used with virtual physical consoles like
hvc (ppc), hvsi (ppc), and altix (ia64). set up in init and carried
throughout.
(#131091, #130906, #131301)
-rwxr-xr-x | anaconda | 5 | ||||
-rw-r--r-- | flags.py | 5 | ||||
-rw-r--r-- | loader2/init.c | 5 | ||||
-rw-r--r-- | loader2/kbd.c | 2 | ||||
-rw-r--r-- | loader2/lang.c | 2 | ||||
-rw-r--r-- | loader2/loader.c | 14 | ||||
-rw-r--r-- | loader2/loader.h | 3 | ||||
-rw-r--r-- | text.py | 6 | ||||
-rw-r--r-- | textw/keyboard_text.py | 2 | ||||
-rw-r--r-- | textw/language_text.py | 2 |
10 files changed, 32 insertions, 14 deletions
@@ -395,7 +395,8 @@ try: 'lang=', 'keymap=', 'kbdtype=', 'module=', 'class=', 'expert', 'serial', 'lowres', 'nofb', 'rescue', 'nomount', 'autostep', 'resolution=', 'skipddc', 'noselinux', 'selinux', - 'vnc', 'vncconnect=', 'vnc=', 'cmdline', 'headless']) + 'vnc', 'vncconnect=', 'vnc=', 'cmdline', 'headless', + 'virtpconsole=']) except TypeError, msg: sys.stderr.write("Error %s\n:" % msg) sys.exit(-1) @@ -538,6 +539,8 @@ for n in args: display_mode = 'c' elif (str == '--kbdtype'): kbdtype = arg + elif (str == '--virtpconsole'): + flags.virtpconsole = arg elif (str == '--headless'): isHeadless = 1 elif (str == '--vnc'): @@ -40,6 +40,11 @@ class Flags: self.__dict__['flags']['autoscreenshot'] = 0 self.__dict__['flags']['usevnc'] = 0 self.__dict__['flags']['selinux'] = SELINUX_DEFAULT + # for non-physical consoles like some ppc and sgi altix, + # we need to preserve the console device and not try to + # do things like bogl on them. this preserves what that + # device is + self.__dict__['flags']['virtpconsole'] = None # determine if selinux is enabled or not diff --git a/loader2/init.c b/loader2/init.c index bc04ced32..be9f2abed 100644 --- a/loader2/init.c +++ b/loader2/init.c @@ -433,6 +433,7 @@ int main(int argc, char **argv) { int doReboot = 0; int doShutdown =0; int isSerial = 0; + char * console = NULL; int noKill = 0; char * argvc[15]; char ** argvp = argvc; @@ -527,6 +528,7 @@ int main(int argc, char **argv) { printf("anaconda installer init version %s using %s as console\n", VERSION, consoles[i]); isSerial = 3; + console = strdup(consoles[i]); break; } } @@ -659,7 +661,8 @@ int main(int argc, char **argv) { /* child */ *argvp++ = "/sbin/loader"; if (isSerial == 3) { - *argvp++ = "--physconsole"; + *argvp++ = "--virtpconsole"; + *argvp++ = console; } *argvp++ = NULL; diff --git a/loader2/kbd.c b/loader2/kbd.c index 5c4d05f7f..41a006e77 100644 --- a/loader2/kbd.c +++ b/loader2/kbd.c @@ -49,7 +49,7 @@ int chooseKeyboard(char ** keymap, char ** kbdtypep, int flags) { return LOADER_NOOP; #endif - if (FL_SERIAL (flags)) return LOADER_NOOP; + if (FL_SERIAL (flags) || FL_VIRTPCONSOLE(flags)) return LOADER_NOOP; #ifdef __sparc__ { diff --git a/loader2/lang.c b/loader2/lang.c index ce4fcaaf9..d1efb1215 100644 --- a/loader2/lang.c +++ b/loader2/lang.c @@ -229,7 +229,7 @@ static int setupLanguage(int choice, int flags) { /* load the language only if it is displayable. if they're using * a serial console or iSeries vioconsole, we hope it's smart enough */ if ((!strcmp(languages[choice].font, "bterm") && !FL_SERIAL(flags) && - !isVioConsole() && startBterm(flags)) || + !FL_VIRTPCONSOLE(flags) && !isVioConsole() && startBterm(flags)) || !strcmp(languages[choice].font, "none")) { if (FL_KICKSTART(flags)) return 0; diff --git a/loader2/loader.c b/loader2/loader.c index f12e5d5cf..83fcd6213 100644 --- a/loader2/loader.c +++ b/loader2/loader.c @@ -1102,15 +1102,14 @@ int main(int argc, char ** argv) { char * ksFile = NULL; int testing = 0; int mediacheck = 0; - int physcon = 0; + char * virtpcon = NULL; poptContext optCon; struct poptOption optionTable[] = { { "cmdline", '\0', POPT_ARG_STRING, &cmdLine, 0 }, { "ksfile", '\0', POPT_ARG_STRING, &ksFile, 0 }, { "test", '\0', POPT_ARG_NONE, &testing, 0 }, { "mediacheck", '\0', POPT_ARG_NONE, &mediacheck, 0}, - /* FIXME: this is a temporary hack to work around #130906 */ - { "physconsole", '\0', POPT_ARG_NONE, &physcon, 0 }, + { "virtpconsole", '\0', POPT_ARG_STRING, &virtpcon, 0 }, { 0, 0, 0, 0, 0 } }; @@ -1154,7 +1153,8 @@ int main(int argc, char ** argv) { /* The fstat checks disallows serial console if we're running through a pty. This is handy for Japanese. */ fstat(0, &sb); - if (major(sb.st_rdev) != 3 && major(sb.st_rdev) != 136 && (physcon != 1)){ + if (major(sb.st_rdev) != 3 && major(sb.st_rdev) != 136 && + (virtpcon != NULL)){ if ((ioctl (0, TIOCLINUX, &twelve) < 0) && (ioctl(0, TIOCGSERIAL, &si) != -1)) flags |= LOADER_FLAGS_SERIAL; @@ -1163,6 +1163,7 @@ int main(int argc, char ** argv) { if (testing) flags |= LOADER_FLAGS_TESTING; if (mediacheck) flags |= LOADER_FLAGS_MEDIACHECK; if (ksFile) flags |= LOADER_FLAGS_KICKSTART; + if (virtpcon) flags |= LOADER_FLAGS_VIRTPCONSOLE; /* uncomment to send mac address in ks=http:/ header by default*/ flags |= LOADER_FLAGS_KICKSTART_SEND_MAC; @@ -1460,6 +1461,11 @@ int main(int argc, char ** argv) { *argptr++ = loaderData.ksFile; } + if (FL_VIRTPCONSOLE(flags)) { + *argptr++ = "--virtpconsole"; + *argptr++ = virtpcon; + } + if ((loaderData.lang) && !FL_NOPASS(flags)) { *argptr++ = "--lang"; *argptr++ = loaderData.lang; diff --git a/loader2/loader.h b/loader2/loader.h index c4012c16e..352d7013f 100644 --- a/loader2/loader.h +++ b/loader2/loader.h @@ -35,6 +35,7 @@ #define LOADER_FLAGS_GRAPHICAL (1 << 29) #define LOADER_FLAGS_HALT (1 << 13) #define LOADER_FLAGS_SELINUX (1 << 14) +#define LOADER_FLAGS_VIRTPCONSOLE (1 << 15) #define FL_TESTING(a) ((a) & LOADER_FLAGS_TESTING) #define FL_EXPERT(a) ((a) & LOADER_FLAGS_EXPERT) @@ -66,7 +67,7 @@ #define FL_CMDLINE(a) ((a) & LOADER_FLAGS_CMDLINE) #define FL_HALT(a) ((a) & LOADER_FLAGS_HALT) #define FL_SELINUX(a) ((a) & LOADER_FLAGS_SELINUX) - +#define FL_VIRTPCONSOLE(a) ((a) & LOADER_FLAGS_VIRTPCONSOLE) void startNewt(int flags); void stopNewt(); @@ -390,8 +390,8 @@ class InstallInterface: oldlang = None if (flags.setupFilesystems and (id.instLanguage.getFontFile(id.instLanguage.getCurrent()) == "bterm") - and not isys.isPsudoTTY(0) - and not flags.serial): + and not flags.serial and not flags.virtpconsole + and not isys.isPsudoTTY(0) and not isys.isVioConsole()): log("starting bterm") rc = 1 try: @@ -421,7 +421,7 @@ class InstallInterface: if DEBUG or flags.test: self.screen.suspendCallback(debugSelf, self.screen) - if flags.serial or isys.isPsudoTTY(0) or isys.isVioConsole(): + if flags.serial or flags.virtpconsole or isys.isPsudoTTY(0) or isys.isVioConsole(): self.screen.suspendCallback(spawnShell, self.screen) # clear out the old root text by writing spaces in the blank diff --git a/textw/keyboard_text.py b/textw/keyboard_text.py index 0e65068ff..dd7fa0327 100644 --- a/textw/keyboard_text.py +++ b/textw/keyboard_text.py @@ -22,7 +22,7 @@ from rhpl.translate import _ class KeyboardWindow: def __call__(self, screen, defaultByLang, kbd): - if flags.serial: + if flags.serial or flags.virtpconsole: return INSTALL_NOOP keyboards = kbd.modelDict.keys() keyboards.sort () diff --git a/textw/language_text.py b/textw/language_text.py index 1b68057df..19ffd9934 100644 --- a/textw/language_text.py +++ b/textw/language_text.py @@ -56,8 +56,8 @@ class LanguageWindow: if (flags.setupFilesystems and instLanguage.getFontFile(choice) == "bterm" + and not flags.serial and not flags.virtpconsole and not isys.isPsudoTTY(0) - and not flags.serial and not isys.isVioConsole()): # bterm to the rescue... have to shut down the screen and # create a new one, though (and do a sleep) |