Home

Awesome

Welcome to GaryOS


GaryOS Icon"The one file that does it all."
Latestv8.0 2024-05-16 -- Kernel, Rootfs, Boot, Disk
Homepagehttp://www.garybgenett.net/projects/gary-os
Downloadhttps://sourceforge.net/projects/gary-os
Sourcehttps://github.com/garybgenett/gary-os

GaryOS Download

Documentation
OverviewQuick Start, Requirements, Support
BootingLinux, Windows, GRUB, EFI, PXE, Virtual
RunningNetworking, GUI, Update, Filesystem
BuildingCompile, Manage, Image, Install
Information
GoalsDesign, Builder, Loader
ProjectReferences, Contributing, Licensing
DetailsVersioning, Repository, Tools, Ecosystem
ReleaseProcess, Checklist, Publish
Versionsv8.0 2024-05-16, v7.0 2023-01-14, v6.0 2021-09-12, (...)

Documentation


Overview

GaryOS is an entire GNU/Linux system in a single bootable file. It is also a Builder system to create and package Gentoo installations.

Builder creates custom root filesystems that GaryOS can load into memory in place of its own. GaryOS can build new or updated versions of itself from within itself.

Key features:

Primary uses:

Unique advantages:

No other GNU/Linux distribution takes the same approach or has the same features as GaryOS.

<!-- ![GaryOS CLI Screenshot](artifacts/images/screenshot_cli-v7.0.png "GaryOS CLI Screenshot") -->

GaryOS CLI Screenshot GaryOS GUI Screenshot

Quick Start

Download the latest Kernel, and select a boot method:

  1. Use Virtual to try it out or test it (quickest and easiest)
  2. Follow the instructions for either Linux or Windows
  3. Configure an existing EFI bootloader
  4. Host on a PXE server

Log in as root with password p@ssw0rd!. Any boot media can be detached. Use the normal shutdown now or simply power off when finished.

Requirements

A 64-bit x86 CPU is required. GaryOS is not built for any other platforms. Intel and AMD x86 processors are by far the most common for desktop and laptop computers, which is what GaryOS was designed for.

The booted system requires at least 4GB of RAM. Some of the advanced features and uses require additional memory, and 8GB is recommended.

The GaryOS Kernel is several hundred MB, and 1GB of storage is recommended. This will be closer to 3GB if the Rootfs is also used. All efforts have been made to make GaryOS as compact as possible without sacrificing functionality or pruning the filesystem.

You will also need a keyboard and monitor in order to use GaryOS, although a serial terminal will work just fine.

Support

Gary B. Genett is the sole developer and maintainer of GaryOS. It is a personal project with aspirations of recognition as an actual distribution, however misguided.

All documentation is in this file and the usage output of the Builder scripts. Everything in Booting, Running and Building are specifically tested and supported. See Checklist for details on the final testing done every release.

While there appears to be some adoption of GaryOS, it is not yet enough to warrant a formal ticket system. For any issues, or to share the creative ways you are using GaryOS, please contact the author directly at gary-os@garybgenett.net.


Booting

GaryOS is a Linux Kernel with a large embedded Linux initramfs (see Design). It can be booted in the exact same way as a standard Linux kernel, and from anywhere that a Linux kernel can.

LinuxStarting from any GNU/Linux system
WindowsStarting from a Microsoft Windows system
GRUBUSB or hard drives, from either GNU/Linux or Windows
EFIExisting EFI systems, which are the contemporary standard
PXENetworked environment, or for rapid Rootfs testing with QEMU
VirtualRun virtualized on any platform, for Building or testing

All standard Linux kernel parameters are valid. In addition, GaryOS has added a number of groot* options, which specify the initial amount of memory reserved for the filesystem and other aspects of the boot process. Full details on these parameters are in Filesystem and Loader.

Linux

Starting from GNU/Linux is easier than with Windows, for obvious reasons. There are two options.

  1. Use an existing booloader configuration
  2. Use the GaryOS GRUB tooling

It is recommended to use the first if it is available. The simplest version for GRUB is below, with the linux line matching the location of the GaryOS kernel.

menuentry "GaryOS" {
  set debug=linux
  linux (hd0,1)/gary-os/gary-os.kernel
}

The gary-os.grub.cfg file in the Boot archive is a good example of a complete GRUB configuration file. It is sourced from grub/grub.menu.gary-os.cfg, and provides many additional features and benefits over the example above.

menuentry "GaryOS Menu" {
  configfile (hd0,1)/gary-os/gary-os.grub.cfg
}

Both of the these options will also work for GRUB installations on USB drives. See GRUB to create or update a bootable USB drive. For EFI systems, see EFI. Any bootloader that can boot Linux will work, but GaryOS is not tested with them, so no instructions or support is provided.

Windows

Installation for Windows systems is not complicated, but does involve a few steps. Microsoft consistently changes the way their bootloader works, and what items are supported. The v3.0 version of GaryOS was the last one to support direct modification of the Windows 7/8 bootloader. In Windows 10, Microsoft removed support for the application type required to boot the GaryOS GRUB image. As such, using a USB drive is the safest and easiest method. There are alternatives to the Windows bootloader that can dual-boot Windows and GNU/Linux, but they are not tested and no support is provided.

Steps for creating the bootable USB drive are in GRUB.

GRUB

The GaryOS Boot file contains everything needed to create and update GNU GRUB on both hard drives and USB drives. The core of the tooling is the scripts/grub.sh script.

Once a drive has been set up, place the GaryOS Kernel in the gary-os directory as gary-os.kernel. The gary-os.grub.cfg file can also be placed in that directory and edited as needed.

/gary-os/gary-os.grub.cfg
/gary-os/gary-os.kernel

