Project Deliverable Report [0.3] –> Testing Plan & Testing Script for Wi-Fi on the Trimslice

Hello World,

Within this blog post contain my notes for v0.3 deliverable for my project in Software Build and Release. I hope the information found here can educate/inform/help you all somehow. All things eventually come to an end, and so does my involvement in this project. My journey has been a rough one but overall successful because I have learned a lot in the process. What I have completed for this project would not have been possible without the help and guidance from Chris Tyler, Raymond Chan, Hugo Pombo and the good folks over at CDOT.  Thank you all very much.

Objective: Create an improved Wi-Fi test plan and test script based on my 0.2 deliverable.  Clean up bash script code to produce output that can help/benefit users. The ultimate goal of this objective is to provide the open source community with a deliverable that provides them with more thorough information about their wireless network card that will help them troubleshoot and learn.

My 0.3 deliverable is a bash script that tests Wi-Fi and provides a log that will allow users to further troubleshoot their wireless connections. The 0.3 version of my script is a lot more capable and produces readable output versus my 0.2 version. I hope to leave this script available to the general public so it can be used and modified for the benefit of the open souce community and for anyone looking to troubleshoot and find out information about their wireless network card.

Test Plan: This script will generate a report that includes valuable information such as:

-Available Wireless Network Interface
-WiFi Network Information
-Required Packages (wireless-tools)
-WiFi MAC Address
-WiFi Transmit Power (TX)
-WiFi Supported Authentication Capabilities
-Display a List of Peers/Access Points
-Display a list of Available WiFi Frequencies
-Display System-Related WiFi Information

The script can be found here: https://dl.dropbox.com/u/11159059/0.3dev
Sample Output: https://dl.dropbox.com/u/11159059/deliverable.report.0.3.txt

In order for this script to work you must make it executable and run it as root.

Screenshots:

log Untitled

Please feel free to take my script and modify it according to your needs. You may also fork or revise it. I hope it is able to provide useful information.

Contributors:

Hugo Pombo has been a great contributor. He helped me test-run scripts as well as help me find a general sense of direction when I was lost. He helped me communicate with professors and the open source commnuty when I was not available due to my extremely tight schedule. His effort and persistence has been refreshing for me and his persistence for success should earn him merit in the open source community. Thank you for your contributions Hugo. I would also like to thank my professors Raymond Chan and Chris Tyler. In my opinion they are the most knowledgeable professors in regards to Linux at Seneca College. I have learned a lot and appreciate the time you spent helping me figure out which direction to proceed. I learned a lot about how the open source community operates and how to find more points of contact. Thank you for your contributions!

Conclusion:

My project was a very difficult one. Initially I was tasked with enabling Wi-Fi on the trimslice. As I pointed out in my 0.2 project deliverable this was not necessary because in the newer Linux kernels Wi-Fi works out of the box. This was pointed out to me by members of the open source community on IRC. When I finally re-defined my objectives I created a rough test script and test plan. This script was extremely primitive and did nothing but spit out a bunch of output related to the wireless network card. In the last release of this script I have been able to clean up the output and group it together so a user can read and understand what the output is. I hope this script is able to be put into use by someone or even modded/revised or forked off into something better in the near future! Although my work with this project ends, my work in the open source community will not. I have met some of the most intelligent and friendly people in the open source community and I plan on remaining as active in the community as I can. I hope the work I put forth in this project is able to be put to use or added to for future use by everyone. My script is very primitive, but it works! Feel free to edit it, add to it, revise it… I hope this helps.

Thank You!

Contact me on IRC!
Find me:
Nick: nssharma
Network: irc.freenode.net

Posted in Open Source, Uncategorized | Leave a comment

Project Deliverable Report [0.2] –> Draft Test Plan and Testing Script

Introduction:

Greetings and Salutations,

I hope the information found here can educate/inform/help you somehow.

I was originally tasked with enabling wifi on the trimslice for my SBR project. For my 0.1 release of my SBR project I didn’t have physical access to an actual trimslice machine so I researched the hardware specs and attempted to package a driver. I was chatting on IRC when someone active in the in open source community pointed out to me that this driver had already been packaged and that there was already built-in support on new linux releases.

Trimslice Network Hardware:

LAN Gigabit Ethernet (Realtek RTL8111DL)
WLAN 802.11n single antenna (RaLink RT3070)

RPM Link for Compatible RT3070 Driver: http://linuxwireless.org/en/users/Drivers/rt2800usb
RPM for RA Link USB Driver: http://rpmfind.net/linux/rpm2html/search.php?query=kmod-rt2870
Source Code for Drivers: http://www.ralinktech.com/en/04_support/support.php?sn=501

