|
问题二, 没有遇到过. 没用过vm, 我用的是VirtualBox.
问题一, 应该是这个语句local_mount_root()里的语句local_premount
所有修改在其后. 用条件语句把其后所有语句括起来,在加入kloop相关语句.
- local_mount_root()
- {
- local_top
- local_device_setup "${ROOT}" "root file system"
- ROOT="${DEV}"
- # Get the root filesystem type if not set
- if [ -z "${ROOTFSTYPE}" ]; then
- FSTYPE=$(get_fstype "${ROOT}")
- else
- FSTYPE=${ROOTFSTYPE}
- fi
- [color=Magenta]local_premount
- [/color]
- if [ "${readonly}" = "y" ] && \
- [ -z "$LOOP" ]; then
- roflag=-r
- else
- roflag=-w
- fi
- # FIXME This has no error checking
- [ -n "${FSTYPE}" ] && modprobe ${FSTYPE}
- checkfs ${ROOT} root "${FSTYPE}"
- # FIXME This has no error checking
- # Mount root
- mount ${roflag} ${FSTYPE:+-t ${FSTYPE} }${ROOTFLAGS} ${ROOT} ${rootmnt}
- mountroot_status="$?"
- if [ "$LOOP" ]; then
- if [ "$mountroot_status" != 0 ]; then
- if [ ${FSTYPE} = ntfs ] || [ ${FSTYPE} = vfat ]; then
- panic "
- Could not mount the partition ${ROOT}.
- This could also happen if the file system is not clean because of an operating
- system crash, an interrupted boot process, an improper shutdown, or unplugging
- of a removable device without first unmounting or ejecting it. To fix this,
- simply reboot into Windows, let it fully start, log in, run 'chkdsk /r', then
- gracefully shut down and reboot back into Windows. After this you should be
- able to reboot again and resume the installation.
- (filesystem = ${FSTYPE}, error code = $mountroot_status)
- "
- fi
- fi
- mkdir -p /host
- mount -o move ${rootmnt} /host
- while [ ! -e "/host/${LOOP#/}" ]; do
- panic "ALERT! /host/${LOOP#/} does not exist. Dropping to a shell!"
- done
- # Get the loop filesystem type if not set
- if [ -z "${LOOPFSTYPE}" ]; then
- eval $(fstype < "/host/${LOOP#/}")
- else
- FSTYPE="${LOOPFSTYPE}"
- fi
- if [ "$FSTYPE" = "unknown" ] && [ -x /sbin/blkid ]; then
- FSTYPE=$(/sbin/blkid -s TYPE -o value "/host/${LOOP#/}")
- [ -z "$FSTYPE" ] && FSTYPE="unknown"
- fi
- if [ ${readonly} = y ]; then
- roflag=-r
- else
- roflag=-w
- fi
- # FIXME This has no error checking
- modprobe loop
- modprobe ${FSTYPE}
- # FIXME This has no error checking
- mount ${roflag} -o loop -t ${FSTYPE} ${LOOPFLAGS} "/host/${LOOP#/}" ${rootmnt}
- if [ -d ${rootmnt}/host ]; then
- mount -o move /host ${rootmnt}/host
- fi
- fi
- }
复制代码
|
|