Chinaunix首页 | 论坛 | 博客
  • 博客访问: 82244
  • 博文数量: 18
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 85
  • 用 户 组: 普通用户
  • 注册时间: 2014-04-18 09:53
文章分类
文章存档

2015年(18)

我的朋友

分类: LINUX

2015-05-28 14:43:20

static int __ref kernel_init(void *unused)
{
    kernel_init_freeable();
    /* need to finish all async __init code before freeing the memory */
    async_synchronize_full();
    free_initmem();
    mark_rodata_ro();
    system_state = SYSTEM_RUNNING;
    numa_default_policy();
 
    current->signal->flags |= SIGNAL_UNKILLABLE;
    flush_delayed_fput();
 
    if (ramdisk_execute_command) {
        if (!run_init_process(ramdisk_execute_command))
            return 0;
        printk(KERN_WARNING "Failed to execute %s\n",
                ramdisk_execute_command);
    }
 
    /*
     * We try each of these until one succeeds.
     *
     * The Bourne shell can be used instead of init if we are
     * trying to recover a really broken machine.
     */
    if (execute_command) {
        if (!run_init_process(execute_command))
            return 0;
        printk(KERN_WARNING "Failed to execute %s.  Attempting "
                    "defaults...\n", execute_command);
    }
    if (!run_init_process("/sbin/init") ||
        !run_init_process("/etc/init") ||
        !run_init_process("/bin/init") ||
        !run_init_process("/bin/sh"))
        return 0;
 
    panic("No init found.  Try passing init= option to kernel. "
          "See Linux Documentation/init.txt for guidance.");
}
网上找的  有空自己找个kernel版本写个具体的版本号对应的源码  先做记录
阅读(1836) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~