The drive can be booted using the BIOS or EFI boot menu on any computer that supports booting from removeable media. It provides a menu which auto-selects the most advanced option available. This menu can be updated at any time using the scripts/grub.sh script within GaryOS, following the directions in "GNU/Linux" below. The gary-os.grub.cfg file can be updated anytime with the latest grub/grub.menu.gary-os.cfg.

GNU/Linux

The scripts/grub.sh script can be run directly from the command line. Running it without any arguments will display the usage documentation. It expects to be run from within the GaryOS Repository, since it requires the menu files in grub/.

Be advised that this script creates a brand new partition table on whatever drive is targeted. Only use this on a brand new or empty device. The update option should only be used on drives that were created by the script or that have a matching partition table layout. Only the partition numbers and codes need to match.

PartitionStart SectorEnd SectorSizeCodeName
1212172872718602.5 GiB0700Microsoft basic data
32457621217271024.0 MiBEF00EFI System
440962457510.0 MiBEF02BIOS boot partition

This is the output from gdisk -l loopfile.img. Using fdisk -l will produce similar output.

Windows

These instructions are tested on Windows 10, but should work just fine on anything Windows 7 or later. They use Rufus to install the GRUB image onto a USB drive.

  1. Insert a new or empty USB drive at least 4GB in size
  2. Download the Boot archive, right click and 'Extract'
  3. Double-click rufus*.exe, click allow, and decline updates 2. For 'Device', select the USB drive 3. For 'Boot Selection', use the large 'Select' button and loopfile.img 4. Click 'Start' 5. Read the warning and click 'OK' when ready 6. Click 'Close' if it completed successfully
  4. Right-click the Windows 'Start' menu, and select 'Disk Management'
    1. The drive will have both lettered (e.g. D:) and unallocated space
    2. Right-click the lettered drive and select 'Delete Volume'
    3. Read the warning and click 'Yes' when ready
    4. Right-click the expanded unallocated space and select 'Simple Volume'
    5. Follow the prompts, using 'exFAT' as the 'File System'
    6. Click 'Finish' when ready

There will be a new drive letter available in 'My Computer', but it will be empty. Create the gary-os directory and add the gary-os.kernel as described at the at the beginning of GRUB. The gary-os.grub.cfg instructions are also supported.

EFI

Both the GaryOS Kernel and the GRUB x86_64.efi file in Boot (see GRUB) are EFI applications, and can be used directly from an EFI menu on an appropriate partition.

Booting from either of these files with EFI is tested and supported, but the necessary EFI configuration steps are not.

PXE

In a networked environment GaryOS can boot from a central server. This is often used in labs or environments where centralized management of infrastructure is critical.

Both the GaryOS Kernel and the GRUB x86_64.efi file in Boot (see GRUB) can be loaded directly from PXE. The Boot image will automatically select and load GaryOS from the server, and will also pass any additional boot parameters to the Linux Kernel directly from the PXE server configuration.

DHCPd and TFTPd are included, so GaryOS can also act as the PXE server. An example DHCPd configuration is below. The x86_64.efi image must be used as the filename in order to pass Linux kernel parameters to GaryOS via extensions-path. Otherwise, the GaryOS kernel can be used directly as filename without any other options.

next-server             0.0.0.0;
filename                "/gary-os/gary-os.grub/x86_64.efi";
option root-path        "/gary-os/gary-os.kernel";
option extensions-path  "<kernel parameters>";

Using Image to create modified Filesystem images could form the basis of a completely automated and centrally managed lab or server farm.

Virtual

Using virtualization is is the quickest and easiest way to try out or test GaryOS. On a GNU/Linux system, QEMU is high-performance and low-complexity, and is what the author uses for all development and testing of GaryOS (see Checklist). However, it is not well suited for other platforms, such as Windows, and VirtualBox is the best choice there. VirtualBox also runs on GNU/Linux, if desired, but it is not included in GaryOS.

The instructions below use 4096MB (4GB) for memory, to emulate a minimal system which meets the Requirements. On systems with only 4GB of memory, virtualization will not work, and using GRUB to create a USB drive is the best path.

QEMU

Use the package manager to install QEMU. It is available on all major distributions, including GaryOS. Once installed, it is simple to get it running.

modprobe kvm_intel
qemu-system-x86_64 -m 4096 -kernel gary-os.kernel

The Disk file is a pre-made QEMU image that is already installed with GRUB and the Kernel.

qemu-system-x86_64 -m 4096 gary-os-*.qcow2

See Checklist for additional information on how QEMU is used in the development of GaryOS.

VirtualBox

Once VirtualBox is installed, create a new virtual machine.

TypeLinux
VersionOther Linux (64-bit)
Memory4096 (or greater)
Virtual disk filegary-os-*.qcow2 (the Disk file)
Enable EFIon

This new virtual machine will run GaryOS GRUB and boot the Kernel.


Running

There are many things that can be done with GaryOS once it is booted, some of which are outlined in Overview. It is essentially a packaged Gentoo installation. There are a few common tasks that are documented to make them easier, and some additional capabilities specific to GaryOS.

By default, GaryOS starts the fewest processes possible and does not mount any hard drives or partitions. This is for security, rescue and forensics.

See Support if you wish to share any creative uses for GaryOS that you come up with.

Networking

For security, no networking configuration or daemons are run by default, but several networking packages are installed. Instructions for Ethernet, Wireless and OpenSSH sshd are below.

The Gentoo Networking page contains full details on all the configuration possibilities. For the purposes of GaryOS, a simple single-interface configuration is likely all that is needed.

Ethernet

The dhcpcd utility is the quickest and easiest to use.

rc-update add dhcpcd default
openrc

This should automatically detect the best interface to use and configure it with DHCP. It can also be run explicitly on a specific interface using something like dhcpcd eth0.

In case this does not work as expected or there is no DHCP available, the ip command from iproute2 can be used to configure manually. Starting with ip address will show all the available interfaces and their status. Use ip help for more information on how to use this command.

Wireless

The configuration for wireless is slightly more involved, especially since it is done on the command line. The wpa_supplicant package is very comprehensive and accomplishes the goal in the fewest steps.

nano /etc/wpa_supplicant/wpa_supplicant.conf
rc-update add wpa_supplicant default
rc-update add dhcpcd default
openrc

If it is required to manually discover an available network, use the wpa_cli command. If preferred, the wpa_gui graphical utility is available on Rootfs.

scan
scan_results
add_network
list_networks
set_network 0 scan_ssid 1
set_network 0 ssid "<ssid>"
set_network 0 psk "<password>"
enable_network 0
select_network 0
status
save_config

The wpa_cli command supports tab-completion, so it is only necessary to type the first few letters of each command. Use iwconfig to verify success.

rc-service wpa_supplicant restart

In cases where the changes do not immediately take effect, the above will restart the daemon and reinitialize the interface.

OpenSSH

If remote access to GaryOS is needed, OpenSSH sshd is the absolute best option.

passwd root
rc-update add sshd default
openrc

It is very important to note that root access is enabled, which is why the password should be changed before enabling SSH.

GUI

GaryOS boots to the command line by default. To run the X.Org graphical interface, use startx.

UtilityKernelRootfs
Window managerdwmIncludes Openbox
Terminal emulatorrxvt-unicodeAlso the default
Web browserLinksIncludes Firefox

The dwm title bar has brief reminders for the shortcuts below. Use XSESSION=openbox startx for Openbox instead of dwm. In Links, use the top bar for the menu and g to open the URL bar.

GaryOS ReadmeAlt-Left
The dwm man pageAlt-Right
Command entryAlt-p
Terminal emulatorAlt-Shift-Enter
Web browserAlt-Ctrl-Enter
Web browser (Firefox)Alt-Shift-Ctrl-Enter

X.Org tries to auto-detect the best resolution for the display. If it does not, use the xrandr utility to change it. If preferred, the arandr graphical utility is available on Rootfs.

xrandr --query
xrandr --output Virtual-1 --mode 1920x1200

These are not the prettiest or most feature-rich applications. They were selected for their lightweight nature and minimal dependencies, along with the high geek factor (see Goals).

Update

GaryOS is essentially a packaged Gentoo system, and can be updated or modified just like a normal installation.

  1. Set up Networking
  2. Increase the size of the filesystem
  3. Use make unpack to install necessary directories
  4. Run whatever Portage emerge or other commands that are desired

It is important that make unpack is run before making updates to the system, since it may remove or replace added files if done afterward.

Increase Filesystem Size

The default size of the filesystem includes a minimal amount of additional space, but not enough to unpack the directories and make other updates.

mount -o remount,size=6144m /.overlay
df -h /.overlay

Replace 6144 with the amount of MB to allocate. This may also be specified as 6g for GB. GaryOS is tested with 6GB, to ensure this works with systems that have 8GB of memory.

Upack Directories

GaryOS has a basic, self-documented, packages-like system for fetching and unpacking additional directories (see Design).

cd /.gary-os
nano /.unpack
make unpack

Nano is a basic, user-friendly text editor. The author uses Vim, so that option is also available. The syntax to use is documented in the file. For this, just remove the first character from all the gcc and emerge lines (except for gentoo-repo.git).

Emerge

At this point, GaryOS is like any other Gentoo installation. The emerge command can be used to install and update packages as usual.

emerge app-misc/hello

Be mindful of how much is being installed compared to available memory. Each package will collect source distribution files, require filesystem space for building, install new files, and generate a binary package file. It can add up fast.

GaryOS maintains a packages repository on SourceForge for the latest version. All packages in gentoo/sets/packages are included, and match the settings in Rootfs (Kernel may need to re-compile some of them). Installing these packages should be quick and inexpensive.

If a large number of non-GaryOS packages are required, building an Image of an updated Filesystem or doing an Install are good alternatives.

Filesystem

GaryOS uses a three-stage process for unpacking the root filesystem into memory. This is covered in detail in Design. During this process, a filesystem image is selected, loaded into memory, and booted. The default is to use the one packed into the Kernel. GaryOS has the capability to load a different filesystem.

Fundamentally, all that is needed is the ability to pass Linux Kernel parameters and host the filesystem image. GaryOS has a pre-made Rootfs that comes with many additional packages installed. See Image to create new ones.

There are a few kernel parameters specific to GaryOS that are needed to load an external filesystem.

grootDisk or partition that the Rootfs resides on
groot_sizeInitial amount of memory reserved for the filesystem
groot_filePath to the Rootfs (default: /gary-os/gary-os.rootfs)
groot_hintProvide a hint to Loader (used by Boot), in case of error

Loader goes into each of these in much more detail. GaryOS provides example defaults in the Boot configuration file, sourced from grub/grub.menu.gary-os.cfg. Generally, only groot and groot_size are required to load an external Image.

The groot_size value for the pre-made GaryOS Rootfs should be at least 4096m, or 4g if that format is preferred. The Boot file is already correctly configured (see GRUB).


Building

In addition to being a GNU/Linux system, GaryOS is the Builder system used to produce itself. It has three main purposes.

These sections are in logical order, following the full lifecycle of creating a build, managing it or creating an image of it, and ultimately installing it. They are mainly for reference from other sections, and not necessarily a prescribed list of steps to take.

Compile

The process to build and install a source-based distribution like Gentoo from scratch is long and complex. The GaryOS Builder is designed to condense it into a small number of atomic steps using GNU Make.

