Personal tools

Log in

Changes

From IGEP - ISEE Wiki

Jump to: navigation, search

QEMU

911 bytes added, 10:06, 31 August 2012
Board Emulation
$ [http://git.linaro.org/gitweb?p=qemu/qemu-linaro.git;a=summary git clone git://git.linaro.org/qemu/qemu-linaro.git]
Download IGEP support patch for QEMU from this [http://downloadswww.igepisee.esbiz/QEMUcomponent/0001zoo/item/qemu-IGEP_QEMU_support.path emulator link ]and after that apply the patch as:
<pre>$ cd qemu-linaro
Install QEMU:
<pre>$ make install</pre>
Optionally you can download from [http://downloadswww.igepisee.esbiz/QEMUcomponent/zoo/item/qemu-linaro.tar.gz emulator here] the QEMU binaries, we suggest install it under /opt directory with the right user execution permissions.<br>
== Board Emulation ==
<pre>$ cd /opt/qemu-linaro/bin
</pre>
We provide a QEMU ready image based on Ubuntu/Linaro Nano (Oneric 11.11) image, it can be download from [http://downloadswww.igepisee.esbiz/QEMUcomponent/igepzoo/item/qemu-nano.img emulator here](first uncompress it).<br>
The image has 2 partitions (you can see the partitions using fdisk -ul command as: fdisk -ul igep-nano.img)<br>
Optionally you can mount the partitions in you host PC and modify the content as:<br>
<pre>First Partition:
$ mount -o loop,offset=$[63*512] igep-nano.img /mnt/tmp
</pre><pre>Second Partition:
$ mount -o loop,offset=$[106496*512] igep-nano.img /mnt/tmp</pre>
Now you're ready for execute the emulator in a console with this command:<br>
<pre>qemu-system-arm -M igep -m 512 -clock unix -serial stdio -drive file=igep-nano.img,if=sd,cache=writeback -usb -monitor telnet:localhost:7100,server,nowait,nodelay -device usb-kbd -device usb-mouse</pre>
Parameters:<br>
-m&nbsp;: Memory assigned to the Virtualized board in Mega Bytes. <br> <br>
== TIPS<br> ==[[Image:QEMU boot.png|thumb|center]]
=== Extending Rootfs partition<br> Tips ===
We will extend the second partition adding a 20 Giga Bytes to rootfs.<br> === Resize Rootfs Partition ===
We will resize our rootfs partition adding 1 GB at end.  First you should we create a new raw file using qemu-img as:<br> <pre>$ qemu-img create -f raw addon.raw 20G1G </pre> With addon.raw we concatenate it should create a at end of our image file like thisas:<pre>$ cat addon.raw &gt;&gt; igep-nano.img </pre> Next step it's modify the partition table information. We will use cfdisk utility for modify the information. <pre>$ sudo cfdisk igep-nano.img <br/pre> Next step it's select your rootfs partition as this picture shows  [[Image:Cfdisk change size partition.png|thumb|center]]Select the menu '''RESIZE''' and select '''CHANGE&nbsp;SIZE'''&nbsp;option.  [[Image:Cfdisk change size partition option.png|thumb|center]]Select resize at '''END'''.
-rw-r--r-- 1 mcaro mcaro 21474836480 2012-01-10 19[[Image:03 addonCfdisk resize end.png|thumb|center]]Enter the MAX new size and press enter key.raw<br>
Now we concat at end We will write the addon file changes to our original file as:<br> the disk using the '''commit''' menu option and select '''YES''' (confirm the changes).
The next step it's update the file-system structure. <pre>$ cat addon.raw &gt;&gt; sudo losetup /dev/loop0 igep-nano.img<br> -o $[106496*512]
We will use Gparted for resize the Rootfs partition, open gparted as root using the igep$ sudo e2fsck -nano.img file as:<br> f /dev/loop0
$ sudo gparted igepe2fsck 1.41.14 (22-Dec-nano.img2010)rootfs: recovering journalPass 1: Checking inodes, blocks, and sizesPass 2: Checking directory structurePass 3: Checking directory connectivityPass 4: Checking reference countsPass 5: Checking group summary information
[[Imagerootfs:Gparted_added_new_space_allocation***** FILE SYSTEM WAS MODIFIED *****rootfs: 11969/5579872 files (0.png|thumb|center]]Select Partition 2 and using right mouse button click over resize option as:6% non-contiguous), 1126338/22491136 blocks
[[Image:Gparted_select_resize.png|thumb|center]]$ sudo resize2fs /dev/loop0
$ sudo losetup -d /dev/loop0 <br/pre> Now you should see your new partition with your wished new size.
<br>[[Category:Development_tools|QEMU]]