将arch装在loop上

其他Linux/Unix/BSD/OSX等发行版讨论
回复
头像
DoraZZ
帖子: 4042
注册时间: 2009-12-16 17:47
系统: Matrix
来自: 火星学院

将arch装在loop上

#1

帖子 DoraZZ » 2012-05-20 14:32

成功了,按照linuxsir上的方法
但是启动时会说can't mount '' in /new_root
必须输入exit两次才能继续
还有
退出时会有一堆I/O ERROR
会windows会让chkdsk :em20 :em20
ฏ้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎้้้้้้้้้้้้้้้้้้้้้้้้้้้้๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎้้้้้้้้้้้้้้้้
我和助手万年不更新的个人首页: https://tuxzz.org
头像
qy117121
论坛版主
帖子: 50587
注册时间: 2007-12-14 13:40
系统: Winbuntu
来自: 志虚国乌由市
联系:

Re: 将arch装在loop上

#2

帖子 qy117121 » 2012-05-20 14:33

小伙挺能折腾的啊
渠月 · QY   
本人只会灌水,不负责回答问题
无聊可以点一下→ http://u.nu/ubuntu

邮箱 chuan@ubuntu.org.cn
头像
DoraZZ
帖子: 4042
注册时间: 2009-12-16 17:47
系统: Matrix
来自: 火星学院

Re: 将arch装在loop上

#4

帖子 DoraZZ » 2012-05-20 15:28

linuxsir上的那段automount简直是胡写
我从头写了一遍,极度精简

hooks

代码: 全选

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."
}
install

代码: 全选

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
}
最后要mkinitcpio -g /boot/initramfs-linux.img
ฏ้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎้้้้้้้้้้้้้้้้้้้้้้้้้้้้๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎้้้้้้้้้้้้้้้้
我和助手万年不更新的个人首页: https://tuxzz.org
回复