browsing the source code of linux packages

12

Click here to load reader

Upload: motaz-saad

Post on 24-Jun-2015

1.857 views

Category:

Technology


4 download

DESCRIPTION

Browsing The Source Code of Linux Packages

TRANSCRIPT

Page 1: Browsing The Source Code of Linux Packages

Browsing Linux Source Packages

Linux Day – May 6, 2007Motaz K. Saad

Department of Computer Sciencehttp://motaz.saad.googlepages.com

[email protected]

Page 2: Browsing The Source Code of Linux Packages

Introduction

• Linux Binary Packages: *.rpm files (rpm = redhat package manager)– Package_name-ver.rpm

• Linux Source Packages: *.src.rpm– Package_name-ver.src.rpm

Page 3: Browsing The Source Code of Linux Packages

Introduction (Cont.)

• Linux source are found in /usr/src directory.• Linux kernel source located in:

/usr/src/linux-2.6.x directory.• When installing source rpm package [src.rpm]

(rpm –i package_name.src.rpm) it will be installed in /usr/src/packages/SOURCES directory.

Page 4: Browsing The Source Code of Linux Packages

How to install software on Linux

• Binary Packages:– RPM packages : • Use the command: rpm –i package_name.rpm

– SH files• Use the command: sh install.sh or execute ./install.sh

– Bin files• Execute it!: ./file.bin

Page 5: Browsing The Source Code of Linux Packages

How to install software on Linux

• Source packages (packge_name.tar.gz):– Extract the packge_name.tar.gz file– cd to extracted directory– Execute ./configure– Execute make– Su to root– Execute make install

Page 6: Browsing The Source Code of Linux Packages

Where to Start Looking?

• coreutils package: – The /bin directory contains the most important

programs that the system needs to operate such as shells, cp, mkdir, ls, …etc.

– Look at cp.c, mkdir.c, ls.c, pwd.c ….

• unix2dos package:– Unix2dos is a program that convert line feed [lf]

('\x0a') characters in a file to carriage return [cr] lf ('\x0d' '\x0a') combinations.

Page 7: Browsing The Source Code of Linux Packages

Where to Start Looking?

• dos2unix package:– dos2unix is a program that Remove carriage

return [cr] ('\x0d') characters from a file.

• xscreensaver package:– Contains set of screen saver that made using

OpenGL and other graphic library.– OpenGL Screensavers:• Pipes Screen Saver: xscreensaver/hacks/glx/pipes.c• Gears Screen Saver: xscreensaver/hacks/glx/gears.c

Page 8: Browsing The Source Code of Linux Packages

Where to Start Looking?

• gzip package:– file compression utility gzip/gzip.c– Compression Algorithm details:

gzip/alogrithm.doc

Page 9: Browsing The Source Code of Linux Packages

Where to Start Looking?

• gnuchess packages– GNU Chess game: Information about game data

structure and search algorithm can be found in gnuchess/doc/README

– Search algorithm gnuchess/src/search.c: Based on Professor Tony Marsland's modification to alpha-beta minimax, called Principal Variation Search (PVS), this algorithm performs credibly.

Page 10: Browsing The Source Code of Linux Packages

Where to Start Looking?

• traceroute package:– traceroute is a system administrators utility to

trace the route ip packets from the current system take in getting to some destination system.

• gcc package: – GNU Compiler

• eject package:– A program that eject the CD/DVD ROM drive

Page 11: Browsing The Source Code of Linux Packages

Where to Start Looking?

• aspell-en package: – GNU Aspell English Word List Package

• And more and more package!

Page 12: Browsing The Source Code of Linux Packages

Thank you!