Chinaunix首页 | 论坛 | 博客
  • 博客访问: 177654
  • 博文数量: 42
  • 博客积分: 2185
  • 博客等级: 大尉
  • 技术积分: 455
  • 用 户 组: 普通用户
  • 注册时间: 2009-06-11 21:32
文章分类

全部博文(42)

文章存档

2012年(5)

2011年(13)

2010年(6)

2009年(18)

我的朋友

分类: LINUX

2012-01-03 20:27:35

Get debian mini cd from debian mirror, IE:

  1. wget http://ftp.cn.debian.org/debian/dists/wheezy/main/installer-powerpc/current/images/powerpc/netboot/mini.iso
Create Qemu ppc disk image as:
  1. qemu-img create -f qcow2 wheezy-ppc.img 10G

Lauch qemu-system-ppc as:
  (Please NOTE:)
- We select machine as mac99 because the default machine kernel panic with mini.iso (wheezy)
- We can use virtio for block device (virtioblk), and I tried use virtio for net (virtionet), but kernel in mini.iso failed to detect ethernet interface, so here e1000 is used.
- direct network boot was also tried (like pxe in x86), but failed, that's why we use mini.iso instead.
    1. sudo qemu-system-ppc -M mac99 -cdrom mini.iso -drive file=/home/wangbj/images/wheezy-ppc.img -net nic,model=e1000,macaddr=ff:00:aa:bb:cc:dd -net tap,script=/etc/qemu/qemu-ifup -vnc :1 -boot d
In another console:

  1. vncviewer :1
Install debian step by step, please note when making file systems, we need create a New world bootstrap partition. like:



When prompt for package selection, we only need install base system & ssh server (openssh).

Please note using virtioblk (driver=xxx.img,if=virtio) will cause yaboot installation failed when debian-installer trying to install yaboot. If you already get this error like:

  1. ofpath: Device: /dev/vda is not supported
You can still let debian installer continue without install boot loader (yaboot), instead, chroot to the target system (IE: by ALT-F2), scp kernel and initrd to host system, then let installation finish. And boot the new system with kernel installed, IE:

  1. sudo qemu-system-ppc -M mac99 -kernel ~/kernels/vmlinux-2.6.32-5-powerpc -initrd ~/kernels/initrd.img-2.6.32-5-powerpc -append 'root=/dev/hda3 ro' -drive file=/home/wangbj/images/wheezy-ppc.img -net nic,model=e1000,macaddr=ff:00:aa:bb:cc:dd -net tap,script=/etc/qemu/qemu-ifup -vnc :1 -boot c
Then you should able to see system boot, and we can run `yabootconfig' again to install yaboot to proper place, IE:

  1. # yabootconfig
    yaboot is the Linux Loader for PowerPC.  yabootconfig sets up your system to boot directly
    from your hard disk, without the need for a boot CD, floppy or a network boot.
    Install yaboot bootstrap on /dev/hda2 to boot Linux from /dev/hda3? [Yes] Yes
    Creating a simple /etc/yaboot.conf...
    Running mkofboot to make the disk bootable...
    mkofboot: Warning: Incompatible version of `nvsetenv', nvram will not be updated
    Done
TODO: Even with the above script, qemu-system-ppc (-M mac99) still can't boot from disk directly (boot c), need find a way to fix this issue. Currently, we still need copy the (debian official) kernel to host machine, boot using -kernel directly, like:

  1. sudo qemu-system-ppc -M mac99 -kernel ~/kernels/powerpc/vmlinux-3.1.0-1-powerpc -initrd ~/kernels/powerpc/initrd.img-3.1.0-1-powerpc -append 'root=/dev/sda3 ro' -drive file=/home/wangbj/images/wheezy-ppc.img -net nic,model=e1000,macaddr=ff:00:aa:bb:cc:01 -net tap,script=/etc/qemu/qemu-ifup -vnc :1
We can also ssh to the target system, and install proper packages interested:

Modify /etc/apt/sources.list, using debian testing (s/wheezy/testing)

  1. aptitude update
  2. aptitude upgrade

  3. aptitude install build-essential automake ncurses-dev vim

The rootfs can also being used for other kernel, IE: mpc85xx, ppc44x, ...

阅读(3293) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~