TargetAction
initInitial build from a stage3 tarball
doitUpdate a build with any package or configuration changes
krnlRecompile Linux Kernel list, and 'doit' once complete
redoComplete start-to-finish rebuild of entire system
editWrapper around gentoo.config customization script

To prepare for a build, create a sources directory in the repository and download a stage3 tarball into it. Each version of GaryOS has a link in Versions to the stage3 it was built with. The default GaryOS settings in gentoo/make.conf call for a generic_64 tarball.

The build directory will be created and used as a 'chroot'. If this will be a direct installation to disk, create the build directory manually and mount the target partition on it. Do not mount any subdirectories until after the 'init' phase. Upon completion of the build, the GRUB Quick Start is all that is needed to make it ready to boot into.

None of the steps in this process are specific to GaryOS, other than the starting Portage configuration and the selected list of packages. This process is generally applicable to all Gentoo systems.

Init

The target directory build will be created. It will grow to many tens of GB, so having 100GB available is recommended.

For the best performance, change the MAKEOPTS -j variable in gentoo/make.conf to the number of CPU threads your system has.

grep "^processor" /proc/cpuinfo | wc -l

The last line in gentoo/_funtoo must be the release version and commit hash in Portage that it is desired to use for the packages repository.

Make any desired Portage package selection and configuration changes, and then start the build with make init. By default, the base GaryOS Kernel package list and configuration is used. The full Rootfs build can be done with make P=_gary-os init. If so, be sure to add P=_gary-os in all the rest of the steps as well.

The initial build is where errors are most likely to occur.

These are all beyond the control of GaryOS. See Builder and Process for strategies to deal with these quickly and continue building.

This phase must at least reach the stage where it is building the selected package list after updating the base system (the @system set) and downloading all the source files. The 'doit' target can be used after that to resume. In that case, the 'redo' phase must definitely be performed, to make sure the skipped 'init' steps are run.

Doit

The main purpose of this target is to do a system update after any package or configuration changes. It also handles a number of backend items key to keeping things clean and orderly.

Once the 'init' phase reaches the point of building the package list, this phase can be used to resume after failed builds. It can be handy to do make DOFAST=true doit to skip some of the ancillary time-consuming steps until a successful build is achieved, and then do a final make doit to ensure they are run. This is a real time saver.

The DOREDO=true variable is also available, and forces an update and re-archive of the Portage tree.

Successful completion of this phase is the #1 measure of a healthy build. It can't be run too often.

Krnl

Somewhere between a 'doit' and a 'redo', this rebuilds the Linux Kernel list and completes the 'doit' process, without performing a full system rebuild as is done with 'init' or 'redo'. Primarily used during development to build and test new kernels and configurations.

The DOREDO=true variable is also available, and removes all previous kernels, along with their modules and configurations.

Redo

This is almost identical to 'init'. Once the build successfully completes 'doit', it is good practice to recompile everything from start to finish. This resolves any mutual dependencies, filters out binary bootstrap packages, and guarantees that the entire system can build flawlessly with the current package list and configuration.

Ultimately, this is maybe not a necessary step under normal circumstances. However, when performing a new build there are usually multiple passes with 'init' and 'doit', with lots of changes to the configuration and additions to gentoo/overlay/. The final rebuild pass is to catch any bugs with the build that might have slipped in.

Edit

This target is only required if the gentoo.config script has been modified (see Builder). It performs any automated customization steps that are desired.

Manage

The GaryOS Builder is designed to support the "rolling release" model of source-based distributions, where the system is more or less constantly being updated and built. Its original and ongoing purpose is to do exactly that. It supports all Gentoo systems, regardless of how they were installed.

There are a lot of steps and miscellaneous tasks that are best practice to keep a Gentoo system in good working order. Over time, it is also inevitable that the Portage configuration will acquire cruft or not be using new options that are available. GaryOS Builder condenses all this into a simple two-step process.

TargetAction
updateUpdate the Portage packages repository and emerge databases
upgradeUpgrade the system to the current packages and configuration

The update target is completely automated, but upgrade requires interaction at various steps to accept updates or confirm configuration file changes.

At the end of upgrade, the /_gentoo directory is updated with information to aid in the maintenance of a healthy system. See Builder for details.

Image

This is the process of creating new Filesystem images. It requires a directory installed with GaryOS (or Gentoo). There are multiple sources where this can come from.

There are two key requirements of the final image for it to work correctly.

  1. That /init is an executable location for the startup process
  2. Has the same Linux Kernel version (the /usr/lib/modules directory)

Image tries to handle the first automatically. Verify this, and be mindful of the second if the source directory is updated (such as Update or Compile). If needed, there is a packdir archive of the /usr/lib/modules directory in Downloads.

It may be important to review the package file that will be used. There are GaryOS variables in them which control portions of this process, such as which directories to package, archive or exclude and what rc-update or other commands should be run to tailor the image filesystem (see Loader). The defaults in gentoo/sets/gary-os should be reasonable. A more complete configuration is in gentoo/sets/_gary-os.

make rootfs
make P=_gary-os rootfs
ls -adl build/.gary-os-*/*.rootfs*

It is also possible to directly build a customized Kernel, so that the two-stage Filesystem process is not needed.

make release
ls -adl build/.gary-os-*/*.kernel*

This method is a little more involved, since it creates an image and then compiles it into the Linux kernel. There may also be unexpected issues when trying to boot a kernel with a very large Linux initramfs (anything bigger than the GaryOS Kernel is untested).

Both will skip portions of the build if there are already output files present, including the final image or kernel. This is sometimes desired when iterating, to avoid doing the same time-consuming steps repeatedly. However, it can be problematic when the intention is to implement changes.

make clean
make DOREDO=true rootfs
make DOREDO=true release

