Package Doctor

From Onda Technology Institute Wiki
Jump to: navigation, search

The Package Doctor project is a small and lightweight implementation of a package management system. It is simple, open and easy to use and integrate. Currently based mostly around shell scripts, Package Doctor has proven to be a valuable and effective tool.

The Package Doctor project was started to fill a gap at the level of the creation customized systems from scratch, especially in the area of embedded systems. It is quite similar to other tools based on source code repositories like, for example, Gentoo's Portage. However, it is considerably simpler and more independent. Being based on BASH scripts allows a significative reduction of dependencies and makes it much easier to work with more compact systems. It also allows the creation of cross compiled binaries, using different profiles and it is also able to deal with different architectures.

Method of Operation

To install a package on the system, PKD executes two steps:

This first step is optional if there is already a pre-compiled binary. The binary is generated from the original source code with the aid of a file, the .pkd, wich describes the compilation and packaging process. The .pkd can be located in a user folder, on the local system repository or on an online repository. PKD is able to automatically detect whre and to get the necessary files. The system uses the .pkd to create a binary file with the extension .pkb.tar.bz2 which can be easily installed. During compilation, the system creates an UnionFS mountpoint to allow the creation of the package without interfering with the working system but allowing it to access all the necessary compilation tools. The corresponding .pkb file also contains all the data necessary for the installation process, including dependency listing.

Installation of the binary .pkb.tar.bz2. The installation is made registering, in a database, all the files that will be installed and a backup of any replaced files. After that, the extraction is made onto the corresponding folders on the destination filesystem. This way it is quite easy to install, remove and update any package.

Working example

  1. # pkd -b binutils01
  2. [ Package Doctor ] package management system
  3. Copyright 2010-2012 Onda Technology Institute
  4. [ OK ] Downloading binutils-2.20.1.tar.bz2
  5. [ OK ] Preparing build environment for package "binutils" (binutils)
  6. [ OK ] Unpacking binutils 2.20.1
  7. [ OK ] Preparing to compile binutils
  8. [ OK ] Compiling binutils
  9. [ OK ] Installing binutils
  10. [ OK ] Building binary package /System/Data/L0/default.profile/packages/binutils-2.20.1.pkb.tar.bz2
  11. [ OK ] Cleaning up.

Available options

  1. -s enable silent mode
  2. -c select alternate configuration file
  3. -i install package
  4. -b build package
  5. -u update package
  6. -r remove package
  7. -g download package source
  8. -l list available profiles
  9. -p select a profile
  10. -h print help screen

More information

There are no available downloads yet, since the project is very recent and hasn't yet been considered ready for distribution. For more news about this project, follow the blog Onda Technology Report.

File formats

Data directory structure example

  1. L0
  2. |
  3. +- default.profile
  4. |
  5. +-
  6. |
  7. +- pkbexclude.txt
  8. |
  9. +- repository
  10. |
  11. +- sys-devel
  12. |
  13. +- binutils
  14. |
  15. +- binutils-tc01-2.20.1.pkd
  16. |
  17. +- binutils-tc01-2.22.pkd
  • default.profile is the default profile directory. While installing you can select any profile you want. All profiles have their own set of configuration files
  • pkbexclude.txt indicates files and directories that shall not be added to the binary package from the build tree