Piren was made to be as general as possible, because every user have specific needs or goals to achieve. For this reason, Piren customization is an easy procedure that is not only possible but also suggested.
Along with any standard Piren distribution you can find "piren-remaster", available also as a Debian package usually placed in the "tools" subdirectory of the live cdrom: it is all you need to transform Piren in your ideal Home Theatre or Home Server platform.
This tool is based upon UCK - Ubuntu Customization Kit, but it is quite different from this application: it is a simple command line utility that can modify the original Piren live distribution using an high level interface. To see a short list of things that piren-remaster can do, just call it without any argument:
Usage: ./piren-remaster
Available commands:
./piren-remaster purge [remaster-dir]
./piren-remaster unpack_iso [remaster-dir] [file.iso]
./piren-remaster unpack_initrd [remaster-dir]
./piren-remaster unpack_rootfs [remaster-dir]
./piren-remaster chroot [remaster-dir] [what-to-execute]
./piren-remaster clean_rootfs [remaster-dir]
./piren-remaster undeb_rootfs [remaster-dir]
./piren-remaster pack_rootfs [remaster-dir]
./piren-remaster undeb_initrd [remaster-dir]
./piren-remaster pack_initrd [remaster-dir]
./piren-remaster pack_iso [remaster-dir] [file.iso]
./piren-remaster pack_deb [remaster-dir] [file.deb]
./piren-remaster install remaster-dir install-device
./piren-remaster debianize remaster-dir install-device
where install-device can be "/dev/sda1", take care...
The default value for [remaster-dir] is "~/tmp/".
Don't worry if you find this syntax quite difficult to understand: in this document you will discover a practical guide to customize Piren and making your own distribution using piren-remaster.
DSL packages are the simplest way to customize a Piren distribution. The DSL package format was introduced by Damn Small Linux, a smart 50 Mb distribution that provides a full desktop system.
Creating a DSL package, you can store your customizations, new software or configuration files and let them loaded automatically on boot, virtually replacing previous content on file-system. A DSL packages is a simple tar.gz file that will be exploded in the root of your file-system. Then only difference between a tar.gz file and a DSL package is the file extension: to let them work properly under Piren, you should ensure that the file name ends with ".dsl", lowercase letters. Every file that is present in the archive will be copied in RAM, and the system will take care to its content.
In the /live/cow directory you will find a collection of every file that you (or the system in your interest) created or modified. It's a good source to create a snapshot DSL, that will save your customization.
But, after creating a DSL package, how can you store it inside the ISO? Of course, using piren-remaster.
Before using this tools you should consider how much disk space you will need. Typically it should be at least 512 Mb, even more if you plan to add more software to the standard distributions. In our example we will stay with default settings: this means that your files will be placed under the "~/tmp" directory. Being a default settings, you will need to specify it just once.
The first thing to do is unpacking the original ISO image. Let's write the following command to accomplish it:
mkdir /home/tmp
piren-remaster unpack_iso ~/tmp /dev/cdrom
Now you have a copy of your original Piren cdrom inside "~/tmp/iso".
To install DSL packages, you have to copy them to the "~/tmp/iso/live" directory and build your new iso with the following command:
piren-remaster pack_iso
You will find the ISO image file inside "~/tmp/new_files".
DSL packages can be useful for simple customizations, but if you want to provide more features you should follow another way: changing the root file-system with piren-remaster. The first thing to do is unpacking the squashfs image that is the main core of Piren:
piren-remaster unpack_rootfs
Now you can chroot into the file-system:
piren-remaster chroot
And install packages you need (remember to run "apt-get update" first) or do whatever you want:
apt-get update
apt-get install ...
Once exited the shell, you can pack the new file-system with:
piren-remaster pack_rootfs
You should already know how to generate a new ISO image:
piren-remaster pack_iso
If you want to change default locale you simple need to provide a file named "~/tmp/locale" that contain the two letters code for desired settings. So, if you plan to get a Dutch environment by default, you can use this command:
echo "nl" > ~/tmp/locale
If you specify more than one locale, the first one is used by default but the others will be still available also if you plan to generate an appliance. Different locales can be selected on boot adding a locale=id boot parameter, where "id" can be something like "nl" or "it".
You should already know how to generate a new ISO image:
piren-remaster pack_iso
If you want to change the ISO label, you simple need to provide a file named "~/tmp/description" that contain the string you want:
echo "My Own Piren" > ~/tmp/description
You should already know how to generate a new ISO image:
piren-remaster pack_iso