Barcode
Parts
scripts
ide boot ISO
Legal
License
Cryptography
Screenshots
grub
desktop
skippy-xd
art
Community
Join

Lug-Nuts
gn*nix is not a *nix, it's a nux!

The generic professional strength OS in the black and white wrapper.

News briefs:
08/27/06 Yup, I did a distro once, well more I scripted a distro build system, you updated one machine, ran gn*nix there, produce a binary set on a disk or flash card to update a bunch of devices such as the cart with it which is the roots of this and how it all began. Was fun, learned a lot, it's just a lot more work keeping it up to date than I want to continue putting in and would rather be working on a video game. These are the remnants of gnnix.org, enjoy, there's a few good innovations and tools in here like gnxconfig, the disk carvulator and gnxinitramfs still relevant, I'll cut them out and make them work for a few other distros some day or just help yourself.
02/15/06 gnxinitramfs passes the smoke test, gnnix uses the initial ram file system instead of the old initial ram disk coupled with user space devices so /dev contains only the current running hardware. The initial ram file system builder tool gnxinitramfs is completely menu driven too, pick a kernel, pick a few devices, hit ok to link as default or runs in completely automatic mode as during the initial install.
01/19/06Slicing from a dynamic disk map testing concept script.
01/15/06Next steps and new to version 0.8 will be:
  1. Auto partitioning. 0.7 leaves all disk slicing up to the admin in cfdisk or fdisk. It should size up the available targets and install the recommended format if requested. This will most likely be a minimal sized old school style layout with lots of separate file systems which will help in the next step.
  2. Logical volume management. It should do a minimal sized layout and leave the balance to be doled out as needed later.
  3. Xen. It should be able to just mount the cd and do a minimal system install into a target directory on an already running system and use a Xenified kernel. Thanks to the help and effort Brie.
  4. Finish a desktop. Integrate a minimal set of apps with a wm. Probably switch to Enlightenment.
  5. Keep adding to the manifesto.
01/03/06The effort continues. After reaching our original goals and a 4 month hiatus it's time to take stock and look at the next phase for the project. So far we have the complete distro builder tool:
  • Scripted the entire LFS tool chain build process.
  • Automated the os components build.
  • Simplified integration and addition of os components.
  • locknload shortest path one shot system installation tool that dynamically configures itself to the hardware and packages available on the disk and able to restart anywhere in the process getting most of it's information from the fstab file.
  • The gnnix example distro featuring:
    • gnxconfig, the one file to rule them all configuration system.
    • Simpleinit for booting all procs in parallel using the needs and provides concept instead of system V so it launches like a rocket!
    • iptables fully integrated with gnxconfig one file configuration so it comes fully armed and defends itself right out of the box, super simple single or full blown multiple network interfaces routing firewall.
    • Xorg and XFCE are installed but remain unconfigured. To finish a 0.7 desktop installation you run xconfigurator, (mouse is /dev/psaux), then startxfce4. Add the line,
      Option "ZAxisMapping" "4 5"
      to the, "input device", section in /etc/X11/xorg.conf to support a mouse with a wheel for a middle button.
  • And the entire project implemented using C and Shell script.
2005 news archive
2004 news archive

The Gnnix Manifesto

