COMP 3000 2011 Report II:PC-BSD

From Soma-notes

Part II

Software Packaging

Package Format and Utilities

PC-BSD's package management system takes a different approach to installing software than many other Unix-like operating systems. Instead of using the FreeBSD ports<ref>FreeBSD ports. http://en.wikipedia.org/wiki/FreeBSD_ports Retrieved Dec 7, 2011.</ref> tree directly, PC-BSD uses files with the .pbi<ref>PBI Package Management. http://www.pcbsd.org/about/pc-bsd-project/package-management Retrieved Nov 16, 2011.</ref> file-name extension which, when double-clicked, bring up an installation wizard program. PBI (PC-BSD Installer or Push-Button Installer) is Binary Packaging format. This distribution uses a wide variety of graphic utilities<ref>PC-BSD Utilities. http://www.pcbsd.org/about/pc-bsd-project/utilities Retrieved Nov 16, 2011.</ref> to supply a front-end to useful FreeBSD features, such as Software Management Utility, Virtual Environment Utility, Backup Utility, Ports Jails Utility and so on. In the distribution, the package management relies on pkg tool, which is also used in FreeBSD, and Software Manager.

List Installed Packages

In command line, it will use "pkg_info" or "pkg_info | less" to get a list of installed packages. The first command will print the whole list of packages at once, while the second one will print the first page of the package list and you can use keyboard to look back and forth in the list.

Add and Remove Packages

"pkg_add" is for installing packages, and "pkg_delete" is for removing packages. In PC-BSD 9.0, it will use PBI manager<ref>PBI Manager. http://wiki.pcbsd.org/index.php/PBI_Manager Retrieved Nov 16, 2011.</ref>, which will use "pbi_info", "pbi_add", "pbi_delete" instead. Packages can be added by using "pkg_add -r -v {pacakge-name}" or "pbi_add -r PBINAME":

 # pkg_add -v -r vim      or   # pbi_add -r alpine

We can also set the environment variable PACKAGEROOT to specify an alternate location for pkg_add to fetch from:

 # export PACKAGEROOT=ftp://ftp3.FreeBSD.org
 # pkg_add -v -r vim 

Packages can be deleted by using "pkg_delete {package-name}" or "pbi_delete {package-name}". Package name and version can be found by "pkg_info" or "pbi_info":

 # pkg_info | grep ntop          or    # pbi_info | grep ntop
 # ntop-4.0.1_1-i386                   # ntop-4.0.1_1-i386   
 # pkg_delete ntop-4.0.1_1-i386        # pbi_delete ntop-4.0.1_1-i386

Software Catelog

The PC-BSD repository<ref>Package Management in PC-BSD. http://en.wikipedia.org/wiki/PC-BSD#Package_management Retrieved Nov 16, 2011.</ref> is http://www.pbidir.com/. The software catalog is organized in alphabetical order of package categories as in the following picture:

Software Management

PC-BSD offers many graphic tools for a desktop user, and is equipped with a utility called Software Management (in PC-BSD version 8.2), which can get a list of installed packages. In this utility, only the packages installed after system installations will be displayed, as in the following picture:


PC-BSD aims to give the user a simple experience of installing or removing packages, like software management in Windows or Mac OS. Software Manager is also very useful in finding desired software and installing them effortlessly, by clicking a specific link. Removing a package is also a simple mouse-click operation. There is also a software browser inside the Software Manager and a search engine for package searching and different catalogs for selections.


Following the user's decision, the software can be downloaded by clicking the download link. After which it will automatically download and install the packages/software.


There is also a remove button under the "Installed Software" menu. Simply choose the package you want to remove, and click "remove".

The software catalog for this distribution can be found in the Software Browser of Software Manager. There are many possible selections: Archives, Astronomy, Audio, Benchmarks, Biology, CAD, Communications, Databases, Desktop Utilities, Development, E-Mail, Editors, Educational, Emulators, File Transfer & Utilities, Finance, Games, Graphics, IRC, Japanese, Java, Languages, Math, Miscellaneous, Multimedia, Network-IM, Network-Management, Network-P2P, Network-Utilities, News, Non-Port, Polish, Ports-Management, Print, Science, Security, Shells, System Utilities, Text Processing, The Warden-Inmates, Web, X11, X11-File Managers and X11-Window Managers.

The fact that there is a vast majority of packages to choose from is a great advantage. A part of the catalog information can be seen in the previous picture.

