- 論壇徽章:
- 0
|
內(nèi)核無法加載ramdisk的文件系統(tǒng)
跟蹤發(fā)現(xiàn)到了
prepare_namespace()->mount_root()->mount_block_root()
最后發(fā)現(xiàn)錯誤在于get_fs_names始終返回的是空
在get_fs_names函數(shù)里,我發(fā)現(xiàn)root_fs_name是空,所以走的是
另外一個流程,來獲取文件名。
在另外一個流程中,由于一直沒有給文件名賦值,從而導(dǎo)致返回的是空文件名。
請問這個錯誤是什么原因?qū)е碌模?謝謝!
附get_fs_names代碼:
static void __init get_fs_names(char *page)
{
char *s = page;
if (root_fs_names) {
printk("root_fs_names is %s\n",root_fs_names); //我加的語句,從沒打印過
strcpy(page, root_fs_names);
while (*s++) {
if (s[-1] == ',')
s[-1] = '\0';
}
} else {
int len = get_filesystem_list(page);
char *p, *next;
page[len] = '\0';
for (p = page-1; p; p = next) {
next = strchr(++p, '\n');
printk("test1"); //我加的打印語句,每次都執(zhí)行
if (*p++ != '\t')
continue;
printk("test2\n"); //我加的打印語句,從未執(zhí)行到這里 while ((*s++ = *p++) != '\n')
;
s[-1] = '\0';
}
}
*s = '\0';
printk("finally in get_fs_names, s is %s\n",s);
} |
|