So what's gn*nix?
gn*nix is not a *nix, rather it is a set of scripts and programs to manage the work flow of integrating a collection of open source software to produce a *nix. What is unique to gn*nix and separates it from the masses of gnu/linux build systems is in the delivery. It does not produce a gnu/linux on just one machine, instead it's end product is a bootable iso cdrom image you can burn and boot to quickly and easily build many custom gnu/linux systems enabling one to spread it across an entire enterprise with minimal effort. It produces gnnix, the minimalist core system you can base system profiles on according to the type of work you need to get done.
And the gnnix-<version> is what?
The proof of concept gnu/linux OS. It's named gnnix, (confusing yes but it saves on domain name registration). It's the end product of the gn*nix system, unencumbered by restrictive licensing, pure in form and simple in design yet far advanced with enterprise wide distribution and zero maintenance uppermost in mind. The specification for it is derived from what form the project lead thinks the linux of the future should take based on polling the membership of the Sacramento Linux Users Group at the monthly meetings with the occasional demo and the volume/temperature of flame on the lug-nuts mailing list. The heart and mission of the gn*nix system is to easily adapt and keep gnnix at the cutting edge with the latest libraries and tool set that can successfully build without errors or side effects. The iso image contains not only a custom installer but all the scripts used to build it, a catalog of all files, md5 signatures, size, permissions, location by component in convenient XML to be used to repair, resurrect and certify a box after being compromised.
The current incarnation of the sample OS known as gnnix is the personal *nix I always wanted. Raw and unfettered, full tool set and libraries to build anything under the sun, clean well integrated desk set providing the minimal set of applications to get some work done wrapped in smoking hot eye-candy I can turn on or off at will. Install all, just the base server or it and add mail server, graphic workstation or web application server packs. In the gn*nix system you can create custom packs or edit the examples just by creating and filling or emptying a directory.
What the hell were you thinking?
I built a few servers and appliances, using straight off the net distributions to base all my efforts on. Redhat for servers, Midori for the shopping carts etc. I built on top of them, with a modified rpmfind and an rdf server I'd set up an internal rpmfind.net, rpm packaged the corporate software and automated UPdates across the enterprise at several large companies mimicking systems I'd built previously on top of Sun pkg tools. Midori was a joy for configuration with it's point and click browser interface but integrating new components and bringing it up to date was not trivial requiring the complete re-packaging of the source and creating around a half dozen text files for each one. Upgrades were not forthcoming, it was up to you to maintain the components and the framework, a lot for one guy, the project gradually all but disappeared when I needed to go to 2.6, things were evolving faster than I could keep up. Suddenly Redhat pulled the plug on the distro I'd been recommending to all my clients, poof, suddenly everybody and their brother started calling, "what are we going to do", "why didn't you warn us blah blah blah". Ok no problem, switch to Slackware was my first instinct, wait there's no bleeding PAM to use the openldap for centrally managing user accounts. Whitebox wasn't out, it looked like I would have to support it all myself. Looking around for another mainstream distro turned up Mandrake, excellent product, but a foriegn country, still why not, oh wait they're in bankruptcy, I'd probably wind up in the same boat again when they go under. It dawned on me that a linux distro is as permanent as a sand painting and to base all my efforts on such impermanence was sheer folly. I decided the best distro is no distro at all which brought me to Linux From Scratch. A wonderful book, real page turner revealing dark magic with every chapter. So I built one, hey zeus what a load of work, repetitive mind numbing work, easy to make a mistake and start all over and over bunch of work. Such focus as needed to complete the task in the MTV generation is a rare trait indeed but after perservering when all the bits settled and the smoke cleared I had my very own linux box built my way, it was an awsome feeling. Then reality set in. it was one linux box. Thoughts of repeating this task in a reliable fashion over and over made me check to see if the window opened, fortunately it was only a second floor drop. I needed packaging and automation. There was a Automated Linux From Scratch project but it used a fat scripting engine and stored everything in XML. I'm the XML guy, but everything has it's place and I saw absolutely no benefit at all from using it here. Reliance on fat scripting engines, like php, python or perl is to add a huge ground floor dependency, build in obsolescence and just make more maintenance work than they alleviate as they continually evolve and make you re-write all your scripts. I was determined to do it all in shell, the one consistent environment in the history of *nix everyone knows, can extend and easily adapt. That and some of the smaller projects have absolutely no room for such tools and I wanted it to be truly, "one size fits all". All you need to know is a little C and a lot of shell script to maintain and grow gn*nix, it's target audience is system administrators and *nix maintainers. You already know how.
But wait there's more...
locknload the installer is flexible, short, sweet, completely menu driven and in text mode. It adapts itself to the contents of the cdrom so it's almost maintenance free. Adding different application packs to the installer is as easy as creating/filling/emptying a directory. Defaults to Silicon Graphics rugged XFS file system and component selection is in groups. Load your drivers, generate an fstab file then exit locknload and use the gnxmount/gnxumount tools for fast easy system rescue too.