The clean target will completely remove all Builder output files, restoring the build directory to its original state. This includes all images and kernels, along will all their supporting files. The DOREDO variable is specific to each target, and only rebuilds the relevant files.

Install

One of the Goals of GaryOS is to simplify the process of installing Gentoo. This can be done using Compile or from directly within GaryOS.

ImagePackagesConfiguration
Kernelpackages.txtOptimized for size and fewer dependencies
Rootfspackages.rootfs.txtComplete configuration and package list

The final result will be identical to a Compile for both images. There are only a few steps to doing the install.

  1. Unpack all the Loader directories
  2. Reset all configuration files to default (optional)
  3. Update packages and configurations (optional)
  4. Run the install

All of this except the Update will be done by Builder.

At least 8GB of memory will be required, due to the size of the fully unpacked filesystem. The base size of the in-memory filesystem will need to be at least 6G, which can be set with groot_size=6144m before booting (see Filesystem) or mount -o remount,size=6144m /.overlay after booting (see Update).

mount -o remount,size=6144m /.overlay

It is strongly advised to at least skim through the Gentoo Installation Guide or the Gentoo Installation Guide. GaryOS aims to simplify the process, and is not meant to supplant all understanding of it.

Unpack

This ensures all directories are uncompressed onto the filesystem. Without it, the install will be incomplete.

cd /.gary-os
make DOREDO=true unpack

Both Kernel and Rootfs require Networking for this, although Rootfs already has all of the absolutely necessary directories locally. For a network-less install, use Rootfs and follow the unpacking instructions in Update. Namely, edit the /.unpack file to skip the external gentoo-repo.git directory.

Configuration Files (Optional)

By default, the small amount of branding and configuration that GaryOS does will be copied over to the installation.

cd /.gary-os
make DOREDO=true install

The above will reset the running GaryOS to a completely default system. The full list of modified files is in "Modifications" below.

cd /.gary-os
make reset

Somewhat similar to the above, a reset will "upgrade" the Portage configuration to gentoo/sets/packages.

Update (Optional)

Perform any Update steps that are desired to have in the final install. If there are a large number of changes, it is best to wait and perform them on the final system after it is installed.

Any changes to package configuration files can also be done at this stage. They should be done on the live Filesystem and not the Repository.

Install

The system is ready for install. All that is needed is to mount the target partition (replace /dev/sda1 with the desired location). This partition must be empty. Anything on it will be erased.

mkdir /.install
mount /dev/sda1 /.install
make install

Once complete, the final step is to install the GRUB bootloader. Some helpful pointers are provided at the end of the install process. This is a simple step, but has a few important considerations, so it is not automated. The GRUB Quick Start can also be a helpful starting point.

The install target can be run any number of times without issue. Make sure to install GRUB as the absolute last step.

All that is left are a few key items to make the system ready for use.

Enjoy your new system!

Modifications

As part of the Image process, several files are added, modified, or replaced to ensure a good experience, fix issues, and generally create a particular look and feel for GaryOS.

FileChangePurpose
/etc/issueReplacedartifacts/files/issue
/etc/motdAddedartifacts/files/issue
/initAddedSymbolic link to /usr/bin/init
/etc/inittabModifiedAdded serial console
/etc/fstabModifiedCommented all lines
/etc/locale.genReplacedartifacts/files/locale.gen
/etc/conf.d/hostnameModifiedSet to gary-os
/etc/profile.d/setterm.shAddedDisabled terminal bell
/etc/wpa_supplicant/wpa_supplicant.confReplacedartifacts/files/wpa_supplicant.conf
/etc/ssh/sshd_configModifiedEnabled root login
/etc/env.d/90xsessionAddedSet default window manager
/etc/X11/Sessions/dwmModifiedTune dwm running environment

In cases where the files are modified or replaced, the original is kept as a *.gary-os file.

In addition to the above, the OpenRC configuration is modified (see Loader). This is primarily to disable all network daemons. The gpm daemon is enabled for mouse support on the console.

As for the overall system, all configuration files for the Linux Kernel and Portage are in the repository.

Linux Kernellinux/
Portagegentoo/
Portage Overlaysgentoo/overlay/

Finally, the root password is set to p@ssw0rd!.


Information


Goals

Here are the guiding principles that keep GaryOS going in a consistent direction with a consistent purpose.

Top requirements:

Other objectives:

Explicit non-goals:

GaryOS will continue to be a Builder and Kernel above all else.

Design

GaryOS uses Linux initramfs as a root filesystem, which was only designed for minimal environments to load kernel modules, do hardware detection, and perform other tasks before mounting an actual root filesystem. This approach presented a few challenges in the early versions of GaryOS.

The solutions for each of these are somewhat mutually exclusive.

In GaryOS v4.0, a comprehensive three-stage Loader infrastructure was developed, along with a robust, generally usable Builder system.

  1. Linux kernel loads and uncompresses the base initramfs into memory
  2. A minimal environment locates, mounts and boots a Rootfs
  3. XZ compressed directories are unpacked or left archived

This approach provides a number of advantages:

In the default Kernel, this all happens seamlessly. When loading a Filesystem, additional kernel parameters are required (see Loader).

Builder

Installing source-based GNU/Linux systems like Gentoo involves a large number of steps and is very error-prone. Keeping them up to date can be equally complex. GaryOS addresses this by applying a monolithic release model. The Builder system was developed over many years to accomplish the goal of a reliable process that produces repeatable builds.

Builder is more of an abstract concept than it is an actual thing, but it is most helpful to think of it this way. Builder is the very core of GaryOS.

Type make usage (basic) or make help (advanced) to get started.

Responsibilities

ComponentPurpose
MakefileWrapper around the other components
gentoo/_systemWorker for all of Building (core of Builder)
gentoo/_funtooGentoo Portage commit tracking
gentoo/.emergentAudit script which creates /_gentoo directory
gentoo.configOptional customization for 'edit' in Compile

Build Tuning

The SELECT variable defined in the package set file determines which eselect values are configured during the build. There are other variables which do similar tuning, and are self-explanatory. The full list is at the top of gentoo/sets/gary-os.

Build Output

The /_build directory is created by Compile, which archives the Linux Kernel and Portage configurations, along with the stage3 tarball and Portage tree used. The purpose of this directory is to centralize everything needed to reproduce the build.

After Compile or Manage, the /_gentoo directory will be created by gentoo/.emergent. It performs a number of checks of the Portage configuration and the installed system. The results are in the /_gentoo/+checks text file. This file is very helpful in keeping a Portage configuration in line with upstream, particularly the addition or removal of $USE flags.

The /_gentoo.log file is created every Compile. It contains the complete output of the build, for troubleshooting. Please include this file when reporting any issues (see Support).

Tooling

Another primary function of Makefile and gentoo/_system is to provide helpful tooling for the sometimes arduous process of bringing Compile 'init' or 'redo' through to a successful build. Process walks through the author's workflow, and has examples of these helpers.

Use gentoo.config to automate any final build steps with Compile 'edit'. By default, it is run inside the 'chroot', so all paths should start from /. Examples are creating users or making initial configuration changes. The author uses a custom version to make sure important personal steps are not forgotten.

Colorization

One final feature of Builder is that Compile is wrapped with a "colorizer" (based on GoboLinux), which makes all the output very pretty.

The entire process of compiling a new system is quite a beautiful thing to admire. Sit and watch it sometime, and contemplate how many human hands and minds are at work in front of your very eyes.

References

References to this section:

These are to make sure everything is cross-linked, and that this section is complete.

Loader

The sole purpose of Loader is to create and load a Filesystem into memory when Booting. This process and the rationale behind it are detailed in Design. Loader also creates Kernel and Rootfs for distribution using Image.

Loader is more of an abstract concept than it is an actual thing, but it is most helpful to think of it this way.

Responsibilities

ComponentPurpose
MakefileWrapper around the other components
gentoo/_systemAll environment and variable initialization
gentoo/_releaseWorker for Filesystem Image (core of Loader)
artifacts/files/Filesystem Image scripts and configuration

Package Directories

During Image creation (also Kernel and Rootfs), large directories are packaged with XZ Compression to maximize space savings (see Design). Commands such as rc-update are run during Image creation or at boot time after directories are unpacked. There are variables sourced from the package set file which define these.

RCUPDTCommands such as rc-update to be run before Image creation
FSUPDTIdentical to RCUPDT, but are run after directories are unpacked
FSPACKIncluded in Image, and unpacked during boot
FSKEEPIncluded in Image, but are left packed
FSARCHExcluded from Image, but are packed for later use
FSEXCLExcluded from Image, and are not packed at all

Note that these can be nested one level deep. Meaning, a directory can be FSARCH from a FSPACK or FSEXCL from a FSKEEP and so on. Anything nested deeper will produce undefined results. They are evaluated in reverse order, so lower on the list will take precedence. For example, if the same directory is set in FSEXCL and FSPACK, the directory will be FSEXCL. Take this into consideration when nesting, since doing things like FSPACK on a FSKEEP subdirectory will also produce undefined results.

Complete examples of usage are in gentoo/sets/gary-os and gentoo/sets/_gary-os.

Overlay Environment

The Booting process goes through three stages (see Design). In the first, Kernel loads into memory along with a Linux initramfs. This is a minimal environment designed to locate, mount and boot a Filesystem such as Rootfs. There are Linux Kernel parameters which inform this environment.

First, groot_size specifies how much memory to reserve for the filesystem. This must be large enough to contain both Kernel and Filesystem, plus a little extra for space needed after booting. Then, the groot partition is mounted and groot_file is loaded into memory. Optionally, groot_hint can be used to provide helpful information in case loading the Filesystem fails.

During this stage, Linux kernel modules are loaded from the Kernel internal Filesystem if they are needed.

In case of failure, a minimal shell environment will be loaded. It is menu-driven and self-documented. Its purpose is to facilitate real-time user selection of a Filesystem to load.

Once a Filesystem is loaded, directories are unpacked as specified in 'Package Directories' above, and /init on the target filesystem is booted. The majority of Linux kernel modules will be loaded after this point, so it is important that the Filesystem has a /usr/lib/modules directory which matches the GaryOS Kernel version. There is a packdir archive of this directory in Downloads.

The final in-memory filesystem is mounted on the backend at /.overlay, so it can be resized after boot using something like mount -o remount,size=6144m /.overlay (see Update).

If desired, the intermediary environment used to locate and boot the Filesystem can intentionally be loaded by using groot=null. This process is a great learning experience for anyone interested in the GNU/Linux boot process or how live systems work. In particular, there is a reference implementation of a completely in-memory Squashfs Overlay in artifacts/files/initrc.

References

References to this section:

These are to make sure everything is cross-linked, and that this section is complete.


Project

The project is not named GaryOS out of any delusions of grandeur or egomania. It was coined years before its public birth by a pair of good friends who jested at the amount of time and effort spent tuning and customizing a computing environment. The author's workstation was jokingly called "Gary OS".

GaryOS as it is today is the organic evolution of that long-ago workstation into the public project it has become. It is produced directly from the same build the author uses on their personal system. In all ways, it IS Gary's OS.

That said, the name is meant to be humorously, ironically self-deprecating. GaryOS would not be possible if not for the incalculable, invaluable contributions of countless developers and enthusiasts worldwide over the course of many decades (as far back as the 1970s). It is the author's hope that this small contribution to the universe of open source software is valuable to someone other than themself.

