Friday, 13 April 2012

UPDATE to Release 0.3 of Packaging Kernel Utility

Released my 0.3 on Thursday however there were some problems running the script that still had to be fixed after installing the rpm package. I've spent some time afterwards to try and fixed them after getting feedback from presenting my project on Thursday in my software build and release class. I needed to use the empty patch file I created to make modification to the original script and include it in my spec file.

Going back to the patch file I created a new patch that holds difference for the script. To create the patch file I needed to be in the directory

Once here I made a copy of the original source file
 cp tools/ tools/

Then I went into the script and made changes to two lines
vi tools/

changed the lines:
load_to_mem("boot-uncompressed.txt", 0x00000000)
load_to_mem("args-uncompressed.txt", 0x00000100)
load_to_mem("/usr/share/imagetool/boot-uncompressed.txt", 0x00000000)
load_to_mem("/usr/share/imagetool/args-uncompressed.txt", 0x00000100)

view the script is Here

Then I used the diff command to create the patch file by comparing the modified script with the original. Also this created the patch file within the directory ~/rpmbuild/SOURCES
diff -u tools/ tools/ > ~/rpmbuild/SOURCES/raspi-tools-0.2.imagetool.patch

Now that the patch was created, I updated the spec file with an entry to indicate the patch file and another entry to apply the patch.

after Source entry I indicated the patch
 Patch0:         raspi-tools-0.2.imagetool.patch
after %setup section I applied the patch
 %patch0 -p0

This is what my patch file looks like raspi-tools-0.2.imagetool.patch

Then I ran rpmbuild to test if that patch file worked and it was successful, below you can see when I ran rpmbuild that it asked what file to patch.

You can view my spec file Here

Once this was completed, I ssh into the Raspberry Pi, removed my old installed package and copied over and install the new package. I reinstalled
with rpm -Uvh raspi-tools-0.3-9.fc16.noarch.rpm

Then I tested running the script as the last time it was not able to find the two text files installed in /usr/share/imagetool. The screen below shows the whole process of installing and running the script.

After running the script it finally generated the files we wanted!!!.

The next point in this project if someone was to take over would be to work to merge "first32k.bin" with the kernel.img. Running the script produce the files we wanted however the script also produce this line
cat: ../linux/arch/arm/boot/Image: No such file or directory
I believe the work still needed to be done would require some editing of the python script so that It can read the files required that was not able to be cat.

I have included all versions of my package and script on my project wiki page witch is located here:

Also you can download the updated 0.3 with working package as well as source rpm below

View Spec file here raspi-tools.spec

Location of all my Releases and work: Project Folder