|
发表于 2010-3-24 15:27:51
|
显示全部楼层
那你看看 lfslivecd 的启动脚本,mount root.ext2 前添加挂载 ntfs 分区的步骤- do_mount_cd() {
- while [ ! -b /dev/lfs-cd ] ; do
- find_cd
- if [ ! -b /dev/lfs-cd ] ; then
- cat <<"EOF"
- LFS LiveCD could not find its device, perhaps due to unsupported or
- undetected hardware. Please fix this problem and exit this shell.
- EOF
- problem
- fi
- done
- mkdir /.tmpfs/.cdrom
- detect_cd_type
- if [ "$toram" = 1 ] ; then copy_cd_to_ram ; fi
- mount -n -t iso9660 -o ro /dev/lfs-cd /.tmpfs/.cdrom
- losetup /dev/loop0 /.tmpfs/.cdrom/root.ext2
- SIZE=`blockdev --getsize /dev/loop0`
- OVERHEAD=$(( 0x1000 + $SIZE * 2 ))
- OVLSIZE=$(( $SIZE + ( $OVERHEAD + 511 ) / 512 ))
- dd if=/dev/null of=/.tmpfs/.overlay bs=512 seek=$OVLSIZE 2>/dev/null
- losetup /dev/loop1 /.tmpfs/.overlay
- echo "0 $SIZE snapshot /dev/loop0 /dev/loop1 p 8" | dmsetup create lfs-cd
- mount -n -t ext2 /dev/mapper/lfs-cd /.root
- mount -n --move /.tmpfs /.root/dev/shm
- if [ "$toram" != 1 ] && [ ! -d /.root/dev/shm/.partition ] ; then
- cp -a /dev/lfs-cd /.root/dev/lfs-cd
- fi
- if [ "$toram" != 1 ] ; then
- ln -sf /dev/shm/.cdrom/drivers /.root/drivers
- fi
- cat /etc/modprobe.conf >>/.root/etc/modprobe.conf
- ln -sf issue.$cdtype /.root/etc/issue
- if [ "$cdtype" = "fullcd" ] ; then
- ln -sf /dev/shm/.cdrom/lfs-sources /.root/lfs-sources
- fi
- if [ "$nodhcp" = "1" ] ; then
- rm -f /.root/etc/udev/rules.d/76-network.rules
- fi
- ( IFS="," ; for module in $load ; do
- echo "$module" >>/.root/etc/sysconfig/modules
- done )
- }
复制代码 |
|