198
edits
Changes
→Pidora QEMU
= Pidora QEMU =
{{Admon/important| Security Warning! |This page is a work in progress. The page is not formatted correctly and Please read the information instructions carefully, there may be errors or may not lead to breaking your computer. Donwrong information, be careful if you don't use this page till it is complete, or you really know what you are doing.}}
This page is here to assist people who would like to run Pidora 2014 in a QEMU environment. This tutorial has been adapted from this website: http://xecdesign.com/compiling-qemu/
== Pidora QEMU Compose ==
Using pidora Pidora in a qemu QEMU environment has some important restrictions to note. The model that is used to emulate pidora Pidora has a hard coded restriction on how much ram RAM it can use(256mb256 MB). However the The programs that we use(livemedia-creator) for composing new images require much more RAM, which makes the Pidora QEMU Environment a bad place to try and create images. (See compose on Fedora Arm QEMU)
= Pidora QEMU Setup =
The two stages to setting up Pidora QEMU involve, getting all the files (kernel, image) and installing the QEMU environment.
== Getting The Files ==
<pre>
# Choose the directory to put both the image and the compiled qemu QEMU software
pidora_dir=/data/pidora-qemu
cd ${pidora_dir}
# Download the qemu QEMU kernel
wget http://xecdesign.com/downloads/linux-qemu/kernel-qemu
# Download the pidora Pidora image
wget http://pidora.ca/pidora/releases/20/images/Pidora-2014-R1.zip
unzip Pidora-2014-R1.zip
</pre> == Getting QEMU == There are multiple ways to get qemu-system-arm. You can compile a new version with a few select flags, or you can try installing the version that your distribution has already compiled. It is possible that the QEMU packaged in your distro was not compiled with the proper flags, however it seems to work on the latest Fedora 20. === Package Install ===This method should probably be good enough to run Pidora in Qemu. I have only tested on Fedora 20, and it works. <pre>yum install qemu-system-arm</pre> === Manual Compile ===If the above package does not allow you to boot Pidora through QEMU, you can try the manual instructions below. This will allow you to use the QEMU software without actually installing it on your system (I don't like installing source files that are not managed by yum). The manual compile will require the dependencies for the program to already be installed. Below is a list of packages that might be required (I think only the devel ones are needed?).<pre># Install Dependencies (not sure if the non-devel packages are required?)yum install gcc-++ zlib zlib-devel SDL SDL-devel pixman pixman-devel libfdt-devel libtool glib2 glib2-devel</pre> Compile qemu-system-arm: <pre># Choose the directory for the compiled QEMU softwarepidora_dir=/data/pidora-qemu # Make a new directory for qemu QEMU and enter it
mkdir ${pidora_dir}/raspidev/
cd ${pidora_dir/raspidev/
git clone git://git.qemu-project.org/qemu.git
cd ${pidora_dir}/raspidev/qemu/
# Configure the options for raspberry pi
./configure --target-list="arm-softmmu arm-linux-user" --enable-sdl --prefix=/usr
# Finally, compile it
make
</pre>
= Boot Pidora in QEMU =
Make sure you run the steps in "Before Booting" and "The First Boot" before you start Pidora for the first time to avoid issues.
== Before Booting =={{Admon/important| Warning! | Running the command "dd" can be dangerous and could result in data loss if not used properly.}}Make sure that you add some more space to the image file. Depending on what you want to do with the Pidora image you may want more space. Replace the value in the variable size, with the number of GB to increase the size of the image with.<pre># Choose the directory for the compiled QEMU softwarepidora_dir=/data/pidora------------------------------qemu
<pre># use whatever Choose the directory you'd likefor the compiled QEMU software
pidora_dir=/data/pidora-qemu
<pre>#!/bin/bash# I think you might only need to install Choose the devel packages in directory for the below command.compiled QEMU softwareyum install gcc-++ zlib zlib-devel SDL SDL-devel pixman pixman-devel libfdt-devel libtool glib2 glib2pidora_dir=/data/pidora-develqemu
# Hopefully now, you have all This is the dependencies on command to boot the Pidora Image using the compiled version of QEMU${pidora_dir}/raspidev/qemu/arm-softmmu/qemu-system-arm -kernel ${pidora_dir}/kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw" -hda ${pidora_dir}/Pidora-2014-R1.img</pre>
<pre># The binary can be found in: ${!/bin/bash# Choose the directory for the compiled QEMU softwarepidora_dir}/raspidev=/qemudata/armpidora-softmmu/qemu-system-arm
# As per XEC's instructions I did This is the following(though I used vi)command to boot the Pidora Image using the compiled version of QEMU${pidora_dir}/raspidev/qemu/arm-softmmu/qemu-system-arm -kernel ${pidora_dir}/kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw 3" -hda ${pidora_dir}/Pidora-2014-R1.img</pre>
# Now just close This is the window or shut it downcommand to boot the Pidora Image using the compiled version of QEMU${pidora_dir}/raspidev/qemu/arm-softmmu/qemu-system-arm -redir tcp:2222::22 -kernel ${pidora_dir}/kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw 3" -hda ${pidora_dir}/Pidora-2014-R1.img</pre>
=== Graphical Boot With SSH ===
This is an example of the above graphical boot with the added redirect option to enable ssh.
<pre>
#!/bin/bash
# Choose the directory for the compiled QEMU software
pidora_dir=/data/pidora-qemu
# At this point it's probably a good idea This is the command to increase boot the Pidora Image using the size compiled version of the QEMU${pidora_dir}/raspidev/qemu/arm-softmmu/qemu-system-arm -redir tcp:2222::22 -kernel ${pidora_dir}/kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw" -hda ${pidora_dir}/Pidora-2014-R1.img file. If you don't it might cause some errors when you start first boot and it tries to resize your partitions and filesystem.</pre>
If for some reason the Pidora Partitions did not resize after running first boot and you did run the dd command above to increase the size of the image, then we will manually resize the file system here.
#WARNING: The following This is done on the qemu machine. This only needs command to be done if you need to manually resize boot the partitions on the image because you forgot to increase Pidora Image using the compiled version of QEMU${pidora_dir}/raspidev/qemu/arm-softmmu/qemu-system-arm -kernel ${pidora_dir}/kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw 3" -hda ${pidora_dir}/Pidora-2014-R1.img file size before you started first boot.</pre>
<pre># On the pidora qemu instance that is booted in multi user modestart fdisk program
fdisk /dev/sda
resize2fs /dev/sda2
</pre>