gnx init No confusing maze of SysV run-level links to maintain rather gnnix uses simpleinit based on the needs and provides concept to launch all startup processes in parallel taking around 8 seconds. The, 'display-services', command (aliased to 'ds'), lets you know what running and in what state. Turning services off and on is as easy as chmod -/+x /sbin/init.d/<service name>.

gnx firewall Quick and easy firewall set up for one or more nics with simple text tables in /etc/firewall. They're already filled in for most purposes, just uncomment the services you offer and plug it into the net. Adapts to DHCP changes too, changing addresses is never a problem.

gnx zips The packaging of gnnix is simple also, a pkzip file of all files from the root with the top most slash missing and a plain text .files list of the contents. There is included an xml file that describes every file in the finest detail complete with checksums to be used by the, "easter kit", to quickly determine a compromised system, perform an exorcism or exsanguinate and replace different versions completely.

/etc/gnxconfig is the one file to edit with gnx-config the one command to run and an entire system is completely personalized and configured. This includes hosts, resolver, network, firewall, routing, mail and more.

gnxinitramfs Quick and painless initial ram file system, no archaic initrd, initramfs creation is all menu driven too, pick a kernel, pick your drivers, pick build to install. User device and hotplug for the widest array of semi-intelligent hardware recognition and automatic module loading with a super modular kernel.

var/gnx/<component_name>-<version>.files List of all the files installed organized by component and version for quick location, checking, removal.

Way of the gn*nix build system

Color enlargement
or SVG
The starting point of is the gnnix directory below that are three directories, tiny, base and tool.

tool is for the scripts to build the toolchain, boot system with installer and the cdrom.

tiny is the uClibc toolchain which is chrooted to build the tiny ram disk linux and the tools used by the locknload installer.

base contains boot, install and root.

base/boot is a scratch directory used to build the mini installer system in with the mkroot command.

base/install contains the locknload installer and all the scripts used by it to build the target system from the iso cd that tool/mkroot copies into the base/boot directory.

base/root is the root directory of the iso cdrom image and holds the dist directory which is the chrooted system the gnnix binary distribution is built in.

base/root/isolinux is the boot loader that launches the busybox uClibc boot system made by mkroot which starts the locknload installer from it's /linuxrc file. To fully understand this process read the book Making Linux Installation Disks for Fun and Profit by Lennart Benschop, the sequel to, Getting Linux Into Small Machines. and consult the CTDP Linux Startup Manual for an overview of the boot process. Dated but enlightening.

base/root/dist/tool is the toolchain used to bootstrap a different version of C libraries than the machine you're build gnnix on. base/root/dist/tool/ is first built on /tool, (very important), with the tool/mkchain-<version> command, then mv /tool to /base/root/dist/tool but it's basically Linux_From_Scratch chapters 1-6 with a lot less typing. Read the book to fully understand the build process is a must.

base/root/dist is where you will build the binaries and is chrooted into with the tool/chdist command. You will have to prime the pump with a ln -s tool/bin/bash bin/sh in the dist directory to get the gnxbuild party started.

base/root/dist/parts/src is where all the open source code components downloaded from the internet are. I convert them all to tar.bz2 to save a bit of space and be consistent, there is a gzbz command to help. I insist on <name.tar.bz2> unpacks into <name> but there are exceptions and it's easy to make allowances for them.

base/root/dist/parts/patches is where all the patches to combine with the source code downloaded from the internet. Linux_From_Scratch is a great source for patches. You basically take the component and untar it in dist/usr/src/ mv it to .orig. Untar another in the same place, hack the hell out of it until it's how you need it then create a patch with a, "diff -Naur <name>.orig <name>", and mv it to dist/parts/patches and wipe out both directories <name> and <name.orig>. The way of gn*nix is the directory is wiped out and a fresh copy of the source is unpacked and all patches applied in every build cycle. This makes it much easier to change component versions.

dist/gnxbuild is where all the gnxbuild and all it's scripts live. Once the toolchain is created, mv'ed to dist/tool and the layout is created, filled with the gnx scripts you cd to the gnnix directory at the very top of the tree where base tool and tiny are, source the tool/gnxenv script which you edit to your layout, the one supplied assumes /usr/local/gnnix as in:

