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 lots 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 forward or backward 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. Package 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 

Package can be delete 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 by alphabet of package categories like the following picture.

Software Management

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


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


After made decision, it can downloaded the software by clicking the download link. And it will automatically download and install the packages/software.


There is also a remove button under "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 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.

There are many packages to choose, part of catalog information can be seen from 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 Internet. Here are version numbers, release date, and upstream source 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 release. </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 and FreeBSD is for server use. They are generally similar but there are still some differences. 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 use 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 in FreeBSD but also has PBI package installer.
X.org Xorg supports several mechanisms for supplying/obtaining configuration and run-time parameters: 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 want to give user better experience in desktop environment like Windows or Mac OS, and multi-thread is needed.
rpm It is the Red Hat Package Manager. There is rpm package in PC-BSD means the system need to manage Linux packages. It is consist with its goal to be compatible with Linux. The reason why the version is far behind with the latest version is it is enough for basic Linux package management.
ruby A dynamic, open source programming language with a focus on simplicity and productivity. Most Unix/Linux distribution will use that, so do 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 interaction with these operating systems in a modern, graphical user interface. PC-BSD need nice GUI and Utilities to provide user a good desktop experience, so KDE is a good choice.
Gwenview Gwenview is part of the kdegraphics module. Gwenview is a fast and easy to use image viewer/browser for KDE. PC-BSD use KDE for better user experience. Gwenview is inside KDE.
amarok Media Player for KDE4. PC-BSD want to provide service for daily uses. 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 checked 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, from files and time shifting on live feed.FFserver runs in daemon mode by default meaning it outs it outs itself in the background and detaches from it TTY, except 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 </ref>


  • fusefs - It runs after syscall but before mountlate is running.It is used to implement a fully functional filesystem in a userspace program, one important feature is its API library. 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 runs 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 runs and runs 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 to disable we 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 boot process.
  • Netatalk - runs after DAEMON, and it provides atalkd papd cnid_metad timelord afpd.It is an appletalk daemon and its datastructures must have time to stabilize before running the other processes, also make sure that atalkd is not started has not started in the background before it starts runing.
  • Snddetect - runs after DAEMON, and it provides sound detect. It first removes sound flag then detects if system has sound or not.
  • Wacom - runs after filesystem, and it offers setup and cleanup to configure Xorg for use of the driver or remove the configuration settings.

End of Initialization

In the end, the initialization of PC-BSD is done after all the shell scripts from /etc/rc.d have been read and run. The /etc/rc script describes how system startup scripts run by init. There is loop to read through and run all the startup scripts and the initialization is done with the loop is done. Then all the processes end up running on this fully initialized system.

Reference

<references/>