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/imagetool-uncompressed.py tools/imagetool-uncompressed.py.orig
Then I went into the script and made changes to two lines
changed the lines:
load_to_mem("boot-uncompressed.txt", 0x00000000) load_to_mem("args-uncompressed.txt", 0x00000100)To:
load_to_mem("/usr/share/imagetool/boot-uncompressed.txt", 0x00000000) load_to_mem("/usr/share/imagetool/args-uncompressed.txt", 0x00000100)
view the imagetool-uncompressed.py 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/imagetool-uncompressed.py.orig tools/imagetool-uncompressed.py > ~/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.patchafter %setup section I applied the patch
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: http://zenit.senecac.on.ca/wiki/index.php/Package_the_Raspberry_Pi_kernel_utility
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