Qemu auf Fritzbox

Aus Zebradem WIKI
Zur Navigation springenZur Suche springen

ZD-Logo.png
Das Board mit Freiheiten





Zebradem Fritzbox Wiki >> Qemu auf Fritzbox Magyar, Nederlands, Italiano, English
Community Modelle Freetz Fritzbox Tipps & Tricks

Einführung Freetz Pakete Freetz Addons Freetz Tipps Freetz chroot Freetz Images Freetz Faqs

Installing QEMU

Testversion in Überarbeitung und Übersetzung


$ wget http://wiki.qemu.org/download/qemu-0.13.0.tar.gz
$ wget http://ftp.riken.go.jp/pub/FreeBSD/distfiles/qemu/qemu-0.13.0.tar.gz 
$ tar zxvf qemu-0.13.0.tar.gz 

To build QEMU a few packages like SDL needs to be installed on your system. As QEMU is present in the archive, just run:

$ su -c "apt-get install libadplug-dev"
$ su -c "apt-get install cl-sdl"
$ su -c "apt-get install gcc-3.4"

Then run the configure script. Note that you need to use gcc version 3.4, as some parts of QEMU do not build with newer gcc versions.

$ cd qemu-0.13.0
$ ./configure --cc=gcc-4.4

Then compile it:

$ make

And install it on your system:

$ su -c "make install"

Preparing the installation First you need to create an image of the hard disk. In my case I have chosen to emulate a 10GB hard-disk, but this size could be changed to correspond to your needs. Note that the file is created in qcow format, so that only the non-empty sectors will be written in the file. A small tip: create a directory to hold all the files related to the emulated MIPS machine.

$ qemu-img create -f qcow hda.img 10G

MIPS Kernel Image:

$ wget http://ftp.nl.debian.org/debian/pool/main/l/linux-2.6/linux-image-2.6.20-1-qemu_2.6.20-3_mips.deb
$ ar x linux-image-2.6.20-1-qemu_2.6.20-3_mips.deb data.tar.gz
$ tar -zxvf data.tar.gz ./boot/vmlinux-2.6.20-1-qemu
$ wget http://ftp.de.debian.org/debian/dists/testing/main/installer-mips/current/images/sb1-bcm91250a/netboot/initrd.gz

Installing Debian Etch To start the installation process, use the following line:

$ qemu-system-mips -kernel .../qemu-0.9.0/boot/vmlinux-2.6.20-1-qemu -initrd
initrd.gz -hda hda.img -append "root=/dev/ram console=ttyS0" -nographic

After a few seconds you should see the kernel booting: And then the first screen of the Debian-Installer: Proceed as a normal installation, until you get to the following screen. Debian-Installer complains that it can't find kernel modules. This is normal because the initrd of another platform is used. This is not really a problem as the QEMU kernel has been compiled with the network driver, the disk driver and ext3 support built-in. However that means you won't be able to install Debian on an XFS partition. This is a known limitation that will disappear when the MIPS QEMU platform is supported in Debian-Installer. So in short answer yes, contrarily to what is suggested. During the installation, Debian installer will complain that it can not found a suitable kernel for this platform, as shown on the screenshot below. This is due to the fact that Debian- Installer currently does not support the QEMU platform; the support will be added post-Etch. An unofficial kernel being provided directly to QEMU, you can safely ignore this message and continue the installation. Near to the end of the installation you will get the following error screen: Again consider this message as harmless. There is no need for a bootloader, as QEMU is able to directly load a kernel and an initrd. Then you will get to the end of the installation. Congratulations! When the systems reboot, just exit QEMU as different parameters have to be used to boot the installed system. Personally, I use killall qemu-system-mips, but other methods could also work. Using the system First boot To start the system use the following command:

$ qemu-system-mips -kernel .../qemu-0.9.0/boot/vmlinux-2.6.20-1-qemu -initrd

initrd.gz -hda hda.img -append "root=/dev/hda1 console=ttyS0" -nographic After a few seconds the system should give you a login prompt: The first thing to do is to install the kernel image corresponding to the running kernel This will install all the modules that you may need. It is available in Sid, but not yet in Etch, therefore you have to download it manually.

$ wget http://ftp.nl.debian.org/debian/pool/main/l/linux-2.6/linux-image-2.6.20-1-

qemu_2.6.20-3_mips.deb

$ su -c "dpkg -i linux-image-2.6.20-1-qemu_2.6.20-3_mips.deb"

hda.img to your USB-Harddisk First umount your USB-Harddisk from your PC

$ su -c "umount /dev/sda... "
$ su -c "dd if=.../had.img of =/dev/sda"

Now mount your USB-Harddisk and Copy al Files to a Folder. (“for example fritzboxdebian”)

$ su –c "mount /dev/sda... "

Format and mount your USB-Harddisk and then Copy the “fritzboxdebian” Folder to your Formated USB-Harddisk. Boot Debian on Fritz box: mount USB-Harddisk

$ modprobe ext2/3
$ mkdir /var/media/ftp/Harddisk/fritzboxdebian
$ chmod 777 /var/media/ftp/Harddisk/fritzboxdebian/
$ mount –t ext2/3 /dev/sda... /var/media/ftp/Harddisk/fritzboxdebian
$ chroot /var/media/ftp/.../fritzboxdebian/ bash

Quellenangaben

http://www.aurel32.net/

Wichtige Links