免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2297 | 回复: 0
打印 上一主题 下一主题

Install Debian testing/lenny into Qemu MIPS Malta [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-01-27 14:21 |只看该作者 |倒序浏览

                [Blog*spot上被墙了的文章,运气了一下竟然能看到cache的..]
            Install Debian testing/lenny into Qemu MIPS Malta board
1.
Install debian (testing/lenny) with qemu-system-mipsel/malta.
qemu-img create -f qcow2 debian-mipsel.img 1G
    lftp -c mirror
ftp://ftp.fi.debian.org/debian/dists/testing/main/installer-mipsel/current/images/malta/netboot/
    cd netboot
    sudo qemu-system-mipsel -kernel
vmlinux-2.6.26-1-4kc-malta -initrd initrd.gz -append 'console=ttyS0'
-nographic -serial stdio -net nic -net tap -hda
/path/to/debian-mipsel.img
  Fellow the standard debian
installation process and finish install debian (standard system) to
debian-mipsel.img.
  Note: Qemu emulation for architecture different
from the host side is very slow, be patient during the installation.
this maybe take more than 1 hrs depending on the host's hardware
configuration.
2. Reboot to the debian-mipsel system we installed
right now, rsyncing the entire file system if neccessary (in case of
nfsroot). Before that, we'd better to build our own kernel. the qemu
simulates MIPS MALTA board with the following hardware:
  The
Malta emulation supports the following devices:
    * - Core board
with MIPS 24Kf CPU and Galileo system controller
    * - PIIX4
PCI/USB/SMbus controller
    * - The Multi-I/O chip's serial device
    * - PCnet32 PCI network card
    * - Malta FPGA serial device
    * - Cirrus VGA graphics card
  compile kernel for mips malta
board:
    cd linux-2.6
    make ARCH=mips malta_defconfig


  Tune the defconfig if needed:
    make ARCH=mips menuconfig
    make ARCH=mips CROSS_COMPILE=mipsel-unknown-linux-gnu- -j3
  
After we have own own kernel, we could use this kernel to boot with our
filesystem we installed right now:
    sudo qemu-system-mipsel
-kernel vmlinux -append 'root=/dev/hda1 ro console=ttyS0' -nographic
-serial stdio -net nic -net tap -hda /path/to/debian-mipsel.img -boot c
  Login into the new system, prepare to exports our filesystem using
rsync:
    aptitude update
    aptitude install rsync
  
Since the `/' filesystem contains some virtual filesystem like /dev,
/proc, /sys, we must avoid syncing these directory, and the simplest way
I know is:
  Mount the root filesystem to other directory:

    mount /dev/hda1 /mnt
  Mount other directory like /boot to the
new mounted root (/mnt) if neccessary.
  On a other machine,
assume it's IP address is
192.168.2.104
:
    sudo mkdir -p /exports/nfs/diskless/debian-mipsel    # on
192.168.2.104, choose a directory you prefer.
  On our Qemu
target:
    cd /mnt
    rsync -av *
root@192.168.2.104:/exports/nfs/diskless/debian-mipsel/     # sync the
entire filesystem to the remote machine.
  Note 1: We use qemu to
`cheat' for a filesystem installed with debian, in a simular way we
could also have a rootfs for other architecture.
  Note 2: Other than
Debian, gentoo stage3 is also a good choice, and you don't have to
install (with qemu-system-xxx), but surely you don't want to `emerge' in
a qemu simluated target system ;-)
  Note 3: If you have a debian
host environment, the simplest way to install a rootfs might be use
debootstrap, you can also debootstrap a filesystem for other
architecture, please refer to `man debootstrap' for details.
   
3.
Using Qemu/MALTA with nfsroot. Before that we have to modify the
something in the nfsroot filesystem, ie:
    cd
/exports/nfs/diskless/debian-mipsel
    vim etc/fstab            
         # comment stuff like /dev/hda1 etc..
    vim etc/inittab   
                # comment tty* since we don't use any tty and uncomment
ttyS0 and use a proper bitrate because our terminal is on ttyS0
  
  cd /path/to/linux-2.6
    sudo qemu-system-mipsel -kernel vmlinux
-append 'root=/dev/nfs rw
nfsroot=192.168.2.104:/exports/nfs/diskless/debian-mipsel ip=dhcp
console=ttyS0' -nographic -serial stdio -net nic -net tap
  Note:
to use this, make sure DHCP and NFS server is configured properly,
please refer to this document:
http://wangbj.blogspot.com/2009/03/using-qemu-to-simulate-armintegratorcp.html
or /usr/src/linux/Documentation/filesystem/nfsroot.txt (the best).


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u3/98727/showart_2162105.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP