Difference between revisions of "COMP 3000 2011 Report: PuppyLinux"

From Soma-notes
Jump to navigation Jump to search
Line 314: Line 314:
At bootup, the first thing that happens is the Linux kernel, vmlinuz, is loaded into RAM, followed by the initial ramdisk, which is file initrd.gz. The file is ".gz"-compressed, so it is uncompressed into the ramdisk and then the ramdisk becomes the very basic Puppy filesystem, that is, designated "/" and called top or root directory together with all subdirectories /bin, /sbin, /lib, /dev, /tmp, etc.
At bootup, the first thing that happens is the Linux kernel, vmlinuz, is loaded into RAM, followed by the initial ramdisk, which is file initrd.gz. The file is ".gz"-compressed, so it is uncompressed into the ramdisk and then the ramdisk becomes the very basic Puppy filesystem, that is, designated "/" and called top or root directory together with all subdirectories /bin, /sbin, /lib, /dev, /tmp, etc.


Puppy then searches for usr_cram.fs, first looking in "/" in the ramdisk, then in "/" in the USB partition. The first case would only be if Puppy had been created with usr_cram.fs inside image.gz, which is not the normal situation. So it falls back to number 2. Puppy will find usr_cram.fs in the USB partition and will mount it on /usr.


A fundamental objective of Puppy is that everything should load into ramdisk, thus freeing up the CD drive so that you can use the CD drive for other purposes. Also, if everything is in RAM, application startup and running speed is stunning.
A fundamental objective of Puppy is that everything should load into ramdisk, thus freeing up the CD drive so that you can use the CD drive for other purposes. Also, if everything is in RAM, application startup and running speed is stunning.


The very first time that Puppy boots from USB, the file pup100 does not yet exist -- Puppy has to create it. Puppy creates it, and mounts it directly on /root - physically on the stick - by means of a loopback device.
When the power goes off, RAMdisk content is lost. To retain your settings, such as configuration changes, email, browser history asf Puppy during bootup looks for a suitable hard drive partition, and if one is found, creates a file on it called "pup001". I arbitrarily chose "pupxxx" where the "xxx" is three numeric digits. The three numeric digits have no particular meaning either, except we are currently using pup001 for the live-CD and pup100 for USB installations of Puppy.


#BIOS (Basic Input/Output System)
pup001 is a single file (easy to backup), but internally is a complete ext2 filesystem. After creating this file, Puppy mounts it, by means a "loopback device", onto /root directory. This directory /root is your home directory -- all your personal stuff goes in there. Thus, when you shutdown, all will still be there next time you start Puppy.
#MBR (Master Boot Record)
 
#GRUB (Grand Unified Bootloader)
Most of the files in Puppy, in any Linux distro for that matter, are in /usr - furthermore there is normally no need to write to anything inside /usr (that is, no need to edit, create or delete files). So the entire content of /usr is compressed as a single file, named usr_cram.fs and mounted as-is on /usr, by means of a "loopback device" -- the actual technique is not the main issue here, but you need to be aware that all of /usr is really only a single file, containing a compressed and read-only filesystem. Utilizing union-fs, however, changes in /usr can be made at run-time while usr_cram.fs remains unchanged.
#Kernel
 
#Init
When looking for the "usr_cram.fs" file, Puppy will follow these steps:
#Runlevel Programs
#At bootup, Puppy will first look to see if ''usr_cram.fs''∞ is at "/" in the ramdisk (which meant that it was inside image.gz originally)
#failing that, Puppy will look in /root (that is, inside pup001)
#else in /mnt/home (in the hard drive partition)
#finally Puppy will look on the CD (the slowest media of these)


The init.d scripts contain a block at the top that determine which processes the script should run before or after, in what run levels the script should be started or stopped and more.
The init.d scripts contain a block at the top that determine which processes the script should run before or after, in what run levels the script should be started or stopped and more.

Revision as of 15:05, 7 November 2011

Part 1

Background

Puppy Linux

Name:

Puppy Linux

Goals (taken from PuppyLinux website About Puppy Linux):

  • Save space with its 100 MB size and runs on most machines since off RAM
  • Easy to install Zip, USB or hard drive media
  • Booting from CD (or DVD), the CD drive is then free for other purposes.
  • Booting from CD (or DVD), save everything back to the CD.
  • Booting from USB Flash drive, minimize writes to extend life indefinitely.
  • Extremely friendly for Linux newbies.
  • Boot up and run extraordinarily fast.
  • Have all the applications needed for daily use.
  • Will just work, no hassles.
  • Will breathe new life into old PCs
  • Load and run totally in RAM for diskless thin stations

Target Audience:

