Friday, November 20, 2009

Packaging Modified gcc

Let the fun begin!

So, what I had to accomplish here was build a gcc package with all the patches necessary for the modifications needed by DXR. This sounds easier than it was, although looking back at it now the reason it took so long was a very small mistake.

The first thing that I started with was getting the spec file for regular gcc by running the command

"yumdownloader --source gcc"

followed by

"rpm -i gcc-4.3.2-7.src.rpm"

where both commands were done in my ~/rpmbuild/SOURCES/ directory.

Next thing I did was grab the patches using the command

hg init .
hg clone http://hg.mozilla.org/users/tglek_mozilla.com/gcc-moz-plugin-mq ~/gccplugins

and that put the patches in the directory ggcplugins in my home directory. After that I copied all the patches to the ~/rpmbuild/SOURCES directory.

From there all I had to do was the spec file which seemed easy. I added the lines -

#My Edits for modified GCC build
Patch20: plugin.patch
Patch21: gty.patch
Patch22: nopoison.patch
Patch23: parm_attrs.patch
Patch24: c_process_decl.patch

near the top of the file, and then the following lines in the %prep section -

#my patches
pwd
%patch20 -p1 -b .c_process_decl~
%patch21 -p1 -b .gty~
%patch22 -p1 -b .nopoison~
%patch23 -p1 -b .parm_attrs~
%patch24 -p1 -b .plugin~

My first problem came from using the -p0 switch when with these particular patches they need to use the -p1 switch. After my teacher and I found that out, there was still a problem becuase the patch failed because it was looking for the file gcc/tree-plugin-pass.c. After a good amount of googling I found that this file was actually created by one of the other patches (plugin.patch).

I then switched out c_process_decl with plugin and after that it built successfully.

The final build times were-

real 85m55.771s
user 135m26.897s
sys 51m59.042s

Tuesday, November 10, 2009

Testing g++ and modified g++

So we had the task in class of testing build times on a package using regular g++ and a modified g++. To do this we had to get the new modified version which I accomplished using this script here. After running this script you will have a new directory called "tools" in your home directory which has the new version of g++ in it.

First thing you should do before anything is test building a package that has a lot of c that needs to be compiled. I used abiword for this. I used the command

time rpmbuild -ba abiword.spec

to get the build times for this.

So to be able to use the modified g++ I had to change the the original /usr/bin/g++ to my new one. But we do not want to lose the old one so I just renamed the old one g++.original. I also did this for the c++ in /usr/bin.

Next I created a symbolic link using the command

su -c "ln -s /home/ashilts/tools/gcc-dehydra/installed/bin/[gc]++ /usr/bin"

and this command created a symbolic link name g++ and also one for c++ in the /usr/bin directory.

Next tried to do the building and it worked mostly until i got to the install section where it failed because it said there was something wrong with the rpaths. I asked my teacher Chris Tyler about this and he gave me the advice of using the command

time QA_RPATHS=$[ 0x003f ] rpmbuild -ba abiword.spec

to run the build process which worked perfectly. I am not very sure what rpaths are even after reading a wiki page on them, but I will link it for anybody that wants to get a little more insight on them.

RPATHS

So The final tests of mine showed that the regular g++ was a slight bit slower by around about 10 seconds at the most. Here is a chart with the stats

Test # Regular g++

Modified g++

1

real 6m42.508s

user 10m36.408s

sys 3m15.561s

real 4m20.988s

user 3m18.736s

sys 2m37.991s

2

real 3m43.744s

user 3m15.126s

sys 2m27.259s

real 4m18.335s

user 3m17.841s

sys 2m36.843s

3

real 3m44.547s

user 3m14.892s

sys 2m27.509s

real 3m51.537s

user 3m18.214s

sys 2m37.537s

4

real 3m41.988s

user 3m14.702s

sys 2m27.030s

real 4m15.478s

user 3m17.870s

sys 2m31.028s

Hmmm I was having troubles getting this table presentable but I think you should be able to make it out.

So in conclusion I think that the modified g++ had a decent build time but I dont know if it will be good enough to use when use to compile things that are much bigger and have longer build time.

I think that is all for now so cya!

Tuesday, October 20, 2009

RPM packaging and the J value

