Importing SRPM’s and RPM’s into Koji June 25, 2010
Posted by Paul Whalen in Uncategorized.add a comment
In order to get our instance of Koji up and running we need to import packages already built on ARM. The first step is to look at the packages that are in Fedora 13, that were also in Fedora 12. This can be done by looking at the package list in Fedora 13 found here, and including only rpms ending in ‘fc12.src.rpm’ and ‘fc11.src.rpm’. Once that list is compiled, it was then checked against the list of existing packages built on ARM, making sure the version number also matched. The list of packages ended up being 3024/9157.
Both the source and binary rpms were available on our local repo so importing them into Koji was a simple process. A short script was created to go through the list and import both the source and binary rpm packages.
#!/bin/bash
while read line
do
echo 'importing' $line
koji import /var/www/html/yum/base/12/arm/$line*.rpm /var/www/html/yum/source/12/arm/$line*.rpm
done < package.lst
Once all the packages are imported, to tag them all in Koji enter the following command:
koji list-untagged | xargs -n 1 koji call tagBuildBypass dist-f13
This tags all untagged packages as dist-f13.
Creating ARM VMs for use with Fedora 12 March 22, 2010
Posted by Paul Whalen in Uncategorized.add a comment
We have decided to work on Fedora support for the ARM architecture. As mentioned previously the two primary architectures for Fedora are i386 and x86_64 however there are a number of secondary architectures including ARM. ARM is a widely used processor that many people may be unfamiliar with. ARM processor uses range from cell phones, tablets and netbooks. The plan is to create a Koji build farm for the ARM architecture. Because we currently do not have a ARM box to run initial mock tests on so we can get an idea of how long it will take for each build, we will do the first part of the testing on Virtual Machines through QEMU emulation.
The eight ARM VM’s are to be created on Hong Kong and assigned to individual builders and use mock to build a total of 7 larger packages each. The instructions for setting the VM’s can be found on the Fedora website (http://fedoraproject.org/wiki/Architectures/ARM/HowToQemu) as well as the resources required to get started including the Root file system tar-ball and pre-built kernel images or instructions to create the image from source. The machines were named “arm-001-00x” with the ‘x’ representing the individual machine number. Small edits were required to the XML file’s for each machine including changing the paths, VM name as well as making sure the MAC addresses for each of the machines were unique. Once completed a machine was booted using the commands
virsh define NameOfFile.xml
virsh start arm-001-007
After the machine was booted, I used the “virt-manager” GUI to sign in and “dhclient” to obtain an IP address, then download “system-config-network-tui” and ran “system-config-network” to set up the network. Once completed I assigned the static IP address and made sure the VM was online. The VM was shutdown using the command “virsh shutdown arm-001-007″. I then mounted the file system to copy the network information from the completed machine to each of the other seven VM’s, making small changes to ensure all machines were using different IP’s and MAC addresses.
After this process was complete, the hosts file on Hong Kong was edited to allow users to ssh into the VM with the machine name, rather then the IP. All VM’s were booted and tested for connectivity. The list of VM’s and assigned user can be found here: http://zenit.senecac.on.ca/wiki/index.php/Fedora_ARM_Secondary_Architecture/ARM_VMs.
Next… Mock testing on the VM’s.
Testing the Newly Created RPM with Koji March 21, 2010
Posted by Paul Whalen in Uncategorized.add a comment
Now that I have successfully created an rpm I need to test that source using Koji. Koji will take the rpm and ensure it builds on the four supported architectures for Fedora – i386, x86_64, ppc, and ppc64. Following the instructions posted on http://fedoraproject.org/wiki/PackageMaintainers/UsingKoji. I installed Koji using the command
yum install fedora-packager
Then ran the set-up by running
/usr/bin/fedora-packager-setup
After this was completed the RPM was submitted using the command
koji build dist-f12 --scratch snort-2.8.5.2-1.fc12.src.rpm
Signing into the web interface for Koji found at http://koji.fedoraproject.org/koji/ you can then view the results and see information if the RPM failed to build. The sign in is done with the certificate created in the Koji guide. After signing in I found my RPM did not successfully build on the x86_64 platform. I will have to revisit this, however we now have a more important task at hand. Which will be covered in the next post.
Creating a Custom Spec file for Snort February 18, 2010
Posted by Paul Whalen in Uncategorized.add a comment
Now to create a custom spec file to be used to build an rpm package for use with Fedora Core 12. First I ran the command:
rpmdev-newspec snort
This will create a skeleton spec file that will be used to create the new rpm package. After filling out the details of the package, I ran the command:
rpmbuild -ba snort.spec
It seemed to be running fine until it hit the make section, then failed. Apparently this was due to the ‘-j3′ option being added to make, the package would not build. After altering the spec file and removing this option, as well as a few tweaks, the package was successfully built. I have included an excerpt for the specific lines that were added below:
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
rm -rf %{buildroot}/usr/src/
mv %{buildroot}/%{_datadir}/doc/%{name} %{buildroot}/%{_datadir}/doc/%{name}-%{version}/
%clean
rm -rf $RPM_BUILD_ROOT
%doc LICENSE RELEASE.NOTES COPYING
%{_bindir}/*
%{_libdir}/*
%{_mandir}/*/*
This built the packages successfully, but now I need to check the rpms. I checked the created rpm binary with rpmlint, running the comand:
rpmlint snort-2.8.5.2-1.fc12.i386.rpm
I discover ‘unstripped-binary-or-object files’, and ‘devel-file-in-non-devel-package’ warnings, 32 in total, however no errors. Running the rpmlint command on the source rpm and the spec file there are no errors. I decided to move forward and revisit the warnings later.
Moving forward I tested with Mock. Using the command:
mock -r fedora-12-i386 --rebuild snort-2.8.5.2-1.fc12.src.rpm
I received errors about build dependencies, checking the log files I needed to add both ‘ibpcap-devel’ and ‘pcre-devel’ to BuildRequires in the spec file. Once that was done and the package was rebuilt using:
rpmbuild -bs snort.spec
Mock was re-run and finished without errors.
Next, Testing with Koji.
Creating a Snort Package for use with Fedora 12 (default spec file) February 9, 2010
Posted by Paul Whalen in Uncategorized.add a comment
First we need to create a packaging environment. I downloaded rpm-build, rpmdevtools, rpmlint using the ‘yum’ command. Then used the “rpmdev-setuptree” command to set up the packaging environment which created a new folder in my working directory called ‘rpmbuild’ which contained the folders ‘BUILD’ , ‘RPMS ‘ , ‘SOURCES’ , ‘SPECS’ and ‘SRPMS’. Then using the command ‘yumdownloader –source snort’ I downloaded ‘snort-2.8.5.1-1.fc12.src.rpm’, the source package for Snort. I then ran the command ‘rpm -i snort-2.8.5.1-1.fc12.src.rpm’.
Moving to the rpmbuild directory I now find in the ‘SOURCES’ folder the files ‘snort-2.8.5.1.tar.gz’, ‘ snortd’ and ‘ sysconfig.snort’. And in the SPEC folder there is now a file ‘snort.spec’.
Now to rebuild. I ran the command ‘rpmbuild –rebuild snort-2.8.5.1-1.fc12.src.rpm’ but received ‘Failed build dependencies’ errors with a list of packages. Installing the needed packages I ran the command again and this time was successful. The default spec file creates 10 different rpms and include snort compiled with different configuration options.
Next I will be creating my own Snort spec file and posting the results.
Installing from Source – Nled, Apache (httpd-2.2.14) and Snort(2.8.5.2) – And the dreaded Norwalk Virus January 31, 2010
Posted by Paul Whalen in Uncategorized.add a comment
It’s been a while since I posted and for that I apologize. I was extremely ill with the Norwalk Virus. If you’ve had it, you will never forget the name and the loss of weight, time and energy.
I have been experimenting with installing software from source code and decided to use a couple of programs most of you are somewhat familiar with – Nled (Nifty Little Editor), Apache web server and Snort. Nled is a simple text editor created by Evan Weaver is who is part of the faculty at Seneca@york, which as a fan of vi I haven’t used much but it seems to have it’s supporters. Apache is the most popular web server and you have no doubt some experience with and Snort is an intrusion detection system (IDS) used to monitor network traffic and behaviour to detect unusual activity that could lead to an attack.
First – Nled. I obtained the source code for the editor from http://cdot.senecac.on.ca/software/nled/, and untarred the package. I then used the make command. Almost immediately I received an error: ncurses.h no such file or directory. Using ‘yum search ncurses.h’ I found the packages that contained the file, installing - ncurses-devel.i686 , which contained development files for the ncurses library. I then tried make again and was successful. Now on the other software.
Second I attempted Snort. Snort is an IDS that I have been experimenting with as a means of detecting unauthorized access to my network server. I obtained the tarball from the snort website – http://www.snort.org/downloads/ and untarred the package. From within the directory I used the ‘./configure’ command. Another error :
ERROR! Libpcap library/headers (libpcap.a (or .so)/pcap.h)
not found, go get it from http://www.tcpdump.org
or use the –with-libpcap-* options, if you have it installed
in unusual place. Also check if your libpcap depends on another
shared library that may be installed in an unusual place
I know I have libpcap installed. I then search for all the other packages with libpcap – ‘yum search libpcap’ and find the ‘libpcap-devel.i686 14:1.0.0-4.20090922gite154e2.fc12′, and use yum to install. Running configure again I recieved this error:
ERROR! Libpcre header not found.
Get it from http://www.pcre.org
I again used ‘yum search pcre’ to determine what needs to be installed and determine I needed ‘pcre-devel.i686 0:7.8-3.fc12′, using yum I installed this package and upon running ‘./configure’ I am now successful! Moving on I ran ‘make’ and was successful, and ‘make install’ and was successful yet again, on a roll.
Finally – Apache. I obtained the source code from http://httpd.apache.org/download.cgi and extracted the tarball. I then ran ‘./configure’, make and finally ‘make install’ with no errors.
Hello fellow SBR600 students! January 15, 2010
Posted by Paul Whalen in Uncategorized.add a comment
My name is Paul Whalen, this is my last semester in CTY at Seneca. I look forward to an exciting semester in SBR!
I can be found on the IRC using the nick PaulW or paulfedora and reached at the email address paul.fedora@gmail.com.
Here is a snippet of a IRC coversation:
<PaulW> Hey guys, how you doing? Saturday night, anyone around?
<the_wonderer> all of’em here but no body is paying attention
<Corazu> ^ that
<PaulW> I’m playing catch up after a nasty bout with the Norwalk Virus. You gentlemen working on anything in particular?
Links