With Puppy Linux's low hardware requirements to be able to run it, one of its major target audiences is towards users with low-end hardware or old computers that are looking to revive their aging machines - especially since the OS is run totally in RAM. Although, it is also intended for users who just want a small distribution that packs a lot of punch in a small size.

Developer:

Barry Kauler

Obtained:

You can download the .iso file off his website Download Puppy

Approximate Size:

~129MB

Heritage:

Puppy Linux 5.0 and later versions are built off binaries from Ubuntu Linux 10.04 (Lucid Lynx). This is the reason for the latest release being named Lucid Puppy.

Installation/Startup

(Figure 1) Loading the ISO with VirtualBox.
(Figure 2) PuppyLinux booting up.
(Figure 3) Initializing PuppyLinux on first boot.

To initialize the Puppy Linux distribution, we downloaded the latest .iso from the puppy-5.2.8 folder. After the .iso was downloaded onto our machine, it was booted up with VirtualBox (Figure 1):

VirtualBox started loading Puppy Linux and a console appeared allowing the user to use more advanced boot options. If nothing is entered by the user then the operating system is loaded into RAM. Since Puppy Linux is run on RAM, during boot the OS will look for a save file from the user's previous session called 'pup_save.2fs-file'. If it doesn't exist, then a new one will be created after the user is prompted for their personal settings. If the boot option 'puppy pfix=ram' is used, then the OS ignores a previously saved 'pup_save.2fs-file' settings file. In this picture, no boot options are selected and the the OS will boot normally (Figure 2):

When the distribution is first loaded by a user, the OS asks for their settings which are then saved either onto a hard drive or external storage such as a CD/DVD/USB drive as 'pup_save.2fs-file'. This file contains information including the machine's hostname, screen resolution and country/time settings (Figure 3):

Basic Operation

The first thing I would do if I was using this easy-to-use distribution would be to fire up an internet browser, mainly Firefox. One purpose for reviving old machines would be to make it usable to the average user and these user's would definitely want access to the web. Puppy Linux doesn’t come pre-installed with any internet browsers but when you click the “browse” icon it gives you the option to install one of five browsers (Firefox, Seamonkey, Chromium, Opera, and Iron). Of course, you have to be connected to the internet to download one of these browsers. Once one is clicked, it is downloaded and automatically installed by the OS. After clicking on the Firefox icon, Puppy Linux prompted me to select which version of Firefox I wanted:

Launching an internet browser in PuppyLinux.

Once it was installed, it launched the default Lucid Puppy page and I was able to use Firefox and surf the internet easily. The main page even comes with links for the user to explore the latest news, updates or documentation about Puppy Linux to get more acquainted with the OS.

Firefox running in PuppyLinux.

We also tested the pre-installed image editor mtPaint and easily managed to create a drawing dedicated to our new favourite Linux distribution:

Creativity at its finest.

Of course, another essential application to test is one of the pre-installed games called XInvaders 3D which is basically a 3D version of the old arcade game invaders. After much testing and intricate study, we were able to attain a high score of 10,000:

A great game for such a small OS.

After all the testing and exploring we did with Puppy Linux, we realized that there was one large bug that came with it. The cursor gets out of sync between the Virtual OS and Windows when you move the cursor outside of the Virtual environment. It seems like this is only evident when the OS is loaded inside a virtual environment, but we could not find any other instances of this problem occurring to other users when searching online. It’s not clear if it would be fixed if the OS was installed directly onto the machine but further testing would need to be done:

Cursor problems in VirtualBox.

Screenshots do not capture the Windows cursor but as you can see the tab “Devices” is being hovered over in Windows while the cursor is all the way on the right in the Virtual Machine. This problem got annoying when trying to reach icons that are close to edge of the window inside the virtual environment, but is fixable if you play around with the mouse to get the locations of both cursors to be close enough together.

Usage Evaluation

Puppy Linux is very easy to use for a novice Linux user and would be ideal for people who want to revive old machines that don’t have much computing power. I found it simple enough that it wouldn’t overwhelm the user with configuration problems or unnatural interfaces. Although, it is also flexible and extensible with many programs so that power Linux users would be able to make great use of its pre-installed applications such as ftp, ssh, irc and IM clients.

I think the look of the user interface isn't very attractive, but that's not really the goal of Puppy Linux. It achieves everything it tries to attain to by bringing lots of applications and power in a small operating system. There are applications for pretty much any basic use you would use a desktop for. AbiWord for documents, which supports Office 2007 documents and has Computer Modern fonts, PSIP VoIP software, Gnumeric spreadsheet, Ayttm IRC software, Pmount to mount drives (including NTFS and USB-attached devices) and even a few games.

