sys_chdir("/old");
return;
}
ROOT_DEV = new_decode_dev(real_root_dev);
mount_root();
printk(KERN_NOTICE "Trying to move old root to /initrd ... ");
error = sys_mount("/old", "/root/initrd", NULL, MS_MOVE, NULL);
if (!error)
printk("okayn");
else {
int fd = sys_open("/dev/root.old", O_RDWR, 0);
if (error == -ENOENT)
printk("/initrd does not exist. Ignored.n");
else
printk("failedn");
printk(KERN_NOTICE "Unmounting old rootn");
sys_umount("/old", MNT_DETACH);
printk(KERN_NOTICE "Trying to free ramdisk memory ... ");
if (fd
error = fd;
} else {
error = sys_ioctl(fd, BLKFLSBUF, 0);
sys_close(fd);
}
printk(!error ? "okayn" : "failedn");
}
}
先将/dev/ram0挂载,而后执行/linuxrc.等其执行完后 。切换根目录,再挂载具体的根文件系统.
到这里 。文件系统挂载的全部内容就分析完了.
五:小结
在本小节里 。分析了根文件系统的挂载流程 。并对几个虚拟根文件系统的情况做了详细的分析 。理解这部份,对我们构建linux嵌入式开发系统是很有帮助的.
- 石榴泡酒石榴籽要吃掉吗
- 一天吃多少鸡胸肉合适
- 陈皮生虫了还能用吗
- 藕炖汤要去皮吗
- 甜菜根粉的作用与功效
- 桃根
- 葛根粉里面有黑的小点是什么
- 现在创业做什么比较好,利润可观?
- 有没有一种备份软件?做到电脑硬盘上文件备份?
- 父亲贺普仁的学养根基与大医之路