References

GaryOS has maintained a steady stream of downloads since its debut in February 2014. It has also shown up in some notable places.

Hopefully, it will someday make these lists as well.

Snapshots of all discovered references to GaryOS are kept in artifacts/archive/. Please contact the author at gary-os@garybgenett.net with any other acknowledgments you find. The fact that you are reading this counts.

<!-- Unused, Tracking Only -->

Contributing

Contributions are welcome and will be publicly acknowledged.

Patches

To create patches there is a function in .bashrc. Submit patches to gary-os@garybgenett.net.

./.bashrc git-patch <parent commit>

The parent commit should be the last commit hash before your changes. This will create ####-* patch files for each commit since the parent. Email them as attachments. GitHub pull requests or links to commits in a forked repository also work.

Inclusivity

The author is passionate about who you are, your ideas, what you manifest, and how you carry yourself in the world. Come as you are. We are all just human beings.

Let's all just be kind to one another, so we someday won't even need documents like these.

Licensing

Starting with v4.0, GaryOS is released under the GNU GPL v3.0. It was originally released under a BSD-style license.

The FSF and GNU projects are dedicated to a completely open society based on open source computing. The GPL is a manifesto as much as it is a license.

The BSD philosophy is that BSD-style licenses are yet more permissive and foster the innovation of new technologies by allowing them to be driven by profit.

The original intent was to support the BSD philosophy. Switching to the GPL was predicated by a few factors.

For further details, see the current License or the licenses for the individual Versions.

The author and contributors do not offer any warranty. You take all responsibility for your use of this software. If it breaks, you own all the pieces.


Details

This is additional information mostly pertaining to how the GaryOS project is managed. It is not necessary reading in order to use any aspect of GaryOS, and is only for the curious.

If you read this section, the author would appreciate a note at gary-os@garybgenett.net.

Versioning

Version numbers follow Semantic Versioning. The major version number increments whenever the Portage tree commit is updated. Minor version numbers increment for release updates that are on the same Portage tree.

Revisions to the GaryOS Builder, Loader and Portage configuration will also line up with the Portage tree, since they can only be validated by doing a full build or a build update.

Repository

Here is an overview of the repository contents, in order of relative importance:

Project FilesPurpose
README.mdAll documentation
LICENSE.mdLicense for project and all patches
MakefilePrimary interface to Builder and Loader
packages.txtKernel packages, sizes and install information
packages.rootfs.txtRootfs packages, sizes and install information
_commitSolely for author tracking of source repositories
Key DirectoriesPurpose
grub/GNU GRUB menu files (for Boot, see GRUB)
linux/Linux Kernel configuration files
gentoo/Portage configuration, Builder and Loader
gentoo/overlay/Version management and fixing broken packages
scripts/GRUB and QEMU
artifacts/files/Loader scripts and Image configuration files
artifacts/patches/GaryOS features and improvements
artifacts/archive/Miscellaneous stash space, including References
artifacts/images/Icons and screenshots
Core FilesPurpose
.bashrcScripting library (author's Bash configuration)
scripts/grub.shGRUB backed worker script
linux/_configSimplifies Linux Kernel configuration updates
gentoo/_systemHeart and soul of Builder, and GaryOS itself
gentoo/_releaseHeart and soul of Loader (and publish process)
gentoo/_funtooGentoo Portage commit tracking
gentoo.configExample for "Edit" stage in Compile
gentoo/.emergentAudit script and information (see Builder)
gentoo/savedconfig/x11-wm/dwmSlightly modified dwm configuration
gentoo/sets/gary-osKernel packages, Loader and Image
gentoo/sets/_gary-osRootfs packages, Loader and Image
OtherPurpose
.vimrcKeeps this handy and also published online
xclock_size_hack.patchMake gkrellaclock look like xclock

The commit history for all these components reside in more than one personal repository. They are merged together into the public GaryOS Git repository by gentoo/_release. This means that even minor merging issues or the inclusion of new files will result in a public repository that can not 'fast-forward' and will require re-cloning.

<!-- Global Links -->

Tools

GaryOS relies on too many open source projects to count (see Project). However, there are a few primary tools and sites which are used to build and distribute GaryOS. An additional list of secondary items is in Ecosystem.

First and foremost, the projects which brought open source into the mainstream:

The backbones which do the real heavy lifting in GaryOS:

Kernel configuration, package lists and acknowledgments:

Special thanks to the sites which made worldwide distribution possible:

GitHub inspired the initial publication of this project, and SourceForge provided the distribution platform that made it possible to instantly reach an international audience.

Ecosystem

Beyond the Tools used to create and publish GaryOS, there is a small universe of projects that either provided inspiration or are used for GaryOS.

To start, homage to those who started it all:

Tomsrtbt was especially influential. GaryOS is modeled very much after Tom's project. Some familiar quotes straight from the tomsrtbt FAQ:

1) tomsrtbt is
   "The most GNU/Linux on one floppy disk"
   Tomsrtbt stands for:
     "Tom's floppy which has a root filesystem and is also bootable."

2) Design goals
   as much stuff as possible on 1 floppy disk
   keep it self contained, build under itself
   try to make it behave like a normal system
   rescue and recovery functions get priority

Thank you so much, Tom.

Inspiration and core concepts were also provided by:

Projects which are relied on daily for critical tasks or highly visible components, and deserve mention:

Gratitude to all those who have contributed to making GNU/Linux the most powerful and flexible operating system on the planet, and a true "run anywhere, anyhow" computing environment.


Release

This is additional information pertaining exclusively to how GaryOS is developed, tested and released. As the author evolved an ever more formal and repeatable process, it made sense to make this part of the public documentation.

Everything needed to perform these steps is in the Repository or the Downloads folder.