Major package versions

The package version information can be found by using command "pkg_info" or "pkg_info | grep {package_name}". More information about the specific package version could be found through the Internet. Here are version numbers, release dates, and upstream sources of various major packages in PC-BSD:

Package Version Latest Official Release Official Source
FreeBSD Kernel 8.2-RELEASE Feb 24, 2011 <ref>FreeBSD Release Information. http://en.wikipedia.org/wiki/FreeBSD Retrieved Dec 7, 2011.</ref> 9.0-RELEASE Sep, 2011 <ref>FreeBSD Release Engineering Information. http://www.freebsd.org/releng/ Retrieved Dec 7, 2011.</ref> http://www.freebsd.org/where.html
X.org 7.5 Oct 26, 2009 <ref>X.org 7.5 release notes. http://www.x.org/wiki/Releases/7.5 Retrieved Dec 5, 2011.</ref> 7.6 Dec 20, 2010 <ref>X.org 7.6 release notes. http://www.x.org/wiki/Releases/7.6 Retrieved Dec 5, 2011.</ref> http://www.x.org/wiki/
Qt 4.7.1 Nov 9, 2010 <ref>Qt 4.7.1 release notes. http://labs.qt.nokia.com/2010/11/09/qt-4-7-1-released/ Retrieved Dec 5, 2011.</ref> 4.7.4 Sep 1, 2011 <ref>Qt 4.7.4 release notes. http://labs.qt.nokia.com/2011/09/01/qt-4-7-4-released/ Retrieved Dec 5, 2011.</ref> http://qt.nokia.com/
GTK+ 2.22.1, Nov 15, 2010 <ref>GTK+ 2.22.1 overview. http://mail.gnome.org/archives/ftp-release-list/2010-November/msg00145.html Retrieved Dec 5, 2011.</ref> 2.24.8, Nov 10, 2011 <ref>GTK+ 2.24.8 overview. http://mail.gnome.org/archives/gtk-devel-list/2011-November/msg00026.html Retrieved Dec 5, 2011.</ref> http://ftp.gnome.org/pub/gnome/sources/gtk+/
bash 4.1.9 March, 2010 <ref>BASH PATH REPORT 4.1.9. ftp://ftp.gnu.org/gnu/bash/bash-4.1-patches/bash41-009 Retrieved Dec 5, 2011.</ref> 4.2.10 April, 2011 <ref>BASH PATH REPORT 4.2.10. ftp://ftp.cwru.edu/pub/bash/bash-4.2-patches/bash42-010 Retrieved Dec 5, 2011.</ref> http://ftp.gnu.org/gnu/bash/
pth 2.0.7 Jun 8, 2006 <ref>GNU Portable Thread. http://www.gnu.org/s/pth/ Retrieved Dec 5, 2011.</ref> current is the latest http://www.gnu.org/s/pth/
rpm 3.0.6 15 Sep 15, 2000 <ref>RPM 3.0.6 release. http://www.redhat.com/archives/rpm-list/2000-September/msg00101.html Retrieved Dec 7, 2000.</ref> 4.9.1.2 Sep 29, 2011 <ref>RPM 4.9.1.2. http://rpm.org/wiki/Releases/4.9.1.2 release. Retrieved Dec 7, 2011.</ref> http://www.rpm.org/
ruby 1.8.7 June 1, 2008 1.9.3 Oct 30, 2011 <ref>Ruby News. http://www.ruby-lang.org/en/feeds/news.rss Retrieved Dec 5, 2011.</ref> http://www.ruby-lang.org/en/news/2008/05/31/ruby-1-8-7-has-been-released/
KDE(Konqueror web browser and KMail) 4.5.5 Jan 4, 2011 <ref>KDE 4.5 Release Schedule. http://techbase.kde.org/Schedules/KDE4/4.5_Release_Schedule#January_4th.2C_2011:_Release_KDE_SC_4.5.5 Retrieved Dec 5, 2011.</ref> 4.7.3 Nov, 2011 <ref>KDE Release News. http://www.kubuntu.org/news/by-date/201111 Retrieved Dec 5, 2011.</ref> http://kde.org/info/4.5.5.php
Gwenview 1.2.92 Aug 21, 2005 <ref>gwenview-1.2.92-0.1.101mdk RPM for i586. http://rpmfind.net/linux/RPM/sourceforge/g/project/gw/gwenview/gwenview/1.2.92/gwenview-1.2.92-0.1.101mdk.i586.html Retrieved Dec 5, 2011.</ref> 4.7.3, Oct 28, 2011 <ref>Gwenview Release list. ftp://ftp.kde.org/pub/kde/stable/latest/src/ Retrieved Dec 5, 2011.</ref> http://rpmfind.net/linux/RPM/sourceforge/g/project/gw/gwenview/gwenview/1.2.92/gwenview-1.2.92-0.1.101mdk.i586.html
amarok 2.3.2 Sep 20, 2010 <ref>Amarok 2.3.2 Release News. http://amarok.kde.org/en/releases/2.3.2 Retrieved Dec 5, 2011.</ref> 2.5 Nov 6, 2011 <ref>Amarok Home. http://amarok.kde.org/ Retrieved Dec 5, 2011.</ref> http://amarok.kde.org/en/releases/2.3.2


