diff --git a/README_initial_setup.md b/README_initial_setup.md index ee24868..1cab87b 100644 --- a/README_initial_setup.md +++ b/README_initial_setup.md @@ -1,10 +1,10 @@ -Install Qemu +Install Qemu and Expect ============ Install the necessary packages: ``` - sudo apt-get qemu qemu-user-static + sudo apt-get install qemu qemu-user-static expect ``` Create a new image from scratch @@ -16,7 +16,8 @@ Create a new image from scratch * Unpack it: ``` - unzip 2015-02-16-raspbian-wheezy.zip + unzip 2015-05-05-raspbian-wheezy.zip + mv 2015-05-05-raspbian-wheezy.zip raspbian-wheezy.zip ``` Prepare the base image @@ -26,12 +27,6 @@ It will be used for the build environment and the final image. * [Add empty space to the image](resize_img.md) -* Edit `mount_image.sh` and change the `IMAGE` variable accordingly - -``` - IMAGE='2015-02-16-raspbian-wheezy.img' -``` - * Chroot in the image ``` @@ -64,8 +59,8 @@ Setup two images * Create two separate images: one will be used to build the deb packages that are not available in wheezy ``` - mv 2015-02-16-raspbian-wheezy.img BUILDENV_2015-02-16-raspbian-wheezy.img - cp BUILDENV_2015-02-16-raspbian-wheezy.img FINAL_2015-02-16-raspbian-wheezy.img + mv raspbian-wheezy.img BUILDENV-raspbian-wheezy.img + cp BUILDENV-raspbian-wheezy.img FINAL-raspbian-wheezy.img ``` Build environment specifics @@ -74,7 +69,7 @@ Build environment specifics * Create a symlink to the build image ``` - ln -s BUILDENV_2015-02-16-raspbian-wheezy.img 2015-02-16-raspbian-wheezy.img + ln -s BUILDENV-raspbian-wheezy.img raspbian-wheezy.img ``` * Chroot in the image @@ -147,8 +142,8 @@ Final image specifics * Change the link to the image ``` - rm 2015-02-16-raspbian-wheezy.img - ln -s FINAL_2015-02-16-raspbian-wheezy.img 2015-02-16-raspbian-wheezy.img + rm raspbian-wheezy.img + ln -s FINAL-raspbian-wheezy.img -raspbian-wheezy.img ``` * Chroot in the image @@ -196,6 +191,12 @@ Final image specifics sudo ./copy_to_final.sh ``` +* Get the PyCIRCLean modules +``` + pip install git+https://github.com/CIRCL/PyCIRCLean +``` + + * Exit the chroot Write the image on a SD card @@ -204,15 +205,29 @@ Write the image on a SD card *WARNING*: Make sure you write on the right filesystem ``` - sudo dd bs=4M if=FINAL_2015-02-16-raspbian-wheezy.img of=/dev/ + sudo dd bs=4M if=FINAL-raspbian-wheezy.img of=/dev/ ``` Run the tests ============= -Make sure to set the filename of the image in `tests/run.sh` +* Get the qemu kernel: +``` + pushd tests; wget https://github.com/dhruvvyas90/qemu-rpi-kernel/raw/master/kernel-qemu; popd +``` +* Put some test data from tests/testFiles into tests/content_img_vfat_norm + +* Comment out the other tests in tests/run.sh or populate those directories as + well + +* Make sure to set the filename of the image and the kernel in `tests/run.sh` + +* Run the tests: ``` sudo ./run_tests.sh ``` +* If the image run processed images correctly but doesn't exit and unmount the + images cleanly, look at tests/run.exp and make sure it's waiting for the + string your qemu and kernel actually produce. diff --git a/mount_image.sh b/mount_image.sh index 614c361..bc4aa26 100755 --- a/mount_image.sh +++ b/mount_image.sh @@ -31,7 +31,7 @@ PARTITION_BOOT='/dev/sdd1' # If you use the img ##### Debian -IMAGE='2015-02-16-raspbian-wheezy.img' +IMAGE='raspbian-wheezy.img' OFFSET_ROOTFS=$((122880 * 512)) OFFSET_BOOT=$((8192 * 512)) ##### Arch diff --git a/tests/run.exp b/tests/run.exp index bda5bf7..3db487f 100755 --- a/tests/run.exp +++ b/tests/run.exp @@ -2,7 +2,7 @@ set timeout -1 -spawn qemu-system-arm -kernel 140801-kernel -cpu arm1176 -m 256 -M versatilepb \ +spawn qemu-system-arm -kernel kernel-qemu -cpu arm1176 -m 256 -M versatilepb \ -append "root=/dev/sdc2 panic=1 rootfstype=ext4 ro console=ttyAMA0 console=ttyS0" \ -drive file=[lindex $argv 1],index=0,media=disk \ -drive file=[lindex $argv 2],index=1,media=disk \ diff --git a/tests/run.sh b/tests/run.sh index a20e033..f497d4b 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -1,8 +1,8 @@ #!/bin/bash -# http://xecdesign.com/qemu-emulating-raspberry-pi-the-easy-way/ +# http://pub.phyks.me/respawn/mypersonaldata/public/2014-05-20-11-08-01/ -IMAGE='../2015-02-16-raspbian-wheezy.img' +IMAGE='../raspbian-wheezy.img' OFFSET_ROOTFS=$((122880 * 512)) IMAGE_VFAT_NORM="testcase.vfat"