先到 http://archlinuxarm.org/platforms/armv7/allwinner/cubieboard 下载 rootfs压缩包 http://archlinuxarm.org/os/ArchLinuxARM-sun4i-latest.tar.gz
下解完后 mkdir sun4i_rootfs, sudo tar zxpf ArchLinuxARM-sun4i-latest.tar.gz -C sun4i_rootfs
挂载 binfmt
[ -d /proc/sys/fs/binfmt_misc ] || modprobe binfmt_misc
[ -f /proc/sys/fs/binfmt_misc/register ] || mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc
4. 安装qemu-user-static, 如果是archlinux用户,通过yaourt 安装,同时安装binfmt-support
(Do not register a handler that matches the host machine)
5. 添加模拟器, 目前就添加两个就够了,重要一点,将 qemu-arm-static 拷到 sun4i_rootfs的usr/bin/下
echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-static:' > /proc/sys/fs/binfmt_misc/register
echo ':armeb:M::\x7f