I am writing this out of my close association with GNU/Linux for quite sometime.I have had been using it everywhere to do my day to day work.
First I have started or introduced to the UNIX system way back in 1996 during my Diploma classes.One day I was sitting in front of a blank and black terminal in the classroom ;so my instructor came to me and said " why are you sitting idle"...I replied back with a pretty confusing face that " I am not able to understand what to do with this(the black and blank terminal)..with small cursor blinking on it". My teacher/instructor smile at me(rightfully) and said " Bhaskar it is challenging you to play with it and waiting for your intervention"..that spark me!! From that day onward I fall in love with that fellow called "UNIX".Yes,it was SCO UNIX ..those days it was used in almost all the academia.Oh yes before that incident happen I was given a book or two about UNIX operating system and I went through them ..but little infer.
My real hands on interaction with GNU/Linux came in year 2000,when I brought my desktop(IBM Netvista A22p black model with 128 MB RAM with P4 processor).I bought a book called "Linux Bible" by Christofer Negus..that book come with CD-Rom of Redhat Linux.So I went on to install that into my desktop.Yes it was not so smooth,because of my lack of knowledge regarding GNU/Linux that time(Yes,I was late by 8 years by that time...Linux invented on 1992!).But somehow manage to install it with lot of pain and with lot of manual tweaking with the system.Because in that time installing GNU/Linux on the computer was not so easy..lot of thing were missing from the installation which had to be added later.Nor I was blessed with an internet connection..it was costly and rare in India.
So my journey started with GNU/Linux ..still continues till today.I have had been to different situation to tackle GNU/Linux in different environments.And I enjoyed every bit of it.Sometime it bring down to my knees and sometime it gave a real pleasure to accomplish some and share it with others fellow thinkers.
This is my 4th laptop(yeah too frequent you can say!)..every time I went to a shop to buy a laptop..the people around said it doesn't support GNU/Linux(yes ,till few years back it was headache to install GNU/Linux in the laptop but not the case now!!) .So the first thing I did (as all the laptop come with a proprietary OS install in it),erase the OS from the HDD and install GNU/Linux on it( I always carry a Live CD/DVD with me) and believe it or not every time it works(yes I might be the lucky few!).
Yes , I had to do lot of tweaking to work it as I like ..but worth the effort and time..in turn it enhances my understanding about GNU/Linux.
I have had tried and tested hell lot of GNU/Linux distro time and time again..just to look into it and try to figure out how it work differently from one distribution to other.And of late doing the same thing with a technology called "virtualization".
I have four GNU/Linux distribution running in my laptop,namely Arch Linux , Gentoo , Debian , Fedora .
Along with that I also run Slackware , openSUSE through virtualization.
I love all of them..but running Gentoo gave me a different kind of pleasure.Because one has to do lot of thing by hand( which is automated by the binary OS isntall i.e fedora).My impression is that running a source based distribution gives anyone much more insight into the OS then a binary distribution.But the basic fact remain the same that all of them running Linux kernel underneath.
Oh yeah the corporate experience!
Basically corporate houses buy or run something which is quite stable and proven track record and should have paid support.The reason behind this is that business data are absolutely crucial to the business and which will fetch revenue with that.
I had have the exposure of handling production box running RHEL(Enterprise version of REDHAT), SLES(SUSE Enterprise version),CentOS(derived from RHEL source) and to my surprise! Gentoo for one of my job assignment.And in the very same place Debian for hosting server.
Handling live production box gives me different kind insight into it.Because most of the cases the underlying kernel(Linux) is tweaked by the vendor to suit their business needs,so many thing has been added for the usability.
Managing production require very much methodical approach(which is a good thing and should be applied for whenever possible) and have to follow the certain procedure sometime employed by the vendor,sometime by the organization one works for.
As the big guns are pushing GNU/Linux for their business and TCO(total cost of ownership)to deploy GNU/Linux into their infrastructure,namely IBM,HP,Intel,Oracle to name a few.I was lucky enough to be work with of those big fish and get to see and work in their GNU/Linux infrastructure.It was awesome experience for a small fry like me...saw a lot and of course learnt a lot.
As I have had met some people running GNU/Linux have a preconceived notion in their mind that running GNU/Linux make their system secure(I am surprise by fact few people handling corporate production system have that kind of idea..phew!).That's not correct.It is an open system and onus has to with owner that how to make his/her system secure.It's an ongoing procedure to make system secure..constant vigilance is required.
Now One important point I want to share that if someone choose to dive deep into it(read GNU/Linux) be prepared to help yourself and get the help from others(without being egoistic).Do a lot of research and applied tactics of your own before one can ask question to people,who have better idea about the problem.If one demonstrate that quality people will get interested on him/her to take the problem seriously.Why I am saying this because I have seen lot of people just throwing the question in an expectation of an answer..which is not correct.The person they are asking to solve their problem are not bound to answer them..so please do your part.I am never ever shy of asking questions ..but I am honest that sometime I won't get pleasant answer or attitude .But one has to have the understanding that the person is ready to help..but might not be the attitude you expect.
You can find me most of the GNU/Linux forums asking question about my problem and giving back the answer to people if someone approach to me.That;s the way it should be. Yeah I do follow lkml very closely as well looking at the other kernel related discussion very frequently.
Cheers!
Bhaskar
Sunday, July 4, 2010
Tuesday, May 4, 2010
Grub Error code explained
I have had come across lot of article on the web written by some brilliant guys regarding the GRUB, a smart(better than LILO) bootloader.Being an administrator I have had managed many a installation during my one of job assignment with one of big(really big) IT company in their data center.
In this article I am trying to accumulate some errors thrown by the grub because of various reason.So, knowing the value of the error code could easily led to simple debugging of it and save time.It's not possible to remember all the code value,so best to put it in a file and keep it close to your heart.( as I do :) )
Here we go :
1 : Filename must be either an absolute filename or blocklist
This error is returned if a file name is requested which doesn't fit the syntax/rules listed in the Filesystem.
2 : Bad file or directory type
This error is returned if a file requested is not a regular file, but something like a symbolic link, directory, or FIFO.
3 : Bad or corrupt data while decompressing file
This error is returned if the run-length decompression code gets an internal error. This is usually from a corrupt file.
4 : Bad or incompatible header in compressed file
This error is returned if the file header for a supposedly compressed file is bad.
5 : Partition table invalid or corrupt
This error is returned if the sanity checks on the integrity of the partition table fail. This is a bad sign.
6 : Mismatched or corrupt version of stage1/stage2
This error is returned if the install command points to incompatible or corrupt versions of the stage1 or stage2. It can't detect corruption in general, but this is a sanity c heck on the version numbers, which should be correct.
7 : Loading below 1MB is not supported
This error is returned if the lowest address in a kernel is below the 1MB boundary. The Linux zImage format is a special case and can be handled since it has a fixed loading a ddress and maximum size.
8 : Kernel must be loaded before booting
This error is returned if GRUB is told to execute the boot sequence without having a kernel to start.
9 : Unknown boot failure
This error is returned if the boot attempt did not succeed for reasons which are unknown.
10 : Unsupported Multiboot features requested
This error is returned when the Multiboot features word in the Multiboot header requires a feature that is not recognized. The point of this is that the kernel requires specia l handling which GRUB is probably unable to provide.
11 : Unrecognized device string
This error is returned if a device string was expected, and the string encountered didn't fit the syntax/rules listed in the Filesystem.
12 : Invalid device requested
This error is returned if a device string is recognizable but does not fall under the other device errors.
13 : Invalid or unsupported executable format
This error is returned if the kernel image being loaded is not recognized as Multiboot or one of the supported native formats (Linux zImage or bzImage, FreeBSD, or NetBSD).
14 : Filesystem compatibility error, cannot read whole file
Some of the filesystem reading code in GRUB has limits on the length of the files it can read. This error is returned when the user runs into such a limit.
15 : File not found
This error is returned if the specified file name cannot be found, but everything else (like the disk/partition info) is OK.
16 : Inconsistent filesystem structure
This error is returned by the filesystem code to denote an internal error caused by the sanity checks of the filesystem structure on disk not matching what it expects. This is usually caused by a corrupt filesystem or bugs in the code handling it in GRUB.
17 : Cannot mount selected partition
This error is returned if the partition requested exists, but the filesystem type cannot be recognized by GRUB.
18 : Selected cylinder exceeds maximum supported by BIOS
This error is returned when a read is attempted at a linear block address beyond the end of the BIOS translated area. This generally happens if your disk is larger than the BI OS can handle (512MB for (E)IDE disks on older machines or larger than 8GB in general).
19 : Linux kernel must be loaded before initrd
This error is returned if the initrd command is used before loading a Linux kernel.
20 : Multiboot kernel must be loaded before modules
This error is returned if the module load command is used before loading a Multiboot kernel. It only makes sense in this case anyway, as GRUB has no idea how to communicate th e presence of such modules to a non-Multiboot-aware kernel.
21 : Selected disk does not exist
This error is returned if the device part of a device- or full file name refers to a disk or BIOS device that is not present or not recognized by the BIOS in the system.
22 : No such partition
This error is returned if a partition is requested in the device part of a device- or full file name which isn't on the selected disk.
23 : Error while parsing number
This error is returned if GRUB was expecting to read a number and encountered bad data.
24 : Attempt to access block outside partition
This error is returned if a linear block address is outside of the disk partition. This generally happens because of a corrupt filesystem on the disk or a bug in the code hand ling it in GRUB (it's a great debugging tool).
25 : Disk read error
This error is returned if there is a disk read error when trying to probe or read data from a particular disk.
26 : Too many symbolic links
This error is returned if the link count is beyond the maximum (currently 5), possibly the symbolic links are looped.
27 : Unrecognized command
This error is returned if an unrecognized command is entered on the command-line or in a boot sequence section of a configuration file and that entry is selected.
28 : Selected item cannot fit into memory
This error is returned if a kernel, module, or raw file load command is either trying to load its data such that it won't fit into memory or it is simply too big.
29 : Disk write error
This error is returned if there is a disk write error when trying to write to a particular disk. This would generally only occur during an install of set active partition comm and.
30 : Invalid argument
This error is returned if an argument specified to a command is invalid.
31 : File is not sector aligned
This error may occur only when you access a ReiserFS partition by block-lists (e.g. the command install). In this case, you should mount the partition with the `-o notail' opt ion.
32 : Must be authenticated
This error is returned if you try to run a locked entry. You should enter a correct password before running such an entry.
33 : Serial device not configured
This error is returned if you try to change your terminal to a serial one before initializing any serial device.
34 : No spare sectors on the disk
This error is returned if a disk doesn't have enough spare space. This happens when you try to embed Stage 1.5 into the unused sectors after the MBR, but the first partition s tarts right after the MBR or they are used by EZ-BIOS.
Hope this will solve lot of owes of lot of people involve in OS implementation.
Cheers!
Bhaskar Chowdhury
In this article I am trying to accumulate some errors thrown by the grub because of various reason.So, knowing the value of the error code could easily led to simple debugging of it and save time.It's not possible to remember all the code value,so best to put it in a file and keep it close to your heart.( as I do :) )
Here we go :
1 : Filename must be either an absolute filename or blocklist
This error is returned if a file name is requested which doesn't fit the syntax/rules listed in the Filesystem.
2 : Bad file or directory type
This error is returned if a file requested is not a regular file, but something like a symbolic link, directory, or FIFO.
3 : Bad or corrupt data while decompressing file
This error is returned if the run-length decompression code gets an internal error. This is usually from a corrupt file.
4 : Bad or incompatible header in compressed file
This error is returned if the file header for a supposedly compressed file is bad.
5 : Partition table invalid or corrupt
This error is returned if the sanity checks on the integrity of the partition table fail. This is a bad sign.
6 : Mismatched or corrupt version of stage1/stage2
This error is returned if the install command points to incompatible or corrupt versions of the stage1 or stage2. It can't detect corruption in general, but this is a sanity c heck on the version numbers, which should be correct.
7 : Loading below 1MB is not supported
This error is returned if the lowest address in a kernel is below the 1MB boundary. The Linux zImage format is a special case and can be handled since it has a fixed loading a ddress and maximum size.
8 : Kernel must be loaded before booting
This error is returned if GRUB is told to execute the boot sequence without having a kernel to start.
9 : Unknown boot failure
This error is returned if the boot attempt did not succeed for reasons which are unknown.
10 : Unsupported Multiboot features requested
This error is returned when the Multiboot features word in the Multiboot header requires a feature that is not recognized. The point of this is that the kernel requires specia l handling which GRUB is probably unable to provide.
11 : Unrecognized device string
This error is returned if a device string was expected, and the string encountered didn't fit the syntax/rules listed in the Filesystem.
12 : Invalid device requested
This error is returned if a device string is recognizable but does not fall under the other device errors.
13 : Invalid or unsupported executable format
This error is returned if the kernel image being loaded is not recognized as Multiboot or one of the supported native formats (Linux zImage or bzImage, FreeBSD, or NetBSD).
14 : Filesystem compatibility error, cannot read whole file
Some of the filesystem reading code in GRUB has limits on the length of the files it can read. This error is returned when the user runs into such a limit.
15 : File not found
This error is returned if the specified file name cannot be found, but everything else (like the disk/partition info) is OK.
16 : Inconsistent filesystem structure
This error is returned by the filesystem code to denote an internal error caused by the sanity checks of the filesystem structure on disk not matching what it expects. This is usually caused by a corrupt filesystem or bugs in the code handling it in GRUB.
17 : Cannot mount selected partition
This error is returned if the partition requested exists, but the filesystem type cannot be recognized by GRUB.
18 : Selected cylinder exceeds maximum supported by BIOS
This error is returned when a read is attempted at a linear block address beyond the end of the BIOS translated area. This generally happens if your disk is larger than the BI OS can handle (512MB for (E)IDE disks on older machines or larger than 8GB in general).
19 : Linux kernel must be loaded before initrd
This error is returned if the initrd command is used before loading a Linux kernel.
20 : Multiboot kernel must be loaded before modules
This error is returned if the module load command is used before loading a Multiboot kernel. It only makes sense in this case anyway, as GRUB has no idea how to communicate th e presence of such modules to a non-Multiboot-aware kernel.
21 : Selected disk does not exist
This error is returned if the device part of a device- or full file name refers to a disk or BIOS device that is not present or not recognized by the BIOS in the system.
22 : No such partition
This error is returned if a partition is requested in the device part of a device- or full file name which isn't on the selected disk.
23 : Error while parsing number
This error is returned if GRUB was expecting to read a number and encountered bad data.
24 : Attempt to access block outside partition
This error is returned if a linear block address is outside of the disk partition. This generally happens because of a corrupt filesystem on the disk or a bug in the code hand ling it in GRUB (it's a great debugging tool).
25 : Disk read error
This error is returned if there is a disk read error when trying to probe or read data from a particular disk.
26 : Too many symbolic links
This error is returned if the link count is beyond the maximum (currently 5), possibly the symbolic links are looped.
27 : Unrecognized command
This error is returned if an unrecognized command is entered on the command-line or in a boot sequence section of a configuration file and that entry is selected.
28 : Selected item cannot fit into memory
This error is returned if a kernel, module, or raw file load command is either trying to load its data such that it won't fit into memory or it is simply too big.
29 : Disk write error
This error is returned if there is a disk write error when trying to write to a particular disk. This would generally only occur during an install of set active partition comm and.
30 : Invalid argument
This error is returned if an argument specified to a command is invalid.
31 : File is not sector aligned
This error may occur only when you access a ReiserFS partition by block-lists (e.g. the command install). In this case, you should mount the partition with the `-o notail' opt ion.
32 : Must be authenticated
This error is returned if you try to run a locked entry. You should enter a correct password before running such an entry.
33 : Serial device not configured
This error is returned if you try to change your terminal to a serial one before initializing any serial device.
34 : No spare sectors on the disk
This error is returned if a disk doesn't have enough spare space. This happens when you try to embed Stage 1.5 into the unused sectors after the MBR, but the first partition s tarts right after the MBR or they are used by EZ-BIOS.
Hope this will solve lot of owes of lot of people involve in OS implementation.
Cheers!
Bhaskar Chowdhury
Tuesday, March 30, 2010
Building rpm package from source
In this article I am gonna show you how to build/create rpm package from source file(.tar.gz,.bz2).Yes,you can find lot of article on the internet telling you the same story,but this is my personal experience with them.So you are welcome to improve it..provided it really makes sense.
I do not issue any guarantee that this will work for you.
We as an administrator basically managed rpm based distros in corporates and as a result of that it is often required that just for the convenience and ease of porting to other similar system to make it package manager aware of that particular distro(Same thing can be done with other distros with different package manager).
Step 1:
So first step to get the tarball from Sourceforge . I am going to get a software called "iperf",which is basically measuring maximum bandwidth performance for TCP and UDP.So here is the link to get it iperf, as I have get from the browser and my default directory to store the downloads is "Downloads" folder under my home directory.Like this;
bhaskar@bhaskar-laptop_08:41:25_Tue Mar 30:~/Downloads> ls
iperf-2.0.4.tar.gz
Step 2:
We need to create five directory according to the rpmbuild specification.So here we go:
bhaskar@bhaskar-laptop_08:44:15_Tue Mar 30:~> mkdir iperfRPM
bhaskar@bhaskar-laptop_08:44:28_Tue Mar 30:~> cd iperfRPM/
bhaskar@bhaskar-laptop_08:45:14_Tue Mar 30:~/iperfRPM> mkdir BUILD SOURCES SPECS SRPMS RPMS
bhaskar@bhaskar-laptop_08:45:47_Tue Mar 30:~/iperfRPM> ls
BUILD RPMS SOURCES SPECS SRPMS
Step 3:
Now we need to copy the source form "Download" directory to the /iperfRPM/SOURCES/ directory:
bhaskar@bhaskar-laptop_08:51:57_Tue Mar 30:~/Downloads> cp -v iperf-2.0.4.tar.gz ~/iperfRPM/SOURCES/
`iperf-2.0.4.tar.gz' -> `/home/bhaskar/iperfRPM/SOURCES/iperf-2.0.4.tar.gz'
Step 4:
Now the most important steps of all : to create the .spec file for that perticular software to be make rpm.Because rpm format understand certain formats and package creator have to follow that to make the rpm package manager to understand it.
so here we go:
bhaskar@bhaskar-laptop_08:58:56_Tue Mar 30:~/iperfRPM> cd SPECS/
bhaskar@bhaskar-laptop_08:58:59_Tue Mar 30:~/iperfRPM/SPECS> ls
bhaskar@bhaskar-laptop_08:58:59_Tue Mar 30:~/iperfRPM/SPECS> vim iperf.spec
And the content of the file would look like this :
# This is a sample spec file for iperf
%define _topdir /home/bhaskar/iperfRPM
%define name iperf
%define release 1
%define version 2.0.4
%define buildroot %{_topdir}/%{name}-%{version}-root
BuildRoot: %{buildroot}
Summary: iperf
License:
Name: %{name}
Version: %{version}
Release: %{release}
Source: %{name}-%{version}.tar.gz
Prefix: /usr
Group: Development/Tools
%description
Iperf was developed by NLANR/DAST as a modern alternative for measuring maximum TCP and UDP bandwidth performance. Iperf allows the tuning of various parameters and UDP characteristics. Iperf reports bandwidth, delay jitter, datagram loss.
%prep
%setup -q
%build
./configure
make
%install
make install prefix=$RPM_BUILD_ROOT/usr
%files
%defattr(-,root,root)
/usr/local/bin/iperf
%doc %attr(0444,root,root) /usr/local/share/man/man1/iperf.1
This file has descibes the purpose of the variables declared there. Most notably under %files section whatever file you include which will be integrated with the rpm .Essentially it will set the permission of the particular file too!
Now one more important note here that %buildroot variable is just an proxy place to hold the content of the software which is going to installed somewhere else.So it's very very important to specify that location properly(because I made a mess of it couple of times :) ).
Step 5:
So the final step is to build the rpm . I will create the binary as well as source rpm too.
NOTE: I have built this on Fedora 12 ..so it doesn't ship with rpmbuildtool,gcc,g++ . So I had to get them manually all(via yum install).Before I proceed to the next step.
bhaskar@bhaskar-laptop_09:20:37_Tue Mar 30:~/iperfRPM> sudo rpmbuild -v -ba --clean ~/iperfRPM/SPECS/iperf.spec
And here is output of that command
bhaskar@bhaskar-laptop_09:40:36_Tue Mar 30:~> sudo rpmbuild -v -ba --clean ~/iperfRPM/SPECS/iperf.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.Enxq4g
+ umask 022
+ cd /home/bhaskar/iperfRPM/BUILD
+ cd /home/bhaskar/iperfRPM/BUILD
+ rm -rf iperf-2.0.4
+ /usr/bin/gzip -dc /home/bhaskar/iperfRPM/SOURCES/iperf-2.0.4.tar.gz
+ /bin/tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd iperf-2.0.4
+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.5K92Wh
+ umask 022
+ cd /home/bhaskar/iperfRPM/BUILD
+ cd iperf-2.0.4
+ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for g++... g++
checking for C++ compiler default output file name... a.out
checking whether the C++ compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... gcc3
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for strerror in -lcposix... no
checking for a BSD-compatible install... /usr/bin/install -c
checking whether make sets $(MAKE)... (cached) yes
checking for ranlib... ranlib
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -kthread... no
checking for the pthreads library -llthread... no
checking whether pthreads work with -pthread... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... no
checking for cc_r... gcc
checking for gethostbyname... yes
checking for socket... yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking libintl.h usability... yes
checking libintl.h presence... yes
checking for libintl.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking for unistd.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking for ssize_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for stdint types... stdint.h (shortcircuit)
make use of stdint.h in include/iperf-int.h (assuming C99 compatible system)
checking 3rd argument of accept... socklen_t
checking for pid_t... yes
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... yes
checking for working vfork... (cached) yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for working memcmp... yes
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking for sys/socket.h... (cached) yes
checking types of arguments for select... int,fd_set *,struct timeval *
checking return type of signal handlers... void
checking for strftime... yes
checking for vprintf... yes
checking for _doprnt... no
checking for atexit... yes
checking for gettimeofday... yes
checking for memset... yes
checking for pthread_cancel... no
checking for select... yes
checking for strchr... yes
checking for strerror... yes
checking for strtol... yes
checking for usleep... yes
checking for snprintf... yes
checking for inet_pton... yes
checking for inet_ntop... yes
checking for gettimeofday... (cached) yes
checking *printf() support for %lld... yes
checking for bool... no
checking size of bool... 0
checking if true is defined... yes
checking whether byte ordering is bigendian... no
checking for struct ip_mreq... yes
checking whether IP_ADD_MEMBERSHIP is declared... yes
checking for multicast support... yes
checking for struct sockaddr_storage... yes
checking for struct sockaddr_in6... yes
checking whether AF_INET6 is declared... yes
checking for IPv6 headers and structures... yes
checking for struct ipv6_mreq... yes
checking whether IPV6_ADD_MEMBERSHIP is declared... yes
checking whether IPV6_MULTICAST_HOPS is declared... yes
checking for IPv6 multicast support... yes
checking whether make is GNU make... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating compat/Makefile
config.status: creating doc/Makefile
config.status: creating include/Makefile
config.status: creating src/Makefile
config.status: creating man/Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing include/iperf-int.h commands
config.status: creating include/iperf-int.h : _IPERF_INCLUDE_IPERF_INT_H
+ make
make all-recursive
make[1]: Entering directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4'
Making all in compat
make[2]: Entering directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/compat'
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT Thread.o -MD -MP -MF ".deps/Thread.Tpo" -c -o Thread.o Thread.c; \
then mv -f ".deps/Thread.Tpo" ".deps/Thread.Po"; else rm -f ".deps/Thread.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT error.o -MD -MP -MF ".deps/error.Tpo" -c -o error.o error.c; \
then mv -f ".deps/error.Tpo" ".deps/error.Po"; else rm -f ".deps/error.Tpo"; exit 1; fi
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT delay.o -MD -MP -MF ".deps/delay.Tpo" -c -o delay.o delay.cpp; \
then mv -f ".deps/delay.Tpo" ".deps/delay.Po"; else rm -f ".deps/delay.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT gettimeofday.o -MD -MP -MF ".deps/gettimeofday.Tpo" -c -o gettimeofday.o gettimeofday.c; \
then mv -f ".deps/gettimeofday.Tpo" ".deps/gettimeofday.Po"; else rm -f ".deps/gettimeofday.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT inet_ntop.o -MD -MP -MF ".deps/inet_ntop.Tpo" -c -o inet_ntop.o inet_ntop.c; \
then mv -f ".deps/inet_ntop.Tpo" ".deps/inet_ntop.Po"; else rm -f ".deps/inet_ntop.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT inet_pton.o -MD -MP -MF ".deps/inet_pton.Tpo" -c -o inet_pton.o inet_pton.c; \
then mv -f ".deps/inet_pton.Tpo" ".deps/inet_pton.Po"; else rm -f ".deps/inet_pton.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT signal.o -MD -MP -MF ".deps/signal.Tpo" -c -o signal.o signal.c; \
then mv -f ".deps/signal.Tpo" ".deps/signal.Po"; else rm -f ".deps/signal.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT snprintf.o -MD -MP -MF ".deps/snprintf.Tpo" -c -o snprintf.o snprintf.c; \
then mv -f ".deps/snprintf.Tpo" ".deps/snprintf.Po"; else rm -f ".deps/snprintf.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT string.o -MD -MP -MF ".deps/string.Tpo" -c -o string.o string.c; \
then mv -f ".deps/string.Tpo" ".deps/string.Po"; else rm -f ".deps/string.Tpo"; exit 1; fi
rm -f libcompat.a
ar cru libcompat.a Thread.o error.o delay.o gettimeofday.o inet_ntop.o inet_pton.o signal.o snprintf.o string.o
ranlib libcompat.a
make[2]: Leaving directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/compat'
Making all in doc
make[2]: Entering directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/doc'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/doc'
Making all in include
make[2]: Entering directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/include'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/include'
Making all in src
make[2]: Entering directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/src'
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT Client.o -MD -MP -MF ".deps/Client.Tpo" -c -o Client.o Client.cpp; \
then mv -f ".deps/Client.Tpo" ".deps/Client.Po"; else rm -f ".deps/Client.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT Extractor.o -MD -MP -MF ".deps/Extractor.Tpo" -c -o Extractor.o Extractor.c; \
then mv -f ".deps/Extractor.Tpo" ".deps/Extractor.Po"; else rm -f ".deps/Extractor.Tpo"; exit 1; fi
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT Launch.o -MD -MP -MF ".deps/Launch.Tpo" -c -o Launch.o Launch.cpp; \
then mv -f ".deps/Launch.Tpo" ".deps/Launch.Po"; else rm -f ".deps/Launch.Tpo"; exit 1; fi
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT List.o -MD -MP -MF ".deps/List.Tpo" -c -o List.o List.cpp; \
then mv -f ".deps/List.Tpo" ".deps/List.Po"; else rm -f ".deps/List.Tpo"; exit 1; fi
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT Listener.o -MD -MP -MF ".deps/Listener.Tpo" -c -o Listener.o Listener.cpp; \
then mv -f ".deps/Listener.Tpo" ".deps/Listener.Po"; else rm -f ".deps/Listener.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT Locale.o -MD -MP -MF ".deps/Locale.Tpo" -c -o Locale.o Locale.c; \
then mv -f ".deps/Locale.Tpo" ".deps/Locale.Po"; else rm -f ".deps/Locale.Tpo"; exit 1; fi
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT PerfSocket.o -MD -MP -MF ".deps/PerfSocket.Tpo" -c -o PerfSocket.o PerfSocket.cpp; \
then mv -f ".deps/PerfSocket.Tpo" ".deps/PerfSocket.Po"; else rm -f ".deps/PerfSocket.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT ReportCSV.o -MD -MP -MF ".deps/ReportCSV.Tpo" -c -o ReportCSV.o ReportCSV.c; \
then mv -f ".deps/ReportCSV.Tpo" ".deps/ReportCSV.Po"; else rm -f ".deps/ReportCSV.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT ReportDefault.o -MD -MP -MF ".deps/ReportDefault.Tpo" -c -o ReportDefault.o ReportDefault.c; \
then mv -f ".deps/ReportDefault.Tpo" ".deps/ReportDefault.Po"; else rm -f ".deps/ReportDefault.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT Reporter.o -MD -MP -MF ".deps/Reporter.Tpo" -c -o Reporter.o Reporter.c; \
then mv -f ".deps/Reporter.Tpo" ".deps/Reporter.Po"; else rm -f ".deps/Reporter.Tpo"; exit 1; fi
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT Server.o -MD -MP -MF ".deps/Server.Tpo" -c -o Server.o Server.cpp; \
then mv -f ".deps/Server.Tpo" ".deps/Server.Po"; else rm -f ".deps/Server.Tpo"; exit 1; fi
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT Settings.o -MD -MP -MF ".deps/Settings.Tpo" -c -o Settings.o Settings.cpp; \
then mv -f ".deps/Settings.Tpo" ".deps/Settings.Po"; else rm -f ".deps/Settings.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT SocketAddr.o -MD -MP -MF ".deps/SocketAddr.Tpo" -c -o SocketAddr.o SocketAddr.c; \
then mv -f ".deps/SocketAddr.Tpo" ".deps/SocketAddr.Po"; else rm -f ".deps/SocketAddr.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT gnu_getopt.o -MD -MP -MF ".deps/gnu_getopt.Tpo" -c -o gnu_getopt.o gnu_getopt.c; \
then mv -f ".deps/gnu_getopt.Tpo" ".deps/gnu_getopt.Po"; else rm -f ".deps/gnu_getopt.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT gnu_getopt_long.o -MD -MP -MF ".deps/gnu_getopt_long.Tpo" -c -o gnu_getopt_long.o gnu_getopt_long.c; \
then mv -f ".deps/gnu_getopt_long.Tpo" ".deps/gnu_getopt_long.Po"; else rm -f ".deps/gnu_getopt_long.Tpo"; exit 1; fi
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT main.o -MD -MP -MF ".deps/main.Tpo" -c -o main.o main.cpp; \
then mv -f ".deps/main.Tpo" ".deps/main.Po"; else rm -f ".deps/main.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT service.o -MD -MP -MF ".deps/service.Tpo" -c -o service.o service.c; \
then mv -f ".deps/service.Tpo" ".deps/service.Po"; else rm -f ".deps/service.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT sockets.o -MD -MP -MF ".deps/sockets.Tpo" -c -o sockets.o sockets.c; \
then mv -f ".deps/sockets.Tpo" ".deps/sockets.Po"; else rm -f ".deps/sockets.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT stdio.o -MD -MP -MF ".deps/stdio.Tpo" -c -o stdio.o stdio.c; \
then mv -f ".deps/stdio.Tpo" ".deps/stdio.Po"; else rm -f ".deps/stdio.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT tcp_window_size.o -MD -MP -MF ".deps/tcp_window_size.Tpo" -c -o tcp_window_size.o tcp_window_size.c; \
then mv -f ".deps/tcp_window_size.Tpo" ".deps/tcp_window_size.Po"; else rm -f ".deps/tcp_window_size.Tpo"; exit 1; fi
g++ -Wall -O2 -o iperf -O2 -pthread -DHAVE_CONFIG_H Client.o Extractor.o Launch.o List.o Listener.o Locale.o PerfSocket.o ReportCSV.o ReportDefault.o Reporter.o Server.o Settings.o SocketAddr.o gnu_getopt.o gnu_getopt_long.o main.o service.o sockets.o stdio.o tcp_window_size.o ../compat/libcompat.a
make[2]: Leaving directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/src'
Making all in man
make[2]: Entering directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/man'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/man'
make[2]: Entering directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4'
make[2]: Leaving directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4'
make[1]: Leaving directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4'
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.qhXikH
+ umask 022
+ cd /home/bhaskar/iperfRPM/BUILD
+ cd iperf-2.0.4
+ make install prefix=/home/bhaskar/rpmbuild/BUILDROOT/iperf-2.0.4-1.i386/usr
Making install in compat
make[1]: Entering directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/compat'
make[2]: Entering directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/compat'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/compat'
make[1]: Leaving directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/compat'
Making install in doc
make[1]: Entering directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/doc'
make[2]: Entering directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/doc'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/doc'
make[1]: Leaving directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/doc'
Making install in include
make[1]: Entering directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/include'
make[2]: Entering directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/include'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/include'
make[1]: Leaving directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/include'
Making install in src
make[1]: Entering directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/src'
make[2]: Entering directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/src'
test -z "/home/bhaskar/rpmbuild/BUILDROOT/iperf-2.0.4-1.i386/usr/bin" || mkdir -p -- "/home/bhaskar/rpmbuild/BUILDROOT/iperf-2.0.4-1.i386/usr/bin"
/usr/bin/install -c 'iperf' '/home/bhaskar/rpmbuild/BUILDROOT/iperf-2.0.4-1.i386/usr/bin/iperf'
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/src'
make[1]: Leaving directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/src'
Making install in man
make[1]: Entering directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/man'
make[2]: Entering directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/man'
make[2]: Nothing to be done for `install-exec-am'.
test -z "/home/bhaskar/rpmbuild/BUILDROOT/iperf-2.0.4-1.i386/usr/share/man/man1" || mkdir -p -- "/home/bhaskar/rpmbuild/BUILDROOT/iperf-2.0.4-1.i386/usr/share/man/man1"
/usr/bin/install -c -m 644 './iperf.1' '/home/bhaskar/rpmbuild/BUILDROOT/iperf-2.0.4-1.i386/usr/share/man/man1/iperf.1'
/usr/bin/install -c -m 644 './iperf.1' '/home/bhaskar/rpmbuild/BUILDROOT/iperf-2.0.4-1.i386/usr/share/man/man1/iperf.1'
make[2]: Leaving directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/man'
make[1]: Leaving directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/man'
make[1]: Entering directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4'
make[2]: Entering directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4'
make[1]: Leaving directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4'
+ /usr/lib/rpm/brp-compress
+ /usr/lib/rpm/brp-strip
+ /usr/lib/rpm/brp-strip-static-archive
+ /usr/lib/rpm/brp-strip-comment-note
Processing files: iperf-2.0.4-1.i386
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 Requires: libc.so.6 libc.so.6(GLIBC_2.0) libc.so.6(GLIBC_2.1) libc.so.6(GLIBC_2.1.3) libc.so.6(GLIBC_2.3) libc.so.6(GLIBC_2.7) libgcc_s.so.1 libgcc_s.so.1(GCC_3.0) libm.so.6 libpthread.so.0 libpthread.so.0(GLIBC_2.0) libpthread.so.0(GLIBC_2.1) libpthread.so.0(GLIBC_2.3.2) libstdc++.so.6 libstdc++.so.6(CXXABI_1.3) libstdc++.so.6(GLIBCXX_3.4) rtld(GNU_HASH) Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/bhaskar/rpmbuild/BUILDROOT/iperf-2.0.4-1.i386 Wrote: /home/bhaskar/iperfRPM/SRPMS/iperf-2.0.4-1.src.rpm Wrote: /home/bhaskar/iperfRPM/RPMS/i386/iperf-2.0.4-1.i386.rpm Executing(--clean): /bin/sh -e /var/tmp/rpm-tmp.V9lg5X + umask 022 + cd /home/bhaskar/iperfRPM/BUILD + rm -rf iperf-2.0.4 + exit 0 So it's all done well. Now what this command will do? It will first create a folder under the user home directory called 'rpmbuild' bhaskar@bhaskar-laptop_09:43:59_Tue Mar 30:~> ls -ld rpmbuild/
drwxr-xr-x. 8 root root 4096 2010-03-30 09:40 rpmbuild/
Surprise by seeing the permisson of that folder..because I ran the command as sudo;Anyway it contains this dir inside it:
bhaskar@bhaskar-laptop_09:44:07_Tue Mar 30:~> ls -lath rpmbuild/
total 32K
drwxr-xr-x. 3 root root 4.0K 2010-03-30 09:41 BUILDROOT
drwxr-xr-x. 8 root root 4.0K 2010-03-30 09:40 .
drwxr-xr-x. 2 root root 4.0K 2010-03-30 09:40 BUILD
drwxr-xr-x. 2 root root 4.0K 2010-03-30 09:40 RPMS
drwxr-xr-x. 2 root root 4.0K 2010-03-30 09:40 SOURCES
drwxr-xr-x. 2 root root 4.0K 2010-03-30 09:40 SPECS
drwxr-xr-x. 2 root root 4.0K 2010-03-30 09:40 SRPMS
drwx------. 43 bhaskar bhaskar 4.0K 2010-03-30 09:40 ..
As I told you beforehand that all the placeholder file location will be under buildroot variable.Just to under BUILDROOT dir disclose this info:
bhaskar@bhaskar-laptop_09:45:40_Tue Mar 30:~> ls -lath ~/rpmbuild/BUILDROOT/
total 12K
drwxr-xr-x. 3 root root 4.0K 2010-03-30 09:41 .
drwxr-xr-x. 3 root root 4.0K 2010-03-30 09:41 iperf-2.0.4-1.i386
drwxr-xr-x. 8 root root 4.0K 2010-03-30 09:40 ..
bhaskar@bhaskar-laptop_09:47:10_Tue Mar 30:~> ls -lath ~/rpmbuild/BUILDROOT/iperf-2.0.4-1.i386/
total 12K
drwxr-xr-x. 4 root root 4.0K 2010-03-30 09:41 usr
drwxr-xr-x. 3 root root 4.0K 2010-03-30 09:41 .
drwxr-xr-x. 3 root root 4.0K 2010-03-30 09:41 ..
So it contain the actual place where the software is going to be installed system wide.
I want check whether that rpm is actually created in the right place or not.For that just look into RPMS and SRPMS dir of the buildroot dir:
bhaskar@bhaskar-laptop_09:49:56_Tue Mar 30:~> ls -alth ~/iperfRPM/RPMS/i386/
total 44K
drwxr-xr-x. 2 root root 4.0K 2010-03-30 09:41 .
-rw-r--r--. 1 root root 36K 2010-03-30 09:41 iperf-2.0.4-1.i386.rpm
drwxr-xr-x. 3 bhaskar bhaskar 4.0K 2010-03-30 09:41 ..
The rpms always create under the arch directory for which it specifically built.Likewise the SRPMS:
bhaskar@bhaskar-laptop_09:50:01_Tue Mar 30:~> ls -alth ~/iperfRPM/SRPMS/
total 256K
-rw-r--r--. 1 root root 245K 2010-03-30 09:41 iperf-2.0.4-1.src.rpm
drwxr-xr-x. 2 bhaskar bhaskar 4.0K 2010-03-30 09:41 .
drwxr-xr-x. 7 bhaskar bhaskar 4.0K 2010-03-30 08:45 ..
Step 6:
Now time to install the rpm
bhaskar@bhaskar-laptop_09:51:07_Tue Mar 30:~> sudo rpm -ivh ~/iperfRPM/RPMS/i386/iperf-2.0.4-1.i386.rpm
[sudo] password for bhaskar:
Preparing... ########################################### [100%]
1:iperf ########################################### [100%]
Now it's been installed.Just to crosss check with rpm query.
bhaskar@bhaskar-laptop_09:52:21_Tue Mar 30:~> rpm -qi iperf
Name : iperf Relocations: /usr
Version : 2.0.4 Vendor: (none)
Release : 1 Build Date: Tue 30 Mar 2010 09:41:11 AM IST
Install Date: Tue 30 Mar 2010 09:52:19 AM IST Build Host: localhost.localdomain
Group : Development/Tools Source RPM: iperf-2.0.4-1.src.rpm
Size : 71890 License: GPL
Signature : (none)
Summary : iperf
Description :
Iperf was developed by NLANR/DAST as a modern alternative for measuring maximum TCP and UDP bandwidth performance. Iperf allows the tuning of various parameters and UDP characteristics. Iperf reports bandwidth, delay jitter, datagram loss.
Now you can view the man page of it like it :
bhaskar@bhaskar-laptop_09:53:08_Tue Mar 30:~> man iperf
IPERF(1) User Manuals IPERF(1)
NAME
iperf - perform network throughput tests
SYNOPSIS
iperf -s [ options ]
iperf -c server [ options ]
iperf -u -s [ options ]
iperf -u -c server [ options ]
DESCRIPTION
iperf is a tool for performing network throughput measurements. It can test either TCP or UDP throughput. To perform an iperf test
the user must establish both a server (to discard traffic) and a client (to generate traffic).
GENERAL OPTIONS
-f, --format
[kmKM] format to report: Kbits, Mbits, KBytes, MBytes
-h, --help
print a help synopsis
-i, --interval n
pause n seconds between periodic bandwidth reports
-l, --len n[KM]
................ output ommited
Step 7:
To see how it can be use :
bhaskar@bhaskar-laptop_09:54:36_Tue Mar 30:~> iperf --help
Usage: iperf [-s|-c host] [options]
iperf [-h|--help] [-v|--version]
Client/Server:
-f, --format [kmKM] format to report: Kbits, Mbits, KBytes, MBytes
-i, --interval # seconds between periodic bandwidth reports
-l, --len #[KM] length of buffer to read or write (default 8 KB)
-m, --print_mss print TCP maximum segment size (MTU - TCP/IP header)
-o, --output output the report or error message to this specified file
-p, --port # server port to listen on/connect to
-u, --udp use UDP rather than TCP
-w, --window #[KM] TCP window size (socket buffer size)
-B, --bind bind to , an interface or multicast address
-C, --compatibility for use with older versions does not sent extra msgs
-M, --mss # set TCP maximum segment size (MTU - 40 bytes)
-N, --nodelay set TCP no delay, disabling Nagle's Algorithm
-V, --IPv6Version Set the domain to IPv6
Server specific:
-s, --server run in server mode
-U, --single_udp run in single threaded UDP mode
-D, --daemon run the server as a daemon
Client specific:
-b, --bandwidth #[KM] for UDP, bandwidth to send at in bits/sec
(default 1 Mbit/sec, implies -u)
-c, --client run in client mode, connecting to
-d, --dualtest Do a bidirectional test simultaneously
-n, --num #[KM] number of bytes to transmit (instead of -t)
-r, --tradeoff Do a bidirectional test individually
-t, --time # time in seconds to transmit for (default 10 secs)
-F, --fileinput input the data to be transmitted from a file
-I, --stdin input the data to be transmitted from stdin
-L, --listenport # port to recieve bidirectional tests back on
-P, --parallel # number of parallel client threads to run
-T, --ttl # time-to-live, for multicast (default 1)
-Z, --linux-congestion set TCP congestion control algorithm (Linux only)
Miscellaneous:
-x, --reportexclude [CDMSV] exclude C(connection) D(data) M(multicast) S(settings) V(server) reports
-y, --reportstyle C report as a Comma-Separated Values
-h, --help print this message and quit
-v, --version print version information and quit
[KM] Indicates options that support a K or M suffix for kilo- or mega-
The TCP window size option can be set by the environment variable
TCP_WINDOW_SIZE. Most other options can be set by an environment variable
IPERF_, such as IPERF_BANDWIDTH.
Report bugs to
Just like this:
bhaskar@bhaskar-laptop_09:55:33_Tue Mar 30:~> sudo iperf -c bhaskar-laptop
connect failed: Connection refused
write1 failed: Broken pipe
------------------------------------------------------------
Client connecting to bhaskar-laptop, TCP port 5001
write2 failed: Broken pipe
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[ 3] local 0.0.0.0 port 35914 connected with 127.0.0.1 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0- 0.0 sec 0.00 Bytes 0.00 bits/sec
Conclusion: Building rpm is an complex task. One can do many thing with rpm namely sign it ,provide prequisite to build the software ,provide post install work ,pre install work done by the rpm all in the spec file.In return it gives you a better understanding of the underlying system and ease to maintain the system. I have been highly motivated by the articles published in IBM developerworks part1 , part2 and part3
This is great site to explain all that step by step rpmbuild-process .
Hope this will help.
Bhaskar Chowdhury
I do not issue any guarantee that this will work for you.
We as an administrator basically managed rpm based distros in corporates and as a result of that it is often required that just for the convenience and ease of porting to other similar system to make it package manager aware of that particular distro(Same thing can be done with other distros with different package manager).
Step 1:
So first step to get the tarball from Sourceforge . I am going to get a software called "iperf",which is basically measuring maximum bandwidth performance for TCP and UDP.So here is the link to get it iperf, as I have get from the browser and my default directory to store the downloads is "Downloads" folder under my home directory.Like this;
bhaskar@bhaskar-laptop_08:41:25_Tue Mar 30:~/Downloads> ls
iperf-2.0.4.tar.gz
Step 2:
We need to create five directory according to the rpmbuild specification.So here we go:
bhaskar@bhaskar-laptop_08:44:15_Tue Mar 30:~> mkdir iperfRPM
bhaskar@bhaskar-laptop_08:44:28_Tue Mar 30:~> cd iperfRPM/
bhaskar@bhaskar-laptop_08:45:14_Tue Mar 30:~/iperfRPM> mkdir BUILD SOURCES SPECS SRPMS RPMS
bhaskar@bhaskar-laptop_08:45:47_Tue Mar 30:~/iperfRPM> ls
BUILD RPMS SOURCES SPECS SRPMS
Step 3:
Now we need to copy the source form "Download" directory to the /iperfRPM/SOURCES/ directory:
bhaskar@bhaskar-laptop_08:51:57_Tue Mar 30:~/Downloads> cp -v iperf-2.0.4.tar.gz ~/iperfRPM/SOURCES/
`iperf-2.0.4.tar.gz' -> `/home/bhaskar/iperfRPM/SOURCES/iperf-2.0.4.tar.gz'
Step 4:
Now the most important steps of all : to create the .spec file for that perticular software to be make rpm.Because rpm format understand certain formats and package creator have to follow that to make the rpm package manager to understand it.
so here we go:
bhaskar@bhaskar-laptop_08:58:56_Tue Mar 30:~/iperfRPM> cd SPECS/
bhaskar@bhaskar-laptop_08:58:59_Tue Mar 30:~/iperfRPM/SPECS> ls
bhaskar@bhaskar-laptop_08:58:59_Tue Mar 30:~/iperfRPM/SPECS> vim iperf.spec
And the content of the file would look like this :
# This is a sample spec file for iperf
%define _topdir /home/bhaskar/iperfRPM
%define name iperf
%define release 1
%define version 2.0.4
%define buildroot %{_topdir}/%{name}-%{version}-root
BuildRoot: %{buildroot}
Summary: iperf
License:
Name: %{name}
Version: %{version}
Release: %{release}
Source: %{name}-%{version}.tar.gz
Prefix: /usr
Group: Development/Tools
%description
Iperf was developed by NLANR/DAST as a modern alternative for measuring maximum TCP and UDP bandwidth performance. Iperf allows the tuning of various parameters and UDP characteristics. Iperf reports bandwidth, delay jitter, datagram loss.
%prep
%setup -q
%build
./configure
make
%install
make install prefix=$RPM_BUILD_ROOT/usr
%files
%defattr(-,root,root)
/usr/local/bin/iperf
%doc %attr(0444,root,root) /usr/local/share/man/man1/iperf.1
This file has descibes the purpose of the variables declared there. Most notably under %files section whatever file you include which will be integrated with the rpm .Essentially it will set the permission of the particular file too!
Now one more important note here that %buildroot variable is just an proxy place to hold the content of the software which is going to installed somewhere else.So it's very very important to specify that location properly(because I made a mess of it couple of times :) ).
Step 5:
So the final step is to build the rpm . I will create the binary as well as source rpm too.
NOTE: I have built this on Fedora 12 ..so it doesn't ship with rpmbuildtool,gcc,g++ . So I had to get them manually all(via yum install).Before I proceed to the next step.
bhaskar@bhaskar-laptop_09:20:37_Tue Mar 30:~/iperfRPM> sudo rpmbuild -v -ba --clean ~/iperfRPM/SPECS/iperf.spec
And here is output of that command
bhaskar@bhaskar-laptop_09:40:36_Tue Mar 30:~> sudo rpmbuild -v -ba --clean ~/iperfRPM/SPECS/iperf.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.Enxq4g
+ umask 022
+ cd /home/bhaskar/iperfRPM/BUILD
+ cd /home/bhaskar/iperfRPM/BUILD
+ rm -rf iperf-2.0.4
+ /usr/bin/gzip -dc /home/bhaskar/iperfRPM/SOURCES/iperf-2.0.4.tar.gz
+ /bin/tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd iperf-2.0.4
+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.5K92Wh
+ umask 022
+ cd /home/bhaskar/iperfRPM/BUILD
+ cd iperf-2.0.4
+ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for g++... g++
checking for C++ compiler default output file name... a.out
checking whether the C++ compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... gcc3
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for strerror in -lcposix... no
checking for a BSD-compatible install... /usr/bin/install -c
checking whether make sets $(MAKE)... (cached) yes
checking for ranlib... ranlib
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -kthread... no
checking for the pthreads library -llthread... no
checking whether pthreads work with -pthread... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... no
checking for cc_r... gcc
checking for gethostbyname... yes
checking for socket... yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking libintl.h usability... yes
checking libintl.h presence... yes
checking for libintl.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking for unistd.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking for ssize_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for stdint types... stdint.h (shortcircuit)
make use of stdint.h in include/iperf-int.h (assuming C99 compatible system)
checking 3rd argument of accept... socklen_t
checking for pid_t... yes
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... yes
checking for working vfork... (cached) yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for working memcmp... yes
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking for sys/socket.h... (cached) yes
checking types of arguments for select... int,fd_set *,struct timeval *
checking return type of signal handlers... void
checking for strftime... yes
checking for vprintf... yes
checking for _doprnt... no
checking for atexit... yes
checking for gettimeofday... yes
checking for memset... yes
checking for pthread_cancel... no
checking for select... yes
checking for strchr... yes
checking for strerror... yes
checking for strtol... yes
checking for usleep... yes
checking for snprintf... yes
checking for inet_pton... yes
checking for inet_ntop... yes
checking for gettimeofday... (cached) yes
checking *printf() support for %lld... yes
checking for bool... no
checking size of bool... 0
checking if true is defined... yes
checking whether byte ordering is bigendian... no
checking for struct ip_mreq... yes
checking whether IP_ADD_MEMBERSHIP is declared... yes
checking for multicast support... yes
checking for struct sockaddr_storage... yes
checking for struct sockaddr_in6... yes
checking whether AF_INET6 is declared... yes
checking for IPv6 headers and structures... yes
checking for struct ipv6_mreq... yes
checking whether IPV6_ADD_MEMBERSHIP is declared... yes
checking whether IPV6_MULTICAST_HOPS is declared... yes
checking for IPv6 multicast support... yes
checking whether make is GNU make... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating compat/Makefile
config.status: creating doc/Makefile
config.status: creating include/Makefile
config.status: creating src/Makefile
config.status: creating man/Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing include/iperf-int.h commands
config.status: creating include/iperf-int.h : _IPERF_INCLUDE_IPERF_INT_H
+ make
make all-recursive
make[1]: Entering directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4'
Making all in compat
make[2]: Entering directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/compat'
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT Thread.o -MD -MP -MF ".deps/Thread.Tpo" -c -o Thread.o Thread.c; \
then mv -f ".deps/Thread.Tpo" ".deps/Thread.Po"; else rm -f ".deps/Thread.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT error.o -MD -MP -MF ".deps/error.Tpo" -c -o error.o error.c; \
then mv -f ".deps/error.Tpo" ".deps/error.Po"; else rm -f ".deps/error.Tpo"; exit 1; fi
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT delay.o -MD -MP -MF ".deps/delay.Tpo" -c -o delay.o delay.cpp; \
then mv -f ".deps/delay.Tpo" ".deps/delay.Po"; else rm -f ".deps/delay.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT gettimeofday.o -MD -MP -MF ".deps/gettimeofday.Tpo" -c -o gettimeofday.o gettimeofday.c; \
then mv -f ".deps/gettimeofday.Tpo" ".deps/gettimeofday.Po"; else rm -f ".deps/gettimeofday.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT inet_ntop.o -MD -MP -MF ".deps/inet_ntop.Tpo" -c -o inet_ntop.o inet_ntop.c; \
then mv -f ".deps/inet_ntop.Tpo" ".deps/inet_ntop.Po"; else rm -f ".deps/inet_ntop.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT inet_pton.o -MD -MP -MF ".deps/inet_pton.Tpo" -c -o inet_pton.o inet_pton.c; \
then mv -f ".deps/inet_pton.Tpo" ".deps/inet_pton.Po"; else rm -f ".deps/inet_pton.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT signal.o -MD -MP -MF ".deps/signal.Tpo" -c -o signal.o signal.c; \
then mv -f ".deps/signal.Tpo" ".deps/signal.Po"; else rm -f ".deps/signal.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT snprintf.o -MD -MP -MF ".deps/snprintf.Tpo" -c -o snprintf.o snprintf.c; \
then mv -f ".deps/snprintf.Tpo" ".deps/snprintf.Po"; else rm -f ".deps/snprintf.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT string.o -MD -MP -MF ".deps/string.Tpo" -c -o string.o string.c; \
then mv -f ".deps/string.Tpo" ".deps/string.Po"; else rm -f ".deps/string.Tpo"; exit 1; fi
rm -f libcompat.a
ar cru libcompat.a Thread.o error.o delay.o gettimeofday.o inet_ntop.o inet_pton.o signal.o snprintf.o string.o
ranlib libcompat.a
make[2]: Leaving directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/compat'
Making all in doc
make[2]: Entering directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/doc'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/doc'
Making all in include
make[2]: Entering directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/include'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/include'
Making all in src
make[2]: Entering directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/src'
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT Client.o -MD -MP -MF ".deps/Client.Tpo" -c -o Client.o Client.cpp; \
then mv -f ".deps/Client.Tpo" ".deps/Client.Po"; else rm -f ".deps/Client.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT Extractor.o -MD -MP -MF ".deps/Extractor.Tpo" -c -o Extractor.o Extractor.c; \
then mv -f ".deps/Extractor.Tpo" ".deps/Extractor.Po"; else rm -f ".deps/Extractor.Tpo"; exit 1; fi
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT Launch.o -MD -MP -MF ".deps/Launch.Tpo" -c -o Launch.o Launch.cpp; \
then mv -f ".deps/Launch.Tpo" ".deps/Launch.Po"; else rm -f ".deps/Launch.Tpo"; exit 1; fi
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT List.o -MD -MP -MF ".deps/List.Tpo" -c -o List.o List.cpp; \
then mv -f ".deps/List.Tpo" ".deps/List.Po"; else rm -f ".deps/List.Tpo"; exit 1; fi
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT Listener.o -MD -MP -MF ".deps/Listener.Tpo" -c -o Listener.o Listener.cpp; \
then mv -f ".deps/Listener.Tpo" ".deps/Listener.Po"; else rm -f ".deps/Listener.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT Locale.o -MD -MP -MF ".deps/Locale.Tpo" -c -o Locale.o Locale.c; \
then mv -f ".deps/Locale.Tpo" ".deps/Locale.Po"; else rm -f ".deps/Locale.Tpo"; exit 1; fi
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT PerfSocket.o -MD -MP -MF ".deps/PerfSocket.Tpo" -c -o PerfSocket.o PerfSocket.cpp; \
then mv -f ".deps/PerfSocket.Tpo" ".deps/PerfSocket.Po"; else rm -f ".deps/PerfSocket.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT ReportCSV.o -MD -MP -MF ".deps/ReportCSV.Tpo" -c -o ReportCSV.o ReportCSV.c; \
then mv -f ".deps/ReportCSV.Tpo" ".deps/ReportCSV.Po"; else rm -f ".deps/ReportCSV.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT ReportDefault.o -MD -MP -MF ".deps/ReportDefault.Tpo" -c -o ReportDefault.o ReportDefault.c; \
then mv -f ".deps/ReportDefault.Tpo" ".deps/ReportDefault.Po"; else rm -f ".deps/ReportDefault.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT Reporter.o -MD -MP -MF ".deps/Reporter.Tpo" -c -o Reporter.o Reporter.c; \
then mv -f ".deps/Reporter.Tpo" ".deps/Reporter.Po"; else rm -f ".deps/Reporter.Tpo"; exit 1; fi
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT Server.o -MD -MP -MF ".deps/Server.Tpo" -c -o Server.o Server.cpp; \
then mv -f ".deps/Server.Tpo" ".deps/Server.Po"; else rm -f ".deps/Server.Tpo"; exit 1; fi
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT Settings.o -MD -MP -MF ".deps/Settings.Tpo" -c -o Settings.o Settings.cpp; \
then mv -f ".deps/Settings.Tpo" ".deps/Settings.Po"; else rm -f ".deps/Settings.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT SocketAddr.o -MD -MP -MF ".deps/SocketAddr.Tpo" -c -o SocketAddr.o SocketAddr.c; \
then mv -f ".deps/SocketAddr.Tpo" ".deps/SocketAddr.Po"; else rm -f ".deps/SocketAddr.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT gnu_getopt.o -MD -MP -MF ".deps/gnu_getopt.Tpo" -c -o gnu_getopt.o gnu_getopt.c; \
then mv -f ".deps/gnu_getopt.Tpo" ".deps/gnu_getopt.Po"; else rm -f ".deps/gnu_getopt.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT gnu_getopt_long.o -MD -MP -MF ".deps/gnu_getopt_long.Tpo" -c -o gnu_getopt_long.o gnu_getopt_long.c; \
then mv -f ".deps/gnu_getopt_long.Tpo" ".deps/gnu_getopt_long.Po"; else rm -f ".deps/gnu_getopt_long.Tpo"; exit 1; fi
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT main.o -MD -MP -MF ".deps/main.Tpo" -c -o main.o main.cpp; \
then mv -f ".deps/main.Tpo" ".deps/main.Po"; else rm -f ".deps/main.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT service.o -MD -MP -MF ".deps/service.Tpo" -c -o service.o service.c; \
then mv -f ".deps/service.Tpo" ".deps/service.Po"; else rm -f ".deps/service.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT sockets.o -MD -MP -MF ".deps/sockets.Tpo" -c -o sockets.o sockets.c; \
then mv -f ".deps/sockets.Tpo" ".deps/sockets.Po"; else rm -f ".deps/sockets.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT stdio.o -MD -MP -MF ".deps/stdio.Tpo" -c -o stdio.o stdio.c; \
then mv -f ".deps/stdio.Tpo" ".deps/stdio.Po"; else rm -f ".deps/stdio.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT tcp_window_size.o -MD -MP -MF ".deps/tcp_window_size.Tpo" -c -o tcp_window_size.o tcp_window_size.c; \
then mv -f ".deps/tcp_window_size.Tpo" ".deps/tcp_window_size.Po"; else rm -f ".deps/tcp_window_size.Tpo"; exit 1; fi
g++ -Wall -O2 -o iperf -O2 -pthread -DHAVE_CONFIG_H Client.o Extractor.o Launch.o List.o Listener.o Locale.o PerfSocket.o ReportCSV.o ReportDefault.o Reporter.o Server.o Settings.o SocketAddr.o gnu_getopt.o gnu_getopt_long.o main.o service.o sockets.o stdio.o tcp_window_size.o ../compat/libcompat.a
make[2]: Leaving directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/src'
Making all in man
make[2]: Entering directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/man'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/man'
make[2]: Entering directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4'
make[2]: Leaving directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4'
make[1]: Leaving directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4'
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.qhXikH
+ umask 022
+ cd /home/bhaskar/iperfRPM/BUILD
+ cd iperf-2.0.4
+ make install prefix=/home/bhaskar/rpmbuild/BUILDROOT/iperf-2.0.4-1.i386/usr
Making install in compat
make[1]: Entering directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/compat'
make[2]: Entering directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/compat'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/compat'
make[1]: Leaving directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/compat'
Making install in doc
make[1]: Entering directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/doc'
make[2]: Entering directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/doc'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/doc'
make[1]: Leaving directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/doc'
Making install in include
make[1]: Entering directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/include'
make[2]: Entering directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/include'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/include'
make[1]: Leaving directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/include'
Making install in src
make[1]: Entering directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/src'
make[2]: Entering directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/src'
test -z "/home/bhaskar/rpmbuild/BUILDROOT/iperf-2.0.4-1.i386/usr/bin" || mkdir -p -- "/home/bhaskar/rpmbuild/BUILDROOT/iperf-2.0.4-1.i386/usr/bin"
/usr/bin/install -c 'iperf' '/home/bhaskar/rpmbuild/BUILDROOT/iperf-2.0.4-1.i386/usr/bin/iperf'
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/src'
make[1]: Leaving directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/src'
Making install in man
make[1]: Entering directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/man'
make[2]: Entering directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/man'
make[2]: Nothing to be done for `install-exec-am'.
test -z "/home/bhaskar/rpmbuild/BUILDROOT/iperf-2.0.4-1.i386/usr/share/man/man1" || mkdir -p -- "/home/bhaskar/rpmbuild/BUILDROOT/iperf-2.0.4-1.i386/usr/share/man/man1"
/usr/bin/install -c -m 644 './iperf.1' '/home/bhaskar/rpmbuild/BUILDROOT/iperf-2.0.4-1.i386/usr/share/man/man1/iperf.1'
/usr/bin/install -c -m 644 './iperf.1' '/home/bhaskar/rpmbuild/BUILDROOT/iperf-2.0.4-1.i386/usr/share/man/man1/iperf.1'
make[2]: Leaving directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/man'
make[1]: Leaving directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4/man'
make[1]: Entering directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4'
make[2]: Entering directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4'
make[1]: Leaving directory `/home/bhaskar/iperfRPM/BUILD/iperf-2.0.4'
+ /usr/lib/rpm/brp-compress
+ /usr/lib/rpm/brp-strip
+ /usr/lib/rpm/brp-strip-static-archive
+ /usr/lib/rpm/brp-strip-comment-note
Processing files: iperf-2.0.4-1.i386
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 Requires: libc.so.6 libc.so.6(GLIBC_2.0) libc.so.6(GLIBC_2.1) libc.so.6(GLIBC_2.1.3) libc.so.6(GLIBC_2.3) libc.so.6(GLIBC_2.7) libgcc_s.so.1 libgcc_s.so.1(GCC_3.0) libm.so.6 libpthread.so.0 libpthread.so.0(GLIBC_2.0) libpthread.so.0(GLIBC_2.1) libpthread.so.0(GLIBC_2.3.2) libstdc++.so.6 libstdc++.so.6(CXXABI_1.3) libstdc++.so.6(GLIBCXX_3.4) rtld(GNU_HASH) Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/bhaskar/rpmbuild/BUILDROOT/iperf-2.0.4-1.i386 Wrote: /home/bhaskar/iperfRPM/SRPMS/iperf-2.0.4-1.src.rpm Wrote: /home/bhaskar/iperfRPM/RPMS/i386/iperf-2.0.4-1.i386.rpm Executing(--clean): /bin/sh -e /var/tmp/rpm-tmp.V9lg5X + umask 022 + cd /home/bhaskar/iperfRPM/BUILD + rm -rf iperf-2.0.4 + exit 0 So it's all done well. Now what this command will do? It will first create a folder under the user home directory called 'rpmbuild' bhaskar@bhaskar-laptop_09:43:59_Tue Mar 30:~> ls -ld rpmbuild/
drwxr-xr-x. 8 root root 4096 2010-03-30 09:40 rpmbuild/
Surprise by seeing the permisson of that folder..because I ran the command as sudo;Anyway it contains this dir inside it:
bhaskar@bhaskar-laptop_09:44:07_Tue Mar 30:~> ls -lath rpmbuild/
total 32K
drwxr-xr-x. 3 root root 4.0K 2010-03-30 09:41 BUILDROOT
drwxr-xr-x. 8 root root 4.0K 2010-03-30 09:40 .
drwxr-xr-x. 2 root root 4.0K 2010-03-30 09:40 BUILD
drwxr-xr-x. 2 root root 4.0K 2010-03-30 09:40 RPMS
drwxr-xr-x. 2 root root 4.0K 2010-03-30 09:40 SOURCES
drwxr-xr-x. 2 root root 4.0K 2010-03-30 09:40 SPECS
drwxr-xr-x. 2 root root 4.0K 2010-03-30 09:40 SRPMS
drwx------. 43 bhaskar bhaskar 4.0K 2010-03-30 09:40 ..
As I told you beforehand that all the placeholder file location will be under buildroot variable.Just to under BUILDROOT dir disclose this info:
bhaskar@bhaskar-laptop_09:45:40_Tue Mar 30:~> ls -lath ~/rpmbuild/BUILDROOT/
total 12K
drwxr-xr-x. 3 root root 4.0K 2010-03-30 09:41 .
drwxr-xr-x. 3 root root 4.0K 2010-03-30 09:41 iperf-2.0.4-1.i386
drwxr-xr-x. 8 root root 4.0K 2010-03-30 09:40 ..
bhaskar@bhaskar-laptop_09:47:10_Tue Mar 30:~> ls -lath ~/rpmbuild/BUILDROOT/iperf-2.0.4-1.i386/
total 12K
drwxr-xr-x. 4 root root 4.0K 2010-03-30 09:41 usr
drwxr-xr-x. 3 root root 4.0K 2010-03-30 09:41 .
drwxr-xr-x. 3 root root 4.0K 2010-03-30 09:41 ..
So it contain the actual place where the software is going to be installed system wide.
I want check whether that rpm is actually created in the right place or not.For that just look into RPMS and SRPMS dir of the buildroot dir:
bhaskar@bhaskar-laptop_09:49:56_Tue Mar 30:~> ls -alth ~/iperfRPM/RPMS/i386/
total 44K
drwxr-xr-x. 2 root root 4.0K 2010-03-30 09:41 .
-rw-r--r--. 1 root root 36K 2010-03-30 09:41 iperf-2.0.4-1.i386.rpm
drwxr-xr-x. 3 bhaskar bhaskar 4.0K 2010-03-30 09:41 ..
The rpms always create under the arch directory for which it specifically built.Likewise the SRPMS:
bhaskar@bhaskar-laptop_09:50:01_Tue Mar 30:~> ls -alth ~/iperfRPM/SRPMS/
total 256K
-rw-r--r--. 1 root root 245K 2010-03-30 09:41 iperf-2.0.4-1.src.rpm
drwxr-xr-x. 2 bhaskar bhaskar 4.0K 2010-03-30 09:41 .
drwxr-xr-x. 7 bhaskar bhaskar 4.0K 2010-03-30 08:45 ..
Step 6:
Now time to install the rpm
bhaskar@bhaskar-laptop_09:51:07_Tue Mar 30:~> sudo rpm -ivh ~/iperfRPM/RPMS/i386/iperf-2.0.4-1.i386.rpm
[sudo] password for bhaskar:
Preparing... ########################################### [100%]
1:iperf ########################################### [100%]
Now it's been installed.Just to crosss check with rpm query.
bhaskar@bhaskar-laptop_09:52:21_Tue Mar 30:~> rpm -qi iperf
Name : iperf Relocations: /usr
Version : 2.0.4 Vendor: (none)
Release : 1 Build Date: Tue 30 Mar 2010 09:41:11 AM IST
Install Date: Tue 30 Mar 2010 09:52:19 AM IST Build Host: localhost.localdomain
Group : Development/Tools Source RPM: iperf-2.0.4-1.src.rpm
Size : 71890 License: GPL
Signature : (none)
Summary : iperf
Description :
Iperf was developed by NLANR/DAST as a modern alternative for measuring maximum TCP and UDP bandwidth performance. Iperf allows the tuning of various parameters and UDP characteristics. Iperf reports bandwidth, delay jitter, datagram loss.
Now you can view the man page of it like it :
bhaskar@bhaskar-laptop_09:53:08_Tue Mar 30:~> man iperf
IPERF(1) User Manuals IPERF(1)
NAME
iperf - perform network throughput tests
SYNOPSIS
iperf -s [ options ]
iperf -c server [ options ]
iperf -u -s [ options ]
iperf -u -c server [ options ]
DESCRIPTION
iperf is a tool for performing network throughput measurements. It can test either TCP or UDP throughput. To perform an iperf test
the user must establish both a server (to discard traffic) and a client (to generate traffic).
GENERAL OPTIONS
-f, --format
[kmKM] format to report: Kbits, Mbits, KBytes, MBytes
-h, --help
print a help synopsis
-i, --interval n
pause n seconds between periodic bandwidth reports
-l, --len n[KM]
................ output ommited
Step 7:
To see how it can be use :
bhaskar@bhaskar-laptop_09:54:36_Tue Mar 30:~> iperf --help
Usage: iperf [-s|-c host] [options]
iperf [-h|--help] [-v|--version]
Client/Server:
-f, --format [kmKM] format to report: Kbits, Mbits, KBytes, MBytes
-i, --interval # seconds between periodic bandwidth reports
-l, --len #[KM] length of buffer to read or write (default 8 KB)
-m, --print_mss print TCP maximum segment size (MTU - TCP/IP header)
-o, --output
-p, --port # server port to listen on/connect to
-u, --udp use UDP rather than TCP
-w, --window #[KM] TCP window size (socket buffer size)
-B, --bind
-C, --compatibility for use with older versions does not sent extra msgs
-M, --mss # set TCP maximum segment size (MTU - 40 bytes)
-N, --nodelay set TCP no delay, disabling Nagle's Algorithm
-V, --IPv6Version Set the domain to IPv6
Server specific:
-s, --server run in server mode
-U, --single_udp run in single threaded UDP mode
-D, --daemon run the server as a daemon
Client specific:
-b, --bandwidth #[KM] for UDP, bandwidth to send at in bits/sec
(default 1 Mbit/sec, implies -u)
-c, --client
-d, --dualtest Do a bidirectional test simultaneously
-n, --num #[KM] number of bytes to transmit (instead of -t)
-r, --tradeoff Do a bidirectional test individually
-t, --time # time in seconds to transmit for (default 10 secs)
-F, --fileinput
-I, --stdin input the data to be transmitted from stdin
-L, --listenport # port to recieve bidirectional tests back on
-P, --parallel # number of parallel client threads to run
-T, --ttl # time-to-live, for multicast (default 1)
-Z, --linux-congestion
Miscellaneous:
-x, --reportexclude [CDMSV] exclude C(connection) D(data) M(multicast) S(settings) V(server) reports
-y, --reportstyle C report as a Comma-Separated Values
-h, --help print this message and quit
-v, --version print version information and quit
[KM] Indicates options that support a K or M suffix for kilo- or mega-
The TCP window size option can be set by the environment variable
TCP_WINDOW_SIZE. Most other options can be set by an environment variable
IPERF_
Report bugs to
Just like this:
bhaskar@bhaskar-laptop_09:55:33_Tue Mar 30:~> sudo iperf -c bhaskar-laptop
connect failed: Connection refused
write1 failed: Broken pipe
------------------------------------------------------------
Client connecting to bhaskar-laptop, TCP port 5001
write2 failed: Broken pipe
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[ 3] local 0.0.0.0 port 35914 connected with 127.0.0.1 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0- 0.0 sec 0.00 Bytes 0.00 bits/sec
Conclusion: Building rpm is an complex task. One can do many thing with rpm namely sign it ,provide prequisite to build the software ,provide post install work ,pre install work done by the rpm all in the spec file.In return it gives you a better understanding of the underlying system and ease to maintain the system. I have been highly motivated by the articles published in IBM developerworks part1 , part2 and part3
Hope this will help.
Bhaskar Chowdhury
Monday, March 22, 2010
Patching the kernel: step by step approch
Patching a kernel refers to upgrading to the latest 'n greatest by small increments.
Rather than downloading a 25 meg source, it is possible, indeed desirable from your point of view, to simply apply the changes in source code that occur between revisions. These changes can be as little as half a megabyte. A considerable saving in download time.
I do not issue any guarantee that this will work for you.
First and foremost the kernel source you upgrade must be 'pristine'. It means that at some time previous, you have obtained a pristine kernel source from www.kernel.org or one of it's mirrors. Redhat distribution source code is NOT pristine (nor is any other distro). You must work from pristine source, or, have the ability to reverse patch what ever changes a distributor made. If this is the case for you, bite the bullet, download a pristine kernel, and use these steps for ever more.
"pristine source" is exactly that. Unmodified source code. It does not apply to the compiled binaries or any extraneous additions that may be present in the directory. Thus, you can safely compile pristine source, create and boot the kernel image derived from it, and regardless of all the now extra bits 'in there' , it is still, pristine source. This means you can conveniently port your current kernel configuration into the new kernel, without problems. It is not, "source code".
Now be warned. One slip, one typo on your part, can devastate the source you have. Read every step carefully.
The examples used assume pristine kernel source 2.6.31 located in
/usr/src/linux-2.6.31
and the symlink
/usr/src/linux pointing to it.
One: Obtain the patch.
The patch you require is one more than your current pristine kernel.
download patch-2.6.32.bz2 from www.kernel.org
place this patch file into /usr/src
repeat this step for each patch above 2.6.32
Two: Prepare a new linux folder.
Type the following
cd (space) /usr/src
cp (space) -r (space) linux-2.6.31 (space) linux-2.6.32
rm (space) linux
ln (space) -s (space) linux-2.6.32 (space) linux
Three: dry run
bzcat (space) patch-2.6.32.bz2 (space) | (space) patch (space) -p0 (space) --dry-run (space) | (space) more
What this command does is unpack the compressed patch file and automatically apply it to the "linux" directory. the --dry-run is test mode, it won't damage the source if there's an error. The verb "more" allows you to check thru the processing looking for a FAIL message. A pristine source will NEVER fail No ifs, no buts. If you get FAILS, you dont have a pristine source, simple as that.
Alternatively, you can type the following
bzcat (space) patch-2.6.32.bz2 (space) | (space) patch (space) -p0 (space) --dry-run (space) > (space) dump
You can then edit the "dump" file to your heart's content, looking for fail messages.
Four: the Full Monty.
bzcat (space) patch-2.6.32.bz2 (space) | (space) patch (space) -p0
Five: iterative
You are now ready to complle kernel 2.6.32
You do so in the normal manner (see kernel compile step by step on this site)
If however you have a series of patches (say up to 2.6.99) simply iterate thru steps two to four before compiling. Remember that the criteria is to change the symbolic link, thus, the second iteration would be
cp (space) -r (space) linux-2.6.32 (space) linux-2.6.33
rm (space) linux
ln (space) -s (space) linux-2.6.33 (space) linux
and as each patch succeeds
rm linux-2.6.32
Naturally, in the examples above, you would NEVER
rm linux-2.6.31
2.6.31 (in this example) is your lifeline. You can always revert and start over if things went seriously awol.
Six: Revert a patch
To back a patch out, simply add the -R (reverse) switch:
bzcat patch-2.6.xx | patch -p0 -R
Hope this will help.
Bhaskar Chowdhury
Rather than downloading a 25 meg source, it is possible, indeed desirable from your point of view, to simply apply the changes in source code that occur between revisions. These changes can be as little as half a megabyte. A considerable saving in download time.
I do not issue any guarantee that this will work for you.
First and foremost the kernel source you upgrade must be 'pristine'. It means that at some time previous, you have obtained a pristine kernel source from www.kernel.org or one of it's mirrors. Redhat distribution source code is NOT pristine (nor is any other distro). You must work from pristine source, or, have the ability to reverse patch what ever changes a distributor made. If this is the case for you, bite the bullet, download a pristine kernel, and use these steps for ever more.
"pristine source" is exactly that. Unmodified source code. It does not apply to the compiled binaries or any extraneous additions that may be present in the directory. Thus, you can safely compile pristine source, create and boot the kernel image derived from it, and regardless of all the now extra bits 'in there' , it is still, pristine source. This means you can conveniently port your current kernel configuration into the new kernel, without problems. It is not, "source code".
Now be warned. One slip, one typo on your part, can devastate the source you have. Read every step carefully.
The examples used assume pristine kernel source 2.6.31 located in
/usr/src/linux-2.6.31
and the symlink
/usr/src/linux pointing to it.
One: Obtain the patch.
The patch you require is one more than your current pristine kernel.
download patch-2.6.32.bz2 from www.kernel.org
place this patch file into /usr/src
repeat this step for each patch above 2.6.32
Two: Prepare a new linux folder.
Type the following
cd (space) /usr/src
cp (space) -r (space) linux-2.6.31 (space) linux-2.6.32
rm (space) linux
ln (space) -s (space) linux-2.6.32 (space) linux
Three: dry run
bzcat (space) patch-2.6.32.bz2 (space) | (space) patch (space) -p0 (space) --dry-run (space) | (space) more
What this command does is unpack the compressed patch file and automatically apply it to the "linux" directory. the --dry-run is test mode, it won't damage the source if there's an error. The verb "more" allows you to check thru the processing looking for a FAIL message. A pristine source will NEVER fail No ifs, no buts. If you get FAILS, you dont have a pristine source, simple as that.
Alternatively, you can type the following
bzcat (space) patch-2.6.32.bz2 (space) | (space) patch (space) -p0 (space) --dry-run (space) > (space) dump
You can then edit the "dump" file to your heart's content, looking for fail messages.
Four: the Full Monty.
bzcat (space) patch-2.6.32.bz2 (space) | (space) patch (space) -p0
Five: iterative
You are now ready to complle kernel 2.6.32
You do so in the normal manner (see kernel compile step by step on this site)
If however you have a series of patches (say up to 2.6.99) simply iterate thru steps two to four before compiling. Remember that the criteria is to change the symbolic link, thus, the second iteration would be
cp (space) -r (space) linux-2.6.32 (space) linux-2.6.33
rm (space) linux
ln (space) -s (space) linux-2.6.33 (space) linux
and as each patch succeeds
rm linux-2.6.32
Naturally, in the examples above, you would NEVER
rm linux-2.6.31
2.6.31 (in this example) is your lifeline. You can always revert and start over if things went seriously awol.
Six: Revert a patch
To back a patch out, simply add the -R (reverse) switch:
bzcat patch-2.6.xx | patch -p0 -R
Hope this will help.
Bhaskar Chowdhury
Saturday, March 20, 2010
How to recover from corrupt rpm database on RHEL/CentOS/Fedora
In this article I am going to show you a trick to recover from a corrupt rpm database...which might make the system defunct.As a direct result of that you just cannot install/upgrade/update the software in rpm base system like RHEL,CentOS and Fedora.
I do not issue any guarantee that this will work for you.
First and foremost thing take a backup of the existing rpm database( yes the corrupted one...you never know...).This is located in /var/lib/rpm ..depend on your distribution.
Now go to that dir(/var/lib) and take a backup of entire rpm dir ..like this:
tar -cvzf rpm-date.tar.gz rpm
And finally start rebuilding the rpm database like this:
cd /var/lib/rpm
rm -f __db* # delete it if present
rpm --rebuilddb -vv
Now once the above command finished work..other related thing should start working i.e
yum update
yum install anypackage
rpm -qi packagename
Don't forget to check the system log file in case it spitting out other msg.
This is a good pointer for recover.
Hope this will help.
Bhaskar Chowdhury
I do not issue any guarantee that this will work for you.
First and foremost thing take a backup of the existing rpm database( yes the corrupted one...you never know...).This is located in /var/lib/rpm ..depend on your distribution.
Now go to that dir(/var/lib) and take a backup of entire rpm dir ..like this:
tar -cvzf rpm-date.tar.gz rpm
And finally start rebuilding the rpm database like this:
cd /var/lib/rpm
rm -f __db* # delete it if present
rpm --rebuilddb -vv
Now once the above command finished work..other related thing should start working i.e
yum update
yum install anypackage
rpm -qi packagename
Don't forget to check the system log file in case it spitting out other msg.
This is a good pointer for recover.
Hope this will help.
Bhaskar Chowdhury
Configure Apache to handle multiple SSL site with single IP address
It's been an feature add to Apache(apache.org) Web Server version 2.2.12 onwards called SNI(Server Name Indication). With the help of this feature we can have multiple SSL (Secure Socket Layer) site with have only one IP address.Before that it not possible to do that kind of thing with Apache.
I do not issue any guarantee that this will work for you.
First of all look into this site to figure it out what it offers..go here ApacheSNI
With Apache 2.2.12 and support for the SNI (Server Name Indication) extension to the SSL protocol, this has changed completely. Now you can configure name-based HTTPS sites, just as you can configure name-based HTTP sites. The bottom line is that the five IPs that you needed today to run five SSL sites can be reduced to one IP tomorrow (provided, of course, you use the newer Apache).
There are some prerequisites, however:
* The server, obviously, must use Apache 2.2.12 or higher.
* It must also use OpenSSL 0.9.8f or later and must be built with the TLS extensions option.
* And Apache must be built against this version of OpenSSL as it will enable SNI support if it detects the right version of OpenSSL — the version of OpenSSL that includes TLS extension support.
Finally, as far as browsers go, not every browser yet supports SNI, but the most popular browsers do, and some have for quite a while. This includes Firefox 2.0 or later, Opera 8.0 or later, Internet Explorer 7.0 or later (unfortunately, only on Vista), Google Chrome, and Safari 3.2.1 (unfortunately only on OS X 10.5.6 or later).
In practical terms, this means that for a serious e-commerce Web site or one that needs to have broad appeal, this solution won’t work — yet. Expect in the next year or so for more people to upgrade and more browsers to support SNI.
For testing purposes or for internal sites where you can have some say over client browser installation (and also considering that such old versions of Firefox support SNI), using SNI can be quite useful.
For configuration, here is an example of what to put in your Apache configuration file:
Listen 443
NameVirtualHost *:443
SSLStrictSNIVHostCheck off
DocumentRoot /srv/www/example1.com/
ServerName www.example1.com
...
DocumentRoot /srv/www/example2.com/
ServerName www.example2.com
...
What the above does is enable Apache listening to port 443 and turns on listening for virtual host requests on all IPs. The new keyword SSLStrictSNIVHostCheck is disabled, meaning we will not throw a 403 error if the client does not support SNI; instead, they will be redirected to the SSL site defined first (example1.com in the example), so be sure to define your default site first.
That is pretty much all there is to it. The largest hurdle here is the client browser support, but that will come in time. The Apache requirements and configuration, by contrast, are very simple and straightforward.
Hope this will help.
Bhaskar Chowdhury
I do not issue any guarantee that this will work for you.
First of all look into this site to figure it out what it offers..go here ApacheSNI
With Apache 2.2.12 and support for the SNI (Server Name Indication) extension to the SSL protocol, this has changed completely. Now you can configure name-based HTTPS sites, just as you can configure name-based HTTP sites. The bottom line is that the five IPs that you needed today to run five SSL sites can be reduced to one IP tomorrow (provided, of course, you use the newer Apache).
There are some prerequisites, however:
* The server, obviously, must use Apache 2.2.12 or higher.
* It must also use OpenSSL 0.9.8f or later and must be built with the TLS extensions option.
* And Apache must be built against this version of OpenSSL as it will enable SNI support if it detects the right version of OpenSSL — the version of OpenSSL that includes TLS extension support.
Finally, as far as browsers go, not every browser yet supports SNI, but the most popular browsers do, and some have for quite a while. This includes Firefox 2.0 or later, Opera 8.0 or later, Internet Explorer 7.0 or later (unfortunately, only on Vista), Google Chrome, and Safari 3.2.1 (unfortunately only on OS X 10.5.6 or later).
In practical terms, this means that for a serious e-commerce Web site or one that needs to have broad appeal, this solution won’t work — yet. Expect in the next year or so for more people to upgrade and more browsers to support SNI.
For testing purposes or for internal sites where you can have some say over client browser installation (and also considering that such old versions of Firefox support SNI), using SNI can be quite useful.
For configuration, here is an example of what to put in your Apache configuration file:
Listen 443
NameVirtualHost *:443
SSLStrictSNIVHostCheck off
DocumentRoot /srv/www/example1.com/
ServerName www.example1.com
...
DocumentRoot /srv/www/example2.com/
ServerName www.example2.com
...
What the above does is enable Apache listening to port 443 and turns on listening for virtual host requests on all IPs. The new keyword SSLStrictSNIVHostCheck is disabled, meaning we will not throw a 403 error if the client does not support SNI; instead, they will be redirected to the SSL site defined first (example1.com in the example), so be sure to define your default site first.
That is pretty much all there is to it. The largest hurdle here is the client browser support, but that will come in time. The Apache requirements and configuration, by contrast, are very simple and straightforward.
Hope this will help.
Bhaskar Chowdhury
Manage different architecture rpm on RHEL/CentOS
As the new RHEL/CentOS distribution allow to manage coexists different architecture rpms in the same machine with minimum fuss. It is also highly enhancement factor for the system administrators to look into the matter of package management on those distributions.
So in this article I am trying to give you a trick or two manage different architecture rpm on same machine efficiently.
I do not issue any guarantee that this will work for you.
First of all you just cannot distinguish whether an rpm is a 32bit or 64bit...can you?? I don't think so by looking at it naked eyes.
So we need a mechanism to provide some sort information us to make us understand that it is an particular architecture rpm.
Here we go:
Step 1: :Please put this line into the .rpmmacro file like this:
cat >> ~/.rpmmacros
%_query_all_fmt %%{name}-%%{version}-%%{release}.%%{arch}
and then try to run the below command to get an information about any damn package installed in the system.
Now spare of thoughts that what you try to accomplish..if you want to install only the x86_64 bit packages then you need configure the /etc/yum.conf properly i.e exclude=*.i386 *.i586 *.i686
And even if you want keep the i386* packages and install the particular x86_64 version of some packages then do it below:
yum install packagename.arch
i.e
yum install mysql.x86_64
Hope this will help.
Bhaskar Chowdhury
So in this article I am trying to give you a trick or two manage different architecture rpm on same machine efficiently.
I do not issue any guarantee that this will work for you.
First of all you just cannot distinguish whether an rpm is a 32bit or 64bit...can you?? I don't think so by looking at it naked eyes.
So we need a mechanism to provide some sort information us to make us understand that it is an particular architecture rpm.
Here we go:
Step 1: :Please put this line into the .rpmmacro file like this:
cat >> ~/.rpmmacros
%_query_all_fmt %%{name}-%%{version}-%%{release}.%%{arch}
and then try to run the below command to get an information about any damn package installed in the system.
Now spare of thoughts that what you try to accomplish..if you want to install only the x86_64 bit packages then you need configure the /etc/yum.conf properly i.e exclude=*.i386 *.i586 *.i686
And even if you want keep the i386* packages and install the particular x86_64 version of some packages then do it below:
yum install packagename.arch
i.e
yum install mysql.x86_64
Hope this will help.
Bhaskar Chowdhury
Subscribe to:
Posts (Atom)