彻底屏蔽linux启动打印信息
2013-06-03 15:43
330 查看
static int __init console_setup(char *str)
{
char buf[sizeof(console_cmdline[0].name) + 4]; /* 4 for index */
char *s, *options, *brl_options = NULL;
int idx;
//weed stop printk to console
// printk("weed test console setup %s\r\n",str);
str="/dev/null";//屏蔽掉init启动信息,grub.cfg里加console=/dev/null
#ifdef CONFIG_A11Y_BRAILLE_CONSOLE
if (!memcmp(str, "brl,", 4)) {
brl_options = "";
str += 4;
} else if (!memcmp(str, "brl=", 4)) {
brl_options = str + 4;
str = strchr(brl_options, ',');
if (!str) {
printk(KERN_ERR "need port name after brl=\n");
return 1;
}
*(str++) = 0;
}
#endif
/*
* Decode str into name, index, options.
*/
if (str[0] >= '0' && str[0] <= '9') {
strcpy(buf, "ttyS");
strncpy(buf + 4, str, sizeof(buf) - 5);
} else {
strncpy(buf, str, sizeof(buf) - 1);
}
buf[sizeof(buf) - 1] = 0;
if ((options = strchr(str, ',')) != NULL)
*(options++) = 0;
#ifdef __sparc__
if (!strcmp(str, "ttya"))
strcpy(buf, "ttyS0");
if (!strcmp(str, "ttyb"))
strcpy(buf, "ttyS1");
#endif
。。。。。。
}
#define DEFAULT_CONSOLE_LOGLEVEL 0//屏蔽掉内核打印信息
{
char buf[sizeof(console_cmdline[0].name) + 4]; /* 4 for index */
char *s, *options, *brl_options = NULL;
int idx;
//weed stop printk to console
// printk("weed test console setup %s\r\n",str);
str="/dev/null";//屏蔽掉init启动信息,grub.cfg里加console=/dev/null
#ifdef CONFIG_A11Y_BRAILLE_CONSOLE
if (!memcmp(str, "brl,", 4)) {
brl_options = "";
str += 4;
} else if (!memcmp(str, "brl=", 4)) {
brl_options = str + 4;
str = strchr(brl_options, ',');
if (!str) {
printk(KERN_ERR "need port name after brl=\n");
return 1;
}
*(str++) = 0;
}
#endif
/*
* Decode str into name, index, options.
*/
if (str[0] >= '0' && str[0] <= '9') {
strcpy(buf, "ttyS");
strncpy(buf + 4, str, sizeof(buf) - 5);
} else {
strncpy(buf, str, sizeof(buf) - 1);
}
buf[sizeof(buf) - 1] = 0;
if ((options = strchr(str, ',')) != NULL)
*(options++) = 0;
#ifdef __sparc__
if (!strcmp(str, "ttya"))
strcpy(buf, "ttyS0");
if (!strcmp(str, "ttyb"))
strcpy(buf, "ttyS1");
#endif
。。。。。。
}
#define DEFAULT_CONSOLE_LOGLEVEL 0//屏蔽掉内核打印信息
相关文章推荐
- 屏蔽linux 的启动打印信息
- 屏蔽内核启动打印信息
- Linux启动打印信息
- Gentoo: 屏蔽Linux的启动信息
- 屏蔽linux启动信息的方法
- 在linux启动过程打印调试信息
- 分析arm linux启动打印信息
- 树莓派linux系统启动信息屏蔽
- linux查看内核启动过程的打印信息
- 调整内核printk打印级别--减少启动时的打印信息
- 嵌入式linux启动信息完全注释
- Linux下启动Tomcat显示控制台日志信息
- ARM-Linux的启动的信息显示到framebuffer
- U-boot移植之RK-PX2开机启动打印信息
- 打印uboot和内核系统的启动信息方法
- Linux 启动信息同时输出到屏幕和串口终端
- Linux应用程序中如何打印带有颜色的提示信息
- 让Linux的启动信息从LCD和串口同时输出
- linux下java打开t1应用程序,并打印输出信息
- 第1章 打印启动信息