In the tests that I tried for the J value(value to change cpu setting) have not really had any big differences, where the fastest elapsed time for a build clocked in at 2:50.66 and that was for the J value of 9 on the 2nd iteration. This was not a very huge improvement as the longest elapsed time was 2:51.60 for the J value of 5 on the 1st iteration. This was all done on the Ireland CDOT machine using the following script with the MegaMek package-------->

##script to change the build values on the cpu to test which is the fastest optimal build setting
rm ~/value.log
for ((j=5; j<=9; j++))
do
mv ~/.rpmmacros ~/.rpmmacros.old
grep -v smp_mflags ~/.rpmmacros.old >~/.rpmmacros
echo "%_smp_mflags -j$j" >>~/.rpmmacros

for ((x=1; x<=3; x++))
do
echo "-j: $j x: $x" >> ~/value.log
echo "build J value $j, iteration $x"
/usr/bin/time -o value.log -a rpmbuild -ba --quiet ~/rpmbuild/SPECS/MegaMek.spec
done
done

---------------------------------------------------------

J Value

Iteration

1

2

3

5

2:51.60

2:50.75

2:51.15

6

2:50.80

2:51.01

2:50.92

7

2:50.89

2:50.74

2:50.87

8

2:50.86

2:50.82

2:50.71

9

2:50.80

2:50.66

2:50.83

Thursday, October 15, 2009

Creating my RPM repository

Almost all the information that I needed to complete this task I received from the notes my professor Chris Tyler gave in class which are here: Creating Repository Instructions

In addition to these notes I had to make sure to change the ownership of my directory in /var/www/html, and I did this using the command "sudo chown -R Adam:Adam ." while in /var/www/html/ashiltsrepo.

To make this repository into an RPM you must first have a build root for RPMs if you do not already have one. To do this run the command

rpmdev-setuptree

and this will create a "~/rpmbuild" directory.

Next you must create a SPEC file or use and existing one. I got a sample of a repo spec file from this website here. This website also has a whole walkthrough for creating a yum repo which is very clear and easy to follow. Put that spec file into your ~/rpmbuild/SPECS directory and edit the fields to fit your repo. Next create a "repoName.repo" file and place that ~/rpmbuild/SOURCES. My repo file looks like this

[ashilts]
name= ashilts repo for $releasever - $basearch
baseurl=http://scotland.proximity.on.ca/ashiltsrepo/
failovermethod=roundrobin
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ASHILTS


Along with this repo file should be the "RPM-GPG-KEY-'KEYNAME'" file that should have been made earlier from following the instructions in the links. After all these files are in place run the command

rpmbuild -ba ~/rpmbuild/SPECS/yourRepoSpec.spec

After this is done a RPM should be placed in your "~/rpmbuild/RPMS/" dir. I moved the file to my web directory "/var/www/html/ashiltsrepo" and made a simple web page with a link to the new rpm. Now anybody can download this rpm and install the rpms that I have packaged and uploaded to my server.

To Download My Repository click HERE.

Here is a picture of me downloading my repo: LINK

To use your repo to download your rpms if they are already in other yum repo's that have higher significance yuo will have to use the command

yum install --disablerepo=fedora,updates "yourPackageName"

Under the disable repos switch you will have to add any repos that you have on your machine that has the package that you do not want to install from.

And this a picture of me downloading one of the rpms I built and put in my repo: LINK

This should be it for setting up your repository, because mine works fine :)

Peace out

Tuesday, October 6, 2009

Filezilla, Mock and Koji

So to catch everyone up from my last blog, I have fixed the errors that I had by adding the lines :

rm -rf $RPM_BUILD_ROOT/usr/share/locale/gr
%find_lang %{name}

and thanks to my teacher Chris Tyler for this info.

So my next step was doing the mock build using the command "mock -r fedora-11-i386 --rebuild filezilla-3.0.3-1.fc11.src.rpm" and that went fine with no errors at all.

So just a few minutes ago I installed all the necessary stuff required for koji use by following the Fedora Koji Guide. This was a very easy and painless procedure. The next step was to try and do the koji build and to find how to do this I used fellow class mate Boris' blog where I got the command "koji build --scratch dist-f10 filezilla-3.0.3-1.fc11.src.rpm". When I ran that it went and did its thing, then and about five minutes later it was all successful. :)

Here are the links to my complete koji build and source rpm:

Koji build
Source RPM

P.S. While searching around on the Koji site I saw that Jesse Keating previously packaged filezilla. I just thought that was something cool to share with the class.

Till next time, Goodbye!

Thursday, October 1, 2009

