FoxyRoxyLinux - How it works - sortof - What is inside

An overview of FoxyRoxyLinux

FoxyRoxyLinux - How it works - sortof - What is inside

Postby jbv » Sun Aug 12, 2012 9:52 am

FoxyRoxyLinux is built from Debian-Live 6.0.4 i386 standard (hybrid) ISO

The "system" consists of two standard .squashfs files

The filenames start with numerics as this is the only way to control the sequence they are loaded in. Many of the scripts that exist to tweak the .squashfs files have the filenames hard coded into them. It is not suggested that these be changed. Along similar lines, it is suggested that any .squashfs files you create are prefixed with a number to control where it is loaded at startup.

Before we get to far, it is important that you understand the basics of what is happening with the .squashfs files and how they work.

FoxyRoxy uses the AUFS filesystem to load and mount the physical .squashfs files. Due to a limitation within Debian-Live the system can only load 8 .squashfs files at any one time. During startup, the system will attempt to load more than 8 if they exist, although only the first 8 files found will actually be mounted. During the mount process, AUFS overlays each .squashfs file in the sequence it is found and loaded. The concept of overlaying files is very important and one that should be understood if you are playing with files or deleting them. The following will attempt to explain how this works.

Assume we have 3 .squashfs files

- contains a text file: /home/readme1.txt (100 bytes long)

- contains a text file: /home/readme1.txt (200 bytes long)

- contains a text file: /home/readme1.txt (50 bytes long)

When the system starts, it loads and mounts 01.squashfs first
If we were to stop the process here and look at the file /home/readme1.txt we would see that it was 100 bytes long

If the system were then restarted and stopped after 02.squashfs was loaded and mounted, looking at the same file we would see that it is 200 byes long and is the /home/readme1.txt file from 02.squashfs What happened was that the files in 02.squashfs were overlaid on top of the files from 01.squashfs If a file did not exist in 01.squashfs it will still be there exactly as it was and is in 01.squashfs, however if a file with the exact same path/name exists in 02.squashfs then the file from 02.squashfs is the one that we get.

If we restart the system and stop it after 03.squashfs is loaded and mounted, when we look at /home/readme1.txt we will see that it is the one from 03.squashfs

Leaving the readme1.txt file in all of the .squashfs files can either work for us or against us. It depends on what is required. For example, if you load a new program into the system and then save that program using one of the save scripts, for the new program to work properly the next time it is loaded it may require that it be loaded after the other programs that were loaded before it when it was installed. However, if you deleted a program before you loaded this program and the new program required the first program to be deleted properly before it was loaded, then things may not work as intended when you restart the system. The reason for this is that you can not actually delete a file from the .squashfs file.

While you may have removed a file from your running instance of FoxyRoxy, this does not physically remove the file from the .squashfs file. What happens in FoxyRoxy while it is running is that the Debian-Live (linux) copy-on-write feature replaces the pointer/market/whatever in the filesystem with a hidden .whitespace file so that the system does not see the file even though it is still physically inside the .squashfs file. Basically, you can never just delete a file that is inside of a .squashfs file unless you open the .squashfs file, copy it somewhere, make the changes you want to make and then rebuild the .squashfs file and put it back where you got it from. FoxyRoxyhas scripts that help you do this and they will be documented elsewhere. For now just keep in mind that this is going on and hopefully you have a grasp on what is happening underneath.
Posts: 600
Joined: Sat Jul 14, 2012 2:02 am
Location: Sydney, Australia

So, what is inside? (part 1)

Postby jbv » Sun Aug 12, 2012 9:52 am

01-FoxyRoxy.squashfs naturally enough contains the primary OS.

It also contains the X-11 sub-system and OpenBox which is the window manager used by FoxyRoxy.
Other than a few other tools and some minor tweaks, this is the basic core system.

It contains the entire Debian-Live distribution. The primary changes made were:
- Installation of the following programs/packages/drivers
firmware-realtek (for Realtek network adapters that require firmware updates)
linux-image-2.6.32-5-686-bigmem (compiled and added to the system)
OpenSSH = SSH access is installed and active by default
alsa-base = Basic sound
fuse-utils = Will be required later for other filesystems and the like
menu = Basic Debian menu system
sysv-rc-conf = Console program to turn services on/off and control starrtup
xfsprogs = provides support for the XFS filesystem
hdparm = Hard Drive analysis and tweaking tool
smartmontools = Monitor and reports on status of Hard Disks that support "smart"
joe = Text Editor with Wordstar type keyboard commands
mc = Midnight Commander - A console mode point-and-shoot shell
- The next 4 programs are a bit of fun and fluff. They don't take much space.
fbset = Allows tweaks and adjustment to the Frame Buffer if required
fbv = compiled from source - Loads a graphic into the Frame Buffer
gpm = General Purpose Mouse driver to allow mouse use in console mode
fbterm = Frame Buffer Terminal provides a graphic terminal that operates without X
- The following libraries are required by fbv/fbterm.
- Many other programs loaded later require them.
OpenBox = Window Manager, OpenBox tools (config, menu, keys) were also installed or built from source
keyboards-rg = International Keyboard Support

