|
本帖最后由 2011niumao 于 2017-2-23 13:40 编辑
感觉是ntfs-3g已经安装好了。应该是init没有修改好吧,因为没有执行到kloop的代码那一段。请检查一下
init文件,重新修改一下再次制作initramfs看看。init的约第45行,应该如下- rootdev=$(resolve_device "$root") && root=$rootdev
- unset rootdev
- if [ -z "$kloop" ] && [ -z "$squashfs" ]; then
- fsck_root
- # Mount root at /new_root
- "$mount_handler" /new_root
- fi
复制代码 加入了一个 if fi 屏蔽掉通常情形的引导检查挂载根的代码。其下面是
- ##############################################################
- # BOOT FROM VHD, KLOOP by niumao #
- ##############################################################
- if [ -n "$squashfs" ]; then
- ### reset the value of the root variable
- HOSTDEV="${root#block:}"
- NEWROOT="/new_root"
-
- ### auto probe the fs-type of the partition in which vhd-file live and mount it /host
- mkdir -p /host
- if [ -z "$hostfstype" ]; then
- hostfstype="$(blkid -s TYPE -o value "${HOSTDEV}")"
- [ -z "$hostfstype" -o "${hostfstype}" = "ntfs" ] && hostfstype="ntfs-3g"
- fi
- [ "${hostfstype}" = "ntfs-3g" ] || modprobe ${hostfstype}
- mount -t ${hostfstype} -o rw ${HOSTDEV} /host
- ###try to boot from squashfs
- mkdir /run/tmpwriteroot /run/tmpreadroot /run/tmpworkdir
- mount /host$squashfs /run/tmpreadroot
- mount -t overlay overlay -o lowerdir=/run/tmpreadroot,upperdir=/run/tmpwriteroot,workdir=/run/tmpworkdir $NEWROOT
- ### mount /host in initrd to /host of the realrootfs
- if [ "${hosthidden}" != "y" ] ; then
- [ -d "${NEWROOT}"/host ] || mkdir -p ${NEWROOT}/host
- mount --move /host ${NEWROOT}/host
- fi
- fi
- if [ -n "$kloop" ]; then
- ### reset the value of the root variable
- HOSTDEV="${root#block:}"
- NEWROOT="/new_root"
- [ -n "$kroot" ] && root="$kroot"
- [ -n "$kroot" ] || root="/dev/loop0"
- export root
- realroot="$root"
- ### auto probe the fs-type of the partition in which vhd-file live and mount it /host
- mkdir -p /host
- if [ -z "$hostfstype" ]; then
- hostfstype="$(blkid -s TYPE -o value "${HOSTDEV}")"
- [ -z "$hostfstype" -o "${hostfstype}" = "ntfs" ] && hostfstype="ntfs-3g"
- fi
- [ "${hostfstype}" = "ntfs-3g" ] || modprobe ${hostfstype}
- mount -t ${hostfstype} -o rw ${HOSTDEV} /host
-
- ### mount the vhd-file on a loop-device
- if [ "${kloop#/}" != "${kloop}" ]; then
- modprobe loop
- partx -av "/host${kloop}"
- [ -e "$realroot" ] || sleep 3
- fi
- ### probe lvm on vhd-file
- if [ -n "$klvm" ]; then
- modprobe dm-mod
- vgscan
- vgchange -ay $klvm
- [ -e "$realroot" ] || sleep 3
- fi
-
- ### mount the realroot / in vhd-file on $NEWROOT
- if [ -z "${kloopfstype}" ]; then
- kloopfstype="$(blkid -s TYPE -o value "$realroot")"
- [ -z "${kloopfstype}" ] && kloopfstype="ext4"
- fi
- [ -e "$realroot" ] || sleep 3
- mount -t "${kloopfstype}" -o rw $realroot $NEWROOT
-
- ### mount /host in initrd to /host of the realrootfs
- if [ "${hosthidden}" != "y" ] ; then
- [ -d "${NEWROOT}"/host ] || mkdir -p ${NEWROOT}/host
- mount --move /host ${NEWROOT}/host
- fi
- fi
- ##############################################################
- # end, BOOT FROM VHD, KLOOP by niumao #
- ##############################################################
- run_hookfunctions 'run_latehook' 'late hook' $LATEHOOKS
- run_hookfunctions 'run_cleanuphook' 'cleanup hook' $CLEANUPHOOKS
复制代码
|
|