Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 294828 Details for
Bug 248028
serial console capabilities are not detected, just forced to vt100-nev
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
patch for inclusion of term=value argument.
init.diff (text/x-patch), 3.00 KB, created by
Joel Andres Granados
on 2008-02-13 20:06:33 UTC
(
hide
)
Description:
patch for inclusion of term=value argument.
Filename:
MIME Type:
Creator:
Joel Andres Granados
Created:
2008-02-13 20:06:33 UTC
Size:
3.00 KB
patch
obsolete
>diff --git a/loader2/init.c b/loader2/init.c >index e16a8bd..a68ad94 100644 >--- a/loader2/init.c >+++ b/loader2/init.c >@@ -133,6 +133,7 @@ void unmountFilesystems(void); > void disableSwap(void); > void shutDown(int noKill, int doReboot, int doPowerOff); > static int getNoKill(void); >+static char *getTermDef(void); > struct termios ts; > > static int mystrstr(char *str1, char *str2) { >@@ -341,8 +342,7 @@ static void doklog(char * fn) { > > static int setupTerminal(int fd) { > struct winsize winsize; >- int fdn, len; >- char buf[65535]; >+ char *termdef; > > if (ioctl(fd, TIOCGWINSZ, &winsize)) { > printf("failed to get winsize"); >@@ -357,17 +357,32 @@ static int setupTerminal(int fd) { > fatal_error(1); > } > >- /* use the no-advanced-video vt100 definition */ >- env[ENV_TERM] = "TERM=vt100-nav"; >- >- /* unless the user specifies that they want utf8 */ >- if ((fdn = open("/proc/cmdline", O_RDONLY, 0)) != -1) { >- len = read(fdn, buf, sizeof(buf) - 1); >- close(fdn); >- if (len > 0 && mystrstr(buf, "utf8")) >- env[ENV_TERM] = "TERM=vt100"; >+ /* >+ * We will set the TERM varirable. If the argument is not set we >+ * fall back to vt100-nav. If both term and utf8 are set we will >+ * go with the term argument. >+ */ >+ termdef = getTermDef(); >+ >+ /* >+ * We must prevent the corruption of this argument. If the user >+ * sets this arg to something that is not sane, we should provide >+ * the default value. Additionally, to add more vts, simply add >+ * to the list. >+ */ >+ int i, inAllowedVts = 0; >+ char * allowedVts[] = { "TERM=vt100", "TERM=vt220", "TERM=vt520" , NULL }; >+ for (i=0 ; allowedVts[i] != NULL ; i++ ){ >+ if ( strcmp(allowedVts[i], termdef) == 0 ){ >+ inAllowedVts = 1; >+ break; >+ } > } > >+ if (termdef == '\0' || !inAllowedVts ) >+ env[ENV_TERM] = "TERM=vt100-nav"; >+ else >+ env[ENV_TERM] = termdef; > return 0; > } > >@@ -455,6 +470,36 @@ static int getNoKill(void) { > return 0; > } > >+static char *getTermDef(void) { >+ int fd, len; >+ char buf[1024]; >+ char *retVal; >+ >+ /* Read Command line */ >+ if ((fd = open("/proc/cmdline", O_RDONLY,0)) > 0) { >+ len = read(fd, buf, sizeof(buf) - 1); >+ close(fd); >+ } >+ >+ /* >+ * Apparently the carriage return at the end of the variable might >+ * be an issue. So we set the delimitors in strtok accordingly. >+ */ >+ for ( retVal = strtok(buf, " ") ; retVal != '\0' ; retVal = strtok(NULL, " \n")) { >+ if( strncmp( retVal, "term=", 5) == 0 ){ >+ /* >+ * We need the whole argument "term=value". The only thing left >+ * to do is put the term part in uppercase. >+ */ >+ int i; >+ for ( i=0 ; i<4 ; i++ ) >+ retVal[i] = toupper(retVal[i]); >+ break; >+ } >+ } >+ return retVal; >+} >+ > static int getInitPid(void) { > int fd = 0, pid = -1, ret; > char * buf = calloc(1, 10);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 248028
: 294828