It also comes with GParted, VPN, firewall, Sylpheed mail clients, Pstreamvid, and a helpful downloader script called Quickpet that lets you find and install some of the more popular software circling the net these days. This software includes GIMP, Audacity, desktop widgets, WINE, Songbird, the HTML editor KompoZer, frameworks such as Java, drivers for modern graphics cards (including Nvidia and Radeon) and of course system updates to patch your system.

If a user is looking for any more than this with a distribution that's no more than 120 MB then I'm not sure what other distribution they could use except for Puppy Linux.

References

Carroll, Gerard. "Puppy Linux Forum." Puppy Linux Forum. Web. 10 Oct. 2011. <http://www.puppylinuxforum.org/>.

Carroll, Gerard. "Puppy Linux FAQ - Home." Puppy Linux FAQ - Home. Web. 10 Oct. 2011. <http://www.puppylinuxfaq.org/>.

DistroWatch. "DistroWatch.com: Puppy Linux." DistroWatch.com: Put the fun back into computing. Use Linux, BSD.. Web. 10 Oct. 2011. <http://distrowatch.com/table.php?distribution=puppy>.

Kauler, Barry. "Puppy Linux Community - Home." Welcome to puppylinux.org !. Web. 10 Oct. 2011. <http://puppylinux.org/main/Overview%20and%20Getting%20Started.htm>.

Kauler, Barry. "Puppy Linux." Puppy Linux. Web. 10 Oct. 2011. <http://puppylinux.com/about.htm>.

Part 2

Software Packaging

In Puppy Linux, software packages are installable via the built-in Puppy Package Manager either via the start menu or by using the command-line interface and typing "ppm".

There are two main software package types, identified by their file extension:

  • .pet (intended for all full and frugal Puppy installations)