Progress on Building Filezilla

So after having the all the problems in class with installing ettercap I decided to avoid it completely and instead build Filezilla.

So at first I just filled in the basic spec file, then ran the "rpmbuild -ba filezilla.spec" command, and it got stuck because it said that I didnt have gcc. I thought that I did have it so I of course did a quick google search are saw that I needed to install gcc-c++ so i did a quick yum install gcc-c++ and everything was fine for that error.

I recieved a few more errors later because I needed to install libidn-devel,
gnutls-devel, and wxGTK-devel. I found these specific packages using "yum provides "*errorInBuild*" command, replacing the error in the quotes of course.

It made it to the end of the build on my next try except it said that there was a whole load of files that were "unpackaged but not installed" or something along those lines. I did a google search of that error and I came to a forum that said to add the file paths of the files not being removed to the %files section of the SPEC file. So I added the following lines-

/usr/share/locale
/usr/share/filezilla
/usr/bin/filezilla
/usr/bin/fzsftp
/usr/share/applications/filezilla.desktop
/usr/share/pixmaps/filezilla.png

and the build finished successfully. I then ran rpmlint on the rpm, source rpm, and the spec file. First errors was that there was no documentation so I added README COPYING INSTALL after the %docs section. I found these files in the tarball and assumed they were what the error wanted me to add. So currently I am getting the errors -

filezilla.i386: E: incorrect-locale-el /usr/share/locale/gr/filezilla.mo
filezilla.i386: W: file-not-in-%lang /usr/share/locale/gr/filezilla.mo
filezilla.i386: W: file-not-in-%lang /usr/share/locale/he_IL/filezilla.mo

and there is about 40 lines like this. I am not really sure where to go from here so I plan on getting help in class today.

Heres my source rpm

Sunday, September 27, 2009

Teleconference with Jesse Keating

So in my SBR600 class recently we had the pleasure of hearing from Jesse Keating, one of the members of the release team for the Fedora Project. This was a very informative session and I got to learn a lot about the release phase of Fedora and a little of what working for Fedora itself is like. Although he was very informative, I do regret not thinking to ask him of how he got to work as part of the Fedora team because from the sounds of it, it is a very fun a fulfilling job. I could definitely see myself having a great time working as part of the team.

Friday, September 11, 2009

Building packages from source

So first I started with building nled from source on my laptop which is running Ubuntu 8.04. Right from the start it was not ready to be done at all. The problems were not that hard to fix though. I just had to download the packages "build-essentials", which I believe is the C compiler, and the ncurses library. From my searching I found that ncurses is just a toolkit for developing GUI-like apps. The exact commands I used to install these are:

sudo apt-get install build-essentials

sudo apt-get install libncurses5-dev

After these were installed, I ran the make command and everything worked perfectly.

The next thing that I decided to build was the program called ettercap. Ettercap is a program that is "A multipurpose sniffer/content filter for man in the middle attacks" as the man page for it states. I know what you may be thinking but dont worry, I am using this program in a completely non-threatening way :). This program did prove to be quite a bit more stubborn to install. I was missing several packages. I started by getting the libpcap, libnet, libpthread and zlib packages by using the built in synaptic package manager in ubuntu. After that I could run the configure but it still needed to have the packages GTK+, ATK, and Pango to be able to run the GUI version. I was able to get the ATK and Pango packages from the package manager as well but when I tried to find the GTK+ package there was so many to choose from that I didn't know which one to get. A quick google search later and I found that I needed to run "sudo apt-get install libgtk2.0-dev" to get the package. I ran the configure command again, waited, ran make, waited, ran sudo make install, then it was all done.

I have added a picture of the finished product just to maybe make this blog a little more appealing.

Adam Out!


Wednesday, September 9, 2009

Hello SBR600 and CDOT

Hello everybody out there.

Well this is my very first blog post for SBR600 and I haven't really had much practice with bloggin' so I'm just gonna get right to the point with this.

Here's my IRC chat, its short but I couldn't think of much to say:

adam_hilts: hey i just got a copy of fedora 10 and was just wondering if it is better to download and use a f11 disc or if the upgrade will be easy?

d3x7r0:Adam_hilts, I would say it would be better to get the F11 iso if you can.

Adam_hilts:d3x7r0: ok thank you

Heres my Fedora Wiki

And last but not least my Seneca Wiki

P.S. IDK if its just me but pasting stuff into blogger is a real pain.