Major Difference and Purpose

PC-BSD is based on FreeBSD, but PC-BSD is for desktop use while FreeBSD is for server use. They are generally similar but some differences still exist. PC-BSD has added some utilities or kernel tweaks or GUI to make PC-BSD suitable for desktop use. For the KDE part, the author just used the one in FreeBSD, so there is no modification in the KDE packages. Therefore the major modification is the kernel. The difference between PC-BSD and FreeBSD can be found here. The purposes of the packages are shown below:

Package Purpose of Using This Package
FreeBSD Kernel FreeBSD is known widely for its stability and security in server environment, so it can provide excellent base for PC-BSD. PC-BSD’s kernel has been recompiled with some configuration tweaks to make it better for desktop use. PC-BSD supports all the major package management systems that are in FreeBSD but also has PBI package installer.
X.org Xorg supports several mechanisms for supplying/obtaining configuration and run-time parameters such as: command line options, environment variables, the xorg.conf configuration file, auto-detection, and fallback defaults. In PC-BSD, it completes distribution meta-port
Qt Qt SDK combines the Qt framework with tools designed to streamline the creation of applications for Symbian and Maemo, MeeGo (Nokia N9) as well as desktop platforms, such as Microsoft Windows, Mac OS X, and Linux. PC-BSD needs that platform.
GTK+ Gimp toolkit for X11 GUI. It is a multi-platform toolkit for creating graphical user interfaces, which is PC-BSD's need.
bash The GNU Project's Bourne Again Shell. Bash is the shell, or command language interpreter, that will appear in the GNU operating system.
pth Pth is a very portable POSIX/ANSI-C based library for Unix platforms which provides non-preemptive priority-based scheduling for multiple threads of execution inside event-driven applications. PC-BSD strives to give users a better experience in desktop environments like Windows or Mac OS. Also, multi-thread is required.
rpm It is the Red Hat Package Manager. There is rpm package in PC-BSD means the system needs to manage Linux packages. It is consistent with its goal to be compatible with Linux. The reason why the version is far behind the latest version is that it is enough for basic Linux package management.
ruby A dynamic, open source programming language with a focus on simplicity and productivity. Majority of Unix/Linux distributions make use of this, such as PC-BSD. It has an elegant syntax that is natural to read and easy to write.
KDE(Konqueror web browser and KMail) KDE offers a full suite of user workspace applications which allow interactions with these operating systems in a modern, graphical user interface. PC-BSD requires quality GUI and Utilities to ensure users have a pleasant desktop experience, therefore, KDE is a good choice.
Gwenview Gwenview is part of the kdegraphics module. Gwenview is a fast and easy way to use image viewer/browser for KDE. PC-BSD uses KDE for better user experience. Gwenview is inside KDE.
amarok Media Player for KDE4. PC-BSD wants to provide service for daily users. Multimedia offers us music and movie needs so that a media player like amarok will be a necessary utility.


Initialization

Start Initialization

Because PC-BSD is based on FreeBSD, the initialization will be BSD-style[1]. The init runs the initialization shell script located in /etc/rc.d, then launches a windowing system such as X on graphical terminals under the control of /etc/ttys. There are no runlevels in PC-BSD. The script file, /etc/rc, determines what programs are run by init. The configuration is read from the master configuration file /etc/rc.conf. When we check the /etc/rc.conf file, we can find that the local startup scripts are on /usr/local/etc/rc.d and /Program/rc.d.