#!/bin/sh
BUILD=gnnix-0.6
GNNIX=/usr/local/gnnix
ROOT=/usr/local/gnnix/base/root
DIST=/usr/local/gnnix/base/root/dist
BOOT=/usr/local/gnnix/base/boot
PATCH=/usr/local/gnnix/base/root/dist/parts/patches
UCLIB=/usr/local/gnnix/tiny
KVER=2.6.7
HOTPLUG=hotplug-2004_04_01
export GNNIX BUILD ROOT BOOT UCLIB PATCH KVER HOTPLUG
echo GNNIX=${GNNIX}
echo BUILD=${BUILD}
echo ROOT=${ROOT}
echo DIST=${DIST}
echo BOOT=${BOOT}
echo PATCH=${PATCH}
echo UCLIB=${UCLIB}
echo KVER=${KVER}
echo HOTPLUG=${HOTPLUG}
alias g='cd /usr/local/gnnix'
Once you've sourced the environment with a . tool/gnxenv you are ready to chroot the gnnix environment with a tool/chdist puts you into the root of the distro system ready to cd gnxbuild then run ./gnxbuild to build your entire distro. Once built, use gnxwrap <filelist> to gnxzip them up and move the gnxzips to $ROOT/parts/bin/<base_or_whatever_grouping_you_want_in_the_installer_menu>.
Finally change to the $GNNIX root directory and execute the steps:
#!/bin/sh
. tool/gnxenv
# if new kernel pass a -k argument to mkroot
tool/mkroot $1
tool/mkird
tool/mkiso
The mkroot command build the installer initial uClibc, Busybox system. The mkird command turns it into an initial ram disk image and the mkiso turns it all into a burnable cdrom iso file.

Adding A New System Component

Add a definition to the bottom of gnxversions with a unique name = name-version sans .tar.gz of the source component in $DIST/parts/src. Follow the other names example.
if for example all that is needed for a component you added as $SIMP=name-version in gnxversions is the simplest:
configure
make
make install
then add an entry of:
if gnxcheck $SIMP; then gnxsimple $SIMP <extra arguments to pass to configure>; fi
to the bottom of gnxbuild and run it. Next:
cd /; gnxbuild/gnxwrap var/gnx/<name>-<version>.files
will create the system component file in /parts/binunstripped and
cd /;gnxbuild/gnxwrap <--nostrip or --redo or nothing to strip all> var/gnx/<name>-<version>.files
will create the debug stripped version ready for distribution in /parts/bin

Beyond The Simplest Build Requirements

If you need anything beyond the simple example above such as patches etc. consult the many examples and how they interact in the gnxbuild directory, note the specs rewrite and double building of core-utils. The above gnxsimple function in the gnxfuncs file expands into

gnxsimple(){
gnxunwrap ${1}
gnxfilelist start ${1}
gnxconfigure --prefix=${PREFIX}
gnxmake
if [ "${2}" == "check" ]; then
 gnxmake check
fi
gnxmake install
gnxfilelist finish ${1}
}
The functions in the file gnxfuncs are the major pieces of the build process used to write your own function in a file to be included in gnxbuild as:

gnxunwrap $SIMP - this blows away any previous attempts and untar/gzips the source code from the /parts/src directory into /usr/src/ and will leave you in the /usr/src/ directory. The source <name-version>.tar.gz should match the <name-version> directory it will expand into, rename the file if you must to make this so.

gnxfilelist start $SIMP - this must be next and creates a /tmp/.start file for use by gnxfilelist finish $SIMP later.

We then wait 60 seconds because find is rather stupid and we need a good margin for our filelist marker.

gnxconfigure <any options for configure to bend its will to our purpose>

gnxmake <any arguments to make needed>

then either move the output files as needed or

gnxmake install

or whatever is needed to install the component and finally

gnxfilelist finish $SIMP - this will create a /var/gnx/<name-version>.files list.

Call these all you want with any args needed just be sure it's between the filelist commands and you should be ready to gnxwrap the results.

