- 1、本文档共26页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
linuxrc详解
linuxrc详解 来源: ChinaUnix博客 日期: 2008.12.18 16:38 (共有0条评论) 我要评论 ? 主題: 請問在busybox 中 linuxrc 與 /sbin/init 的不同處linuxrc 是 busybox make install 產生出來的/sbin/init 也是busybox 用來初始開機的程式我分別用來開機 都可正常運作那請問兩者的差別在哪裡??還是這兩個東西其實都是一樣的 ^^以下為摘自linux kernel Documentation應該可以解決你的疑問。When using initrd, the system typically boots as follows:??1) the boot loader loads the kernel and the initial RAM disk??2) the kernel converts initrd into a normal RAM disk and? ???frees the memory used by initrd??3) initrd is mounted read-write as root??4) /linuxrc is executed (this can be any valid executable, including? ???shell scripts; it is run with uid 0 and can do basically everything? ???init can do)??5) linuxrc mounts the real root file system??6) linuxrc places the root file system at the root directory using the? ???pivot_root system call??7) the usual boot sequence (e.g. invocation of /sbin/init) is performed? ???on the root file system??the initrd file system is removedlinuxrc常见错误2008年09月04日 星期四 下午 04:161? ?linuxrc不具备可执行属性 2? ?linuxrc的解释shell不在首行 3? ?linuxrc的解释shell不存在一般都出不了上面三个原因.linuxrc脚本kernel启动后,执行/root_china/linuxrc脚本文件,接下来执行/root_china/usr/etc/rc.local脚本文件。这两个文件我以前没去管是什么意思,起到什么作用,直到今天。/root_china/linuxrc:#!/bin/shecho mount /etc as ramfs/bin/mont -n -t ramfs ramfs /etc //将/etc目录mount成可写的ramfs文件系统/bin/cp -a /mnt/etc/* /etc? ?? ???//将/mnt/etc目录下的文件拷贝到/etc目录下echo re-create the /etc/mtab entries#re-create the /etc/mtab entries/bin/mount -f -t cramfs -o remount,ro /dev/mtdblock/2 / //将/dev/mtdblock/2 mount成根文件系统/bin/mount -f -t ramfs ramfs /etcexec /sbin/init? ?? ?//执行脚本档 /usr/etc/rc.local1. /bin/mount -n -t ramfs ramfs /etc 这句话的作用加载一个ramfs作为/etc目录。这样/etc就是一个可写目录。看这个脚本,得出根文件系统是一个cramfs(只读可压缩文件系统),而/etc作为系统运行配置文件的存放地点,可能会写一些运行状态在这里,linuxrc第一件事情就是将一个ramfs mount到/etc只读目录中,使得/etc/目录可写,指定参数-n的目的是告诉mount不要写/etc/mtab(这个文件存放当前系统mount了的所有文件系统)。因为现在/etc/目录还是只读,所以这次mount不要写这个文件,否则会失败。ramfs在哪里?在 /etc/fstab文件中应该有ramfs一项,mount会去找这项,如果没有,mount会失败。后面就执行不下去。2. /
您可能关注的文档
最近下载
- 第三单元第1课+广而告之+课件+ 2024——2025学年人教版(2024)初中美术七年级下册.pptx VIP
- 第三单元第1课《广而告之》课件-+ 2024——2025学年人教版(2024)初中美术七年级下册.pptx VIP
- 房屋市政工程生产安全重大事故隐患判定标准(2024版)试题附答案.doc
- 第三单元第1课《广而告之》课件-七年级美术下册(人教版2024).pptx VIP
- 2025【基于精准重心法的S家电企业物流配送中心选址和路线规划问题实证研究14000字】.docx
- 基于精确重心法的农产品冷藏仓库选址研究一以米易为例.docx
- (二模)2025届大湾区高三普通高中毕业年级联合模拟考试 (二)地理试卷(含答案详解).docx
- 双叉臂式悬架设计.docx
- 新生儿先天性肛门闭锁护理.pptx
- IEEE C57.149-2012国外国际标准.pdf
文档评论(0)