Major Programs

  • ffserver - It is a streaming server for both audio and video which supports several live feeds. It is streaming from files and time shifting on live feeds. FFserver runs in daemon mode by default, which means it puts itself in the background and detaches from its TTY, except it is launched in debug mode. It is Initialized thus - ffserver [options].

To configure, type the command ffserver ./configure and to disable, type the command ffserver ./n. This enables the no launch mode of the ffserver <ref>Initilization Manual page in PC-BSD. http://linux.die.net/man/1/ffserver Retrieved Dec 15, 2011.</ref>


  • fusefs - It runs after syscall but before mountlate. It is used to implement a fully functional filesystem in a userspace program, with its API library as the key feature. To enable or disable fusefs, add the following line to /etc/rc.conf.local, fusefs_enable (bool) : Set to NO to disable or set to YES to enable fusefs. The filesystem works when the fuse kernel module and the fuse library communicate through a special file descriptor which is obtained by opening /dev/fuse. This file can be opened multiple times, and the obtained file descriptor is passed to the mount syscall, to match up the descriptor with the mounted filesystem.


  • Pcbsdinit - runs after DAEMON and it starts the system scripts. It is the last stage of the boot process which usually runs in automatic reboot sequence. It is a really important part of the boot operation such that if it dies, the system will reboot itself automatically


  • Gpsd - runs after networking DAEMON, cleanvar, devfs and before ntpd, and it is an interface daemon for GPS receivers. It collects information from gpses, differential -GPS radios or AIS receivers attached to the host machine. Each GPS should be connected to the host via sub or R232C serial device so that in order to disable, one would just take out the device.


  • Oss - Runs after DAEMON, and it handles the sound system. It is the open sound system which provides support for PCM audio play and capture. Varoius systcall variables are stored in /etc/systcl.conf so it is automatically set during the boot process.


  • Netatalk - Netatalk is a freely-availabe open source AFP fileserver package thats helps deal with the Appletalk protocol suite and its relatives. It can perform file and print sharing for macintosh. It comes with small utilities that help ease dealing with macintosh files from unix. To start netatalk from boot time, add these lines<ref>Initilization Netatalk in PC-BSD. http://openports.se/net/netatalk Retrieved Dec 15, 2011.</ref>./etc/rc.local:

if [ -f ${SYSCONFDIR}/netatalk/rc.atalk ]; then . ${SYSCONFDIR}/netatalk/rc.atalk fi

It runs after DAEMON, and it implements the following major utilities while on booting :
  1)atalkd - an implementation of the AppleTalk protocol <ref>Netatalk functions in PC-BSD. http://netatalk.sourceforge.net/2.2/ReleaseNotes2.2.1.html Retrieved Dec 15, 2011.</ref>.
  2) papd - a print server that enables macintosh computers to access printers that are connected to unix servers <ref>Netatalk functions in PC-BSD. http://netatalk.sourceforge.net/2.2/ReleaseNotes2.2.1.html Retrieved Dec 15, 2011.</ref>.
  3) afpd - File server that implements the Apple filing protocol, which allows clients the run MasOs to access unix file servers <ref>Netatalk functions in PC-BSD. http://netatalk.sourceforge.net/2.2/ReleaseNotes2.2.1.html Retrieved Dec 15, 2011.</ref>.

Other less important utilities it implements are cnid_metad, timelord . It is an appletalk daemon whose data structures must have time to stabilize before running the other processes. One must also make sure that atalkd has not started in the background before it starts running.

  • Snddetect - Runs after DAEMON, and detects sound. It first removes sound flag then detects an unknown sound card.
  • Wacom - Runs after filesystem, and it offers setup and cleanup to configure Xorg for use of the driver or removes the configuration settings. It is an input device driver for wacom devices, and it functions as a pointer input device. It is useful to define multiple devices with diferent active zones. Various entries are supported by wacom, but the most important entry or the most general entry is the OPtion "Type" entry. This entry sets the type of tool the device represents, which could be stylus, eraser, cursor, pad or touch. Note that the tool can represent more than one device. There are other options that come with wacom for pcbsd such as "device", "forceDrive", "suppress" etc, depending on what tool we are looking at.

End of Initialization

The initialization of PC-BSD is complete after all the thirty two shell scripts from /etc/rc.d have been initialized. The /etc/rc script describes how system startup scripts run by init. There is a loop which reads through and runs all the startup scripts. Initialization is complete when the loop is over. Then all the processes start running on this fully initialized system.

Reference

<references/>