Changing To A Newer Kernel

Upgrading to a newer kernel is the most complicated operation in gn*nix and gives a good overview of how it's all put together. There are more than a dozen steps and the process touches all parts of the gnnix build system.

  1. First edit the $GNNIX/tool/gnxenv file KVER= line to the version of kernel you want.
    $ cd $GNNIX (/usr/local/gnnix or wherever your build home is)
    $ vi tool/gnxenv
    
  2. Most important step in any gnnix maintenance is always to source the gnx environment.
    $ . tool/gnxenv
    
  3. Download the latest stable kernel source.
    $ cd $DIST/parts/src
    $ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-${KVER}.tar.bz2
    
  4. Download the matching libc-headers.
    $ wget http://ep09.pld-linux.org/~mmazur/linux-libc-headers/linux-libc-headers-<version>.tar.bz2
    
  5. Unpack the kernel source in the gnxbootscript package usr/src directory, copy the previous configuration into the new kernel then merge the old config and create a new one.
    $ cd $DIST/usr/src/gnxbootscripts-<version>/usr/src
    $ tar xvfj $DIST/parts/src/linux-${KVER}.tar.bz2
    $ cp kernel.dot.config linux-${KVER}/.config
    $ make oldconfig
    
    Answer m to all modules and no pretty much to everything else unless you recognize it.
  6. Switch to the chrooted gnnix distro build system
    $ cd /usr/local/gnnix (or wherever your build home is)
    $ tool/chdist
    
  7. Change to the gnxbuild home directory
    $ cd /gnxbuild
    
  8. Edit the gnxversions file and update the version to the new package you downloaded
    $ vi gnxversions
    
  9. Copy the old version build script and make a new script
    $ cp linux-libc-headers- linux-libc-headers-<new.version>
    
  10. Remove all of the old files
    $ cat /var/gnx/linux-libc-headers-<old.version>.files | while read i
    > do
    > rm $i
    > done
    
  11. Now bring the entire distro up to date.
    $ ./gnxbuild
    
  12. Wrap the linux-libc-headers component.
    $ cd /
    $ gnxbuild/gnxwrap var/gnx/linux-libc-headers-<old.version>.files
    
  13. Move the wrapped component to here the installer will find it. First exit the chrooted distro build system
    $ exit
    $ cd $DIST/parts/bin/
    $ mv *.gnx $ROOT/parts/bin/base
    
  14. Change to the root of the gnxbootscripts system component. First chamge back to the root of the distro build system.
    $ cd $GNNIX
    $ tool/chdist
    $ cd usr/src/gnxbootscripts-<version>/
    
  15. Edit the KVER=<version> line in the files installk.sh and update.sh
    $ vi installk.sh
    $ vi update.sh
    
  16. Build and install the new kernel.
    $ ./installk.sh
    
  17. Update the gnxbootscripts package but first you must exit the chrooted distro.
    $ exit
    $ cd $DIST/usr/src/gnxbootscripts-<version>/
    $ ./update.sh
    
At this point we've updated the kernel and it's headers that will be distributed in the ISO image to be installed on the target servers and clients. Now to update the kernel used to boot and install those targets.
  1. First source the environment if you haven't already.
    $ cd $GNNIX
    $ . tool/gnxenv
    
  2. Change back into the chrooted distro build system.
    $ tool/chdist
    
  3. Unpack another copy of the kernel source.
    $ cd /usr/src/
    $ tar xvfj /parts/src/linux-${KVER}.tar.bz2
    
  4. Start with the previous configuration, merge with the new and edit to suit your targets, this is the kernel the cdrom will boot so it must accomodate enough to run the installer everywhere you want it to run.
    $ cd linux-{$KVER}
    $ cp ../linux-<old.version>/.config .
    $ make oldconfig
    $ make menuconfig
    
You are now ready to build the iso. Since the kernel has been changed we'll add a '-k' argument to the mkroot command. First we make the root of the boot image, then the initial ramdisk of it, finally the ISO image to be downloaded and burned to a cdrom.
$ cd $GNNIX
$ . tool/gnxenv
$ tool/mkroot -k
$ tool/mkird
$ tool/mkiso