Process

Personal Build

Iterate {

}

Errors {

}

GaryOS Build

Validate { <kernel> <check> <option> <target>

}

Test & Publish

Rolling Builds

Retry {

}

Checklist

Everything in Booting, Running and Building should be validated below.

Compile

Linux / Virtual

GRUB / Filesystem

EFI

PXE

Windows / GRUB / Virtual

Networking / GUI

Update / Manage / Image / Install

Publish

Review

Commit

Verify {

}

Upload

Personal

Celebrate


Versions

v8.0 2024-05-16

Repository / Readme / License / Packages (Kernel) / Packages (Rootfs)

Kernelgary-os-v8.0-generic_64.kernel
Rootfsgary-os-v8.0-generic_64.rootfs
Bootgary-os-v8.0-generic_64.grub.zip
Diskgary-os-v8.0-generic_64.qcow2
Source Stage3gary-os-v8.0-generic_64.stage3.tar.xz
Source Portagegary-os-v8.0-generic_64.gentoo-repo.tar.xz

v7.0 2023-01-14

Repository / Readme / License / Packages (Kernel) / Packages (Tiny) / Packages (Rootfs)

Kernelgary-os-v7.0-generic_64.kernel
Kernel (Tiny)gary-os-v7.0-generic_64.tiny.kernel
Rootfsgary-os-v7.0-generic_64.rootfs
Bootgary-os-v7.0-generic_64.grub.zip
Source Stage3gary-os-v7.0-generic_64.stage3.tar.xz
Source Portagegary-os-v7.0-generic_64.gentoo-repo.tar.xz

v6.0 2021-09-12

Repository / Readme / License / Packages (Kernel) / Packages (Tiny) / Packages (Rootfs)

Kernelgary-os-v6.0-generic_64.kernel
Kernel (Tiny)gary-os-v6.0-generic_64.tiny.kernel
Rootfsgary-os-v6.0-generic_64.rootfs
Bootgary-os-v6.0-generic_64.grub.zip
Source Stage3gary-os-v6.0-generic_64.stage3.tar.xz
Source Portagegary-os-v6.0-generic_64.meta-repo.tar.xz

v5.0 2021-08-04

Repository / Readme / License / Packages (Kernel) / Packages (Rootfs)

Kernelgary-os-v5.0-generic_64.kernel
Rootfsgary-os-v5.0-generic_64.rootfs
Bootgary-os-v5.0-generic_64.grub.zip
Source Stage3stage3-generic_64-1.4-release-std-2019-10-28.tar.xz
Source Portagegary-os-v5.0-generic_64.meta-repo.tar.xz

v4.0 2021-07-26

Repository / Readme / License / Packages (Kernel) / Packages (Rootfs)

Kernelgary-os-v4.0-generic_64.kernel
Rootfsgary-os-v4.0-generic_64.rootfs
Bootgary-os-v4.0-generic_64.grub.zip
Source Stage3stage3-generic_64-funtoo-current-2018-09-30.tar.xz
Source Portagegary-os-v4.0-generic_64.meta-repo.tar.xz

v3.0 2015-03-16

Repository / Readme / License / Packages (64-bit) / Packages (32-bit)

Kernelgary-os-v3.0-generic_64.kernel
Kernel (32-bit)gary-os-v3.0-generic_32.kernel
Bootgrub.sh
Source Stage3stage3-core2_64-funtoo-stable-2015-01-27.tar.xz
Source Portageportage-21811b59a8484b2a6b73e0c5277f23c50a0141dc.0.tar.xz

v2.0 2014-06-19

Repository / Readme / License / Packages (64-bit) / Packages (32-bit)

Kernelgary-os-v2.0-generic_64.kernel
Kernel (32-bit)gary-os-v2.0-generic_32.kernel
Bootgrub.sh
Source Stage3stage3-core2_64-funtoo-stable-2014-01-13.tar.xz
Source Portageportage-873ca4a3a4e6ff41e510dbcf2e0fe549fb23474d.0.tar.xz

v1.1 2014-03-13

Repository / Readme / License

Kernelgary-os-v1.1-generic_64.kernel
Kernel (32-bit)gary-os-v1.1-generic_32.kernel
Bootgrub.sh
Source Stage3stage3-core2_64-funtoo-stable-2014-01-13.tar.xz
Source Portageportage-95ad4fd257697618bae7402d4bc3a27499035d30.4.tar.xz

v1.0 2014-02-28

Repository / Readme

Kernelgary-os-v1.0-generic_64.kernel
Kernel (32-bit)gary-os-v1.0-generic_32.kernel
Source Stage3stage3-core2_64-funtoo-stable-2014-01-13.tar.xz
Source Portageportage-95ad4fd257697618bae7402d4bc3a27499035d30.3.tar.xz

v0.3 2014-02-24

Repository

Kernelgary-os-v0.3-core2_64.kernel
Source Stage3stage3-core2_64-funtoo-stable-2014-01-13.tar.xz
Source Portageportage-95ad4fd257697618bae7402d4bc3a27499035d30.2.tar.xz

v0.2 2014-02-13

Repository

Kernelgary-os-v0.2-core2_64.kernel
Initrdgary-os-v0.2-core2_64.initrd
Source Stage3stage3-core2_64-funtoo-stable-2014-01-13.tar.xz
Source Portageportage-95ad4fd257697618bae7402d4bc3a27499035d30.1.tar.xz

v0.1 2014-02-09

Repository

Kernelgary-os-v0.1-core2_64.kernel
Initrdgary-os-v0.1-core2_64.initrd
Source Stage3stage3-core2_64-funtoo-stable-2014-01-13.tar.xz
Source Portageportage-95ad4fd257697618bae7402d4bc3a27499035d30.0.tar.xz

End Of File