Also, according to Wikipedia:

“Linux includes partially working (no AP or Ad-hoc mode) drivers for Ralink cards starting from version 2.6.24. However, these drivers require firmware to function. Due to Ralink’s practice of providing documentation without a non-disclosure agreement, virtually all Ralink wireless chipsets are supported on all three of the major BSD systems. Indeed, the OpenBSD development team recommends the use of Ralink chipsets for this reason”

Due to this mishap and major time constraint I had conversations with my professor and Hugo Pombo (another active member of the open source community who is also working on Trimslice hardware enablement for Fedora 18 Alpha) on which direction this project should proceed.

 

Re-Defined Objectives:

0.2 Draft Edition: Test WiFi on the Trim Slice, create a draft version of a test plan along with a draft version of a script (to aide the process).

0.3 Edition: Create a final version of my test plan and also finalize the script for producing better output.

 

Draft Test Plan

In order for this test plan to have worked I needed physical access to a trim-slice machine. I also learned that Hugo who was working on Bluetooth testing also needed physical access. His timeline to work on this project was as tight as mine and he was kind of enough to let me take the trimslice home the first day he signed it out. He signed it out, and I got the fun of setting it up. The re-imaging process was the same as the Raspberry Pi, but with a different image. The TrimSlice was loaned to us by the good folks over at CDOT with the permission of our professor.

Note: This device was re-imaged to Fedora 18 Alpha. I was able to re-image the trimslice successfully, but learned that the trimslice display doesn’t work.  The only way to get video through Fedora is through an rs232 serial port to which I had no cable.

Install: http://fedoraproject.org/wiki/Architectures/ARM/Fedora_18_Alpha/Trimslice
Download: http://dl.fedoraproject.org/pub/fedora-secondary/releases/test/18-Alpha/Images/armhfp/Fedora-18-Alpha-armhfp-trimslice.img.xz

Eventually, with the help of my professor, Hugo, and Andrew, we were able to setup the trimslice so Hugo and I could work on our projects at the same time. Also, after installing Fedora 18 Alpha on the trimslice from scratch I learned that WiFi worked right out of the box and no driver was needed. Tools were needed.

yum install wavemon

yum install wireless-tools

I typed all sorts of commands to get different kinds of information and output about WiFi and threw them into two bash scripts for my test plan. The first script installs drivers for the trimslice if they aren’t already there, then it installs necessary commandline tools needed for wireless network management. The second script is to give you information about your wireless network card.

Draft Scripts

WiFi Information Script: https://dl.dropbox.com/u/11159059/wifi.check.bash
Utility & Driver Install Script: https://dl.dropbox.com/u/11159059/wifi.install.bash

Note: Due to severe time constraints the quality of these scripts will significantly improve upon the next deliverable.

Posted in Open Source | Leave a comment

Hello world!

Welcome to WordPress.com! This is your very first post. Click the Edit link to modify or delete it, or start a new post. If you like, use this post to tell readers why you started this blog and what you plan to do with it.

Happy blogging!

Posted in Uncategorized | 1 Comment

Repo Creation Lab

Prerequisites:

In order to complete this lab I must ensure I have all the tools I need.

yum install createrepo

 

The next step is to append the .rpmmacros file located in ~/.rpmmacro with my GPG Name. I did this with the command:

echo %_gpg_name “nsharma@myseneca.ca” >> ~/.rpmmacro

 

Now that the GPG name is in the .rpmmacro file we can now create a local repository file in /etc/yum.repo.d

To do this I typed the following commands as root:

vi /etc/yum.repos.d/local.repo

Inside this file are the following contents:

[nssharma]
Name=Nikhil Sharma
Baseurl=file:///home/nssharma/rpmbuild/RPMS/x86_64/
Enabled=1
Gpgcheck=1
Gpgkey=file:///home/nssharma/ascii.key

/home/nssharma/ascii.key is the location to the ascii key I created.

/home/nssharma/rpmbuild/RPMS/x86_64/ is the location to where all of my repositories are.

The next step is to change directories into ~/rpmbuild/RPMS/x86_64 and enter the command ‘createrepo .’

Next I typed in yum update, and then I attempted to install a package located on my repo. It was a success!

 

 

Posted in Uncategorized | Leave a comment

RPM Signing Lab

Preparation:

rpm-sign and gnupg are required to complete this lab. Install them using:

yum install rpm-sign gnupg

Create a GPG Key:

pg (GnuPG) 1.4.12; Copyright (C) 2012 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

