但是启动时会说can't mount '' in /new_root
必须输入exit两次才能继续
还有
退出时会有一堆I/O ERROR
会windows会让chkdsk


代码: 全选
run_hook ()
{
mkdir /host
mkdir /new_root
mount.ntfs-3g /dev/sdb7 /host
mount -t ext4 /host/arch/arch-sys.img /new_root
echo "Loopback Mounted."
mkdir -p /new_root/host
mount -o bind /host /new_root/host
MOUNTED=1
mounted=1
echo "Run automount hook end."
}
代码: 全选
build ()
{
MODULES=" $(checked_modules "/usb/host" | grep -ve "_cs" -e "sl811-hcd" -e "isp116x-hcd")"
MODULES=$(echo ${MODULES}) #trim whitespace
if [ -n "${MODULES}" ]; then
MODULES="${MODULES} usb_storage sd_mod sr_mod"
MODULES="${MODULES} $(checked_modules "drivers/usb/storage/ums-*")"
fi
MODULES="${MODULES} nls_utf8"
BINARIES="blkid mount.ntfs-3g tr"
FILES=""
SCRIPT="automount"
}
help ()
{
cat<<HELPEOF
This hook auto mount the root device base on cmdline.
Can support:
1. Boot from normal harddisk or USB disk;
2. Boot from CD-ROM or DVD-ROM;
3. Boot from loop device file (made by dd or other tools);
4. Boot from squashfs files;
...
HELPEOF
}