Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:init\do_mounts_initrd.c Create Date:2022-07-28 13:58:26
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:handle_initrd

Proto:static void __init handle_initrd(void)

Type:void

Parameter:Nothing

63  static char * argv[] = {"linuxrc", NULL, }
67  do_proc_dointvec cannot handle kdev_t = new_encode_dev(ROOT_DEV)
68  create_dev("/dev/root.old", Root_RAM0)
70  mount_block_root("/dev/root.old", root_mountflags & ~Mount read-only )
71  ksys_mkdir("/old", 0700)
72  ksys_chdir("/old")
78  flags |= Freezer should not count it as freezable
80  info = all_usermodehelper_setup - prepare to call a usermode helper*@path: path to usermode executable*@argv: arg vector for process*@envp: environment for process*@gfp_mask: gfp mask for memory allocation*@cleanup: a cleanup function*@init: an init
82  If Not info Then Return
84  all_usermodehelper_exec - start a usermode application*@sub_info: information about the subprocessa*@wait: wait for the application to finish and return status.* when UMH_NO_WAIT don't wait at all, but you get no useful error back
86  flags &= ~Freezer should not count it as freezable
89  do_mount("..", ".", NULL, MS_MOVE, NULL)
91  ksys_chroot("..")
93  If new_decode_dev(do_proc_dointvec cannot handle kdev_t ) == Root_RAM0 Then
94  ksys_chdir("/old")
95  Return
98  ksys_chdir("/")
99  ROOT_DEV = new_decode_dev(do_proc_dointvec cannot handle kdev_t )
100  mount_root()
102  printk - print a kernel message*@fmt: format string* This is printk(). It can be called from any context. We want it to work.* We try to grab the console_lock. If we succeed, it's easy - we log the* output and call the console drivers
103  error = do_mount("/old", "/root/initrd", NULL, MS_MOVE, NULL)
104  If Not error Then printk - print a kernel message*@fmt: format string* This is printk(). It can be called from any context. We want it to work.* We try to grab the console_lock. If we succeed, it's easy - we log the* output and call the console drivers
106  Else
107  fd = ksys_open("/dev/root.old", O_RDWR, 0)
108  If error == -ENOENT Then printk - print a kernel message*@fmt: format string* This is printk(). It can be called from any context. We want it to work.* We try to grab the console_lock. If we succeed, it's easy - we log the* output and call the console drivers
110  Else printk - print a kernel message*@fmt: format string* This is printk(). It can be called from any context. We want it to work.* We try to grab the console_lock. If we succeed, it's easy - we log the* output and call the console drivers
112  printk - print a kernel message*@fmt: format string* This is printk(). It can be called from any context. We want it to work.* We try to grab the console_lock. If we succeed, it's easy - we log the* output and call the console drivers
113  Kernel code should not call syscalls (i.e., sys_xyzyyz()) directly.* Instead, use one of the functions which work equivalently, such as* the ksys_xyzyyz() functions prototyped below.
114  printk - print a kernel message*@fmt: format string* This is printk(). It can be called from any context. We want it to work.* We try to grab the console_lock. If we succeed, it's easy - we log the* output and call the console drivers
115  If fd < 0 Then
116  error = fd
117  Else
121  printk - print a kernel message*@fmt: format string* This is printk(). It can be called from any context. We want it to work.* We try to grab the console_lock. If we succeed, it's easy - we log the* output and call the console drivers
Caller
NameDescribe
initrd_load