比如说要获取project_id这个参数
首先在kernel/init目录下的main.c中
int asus_PRJ_ID = 0;
EXPORT_SYMBOL(asus_PRJ_ID);
static int set_project_id(char *str)
{ printk(“prj_id = %s\n”, str);
if( strcmp(“0”, str) == 0 ){
asus_PRJ_ID = ASUS_ZE550KL;
}else if( strcmp(“1”, str) == 0 ){
asus_PRJ_ID = ASUS_ZE600KL;
}else if( strcmp(“2”, str) == 0 ){
asus_PRJ_ID = ASUS_ZX550KL;
}else if( strcmp(“3”, str) == 0 ){
asus_PRJ_ID = ASUS_ZD550KL;
} return 0;
}
__setup(“PRJ_ID=”, set_project_id);这样就可以在kernel中全局使用asus_PRJ_ID这个变量