相关讨论
做嵌入式根文件系统时,有linuxrc如下:
#!/bin/sh
echo "mount /etc as ramfs"
/bin/mount -n -t ramfs ramfs /etc
这里的ramfs是从哪儿来,做的根目录没有这个,挂这个的目的是干吗
/bin/cp -a /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/bon/2 /
/bin/mount -f -t ramfs ramfs /etc
exec /sbin/init 这里是映象的还是根目录...
做嵌入式根文件系统时,有linuxrc如下:
#!/bin/sh
echo "mount /etc as ramfs"
/bin/mount -n -t ramfs ramfs /etc
这里的ramfs是从哪儿来,做的根目录没有这个,挂这个的目的是干吗
/bin/cp -a /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/bon/2 /
/bin/mount -f -t ramfs ramfs /etc
exec /sbin/init 这里是映象的还是根目录...
linuxrc 详解
2007-07-24 19:57做嵌入式根文件系统时,有linuxrc如下:
#!/bin/sh
echo "mount /etc as ramfs"
/bin/mount -n -t ramfs ramfs /etc
这里的ramfs是从哪儿来,做的根目录没有这个,挂这个的目的是干吗
/bin/cp -a /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/bon/2 /
/bin/mount -f -t ramfs ramfs /etc
exec /sb...
发表于 2006-3-16 17:03
QUOTE:
原帖由 solomoon 于 2006-3-15 14:25 发表
做嵌入式根文件系统时,有linuxrc如下:
#!/bin/sh
echo "mount /etc as ramfs"
/bin/mount -n -t ramfs ramfs /etc
这里的ramfs是从哪儿来,做的根目录没有这个,挂这个的目的是干吗
/b ...
首先你要看懂这个linuxrc,
1. /bin/mount -n -t ramfs ramfs /etc
这句话的作用加载一个ramfs作为/etc目录。这样/etc就是一个可写目录。
看这个脚本...
發表人 內容
thyme
板主
註冊時間: 2002-05-09
文章: 1024
來自: 台北 發表於: 星期一 八月 15, 2005 4:14 pm 文章主題: [教學] linuxrc 實作剖析
linuxrc 實作剖析
本篇背景知識:linuxrc, busybox, initrd, bootloader(lilo or grub)
linuxrc 有何特異功能,請自行研究,本篇只說明如何應用。
linuxrc 通常在 initrd.img 內出現,由於此時所有檔案系統皆未掛載,
所以相關的 shell、binary、library 都要先包在裡面,...
系统启动后执行linuxrc 但脚本执行到exec $BB chroot . sh dev/console 这一句就不执行了??
脚本如下:
[code]
#!/bin/sh
BB=/bin/busybox
$BB mkdir /proc
$BB mount -t proc /proc /proc
$BB mkdir /tmpfs
echo "Mounting a TMPFS filesystem..."
$BB mount -t tmpfs /dev/root /tmpfs -o size=110M
$BB umount /proc
cd /tmpfs
$BB mkdir initrd
echo "Pivoting..."
$BB pivot_root . initrd
cd initrd
exec $B...
系统启动后执行linuxrc 但脚本执行到exec $BB chroot . sh dev/console 这一句就不执行了??
脚本如下:
[code]
#!/bin/sh
BB=/bin/busybox
$BB mkdir /proc
$BB mount -t proc /proc /proc
$BB mkdir /tmpfs
echo "Mounting a TMPFS filesystem..."
$BB mount -t tmpfs /dev/root /tmpfs -o size=110M
$BB umount /proc
cd /tmpfs
$BB mkdir initrd
echo "Pivoting..."
$BB pivot_root . initrd
cd initrd
exec $B...
by
rmqh
-
内核源码
-
2006-12-23 20:05:39 阅读(1609) 回复(3)
Reading data from NAND FLASH without ECC is not recommended
VFS: Mounted root (cramfs filesystem) readonly.
Mounted devfs on /dev
Freeing init memory: 92K
Failed to execute /linuxrc. Attempting defaults...
Kernel panic - not syncing: No init found. Try passing init= option to kernel.
移植了内核2.6.14.1
自己制作了文件系统cramfs,
#touch linuxrc
#chmod 777 linuxrc
#ls -al
-rwxrwxrwx 1 502 root...
Reading data from NAND FLASH without ECC is not recommended
VFS: Mounted root (cramfs filesystem) readonly.
Mounted devfs on /dev
Freeing init memory: 92K
Failed to execute /linuxrc. Attempting defaults...
Kernel panic - not syncing: No init found. Try passing init= option to kernel.
移植了内核2.6.14.1
自己制作了文件系统cramfs,
#touch linuxrc
#chmod 777 linuxrc
#ls -al
-rwxrwxrwx 1 502 root...
by
antione
-
内核源码
-
2010-03-11 10:36:53 阅读(10198) 回复(6)
做嵌入式根文件系统时,有linuxrc如下:
#!/bin/sh
echo "mount /etc as ramfs"
/bin/mount -n -t ramfs ramfs /etc
这里的ramfs是从哪儿来,做的根目录没有这个,挂这个的目的是干吗
/bin/cp -a /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/bon/2 /
/bin/mount -f -t ramfs ramfs /etc
exec /sbin/init 这里是映象的还是根...