The finished product is in $GNNIX/iso/$BUILD.iso and it's signature in $GNNIX/iso/$BUILD.md5 Burn a cdrom to test/use with the following command changed to fit your device settings.

$ cdrecord -v speed=8 dev=ATAPI:0,0 $GNNIX/iso/$BUILD.iso

Creating A Higher Version

  1. Change the build line in tool/gnxenv
    BUILD=gnnix-0.8
    
  2. Add a line to exclude earlier version xml to tool/mkiso
    -x $ROOT/parts/xml/0.7 \
    
  3. If updating the tool chain you should reference it in $GNNIX/updatetoolscripts
    $ cp tool/mkchain-0.5 $ROOT/tool/scripts/mkchain
    
  4. Edit $DIST/usr/src/gnxbootscripts-$GVER/installk.sh and update the line:
    GVER=$OLDGVER
    
    to your new version number
  5. In $DIST/usr/src/gnxbootscripts-$GVER/update.sh update the line:
    GVER=$OLDGVER
    
  6. Create a new version of the package that makes our distro unique
    $ cp -a $DIST/usr/src/gnxbootscripts-$OLDGVER $DIST/usr/src/gnxbootscripts-$GVER
    
  7. Delete old kernels to conserve space.
    $ rm -rf $DIST/usr/src/gnxbootscripts-$OLDGVER/usr/src
    
  8. Now we are ready to build our new version
    cd $GNNIX 
    tool/chdist
    # you should now be in the chrooted build system
    cd /usr/src/gnxbootscripts-$GVER
    sh installk.sh
    # you should now leave the chrooted build system
    exit
    cd $DIST/usr/src/gnxbootscripts-$GVER
    ./update.sh
    # now clean up the previous version package
    rm  $ROOT/parts/bin/base/gnxbootscripts-$OLDGVER
    # if you'r not rebuilding everything 
    cp -a $ROOT/parts/xml/$OLDGVER $ROOT/parts/xml/$GVER
    
  9. Execute the build steps:
    cd $GNNIX
    tool/mkroot -k
    tool/mkird
    tool/mkiso
    
Your new ISO image can be found in $GNNIX/iso/. Use a command like
$ CDRW=`cdrecord --scanbus 2>/dev/null | grep CD-RW | while read i; do set $i; echo $1; done`
$ cdrecord -v speed=8 dev=ATAPI:$CDRW  $GNNIX/iso/$1
or for SCSI
$ cdrecord -v speed=8 dev=$CDRW $GNNIX/iso/$1
to create a bootable CD.

Other Scripts Besides gnxbuild And It's Parts

gnxbuild/gnxwrap with the options of either --nostrip to skip stripping of debug information from executables or --redo if this is a rebuild with a modified list or nothing to strip and make your component ready for inclusion with the distribution by copying the $DIST/parts/bin/<name>-<version>.gnx file to $ROOT/parts/bin/<collection> where collection is the option set you want it included in on the installer menu. There is a directory below gnxbuild named gnxcept where you can put package-name-version files containing lists of files you don't want included in wrapping. Use this feature to eliminate any duplicate files that will cause the installer to pause for a yes/no overwrite file keypress.

gnxnew <component name>-<version> - this creates a skeleton of the simple function in a file with the component name to be edited by you and used in gnxbuild for more complicated builds with an entry like:
if gnxcheck $XFGUI4; then . ./$XFGUI4; gnxxfgui4 $XFGUI4; fi

gnxpaths - creates the basic directory structure and whatever files are needed to pass the tests.

gnxdevs - creates a minimal /dev contents.

gnxpamconf - creates minimal pam configuration file setup

gzbz - convert tar.gz files to tar.bz2 files to save a few bytes

gnxdupes - thrashes the hell out of the /var/gnx file lists to produce a list of all duplicate entries for you to make a few decisions on each offending components turf and additions to the gnxcept directory below gnxbuild.

More later...Sphinx - last update April 7 2006


ExitCertified Gn*Nix Training
J&P Cycles - Parts for your Harley-Davidson