COMP 3000 2011 Report II:PC-BSD

From Soma-notes
Jump to navigation Jump to search

Part II

Software Packaging

Package Format and Utilities

PC-BSD's package management system takes a different approach to install software from 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 shown in the following picture:

Software catalog.png

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:

Software management.png


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.

Software browser.png


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

Install software.png


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 and 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. It satisfies PC-BSD's goal.
GTK+ Gimp toolkit for X11 GUI. It is a multi-platform toolkit for creating graphical user interfaces, which provides desktop environment for PC-BSD.
bash The GNU Project's Bourne Again Shell. Bash is the shell, or command language interpreter, that will appear in the GNU operating system. It is UNIX shell, and PC-BSD is based on UNIX. So that's the reason why we need bash.
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. Then multi-threads 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 KDE graphics 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. 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 in /usr/local/etc/rc.d and /Program/rc.d.

Major Programs

The scripts provide information about how to start service or disable service. Most of services can be disabled or disabled by adding some codes to /etc/rc.conf. For example, in the following programs, fusefs shows how to disable its service.

  • fusefs - It runs after sysctl and before mountlate. It is used to implement a fully functional filesystem in a user-space program, with its API library as the key feature. 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. To disable the fusefs service, add the following line to /etc/rc.conf :
 fusefs_enable="NO"
 fusefs_safe="NO"
 fusefs_safe_evil="NO"
  • ffserver - It runs before NETWORKING service. FFserver 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, unless it is launched in debug mode or a NoDaemon option is specified in the configuration file.
  • pcbsdinit - pcbsdinit runs after DAEMON. 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 - gpsd is an interface daemon for GPS receivers. It runs after networking DAEMON, cleanvar, and devfs. It also runs before ntpd. It collects information from GPSes, differential-GPS radios, or AIS receivers attached to the host machine. Each GPS, DGPS radio or AIS receiver is expected to be direct-connected to the host via sub or R232C serial device.
  • oss - Open Sound System (OSS) is the first attempt in unifying the digital audio architecture for UNIX. It runs after DAEMON, and it handles the sound system. It is the open sound system which provides support for PCM audio play and capture. It is started by function oss_start() and stopped by function oss_stop(). The two function will call system calls: /usr/local/sbin/soundon and /usr/local/sbin/soundoff.
  • netatalk - Netatalk is a freely-available open source AFP fileserver. It also provides a kernel level implementation of the AppleTalk Protocol Suite. It makes *NIX/BSD system to be capable of serving many Macintosh clients simultaneously as an AppleShare file server (AFP), AppleTalk router, *NIX/*BSD print server, and for accessing AppleTalk printers via Printer Access Protocol (PAP). In the script, netatalk will start with netatalk_start() and stop with netatalk_stop(). 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 which are connected to UNIX server <ref>Netatalk functions in PC-BSD. http://netatalk.sourceforge.net/2.2/ReleaseNotes2.2.1.html Retrieved Dec 15, 2011.</ref>.
 3) afpd - a file server that implements the Apple Filing Protocol, allowing clients running MacOS 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>.
  • snddetect - It runs after DAEMON, and detects sound. It first removes sound flag then detects an unknown sound card. It starts with snddetect_start(), which call /usr/PCBSD/soundDetect/sound_detect, and stops with snddetect_stop().
  • wacom - This is Wacom input driver. It runs after filesystem, and it offers setup and cleanup to configure Xorg for use of the driver or remove the configuration settings. It functions as a pointer input device. There is two function in scripts: do_start() to start service by /sbin/kldload and boot/modules/uwacom.ko, and do_stop() to stop service by /sbin/kldunload /boot/modules/uwacom.ko.

End of Initialization

The initialization of PC-BSD is completed 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 completed when the loop is over. Then all the processes start running on this fully initialized system.

Reference

<references/>