#022
#023/* clear the umask */
#024 umask (0 );
In the above Code, call the umask function to set the blocking bit to 0. What does this mean? Is it telling the system what work it has done? To learn about this, you have to go into the linux function library, because its function is clear at a glance. Its explanation is as follows:
The umask function in linux is mainly used to block access permissions from new files or directories when creating new files or directories. There are nine types of file access permissions, respectively: r w x (they represent: users read users write users execute Group read group write Group execute other read others execute ).
In fact, the role of this function is to set the maximum operation permission for the current process to create files or directories. For example, if this parameter is set to 0, it means that the permission phase is used when files are created, that is :(~ 0) & mode is equal to the value of 0777 & mode in octal mode. In this way, the maximum permission is granted to the mkdir function called by the subsequent code to avoid permission uncertainty in creating directories or files, specifying a clear flag is a profound reflection of the Code robustness and a high degree of clarity of developers.
#025
#026/* Get the basic filesystem setup we need put
#027 * together in the initramdisk on/and then well
#028 * let the rc file figure out of the rest.
#029 */
#030 mkdir ("/dev", 0755 );
#031 mkdir ("/proc", 0755 );
#032 mkdir ("/sys", 0755 );
In the above Code, we mainly create a basic file system in the current Memory Simulated disk to load the rc file later for other tasks. Create the Device directory dev, the process file system directory proc, and the system directory sys.
/Dev is the mount point of the devfs (Device File System) or udev. If no/dev exists in the kernel using devfs, the Shell startup information cannot be found, because/dev/console cannot be found in the kernel; In the udev system, you also need to create the console and null nodes under/dev in advance. There are many articles on the difference between devfs and udev. Of course, if your kernel does not support devfs anymore (after 2.6.12), you can use pure static nodes. That is, it is manually generated using mknod.
/Proc is used to mount the Virtual File System for storing system information-"proc file system", and "proc file system" can be selected in the kernel. Without the "proc file system", many Shell commands cannot be run, such as ifconfig. Unlike devfs, the "proc file system" can be automatically mounted. It must be mounted using an initialization script. In addition, udev also needs support from the "proc file system.
/Sys is used to mount the "sysfs file system". The "sysfs File System" can be selected in the kernel