1 / 34

Distributing Open Software RPM Command

제 18 강 : Distributing Open Software RPM Command. Distributing Open Software RPM Command. “Computer” “layers” “network of objects”. ed. mail. lib. DB. middleware operating system high level language assembler language machine language. L5. OS. L4. C. MW. L3. ASM. L2. CPU.

vega
Télécharger la présentation

Distributing Open Software RPM Command

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 제18강 : Distributing Open Software RPM Command Distributing Open Software RPM Command

  2. “Computer” “layers” “network of objects” ed mail lib DB middleware operating system high level language assembler language machine language L5 OS L4 C MW L3 ASM L2 CPU L1

  3. Each Object Provides / Requires “ Provides “ Object “ Requires “

  4. example “provides / requires” Provides High level language Object Compiler lib Assember Preprocessor Requires

  5. node: object edge: provide/require OS Function & Commands Provides Operating System Object High level language Compiler Asm Language lib Preprocessor Requires Assembler machine instruction

  6. as gcc libc.a kernel include … Each object: object descriptor (HW object, SW object, Data object) Object descriptor: capabilities this object provides capabilities this object requires info about object itself, install, … System stores object descriptors in object DB Whenever a new object is added system checks whether required capabilities exist ed mail lib DB OS C MW ASM stores object descriptors in system DB D B CPU clock gate bus

  7. Requires: libg.so.1.2 • Provides: gamex • Program: gamex-tar.gz • Files • Script: Makefile Files install etc Standard formatObject Descriptor gamex Information Program Files Script Files

  8. Distribute Open Software? • Open software runs on many different platforms • Open Software presents a New Challenge • HW • chip: Intel, Motorolla, MIPS, • architecture: PC, SMP, • devices: many different kind of devices • OS: • Kernel: vendor, version • Library: vendor, version • Compiler, utilities vendor, version • RPM  Red Hat’s solution to software distribution

  9. Challenges – Open Software Distribution • Send binary • Depends on {DLL library, manual, …} (binary file requires them to run) • Send source • If different platform, needs compile & build • Depends on {header files, gcc, …} (source file requires them to compile & run)

  10. Action at target platform … (1) Copy Files (man install  3 formats, -m –o) • Create directories, Copy files -- Install command • Set protection modes, Set owner id, … (2) Requires other objects? • eg compiler, library, header files, … • Check dependency information • Pre-Install other objects, if necessary, in preparation for this object (3) Prepare for build - Edit makefilescript(customize for this platform) • Which compiler?  depends on the host, adjust pathnames • Which header files, lib?  adjust pathnames • Which gcc options?  depends on the compiler • Which part of the source?  (adjust pathnames) or (gcc option) eg gcc src/arch/SUN/* or gcc src/arch/IBM/* #ifdef SUN -- source code may contain conditionals gcc –DSUN --- then gcc may have to define MACRO (4) Build. • Run the make (Makefile script). Build executable binary

  11. A lee B bob Install command “ginstall” command (try “man install”) create directories -- name, owner, protection mode copy files -- name, owner, protection mode (eg source, library, header files, binary, ..)   eg  install -m 644 –o koh $(Source)  $(Destination) Directory (exist?/create) Set protection mode Set owner

  12. Definition of “ package” {3 type of files} scripts program files information I provide ooo I require xxx Who I am {vendor version …..…} install (install) build (makefile) adapt (configure**) src include lib *.c *.h *.so ** We will explain this in UNIX kernel code section

  13. Example of package {collection of files} information files program files script files Package: game OO Program files: java-src tar Media: USB flash ….. Package: OS kernel Program files: C-src tar Media: CD-ROM ….. Package: math lib Program files: binary Media: ftp server ….. Package: MS Office Program files: *.EXE

  14. package {archive 3 type of files} information files package tar program files script files

  15. “package” • Archive file created by tar (or cpio) command • programfiles source, lib, man, • script files to install, build this package • information  in spec file (see next page) • Package name convention <package-name>-<package-version>-<release>.architecture.rpm eg sql-3.4.1-15.i386.rpm /* binary */ eg sql-3.4.1-15.src.rpm /* source – SRPM */

  16. Dependency between packages • “package (A) depends on package (B) • eg C-program-package depend on C-library-package • Document-package depend on reader-program-package • Each source package have a specfile • eg gamex . spec :Name: gamex Vendor: IBM Version: 1.3 Summary: New internet game Requires: libg.so.1.2 Provides: gamex Source: gamex-1.1.tar.gz Scripts builds/installs this Info Src Script

  17. sample list of spec files find / -name “*.spec” –print > list

  18. content of spec file

  19. rpm • rpm (RedHat Package Manager) • Linux command for managing “packages” • 3 modes of operation • query mode • install & upgrade mode • build mode • maintains DB of packages • ls –l /var/lib/rpm/*

  20. rpm DB

  21. Using rpm command Try following : rpm –q –a rpm –q –l any rpm –q –f /bin/ls rpm –q –i any • All installed packages ? • eg $ rpm –q –a package_a-11.12.1-7 package_b-7.14.6-12 package_c-14.32.3-5 • What files are inpackage_a • eg $ rpm –q –l package_a-11.12.1-7 /* We usually discard source files after build  CD-ROM or ftp site */ • file X is from which package? • eg $ rpm –q –f /bin/ls • Remove this package • eg $ rpm –e package_b

  22. All installed packages in the system

  23. Using rpm command Try following : rpm –q –a rpm –q –l any rpm –q –f /bin/ls rpm –q –i any • All installed packages ? • eg $ rpm –q –a package_a-11.12.1-7 package_b-7.14.6-12 package_c-14.32.3-5 • What files are inpackage_a • eg $ rpm –q –l package_a-11.12.1-7 /* We usually discard source files after build  CD-ROM or ftp site */ • file X is from which package? • eg $ rpm –q –f /bin/ls • Remove this package • eg $ rpm –e package_b

  24. List files inpackage_x /* We usually discard source files after build  CD-ROM or ftp site */

  25. Using rpm command Try following : rpm –q –a rpm –q –l any rpm –q –f /bin/ls rpm –q –i any • All installed packages ? • eg $ rpm –q –a package_a-11.12.1-7 package_b-7.14.6-12 package_c-14.32.3-5 • What files are inpackage_a • eg $ rpm –q –l package_a-11.12.1-7 /* We usually discard source files after build  CD-ROM or ftp site */ • file X is from which package? • eg $ rpm –q –f /bin/ls • Remove this package • eg $ rpm –e package_b

  26. file X is from which package?

  27. rpm and capability • /* display the information of ‘glibc’ package */ rpm –q –i glibc rpm –q --provides glibc ibc.so.6 • /* which package provides this capability? */ rpm –q - - whatprovides libc.so.6 glibc-x.x.x-x • /* which package require this capability? */ rpm –q - - whatrequires glibc authconfig-x.x.x-x gcc --------------- provided capabilities C compiler package as libc.a os …. ------- required capabilities

  28. display information of package

  29. provides what?

  30. rpm and capability • /* display the information of ‘glibc’ package */ rpm –q –i glibc rpm –q --provides glibc ibc.so.6 • /* which package provides this capability? */ rpm –q - - whatprovides libc.so.6 glibc-x.x.x-x • /* which package require this capability? */ rpm –q - - whatrequires glibc authconfig-x.x.x-x gcc --------------- provided capabilities C compiler package as libc.a os …. ------- required capabilities

  31. installing package from CD % mount /cdrom /* mount the distribution CD */ % cd /cdrom/suse/fun /* cd to mounted CD file system*/ % ls /* list packages in CD */ a.rpm b.rpm c.rpm d.rpm … % rpm –i b.rpm c.rpm /* install packages */ % rpm –U b.rpm c.rpm /* upgrade, b & c already exist */

  32. rpm summary • What rpm command does : • Looks for spec file • take source tar file • unpack it (if patch files  order of patches) • install it, i.e. • make directories if necessary • copy files from CD (or ftp) to destination directories • chmod files & directories • change owner of files & directories • configure ** • examine target platform (hardware & software type) • edits makefile & install command for this specific platform (eg set compile options, library pathname …) • build the software (make) • spec file & source files remain in CD by default. ** We will explain this in UNIX kernel code section

  33. RPM - Summary Package is an archive • Different platform may need different source files, gcc options, lib  need to edit makefile  script file that handles source files (sometimes patch) edits makefile installs binary, directory • Package & platform need to know each other • Platform is a layer of software (package) • Each package describes itself by spec file Program Files: source binary ----------- Information Spec file ------------- Scripts make install

More Related