Open main menu

CDOT Wiki β

Changes

Pidora 2014 qemu

3,691 bytes removed, 13:13, 28 May 2014
no edit summary
== Pidora QEMU Compose ==
Using pidora in a qemu environment has some important restrictions to note. The model that is used to emulate pidora has a hard coded restriction on how much ram it can use(256mb). 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 ==
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 software
pidora_dir=/data/pidora-qemu
= 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 ==
</pre>
== Pidora Graphical Boot == <pre># Choose the directory for the compiled qemu softwarepidora_dir=/data/pidora-qemu # This is the 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> == Pidora Multi-user Boot == <pre># Choose the directory for the compiled qemu softwarepidora_dir=/data/pidora-qemu # This is the 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>  = Issues =Some issues can occur during the above processes. Some fixes are listed below. == Manually Resize Pidora ===
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.
<pre>
# start fdisk program
fdisk /dev/sda
# list all partitions, note the start location of partition 2
 
p
# delete a partition
# write/save the changes
w
reboot
<pre>
    == After the Pidora Graphical Boot ==restarts, run the following command to finish the resize setup:
<pre>
# Choose the directory for the compiled qemu softwarepidora_dir=/data/pidora-qemu # This is the 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=resize2fs /dev/sda2 panic=1 rootfstype=ext4 rw" -hda ${pidora_dir}/Pidora-2014-R1.img
</pre>
== Pidora Multi-user Boot == <pre># Choose the directory for the compiled qemu softwarepidora_dir=/data/pidora-qemu # This is the 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>    ------------------------------ This tutorial is basically just using the tutorial found on this site(http://xecdesign.com/compiling-qemu/), with some added steps specifically for pidora. This setup is done completely on fedora 20. If you are using ubuntu/debian it might be easier to use the site above. This setup avoids the installation of Now the newly compiled qemu, so that your system stays clean, and keeps your system and any already install qemu instances managed by yum. Some of the commands may need root. # use whatever directory you'd likepidora_dir=/data/pidora-qemu mkdir ${pidora_dir}cd ${pidora_dir}wget http://xecdesign.com/downloads/linux-qemu/kernel-qemuwget http://pidora.ca/pidora/releases/20/images/Pidora-2014-R1.zip unzip Pidora-2014-R1.zipmkdir ${pidora_dir}/raspidev/cd ${pidora_dir/raspidev/git clone git://git.qemu-project.org/qemu.gitcd ${pidora_dir}/raspidev/qemu/ # Before you can continue, you will probably need to install a bunch of build deps# I will show all the packages I needed to install for the configure/make to finish successfully# Note: I do NOT make install # I think you might only need to install the devel packages in the below command.yum install gcc-++ zlib zlib-devel SDL SDL-devel pixman pixman-devel libfdt-devel libtool glib2 glib2-devel # Hopefully now, you have all the dependencies on the system ./configure --target-list="arm-softmmu arm-linux-user" --enable-sdl --prefix=/usr make # The newly compiled qemu program should now have compiled Qemu environment has been successfully # The binary can be found in: ${pidora_dir}/raspidev/qemu/arm-softmmu/qemu-system-arm # As per XEC's instructions I did the following(though I used vi)  ${pidora_dir}/raspidev/qemu/arm-softmmu/qemu-system-armqemu-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 init=/bin/bash" -hda ${pidora_dir}/Pidora-2014-R1.img # Wait for the new qemu instance to boot for the first time, then do the below instructionsnano /etc/ld.so.preload # Put a # in front of the first line so that it looks like this:#/usr/lib/arm-linux-gnueabihf/libcofi_rpi.so Press ctrl-x then y then enter to save and exit.(Optional) Use steps 2 to 4 above extended to create a file /etc/udev/rules.d/90-qemu.rules with the following content:KERNEL=="sda", SYMLINK+="mmcblk0"KERNEL=="sda?", SYMLINK+="mmcblk0p%n"KERNEL=="sda2", SYMLINK+="root" # Now just close the window or shut it down  # At this point it's probably a good idea to increase the max size of the 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. # WARNING: This next command can be very dangerous, use at your own risk! Change the count=# number to the number of GB you would like to add to the size of the image. The command below should increase the size by 4 GB.# You may be fine with 1GB more or maybe, if you are going to try composing your own images, much much more!dd if=/dev/zero bs=1G count=4 >> ${pidora_dir}/Pidora-2014-R1.img # you should now be able to run this command to start the pidora instance and get to first boot. This is the same command above, except without the init=/bin/bash part.${pidora_dir}/raspidev/qemu/arm-softmmu/qemu-system-armqemu-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   # PROBLEMS: When I wrote this tutorial I accidentally ran first boot before I resized my image file, which cause a bunch of problems. I shut down the qemu instance after running first boot, and rebooted it in multi-user mode. This is done by adding a 3 to the arguments like in the below command.${pidora_dir}/raspidev/qemu/arm-softmmu/qemu-system-armqemu-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 #WARNING: The following is done on the qemu machine. This only needs to be done if you need to manually resize the partitions on the image because you forgot to increase the img file size before you started first boot. # Assuming that you ran the dd command above to increase the images size, you now need to manually modify the partitions size on the pidora image. # On the pidora qemu instance that is booted in multi user modefdisk /dev/sda>d>2>n>(press enter for default) >(press enter for default)>(press enter for default) >w# Shutdown the pidora qemu machine # Start the pidora qemu instance again and run the following command when it bootsresize2fs /dev/sda2 # Pidora should now have the proper root filesystem size.
198
edits