gpg: directory `/home/nssharma/.gnupg’ created
gpg: new configuration file `/home/nssharma/.gnupg/gpg.conf’ created
gpg: WARNING: options in `/home/nssharma/.gnupg/gpg.conf’ are not yet active during this run
gpg: keyring `/home/nssharma/.gnupg/secring.gpg’ created
gpg: keyring `/home/nssharma/.gnupg/pubring.gpg’ created
Please select what kind of key you want:
(1) RSA and RSA (default)
(2) DSA and Elgamal
(3) DSA (sign only)
(4) RSA (sign only)
Your selection? 1
RSA keys may be between 1024 and 4096 bits long.
What keysize do you want? (2048) 1024
Requested keysize is 1024 bits
Please specify how long the key should be valid.
0 = key does not expire
<n>  = key expires in n days
<n>w = key expires in n weeks
<n>m = key expires in n months
<n>y = key expires in n years
Key is valid for? (0)
Key does not expire at all
Is this correct? (y/N) y

You need a user ID to identify your key; the software constructs the user ID
from the Real Name, Comment and Email Address in this form:
“Heinrich Heine (Der Dichter) <heinrichh@duesseldorf.de>”

Real name: Nikhil Sharma
Email address: nsharma@myseneca.ca
Comment: w00t
You selected this USER-ID:
“Nikhil Sharma (w00t) <nsharma@myseneca.ca>”

Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O
You need a Passphrase to protect your secret key.

We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.

Not enough random bytes available.  Please do some other work to give
the OS a chance to collect more entropy! (Need 164 more bytes)
….+++++
+++++
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
.+++++
..+++++
gpg: /home/nssharma/.gnupg/trustdb.gpg: trustdb created
gpg: key 09F7E6EE marked as ultimately trusted
public and secret key created and signed.

gpg: checking the trustdb
gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model
gpg: depth: 0  valid:   1  signed:   0  trust: 0-, 0q, 0n, 0m, 0f, 1u
pub   1024R/09F7E6EE 2012-10-23
Key fingerprint = C516 C963 C972 EBD5 9B00  C1EA CC4C 0094 09F7 E6EE
uid                  Nikhil Sharma (w00t) <nsharma@myseneca.ca>
sub   1024R/8C4DF54D 2012-10-23

Next we have to add the key to the RPM packages we built. This is done with the following commands:

[nssharma@localhost ~]$ rpm –addsign rpmbuild/RPMS/x86_64/hello-2.8-1.fc17.x86_64.rpm
Enter pass phrase:
Pass phrase is good.
rpmbuild/RPMS/x86_64/hello-2.8-1.fc17.x86_64.rpm:
[nssharma@localhost ~]$ rpm –addsign rpmbuild/RPMS/x86_64/jwhois-
jwhois-4.0-1.fc17.x86_64.rpm            jwhois-debuginfo-4.0-1.fc17.x86_64.rpm
[nssharma@localhost ~]$ rpm –addsign rpmbuild/RPMS/x86_64/jwhois-4.0-1.fc17.x86_64.rpm
Enter pass phrase:
Pass phrase is good.
rpmbuild/RPMS/x86_64/jwhois-4.0-1.fc17.x86_64.rpm:
[nssharma@localhost ~]$

Next we need to create the ASCII key file. This is done with the following command(s)

[nssharma@localhost ~]$ gpg –export –armour nsharma@myseneca.ca > ascii.key
[nssharma@localhost ~]$ cat ascii.key
—–BEGIN PGP PUBLIC KEY BLOCK—–
Version: GnuPG v1.4.12 (GNU/Linux)

mI0EUIX4EwEEALnHGHhcZtcwZuEj9U6yMxhF/t1vEMFAsgfr9Ya8PNCHcl/5AKCg
MSeN5iXe/ly2b87FRhSbs7N2IGuUcrNRIKcnSEDDVxP1n+d67agAMDcAUnjmvAtd
kIA67bensUqTKhlothohdiWZyk5echwsIo0tAbONJOLg2jE9qaKhRddlABEBAAG0
Kk5pa2hpbCBTaGFybWEgKHcwMHQpIDxuc2hhcm1hQG15c2VuZWNhLmNhPoi4BBMB
AgAiBQJQhfgTAhsDBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAKCRDMTACUCffm
7vtUBACnLoII58seuk//86MIrTjvsrNR5G2ZnxVEiqeRu1qoQdfr0RssppL/5NUI
viuxfs/Bg2SfiwWCkpf4HHjvbHuWOu+gOlt2+h017/obtiaj89EjtUneLjOYHXSW
VGd/bengT12ek8Bbl0v42N9xD0p4AfN+55hvfA1qWSpkE+VYcLiNBFCF+BMBBADC
hbo/d0lUGyBB6ONYUf6i2ustO352dTm7UW8bNON8Gp9mawnwcr6GFr4tB2Gbj4xO
7axzBcaOYPZ/N4am1kWAATeNyB1JEBikrR5gTd4KW06vGhBppR8A3GNuVyu0dpEp
7Ry2R1PhiKLYRB1fMm7eCbcRA0ZqepqesdSoJHk6oQARAQABiJ8EGAECAAkFAlCF
+BMCGwwACgkQzEwAlAn35u7NOgP9FR6LBWuSM853nd9hW3YKMhup7zRl7SVbDt/v
NNq++FiQ9LeUN3yME0/T9yQZeUECClhNLT2hW8+lBRNBcbMOxhVY4vMQ8pOGgq/f
/UDPaHr9Gfxu/NLOntqddbm1yUsHzy4Z9O4XEa2sZcCSl3h1T/o+NvIOmi0ZEO1N
oXNUGes=
=9B4E
—–END PGP PUBLIC KEY BLOCK—–

 

Posted in Uncategorized | Leave a comment

Using Koji to Test on Multiple Architectures

The Koji Build System is Fedora’s RPM buildsystem. Packagers use the koji client to request package builds and get information about the buildsystem. Koji runs on top of Mock to build RPM packages for specific architectures and ensure that they build correctly.

Preparation:

 yum install fedora-packager

Koji Setup:

 /usr/bin/fedora-packager-setup

[makerpm@localhost ~]$ /usr/bin/fedora-packager-setup
Setting up Fedora packager environment
Saved: /home/nssharma/.fedora-server-ca.cert
Linking: ~/.fedora-server-ca.cert to ~/.fedora-upload-ca.cert
Setting up Browser Certificates
Enter Export Password:
Verifying – Enter Export Password:

Browser certificate exported to ~/fedora-browser-cert.p12
To import the certificate into Firefox:

Edit -> Preferences -> Advanced
Click “View Certificates”
On “Your Certificates” tab, click “Import”
Select ~/fedora-browser-cert.p12
Type the export passphrase you chose earlier

Once imported, you should see a certificate named “Fedora Project”.
Your username should appear underneath this.

You should now be able to click the “login” link at http://koji.fedoraproject.org/koji/ successfully.

importing the certificate is optional and not needed for daily use.
you should also import the ca cert at ~/.fedora-upload-ca.cert

Time to use Koji! This was done with the following commands:

[makerpm@localhost SRPMS]$ koji build f18 –scratch hello-2.8-1.fc17.src.rpm
^Z
[1]+  Stopped                 koji build f18 –scratch hello-2.8-1.fc17.src.rpm
[makerpm@localhost SRPMS]$ arm-koji build f18 –scratch hello-2.8-1.fc17.src.rpm
^Z
[2]+  Stopped                 arm-koji build f18 –scratch hello-2.8-1.fc17.src.rpm
[makerpm@localhost SRPMS]$ s390-koji build f18 –scratch hello-2.8-1.fc17.src.rpm
^Z
[3]+  Stopped                 s390-koji build f18 –scratch hello-2.8-1.fc17.src.rpm
[makerpm@localhost SRPMS]$ ppc-koji build f18 –scratch hello-2.8-1.fc17.src.rpm
^Z
[4]+  Stopped                 ppc-koji build f18 –scratch hello-2.8-1.fc17.src.rpm
[makerpm@localhost SRPMS]$ koji build f18 –scratch jwhois-4.0-1.fc17.src.rpm
^Z
[5]+  Stopped                 koji build f18 –scratch jwhois-4.0-1.fc17.src.rpm
[makerpm@localhost SRPMS]$ arm-koji build f18 –scratch jwhois-4.0-1.fc17.src.rpm
^Z
[6]+  Stopped                 arm-koji build f18 –scratch jwhois-4.0-1.fc17.src.rpm
[makerpm@localhost SRPMS]$ s390-koji build f18 –scratch jwhois-4.0-1.fc17.src.rpm
^Z
[7]+  Stopped                 s390-koji build f18 –scratch jwhois-4.0-1.fc17.src.rpm
[makerpm@localhost SRPMS]$ ppc-koji build f18 –scratch jwhois-4.0-1.fc17.src.rpm
^Z
[8]+  Stopped                 ppc-koji build f18 –scratch jwhois-4.0-1.fc17.src.rpm

After entering these commands I pressed Control + Z so they could run in the background. These processes are still active and were seen when I run ‘ps x’

3227 pts/0    T      0:00 /usr/bin/python /usr/bin/koji build f18 –scratch he
3229 pts/0    T      0:00 /bin/sh /usr/bin/arm-koji build f18 –scratch hello-
3233 pts/0    T      0:00 /usr/bin/python /usr/bin/koji -c /etc/koji/arm-confi
3234 pts/0    T      0:00 /bin/sh /usr/bin/s390-koji build f18 –scratch hello
3238 pts/0    T      0:00 /usr/bin/python /usr/bin/koji -c /etc/koji/s390-conf
3239 pts/0    T      0:00 /bin/sh /usr/bin/ppc-koji build f18 –scratch hello-
3243 pts/0    T      0:00 /usr/bin/python /usr/bin/koji -c /etc/koji/ppc-confi
3248 pts/0    T      0:00 /usr/bin/python /usr/bin/koji build f18 –scratch jw
3249 pts/0    T      0:00 /bin/sh /usr/bin/arm-koji build f18 –scratch jwhois
3253 pts/0    T      0:00 /usr/bin/python /usr/bin/koji -c /etc/koji/arm-confi
3254 pts/0    T      0:00 /bin/sh /usr/bin/s390-koji build f18 –scratch jwhoi
3258 pts/0    T      0:00 /usr/bin/python /usr/bin/koji -c /etc/koji/s390-conf
3259 pts/0    T      0:00 /bin/sh /usr/bin/ppc-koji build f18 –scratch jwhois
3263 pts/0    T      0:00 /usr/bin/python /usr/bin/koji -c /etc/koji/ppc-confi

Now that each of these processes is suspended in the background, I can type ‘bg’ and have them re-enabled one-by-one.

Created task: 1216231
Task info: http://arm.koji.fedoraproject.org/koji/taskinfo?taskID=1216231
Uploading srpm: jwhois-4.0-1.fc17.src.rpm

Created task: 760488
Task info: http://ppc.koji.fedoraproject.org/koji/taskinfo?taskID=760488
Uploading srpm: jwhois-4.0-1.fc17.src.rpm

Created task: 834555
Task info: http://s390.koji.fedoraproject.org/koji/taskinfo?taskID=834555
Uploading srpm: jwhois-4.0-1.fc17.src.rpm

Created task: 4617364
Task info: http://koji.fedoraproject.org/koji/taskinfo?taskID=4617364
Uploading srpm: hello-2.8-1.fc17.src.rpm

Created task: 760500
Task info: http://ppc.koji.fedoraproject.org/koji/taskinfo?taskID=760500
Uploading srpm: hello-2.8-1.fc17.src.rpm

Created task: 834558
Task info: http://s390.koji.fedoraproject.org/koji/taskinfo?taskID=834558
Uploading srpm: hello-2.8-1.fc17.src.rpm

Created task: 1216240
Task info: http://arm.koji.fedoraproject.org/koji/taskinfo?taskID=1216240
Uploading srpm: hello-2.8-1.fc17.src.rpm

Posted in Uncategorized | Leave a comment

Using Mock to Test Package Builds

Mock takes a srpm and builds it in a chroot. This ensures that your BuildRequires lines are correct, that there are no missing dependencies, and that it builds cleanly.

For my last lab I created the following files using rpmbuild:

  • hello-2.8-1.fc17.x86_64.rpm
  • hello-2.8-1.fc17.src.rpm
  • jwhois-4.0-1.fc17.x86_64.rpm
  • jwhois-4.0-1.fc17.src.rpm

In this lab I will verify that these files build cleanly using mock. First I need to make sure I have all my dependencies/requirements installed.

yum install mock fedora-packager @development-tools

 

Once I had the packages required to use mock, I added my user account to the mock user group with the command:

usermod -a -G mock makerpm

 

Now that this is complete. I will use mock with the source files:

hello-2.8-1.fc17.src.rpm
jwhois-4.0.1.fc17.src.rpm

To do this for hello-2.8-1.fc17.src.rpm for x86_64 I enter the command:

makerpm@localhost SRPMS]$ mock -r fedora-17-x86_64 hello-2.8-1.fc17.src.rpm
INFO: mock.py version 1.1.26 starting…
Start: init plugins
INFO: selinux enabled
Finish: init plugins
Start: run
INFO: Start(hello-2.8-1.fc17.src.rpm)  Config(fedora-17-x86_64)
Start: lock buildroot
Start: clean chroot
Finish: clean chroot
Finish: lock buildroot
Start: chroot init
Start: lock buildroot
Mock Version: 1.1.26
INFO: Mock Version: 1.1.26
INFO: calling preinit hooks
INFO: enabled root cache
INFO: enabled yum cache
Start: cleaning yum metadata
Finish: cleaning yum metadata
INFO: enabled ccache
Start: device setup
Finish: device setup
Start: yum update
Finish: yum update
Start: creating cache
Finish: creating cache
Finish: lock buildroot
Finish: chroot init
INFO: Installed packages:
Start: build phase for hello-2.8-1.fc17.src.rpm
Start: device setup
Finish: device setup
Start: build setup for hello-2.8-1.fc17.src.rpm
Finish: build setup for hello-2.8-1.fc17.src.rpm
Start: rpmbuild -bb hello-2.8-1.fc17.src.rpm
Finish: rpmbuild -bb hello-2.8-1.fc17.src.rpm
Finish: build phase for hello-2.8-1.fc17.src.rpm
INFO: Done(hello-2.8-1.fc17.src.rpm) Config(fedora-17-x86_64) 3 minutes 21 seconds
INFO: Results and/or logs in: /var/lib/mock/fedora-17-x86_64/result
Finish: run

To do this for hello-2.8-1.fc17.src.rpm for i386 I enter the command:

[makerpm@localhost SRPMS]$ mock -r fedora-17-i386 hello-2.8-1.fc17.src.rpm
INFO: mock.py version 1.1.26 starting…
Start: init plugins
INFO: selinux enabled
Finish: init plugins
Start: run
INFO: Start(hello-2.8-1.fc17.src.rpm)  Config(fedora-17-i386)
Start: lock buildroot
Start: clean chroot
Finish: clean chroot
Finish: lock buildroot
Start: chroot init
Start: lock buildroot
Mock Version: 1.1.26
INFO: Mock Version: 1.1.26
INFO: calling preinit hooks
INFO: enabled root cache
INFO: enabled yum cache
Start: cleaning yum metadata
Finish: cleaning yum metadata
INFO: enabled ccache
Start: device setup
Finish: device setup
Start: yum update
Finish: yum update
Start: creating cache
Finish: creating cache
Finish: lock buildroot
Finish: chroot init
INFO: Installed packages:
Start: build phase for hello-2.8-1.fc17.src.rpm
Start: device setup
Finish: device setup
Start: build setup for hello-2.8-1.fc17.src.rpm
Finish: build setup for hello-2.8-1.fc17.src.rpm
Start: rpmbuild -bb hello-2.8-1.fc17.src.rpm
Finish: rpmbuild -bb hello-2.8-1.fc17.src.rpm
Finish: build phase for hello-2.8-1.fc17.src.rpm
INFO: Done(hello-2.8-1.fc17.src.rpm) Config(fedora-17-i386) 2 minutes 24 seconds
INFO: Results and/or logs in: /var/lib/mock/fedora-17-i386/result
Finish: run

To do this for jwhois-4.0-1.fc17.src.rpm for x86_64 I enter the command:

[makerpm@localhost SRPMS]$ mock -r fedora-17-x86_64 jwhois-4.0-1.fc17.src.rpm
INFO: mock.py version 1.1.26 starting…
Start: init plugins
INFO: selinux enabled
Finish: init plugins
Start: run
INFO: Start(jwhois-4.0-1.fc17.src.rpm)  Config(fedora-17-x86_64)
Start: lock buildroot
Start: clean chroot
Finish: lock buildroot
Start: chroot init
Start: lock buildroot
Mock Version: 1.1.26
INFO: Mock Version: 1.1.26
INFO: calling preinit hooks
INFO: enabled root cache
Start: unpacking root cache
Finish: unpacking root cache
INFO: enabled yum cache
Start: cleaning yum metadata
Finish: cleaning yum metadata
INFO: enabled ccache
Start: device setup
Finish: device setup
Start: yum update
Finish: yum update
Finish: lock buildroot
Finish: chroot init
INFO: Installed packages:
Start: build phase for jwhois-4.0-1.fc17.src.rpm
Start: device setup
Finish: device setup
Start: build setup for jwhois-4.0-1.fc17.src.rpm
Finish: build setup for jwhois-4.0-1.fc17.src.rpm
Start: rpmbuild -bb jwhois-4.0-1.fc17.src.rpm
Finish: rpmbuild -bb jwhois-4.0-1.fc17.src.rpm
Finish: build phase for jwhois-4.0-1.fc17.src.rpm
INFO: Done(jwhois-4.0-1.fc17.src.rpm) Config(fedora-17-x86_64) 0 minutes 35 seconds
INFO: Results and/or logs in: /var/lib/mock/fedora-17-x86_64/result
Finish: run

To do this for jwhois-4.0-1.fc17.src.rpm for i386 I enter the command:

[makerpm@localhost SRPMS]$ mock -r fedora-17-i386 jwhois-4.0-1.fc17.src.rpm INFO: mock.py version 1.1.26 starting…
Start: init plugins
INFO: selinux enabled
Finish: init plugins
Start: run
INFO: Start(jwhois-4.0-1.fc17.src.rpm)  Config(fedora-17-i386)
Start: lock buildroot
Start: clean chroot
INFO: chroot (/var/lib/mock/fedora-17-i386) unlocked and deleted
Finish: clean chroot
Finish: lock buildroot
Start: chroot init
Start: lock buildroot
Mock Version: 1.1.26
INFO: Mock Version: 1.1.26
INFO: calling preinit hooks
INFO: enabled root cache
Start: unpacking root cache
Finish: unpacking root cache
INFO: enabled yum cache
Start: cleaning yum metadata
Finish: cleaning yum metadata
INFO: enabled ccache
Start: device setup
Finish: device setup
Start: yum update
Finish: yum update
Finish: lock buildroot
Finish: chroot init
INFO: Installed packages:
Start: build phase for jwhois-4.0-1.fc17.src.rpm
Start: device setup
Finish: device setup
Start: build setup for jwhois-4.0-1.fc17.src.rpm
Finish: build setup for jwhois-4.0-1.fc17.src.rpm
Start: rpmbuild -bb jwhois-4.0-1.fc17.src.rpm
Finish: rpmbuild -bb jwhois-4.0-1.fc17.src.rpm
Finish: build phase for jwhois-4.0-1.fc17.src.rpm
INFO: Done(jwhois-4.0-1.fc17.src.rpm) Config(fedora-17-i386) 0 minutes 26 seconds
INFO: Results and/or logs in: /var/lib/mock/fedora-17-i386/result
Finish: run

 

 

 

 

Posted in Uncategorized | Leave a comment

Creating an RPM Package

Before I can begin this lab I need some prerequisites installed!

yum install @development-tools
yum install fedora-packager
Once my prerequisites are installed I can finally get started with account/group creation!
I am going to need an account/group for building RPM packages with.
[root@localhost ~]# /usr/sbin/useradd makerpm
[root@localhost ~]# usermod -a -G mock makerpm
[root@localhost ~]# passwd makerpm
Changing password for user makerpm.
Once created, I switch into my newly created account and run the following commands:
[makerpm@localhost ~]$ rpmdev-setuptree
[makerpm@localhost ~]$ tree ~/rpmbuild/
/home/makerpm/rpmbuild/
├── BUILD
├── RPMS
├── SOURCES
├── SPECS
└── SRPMS5 directories, 0 files
After I entered the ‘rpmdev-setuptree it creates a folder called rpmbuild in my home directory with 5 subdirectories underneath it. The directories created are:
  • ~/rpmbuild/SOURCES – for source code (tarballs/zip archives and patches)
  • ~/rpmbuild/SPECS – for the spec file
  • ~/rpmbuild/SRPMS – for the resulting source RPMs
  • ~/rpmbuild/RPMS – for the resulting binary RPMs
  • ~/rpmbuild/BUILD – directory used to perform the build
  • ~/rpmbuild/BUILDROOT – contains a fake root directory into which the built files are “installed” prior to being packaged
Now that I have my environment ready, I change directory in ~/rpmbuild/SOURCES and download the following two packages:
Now that I have my packages, I can start building an RPM for jwhois-4.0 and proxyknife-1.7. I start by entering these commands in ~/rpmbuild/SPECS:
[makerpm@localhost SPECS]$ rpmdev-newspec jwhois-4.0
jwhois-4.0.spec created; type minimal, rpm version >= 4.9.
makerpm@localhost SPECS]$ rpmdev-newspec hello-2.8
hello-2.8.spec created; type minimal, rpm version >= 4.9.
These files are blank and look like this:
I modify these files accordingly. Before I run the command ‘rpmbuild -ba jwhois.spec’ I want to test the file with rpmlint.
[makerpm@localhost SPECS]$ rpmlint jwhois-4.0.spec
jwhois-4.0.spec:36: W: macro-in-comment %{_sysconfdir}
jwhois-4.0.spec:37: W: macro-in-comment %{_sbindir}
jwhois-4.0.spec:5: W: mixed-use-of-spaces-and-tabs (spaces: line 1, tab: line 5)
0 packages and 1 specfiles checked; 0 errors, 3 warnings.
Now I can run: rpmbuild -ba jwhois-4.0.spec
Everything compiles fine with some warnings! Now I can see the RPM and SRPM files.
├── RPMS
│   └── x86_64
│       ├── jwhois-4.0-1.fc17.x86_64.rpm
│       └── jwhois-debuginfo-4.0-1.fc17.x86_64.rpm
├── SRPMS/
└── jwhois-4.0-1.fc17.src.rpm
This is my working jwhois-4.0.spec file.
This is my working jwhois-4.0-1.fc17.src.rpm
[nssharma@localhost SPECS]$ rpmlint hello-2.8.spec
0 packages and 1 specfiles checked; 0 errors, 0 warnings.
Now I can run: rpmbuild -ba hello-2.8.spec
Everything compiles fine with some warnings! Now I can see the RPM and SRPM files
RPMS
└── x86_64
├── hello-2.8-1.fc17.x86_64.rpm
├── hello-debuginfo-2.8-1.fc17.x86_64.rpm
├── jwhois-4.0-1.fc17.x86_64.rpm
└── jwhois-debuginfo-4.0-1.fc17.x86_64.rpm
SRPMS/
├── hello-2.8-1.fc17.src.rpm
└── jwhois-4.0-1.fc17.src.rpm
This is my working hello-2.8.spec
This is my working hello-2.8-1.fc17.x86_64.rpm
This is my working hello-2.8-1.fc17.src.rpm
*** USEFUL LINKS ***

 

Posted in Uncategorized | Leave a comment

Building from Source

Hello,

I will demonstrate how to build software from source on Fedora 17 a.k.a. “Beefy Miracle”

This is very simple. Assuming you have a fresh install of Fedora Linux, you must first install pre-requisite software. This is done by logging as root and entering the following command(s) in a terminal:

yum groupinstall "Development Tools" "Development Libraries"

Once you have all the required tools and libraries now you can compile from source! The next step is to download something you want to compile.

I decided to download and compile GNU spell. GNU spell is a spell checking program which prints each misspelled word on a line of its own. It is designed as a clone of the standard Unix ‘spell’ program, and implemented as a wrapper for ‘GNU aspell’ and ‘ispell’. It can be found here.

I downloaded the file in terminal with the following command:

wget http://ftp.gnu.org/gnu/spell/spell-1.1.tar.gz

I extracted the source code tarball into it’s own folder with this command:

tar zxvf spell-1.1.tar.gz

Once you have extracted the contents of the source code tarball you can now change into it’s directory and begin the build/compile/install. This is done by typing:

./configure && make

Once this process is complete you are ready to ‘make install’
What this does is compiles the binary into /usr/bin so it is accesible to all users on the system.

Note: make install works as a regular user if you change the destination directory into one you have permissions to read/write to. Since I wanted the binary available to all users on the system I executed ‘make install’ with sudo.

…and bam! The software has been compiled from source.

Posted in Uncategorized | Leave a comment

My First Post

Hello Everyone,

This is post overdue but I’ve been swamped with course work this semester and my hard drive decided to fail on me. Anyways

Here is some random information about me:
-I am a student at Seneca College studying Computer Systems Technology (CTY)
-I am currently taking 6 courses this semester. All six of the courses I’m enrolled in this semester are professional options.
-I hope to graduate from CTY after this semester.

My hobbies include:
-Socializing with friends and family
-Listening to music
-Watching good movies and television (when I have time)
-Playing video games (also when I have time)

Here is my link to my Seneca wiki user page:
http://zenit.senecac.on.ca/wiki/index.php/User:Nikhil_Shrey_Sharma

My IRC nickname is:
nssharma

My LEARN ID is:
nssharma

IRC:

My thoughts on the Raspberry Pi:

The Raspberry Pi is AWESOME! I recently ordered one and plan on connecting it to my television at home. It can accomplish the same things that expensive devices such as the Boxee Box by D-Link or AppleTV can. I hope to setup and integrate the Raspberry Pi into my home entertainment center to allow me to stream netflix, youtube, and other high-definition videos directly to my television. It’s an added bonus that there is a lot of development and upcoming software releases for this product. It has the capability to do things the AppleTV can, plus more! I predict the Raspberry Pi will become a very succesful project and will eventually be commonly owned technology among Seneca students in the near future.

Signing off,

Nikhil Sharma

Posted in Uncategorized | Leave a comment