Lately, I've been seriously involved in the development of automated package building infrastructures. I wrote a set of scripts which built, trimmed and packaged pretty much anything. I even made a magical script which takes a Puppy ISO and the matching devx module and uses them to build packages, so you can build packages for a Puppy version different from the one you use.
Some time ago I had a brilliant idea: if we have remastering tools and the means for automated package building on any Puppy for any Puppy, why don't we combine the three to form the ultimate remastering tool?
I decide to implement this idea in a tool, which takes a Puppy, builds your favorite packages inside it (so they're 100% compatible with it), optimizes it (strips all binary files, optimizes all images, re-compresses all archives, etc') and produces an optimized puplet with lower memory requirements and small size.
It is in alpha quality; use with care. Any damage done to your system is under your responsibility; if you don't agree with this, don't use it.
The tool is not meant for novice users; use it only if you have a certain degree of experience with Puppy, package building, package creation and remastering.
How It Does Whatever It Does
It's simple. In the UNIX family of operating systems (which includes Puppy), there is a cool utility called "chroot", which runs a command and changes the file system root it sees. For example, if you run this:
Code: Select all
chroot /path/to/directory /path/to/executable a b c
Now, imagine a Puppy is extracted to a large partition with the devx module loaded on top of it, as in a running Puppy. If you use chroot with such setup, you can use this environment to build packages; the only thing you need is an automated way to build packages; that's where Builder fits in.
Builder is a simple tool I wrote for building packages. It receives one command-line argument, which is the path to a script which defines how to build a certain package.
Here's an example for a script skeleton:
Code: Select all
#!/bin/sh
PKG_NAME="mplayer"
PKG_VER="svn$(date +%d%m%Y)"
PKG_REV="1"
PKG_DESC="Multimedia player"
PKG_CAT="Multimedia"
PKG_DEPS="+yad"
download() {
...
}
build() {
...
}
package() {
...
}
Builder prepares a build directory and builds each package according to the magic recipe contained in its build script. Once it's done, Builder trims the package, splits it and compresses it. It is 100% automatic.
In short, the remastering tool extracts the Puppy you give it, then uses chroot with Builder to build your desired packages inside it. Then, it trims and optimizes it; unneeded documentation and some useless files are removed to reduce its size.
Finally, the puplet is created from the extracted Puppy.
System Requirements
- squashfs-tools 4.1 or above, with support for at least one compression method. Make sure it supports the "-comp" option; if it doesn't, install a newer version. This one should be just fine.
- Wary, Slacko, dpup or any Puppy built with a recent Woof.
- Some build scripts require xz-utils, Git and Subversion.
Limitations
In its current implementation, the remastering tool has several limitations:
- It doesn't deal with dependencies; you have to build the packages in the right order if they depend on each other.
- It doesn't have a name :p
Included Build Scripts
- Develpment: AdvanceCOMP, OptiPNG.
- Fun: DOSBox, ScummVM and OpenTTD.
- Utilities: Galculator, gHasher, TrayFreq, Xarchiver, rxvt-unicode, emelFM2.
- Documents: Leafpad, Zathura.
- System tools: LXTask.
- Multimedia: Aumix, DeaDBeeF, FFmpeg, MPlayer, TiMidity++, freepats.
- Misc. stuff: file, Squashfs, syslinux, dhcpcd, Yad.
- Graphics: mtPaint, XSane, Viewnior.
- Desktop: LXAppearance.
- Fonts: Liberation, Ubuntu, Libertine, DejaVu, font-bh-ttf, FreeFont.
- Internet: Seamonkey, youtube-dl.
Desktop stuff:
- Window Maker: Window Maker, AlsaMixer.app, asmon, wmclock, wmsystemtray.
The included build scripts allow you to transform a Puppy into something very similar to Next Puppy, a minimalistic dpup puplet with Window Maker.
Notes
- The trimming script assumes you have Builder and all its dependencies available on the host distribution used to run the remastering tool. If you don't, simply copy the contents of the Builder directory to / and install both AdvanceCOMP and OptiPNG if you want to optimize your puplet. Bear in mind that puplets created using the remastering tool are "self hosting" and should have all those built-in, so they can be used to create the next versions of your puplet without any additional effort.
- If you read the list of included build scripts, the tool is able to build DOSBox and ScummVM, which are great if you're into retro DOS gaming. I also wrote build scripts for TiMidity++ and freepats (which contains sound samples), which provide MIDI emulation through software. It is useful since most modern sound cards lack the MIDI support that was popular back at the DOS era; most DOS use MIDI for music and sound effects.
- The MPlayer package built using the script can be built statically, without an external FFmpeg. This saves lots of space and some RAM.
- The MPlayer build script also installs a script called "mplayer_shell", which includes a file chooser that makes it easier to use the "mplayer" binary when GNOME MPlayer or any other GUI frontend is missing. It depends on Yad, so make sure you have it, too.
- The Seamonkey package is built from the static, official binary packages provided by Mozilla and not compiled, since it takes ages and because it updates so often it makes no sense to compile it on your own. Also, when you build it yourself, the updater is missing. Moreover - the official binaries are optimized for size, so there's very little (if any) difference in the result package size.
- The font packages are huge, especially the DejaVu fonts; use with care. For the best balance between small size and looks, go for the DejaVu and Liberation fonts.
- At the moment, the tool does not support selection of the default wallpaper, GTK theme, window manager theme, etc'.
- At the moment, the tool deletes all wallpapers in /usr/share/backgrounds, because they waste lots of space. I can change this behavior to make it keep only the default wallpaper.
How to Use It
Using the tool is very simple. Start by editing the configuration file.
Code: Select all
defaulttexteditor config
Once the configuration file is ready, run the extraction script to fully extract the Puppy you are remastering.
Code: Select all
./0extract
Code: Select all
./0extract clean
Code: Select all
./1prepare
As with 0extract, you can always clean up the directories created by 1prepare using the "clean" option:
Code: Select all
./1prepare clean
Once the build environment is ready, you can proceed to the package building stage:
Code: Select all
./2build package
Regarding the packages you can build, you can find all included build scripts under builder/var/builder. Of course, you can add your own build scripts to that directory. Just take a look at the existing ones to see how to write one. It's very easy.
In order to produce smaller and faster packages, build AdvanceCOMP and OptiPNG and make sure you build the former twice. AdvanceCOMP is used for optimizing packages (or more percisely, to compress them better), so you'll need to build it again to make it optimize its own package.
Of course, you can always clean up the working directory used for building packages using the "clean" option:
Code: Select all
./2build clean
Code: Select all
./1prepare clean
Then, you can call the trimming script:
Code: Select all
./3strip
Finally, call the puplet building script:
Code: Select all
./4builddistro
You can easily clean the output of 4builddistro using the "clean" option:
Code: Select all
./4builddistro clean
Does it work with Lucid Puppy?
I don't know, since Lucid Puppy was built using an older Woof. I think it won't work. The only thing I can say for sure is that Lucid Puppy supports only gzip compression.
Regarding Puppy 4.3.1 and older - I'm confident it won't work.
Which compression should I use?
Traditionally, Puppy uses gzip compression, which provides a good balance between performance and the puplet size. It is the sane default you should use if unsure.
You can also use XZ compression, which provides much better compression at the cost of time and speed. It requires Linux 2.6.38 and above; it is good for USB installations, since the bottleneck in many cases is the slow reading speed - if the puplet is smaller, less time is spent on reading it from the slow flash drive.
Also, there's LZO compression, my personal favorite - it is supported on Linux 2.6.36 and above and provides insanely fast decompression. It makes your puplet way faster, but much bigger. I think it's nice to have a LZO-compressed flavor for a puplet, for those who use it for hard drive installations and don't care much about size.
If you're still unsure after this explanation - try all. You'll find out that LZO is very fast and comfortable to work with, XZ produces smaller puplets at the cost of very long compression times and some loss of performance, while gzip is well-balanced.
Can I use it to optimize my Puppy?
Yes, you can use this tool just to optimize a Puppy, without building any packages.
Which packages should I choose?
As mentioned earlier: I suggest you to always include AdvanceCOMP and OptiPNG and build the former twice.
Regarding the rest, the answer is simple: listen to your heart.
How long does it take to build a puplet?
It depends on how fast your machine is, the compression you use, whether you run the 3strip script and your choice of packages.
Does it remaster the devx?
Yes, it does.
Can I use it with a Puppy that has a zdrv module?
Maybe; this feature exists but I haven't tested it.