Get debian mini cd from debian mirror, IE:
- wget http://ftp.cn.debian.org/debian/dists/wheezy/main/installer-powerpc/current/images/powerpc/netboot/mini.iso
Create Qemu ppc disk image as:
- 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.
- 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:
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:
- 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:
- 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:
- # 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:
- 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)
- aptitude update
-
aptitude upgrade
-
-
aptitude install build-essential automake ncurses-dev vim
The rootfs can also being used for other kernel, IE: mpc85xx, ppc44x, ...
阅读(3305) | 评论(0) | 转发(0) |