The main changes made were as follows:

bash_completion was disabled by renaming /etc/profile.d/ to /etc/profile.d/

/usr/sbin/update-initramfs was copied to /usr/sbin/update-initramfs.debian to trick update-initramfs so the bigmem kernel could be built and the initramfs could be built on a read-only filesystem.

Changes were made to /etc/apt/

A few changes were made to the startup though edits to /etc/profile
- The original file was renamed to be /etc/
The new default "profile" sets some very important Environment variables that a few of the scripts rely upon, sets the PATH and also adds a "Pause" function that can be used in scripts. The Environment variables will be explained later along with the scripts.

/etc/issue was changed to show a sign-on banner that reflects what the system is.
- This is the text that is displayed just before the login prompt.
- If you want a custom login prompt, edit /etc/issue and /etc/

/etc/sysctl.cnf was tweaked to suppress a lot of the low-level messages that are shown during start-up. This was done primarily to ensure that the user always saw the "login" prompt which can sometimes be overwritten or lost if the network card needs to load firmware or some other background wizardry is occurring during start-up and takes a little while to output it's message. If you want it back, un-comment the following line from /etc/sysctl.conf
#kerkel.printk=3 4 1 3

APT has been tweaked so that it does not load suggested or recommended packages be default. This means that apt-get install will only download and install the minimum required for a package to run. This may or may not achieve the desired result and some packages may not perform to their full capabilities. If you want to change this, simply edit /etc/apt/apt.conf

The APT sources have also been tweaked by changes made to /etc/apt/sources.list
At the moment, they point to mirrors which work best for me.
The original sources are still in the file as is "backports" and Debian-Multimedia. Now would probably be a good time to tell you that debian-multimedia is not part of the Debian project, nor is it related. It is a private individual who is doing his thing to provide assistance. Different people have a different view on this situation. If you care to look into it you can form your own opinion. The pgp keyring for debian-multimedia has been put in and it works for me. If it doesn't work for you, there will be another message somewhere else on the apt system in general and how to fix the keyrings.

You should probably edit /etc/apt/sources.list and season to your location.

There are a series of scripts in /scripts which will be explained elsewhere.

The intent and goal here was to get a good clean Debian base with a good clean X11 system and the OpenBox window manager. I think we achieved this goal. If you want to play with a different desktop or just experiment with OpenBox on Debian, then this would be a good starting point. If you login and type "startx" you will get OpenBox, which by itself is just a Window Manager. The screen will look black or gray with a cursor in the middle of the screen. If you right-click your mouse, you will get an OpenBox menu that contains some basic tools and applications in the Debian menu. Everything here works and is solid, but it is basic.

The only other real "tweaks" worth mentioning here are: The root user .bashrc file has been tweaked to enable the standard l, ll, and ls "tweaks" for colour and shorthand usage. An Alias has been created so that "cls" is the same as "clear", and "ff" calls mlocate to find files. The file test.wav has been put in the /root directory so you can test sound straight away by typing "aplay test.wav" and some wallpapers have been put in the directory /root/papers

GPM (general purpose mouse) driver is loaded at startup.
This let you use the mouse in the basic console to right-click which will copy the selected text. The mouse will also work in "mc" (Midnight Commander) and with quite a few other console only programs to click buttons etc that you normally need to "tab" or otherwise move to. My mouse-wheel also works in many console programs. Your results and findings in this regard may vary.

/etc/X11/app-defaults/XTerm was edited to provide a workable font on my screen.
If you want the Terminal Font in OpenBox to be bigger or smaller, then edit this file and adjust the *faceSize

If you only want a basic/clean Debian-Live with X11 and the OpenBox window manager, then just make sure that 01-FoxyRoxy is the only file in the /live directory with a .squashfs extension when you start your system. For testing, I simply append ".noload" to the existing filename so they are named "xx-whatever.squashfs.noload"

If you are looking for less than this, then you are probably better off starting from scratch
Posts: 600
Joined: Sat Jul 14, 2012 2:02 am
Location: Sydney, Australia

So, what is inside? (part 2)

Postby jbv » Sun Aug 12, 2012 9:53 am

02-FoxyDesktop.squashfs this sqf contains the desktop, all graphical programs and networking support.

Note: Wireless networking has not been installed yet. This is on the to-do list.

This section needs a little work...
Posts: 600
Joined: Sat Jul 14, 2012 2:02 am
Location: Sydney, Australia

Return to The Basics - Please Look in here First

Who is online

Users browsing this forum: No registered users and 1 guest