PET files (which stand for Puppy's Extra Treats) are actually just tarball files (tar.gz) that have an md5sum appended on the end. This allows for an integrity check after the package as been downloaded.

  • .sfs (intended for all frugal or LiveDVD installations)

SFS files are a type of "package management" Puppy Linux has integrated into the boot sequence to allow combinations of packages to be loaded into the OS on boot. A user just has to download an .sfs file (for example: a "mySQL-PHP-Apache" package or a "Open Office Suite" package) and put it into the "/mnt/home" directory, run the BootManager to select which SFS files they wish to load and reboot. After rebooting, the packages are available for use right away. This allows for highly customizable software packages to satisfy a user's OS specifications.

(Figure 1) Installing a package with Puppy Package Manager.
(Figure 2) Selecting which repository to install the selected package from.
(Figure 3) The installed package now shows up in the installed package list.

Other software package types:

  • .tar.xz or .txz (intended for all full and frugal Puppy installations)
  • .pup (obsolete; superseded by .pet)

The user can use Puppy Package Manager to display a list of all the user-installed packages, although this display doesn't show all the packages that come pre-installed with the distribution.

To see all the pre-installed packages, the user would have to open the file located in the directory /root/.packages/ (with .packages being a hidden folder) and open the file "woof-installed-packages". This file lists all the packages that came with Puppy Linux. One way I got the packages in a useful text file was to run the command "cat ./packages/woof-installed-packages > packages.txt" and then viewed the new text file.

Using PPM (Puppy Package Manager), you can view or search for different packages from the Puppy repositories and are able to install them by clicking on the desired package. Once a package is installed by the user, the list of user-installed packaged gets populated. From this list, the user is able to delete one of these installed packages by clicking on the one they wish to remove.

Puppy Linux comes with software to perform equivalent functions as they do on other OS's. The table below displays a list of the equivalent software (Table 1):


(Table 1)
Application Puppy Linux Bundled Software
File Manager ROX-Filer
Spreadsheet Gnumeric
Word Processor AbiWord
Image Viewer Viewnior
Graphic Editor mtPaint
Vector Art Editor InkscapeLite
Internet Browser SeaMonkey
Email SeaMonkey
Audio Player Pmusic
Audio Editor mhWaveEdit
Audio Encoder Converter PawdioConverter
Video - Movie Player GNOME MPlayer
Disc Burner Pburn
DVD Ripper Pdvdrsab
CD Ripper Asunder
Personal Wiki DidiWiki
IRC Ayttm
FTP Utility gFTP
HTML Editor SeaMonkey
Personal Organizer OSMO
File Compression XArchive
Windows Data Recovery ROX-Filer
Drive and Partition Backup Pudd
Integrated Development Environment Geany IDE
Text Editor NicoEdit

Major package versions

  • Linux Kernel - 2.6.38.4

Vintage: Released 21 Apr 2011, latest stable kernel is 3.0.8

Modifications:

Reasoning:

  • glibc - Ubuntu EGLIBC 2.11.1-0ubuntu7.1

Vintage: Released 19 May 2010, latest stable version is Ubuntu EGLIBC 2.13-20ubuntu5

Modifications:

Reasoning:

  • Syslinux 4.03

Vintage: Released 25 Oct 2010, latest stable version is Syslinux 4.04

Modifications:

Reasoning:

  • Xorg 7.3

Vintage:

Modifications:

Reasoning:

  • busybox v1.16.2

Vintage: Released 12 June 2010, latest stable version is BusyBox 1.19.3

Modifications:

Reasoning:

  • Bash 4.1.0

Vintage: Released 1 Jan 2010, latest stable version is Bash 4.2

Modifications:

Reasoning:

  • wget 1.12

Vintage: Released 22 Sep 2009, latest stable version is Wget 1.13.4

Modifications:

Reasoning:

  • tar 1.22

Vintage: Released 5 March 2009, latest stable version is tar 1.26

Modifications:

Reasoning:

  • procps 3.2.8

Vintage: Latest stable release

Modifications:

Reasoning:

  • grep 2.5.4

Vintage: Released 10 Feb 2009, latest stable version is grep-2.9

Modifications:

Reasoning:

  • who/ls/chmod/touch 7.4 (GNU coreutils)

Vintage: Released 07 May 2009, latest stable version is coreutils-8.14

Modifications:

Reasoning: Contains necessary functions for a Linux distribution

  • Firefox 3.6.13 or Firefox 5.0.1

Vintage: 3.6 Released 21 Jan 2010 and 5.0.1 released 21 Jun 2011. Latest stable version is 7.0.1

Modifications:

Reasoning:

  • Seamonkey 2.3

Vintage: Released 16 Aug 2011, latest stable version is SeaMonkey 2.4.1

Modifications:

Reasoning:

Initialization

At bootup, the first thing that happens is the Linux kernel, vmlinuz, is loaded into RAM, followed by the initial ramdisk, which is file initrd.gz. The file is ".gz"-compressed, so it is uncompressed into the ramdisk and then the ramdisk becomes the very basic Puppy filesystem, that is, designated "/" and called top or root directory together with all subdirectories /bin, /sbin, /lib, /dev, /tmp, etc.


A fundamental objective of Puppy is that everything should load into ramdisk, thus freeing up the CD drive so that you can use the CD drive for other purposes. Also, if everything is in RAM, application startup and running speed is stunning.

When the power goes off, RAMdisk content is lost. To retain your settings, such as configuration changes, email, browser history asf Puppy during bootup looks for a suitable hard drive partition, and if one is found, creates a file on it called "pup001". I arbitrarily chose "pupxxx" where the "xxx" is three numeric digits. The three numeric digits have no particular meaning either, except we are currently using pup001 for the live-CD and pup100 for USB installations of Puppy.

pup001 is a single file (easy to backup), but internally is a complete ext2 filesystem. After creating this file, Puppy mounts it, by means a "loopback device", onto /root directory. This directory /root is your home directory -- all your personal stuff goes in there. Thus, when you shutdown, all will still be there next time you start Puppy.

Most of the files in Puppy, in any Linux distro for that matter, are in /usr - furthermore there is normally no need to write to anything inside /usr (that is, no need to edit, create or delete files). So the entire content of /usr is compressed as a single file, named usr_cram.fs and mounted as-is on /usr, by means of a "loopback device" -- the actual technique is not the main issue here, but you need to be aware that all of /usr is really only a single file, containing a compressed and read-only filesystem. Utilizing union-fs, however, changes in /usr can be made at run-time while usr_cram.fs remains unchanged.

When looking for the "usr_cram.fs" file, Puppy will follow these steps:

  1. At bootup, Puppy will first look to see if usr_cram.fs∞ is at "/" in the ramdisk (which meant that it was inside image.gz originally)
  2. failing that, Puppy will look in /root (that is, inside pup001)
  3. else in /mnt/home (in the hard drive partition)
  4. finally Puppy will look on the CD (the slowest media of these)

The init.d scripts contain a block at the top that determine which processes the script should run before or after, in what run levels the script should be started or stopped and more.

http://pupweb.org/wikka/howPuppyWorks

http://puppylinux.org/wikka/howPuppyWorks

http://puppylinux.com/development/howpuppyworks.html

http://puppylinux.com/technical/module-loading.htm

http://bkhome.org/woof/index.html

http://puppylinux.com/development/createpet.htm

http://puppylinux.com/development/package-management.htm

Part 3

Later.