Attention: We are affected by this launchpad bug. This causes that if you use directly agarfu's ppa your distro wont be correctly build. We recommend you generate all unidistro debs locally and add them to your local repository until this bug is fixed.
Unidistro goal is to develope a infrastructure or framework to create distros. This projects was an effort of some universities, so the project's name is a mix between university and distribution.
At this time Unidistro is being developed at launchpad. You can see the project page.
TODO
Write more documentation, there are some no documented cool features, like the ~/.unidistro configuration files and <directory/> tag on diverts and installs.
- Add some templates to create ubuntu, kubuntu, ubuntu-studio (a little bit ticky because the kernel they use), etc ...
Add some recipes as CustomisedIsoImageTools mention
Investigate how to create package based isos and try to write code to do it. Custom Debian Distribution Toolkit
- Conquer the whole world ...
Requirements
- debootstrap
- dpkg-dev
- squashfs-tools
- coreutils
- gzip
- mkisofs
- e2fsprogs
- dput
Packages for gutsy are available in the Agarfu's ppa repository
deb http://ppa.launchpad.net/agarfu/ubuntu gutsy main deb-src http://ppa.launchpad.net/agarfu/ubuntu gutsy main
If you want to try Unidistro to create your own distro, you need to install undisitro-framework package (from agarfu's repo)
There are lots of other packages, these other are helpers to properly create a distro.
The currently development version is hosted in launchpad
bzr branch http://bazaar.launchpad.net/~unidistro/unidistro/unidistro
The framework is under active development therefore the old spanish documentation may contain some mistakes. In the last week we had been working in simplifying the creation of a distro and now it's possible to generate it in a single line under certains circumstances despite the line is quite long. Anyway the XML definitions are right.
Timeline
- As metapackages generation and configpackages generation has been merge we don't depend anymore on equivs.
- The framework has been improved to be able to generate source packages.
- The framework has been improved to be able to sign packages.
- The framework has been improved to be able to upload packages to a repository using dput.
Documentation
Unidistro started as some spanish Universities common effort to develop a something to deal with custom distros. Therefore at this time most documentation is still in spanish.
This is some documentation...
Usage: framework.py [options] config_file [package1 package2 ...] note if you select -i or -u at least one package MUST be provided Options: --version show program's version number and exit -h, --help show this help message and exit -d DBS_ACTION, --debootstrap=DBS_ACTION Debootstrap action to run -i INSTALL_PACKAGES, --install_package=INSTALL_PACKAGES A package to install -p GENPACKAGES, --gen-package=GENPACKAGES Packages to build -u REMOVE_PACKAGES, --remove_package=REMOVE_PACKAGES A package to remove -m, --make_iso Generate the iso -x, --create_metapackages Create metapackages -y, --create_configpackages Create configpackages -r REPOSITORY, --repository=REPOSITORY Repository action to run -t THE_TEMPLATE, --template=THE_TEMPLATE Generate a template -S, --source Build only binary packages -g, --gpgsign Sign created packages -k KEYID, --key-id=KEYID GPG's ID -U UPLOADREPO, --upload=UPLOADREPO Upload packages using dput -l, --list-packages List packages
Unidistro
Unidistro is a project that was born out of collaboration between several Spanish universities, initially Universidad de Sevilla, Universidad de Las Palmas de Gran Canaria, Universidad Rey Juan Carlos III, Universidad de La Laguna, Universidad de Huelva and Universidad Nacional de Educación a Distancia.
The aim is to create an easy to use tool to create univesitary linux distributions. Another target is to find one good way to share knowledge about applications that are useful in each group of users in university. We have different kind of users, we have professors and researchers, pupils and people from administration and services.
Nowadays the project is hosted at Ubuntu's launchpad https://launchpad.net/unidistro/
To download the project's code:
bzr branch http://bazaar.launchpad.net/~unidistro/unidistro/unidistro
Framework to build distributions
The framework uses xml documents to define different questions about distribution, for instance the name, principal depository, distribution base, etc ... as well as packages definitions (metapackages and config packages).
The tools is designed to extend any distribution based on Debian, but today there are only packages to derive from Ubuntu. A typical configuration file will consist of two main sections. One where we define things like the generation directories, parent distribution, base repository, etc ... and the second section where we define all our packages.
With this tool you can generate the same distro for various architectures, the only thing you have to change content of the <arch></arch> tag.
Configuration tags are self explanatory except build_repository. These are the repos that we will use after debootstrap is done. We will download and install packages from this repositories.
<configuration> <project_name>unidistro</project_name> <project_dir>/bardinux/</project_dir> <live_extra_content_dir>live-extra/</live_extra_content_dir> <debfiles_dir>debs</debfiles_dir> <tmp_dir>/bardinux/tmp</tmp_dir> <remove_tmp_files>yes</remove_tmp_files> <repository_dir>var/tmp/paquetes</repository_dir> <repository_remote_base>http://archive.ubuntu.com/ubuntu</repository_remote_base> <base_distribution>feisty</base_distribution> <arch>i386</arch> <build_repositories> <repository>deb http://archive.ubuntu.com/ubuntu gutsy main universe multiverse</repository> <repository>deb http://ppa.launchpad.net/tsimpson/ubuntu gutsy main</repository> <repository>deb http://ppa.launchpad.net/agarfu/ubuntu gutsy main</repository> </build_repositories> </configuration>
Historically we have two different kind of packages, metapackages and config packages. Right now we have merged both, because config packages are a superset of metapackages and merging them we gain the ability to create source packages that we can upload to PPA using dput. The framework itself is able to do it using -S -U.
Metapackages
A metapackage is a package that doesn't contain anything, just dependencies, conflicts, recommendations, etc ... With Unidistro create a metapackage is as simple as add the description to a xml document.
<configpackages> <package name="unidistro-live"> <priority>optional</priority> <section>metapackages</section> <maintainer name="Carlos De La Cruz Pinto" email="carlos@ssl.ull.es"/> <architecture>all</architecture> <version>0.2</version> <depends> <pkg>casper</pkg> </depends> <recommends> <pkg>ubiquity-ubuntu-artwork</pkg> <pkg>xfsprogs</pkg> <pkg>jfsutils</pkg> <pkg>ntfsprogs</pkg> <pkg>discover1</pkg> <pkg>man</pkg> <pkg>man-db</pkg> <pkg>groff-base</pkg> <pkg>xresprobe</pkg> <pkg>laptop-detect</pkg> <pkg>linux-image-generic</pkg> <pkg>command-not-found</pkg> </recommends> <description>Metapackage to create an unidistro distribution.</description> <bugs>becarios@ssl.ull.es</bugs> <origin>Unidistro</origin> </package> </configpackages>
This example metapackage will depend on all packages that are listed in <depends/> tag. If you use Ubuntu, all packages listed on suggests will istall as well as depends. We can also specify all the following tags.
<suggests> <pkg>mozilla-firefox</pkg> </suggests> <pre-depends> <pkg>bash</pkg> <pkg>python</pkg> <pkg>audacity</pkg> </pre-depends> <depends> <pkg>gnuplot</pkg> <pkg>octave</pkg> </depends> <recommends> <pkg>audacity</pkg> </recommends> <conflicts> <pkg>emacs21</pkg> </conflicts> <replaces> <pkg>unidistro-ingenieria</pkg> </replaces>
Config packages
A configuration package is able to install files in different directories and create diverts of other configuration files that are part of packages. This is a legal work around of Debian Policy to change configuration files and keep them updated.
<configpackages> <package name="unidistro-live"> <priority>optional</priority> <section>base</section> <maintainer name="Carlos De La Cruz Pinto" email="carlos@ssl.ull.es"/> <architecture>all</architecture> <version>0.2</version> <depends> <pkg>casper</pkg> <pkg>ubiquity-frontend-kde</pkg> <pkg>ubiquity-ubuntu-artwork</pkg> <pkg>xfsprogs</pkg> <pkg>jfsutils</pkg> <pkg>ntfsprogs</pkg> <pkg>discover1</pkg> <pkg>man</pkg> <pkg>man-db</pkg> <pkg>groff-base</pkg> <pkg>xresprobe</pkg> <pkg>laptop-detect</pkg> <pkg>linux-image-generic</pkg> <pkg>command-not-found</pkg> </depends> <copyright>unidistro-live/copyright</copyright> <diverts> <file genuine="/ruta/a/sustituir/en/la/distro.sh">ruta/hasta/el/fichero/partiendo/de/projectdir</file> <file genuine="/ruta/a/sustituir/en/la/distro.desktop">ruta/hasta/el/fichero/partiendo/de/projectdir</file> <file genuine="/ruta/a/sustituir/en/la/distro.directory">ruta/hasta/el/fichero/partiendo/de/projectdir</file> <file genuine="/ruta/a/sustituir/en/la/distro.png">ruta/hasta/el/fichero/partiendo/de/projectdir</file> </diverts> <install> <file installpath="/ruta/a/instalar/en/la/distro">ruta/hasta/el/fichero/partiendo/de/projectdir</file> <file installpath="/ruta/a/instalar/en/la/distro">ruta/hasta/el/fichero/partiendo/de/projectdir</file> <file installpath="/ruta/a/instalar/en/la/distro">ruta/hasta/el/fichero/partiendo/de/projectdir</file> </install> <changelog> <log maintainer="René Martín Rodríguez" email="rene@ssl.ull.es" datetime="Mon, 23 Jul 2007 17:09:20 +0100" version="0.1"> Primera versión del paquete de configuración de bardinux ... </log> </changelog> <description>Metapackage to create an unidistro distribution.</description> <bugs>becarios@ssl.ull.es</bugs> <origin>Unidistro</origin> </package> </configpackages>
En este tipo de paquetes también podremos utilizar las etiquetas que soportan los metapaquetes y además las etiquetas diverts e install. Los ficheros que están entre los tags diverts instalan el fichero que se le indica en la distribución que se genera y añade un dpkg-divert del fichero que aparece en el atributo installpath. Esto vale, por ejemplo para poner nuestra propia configuración de cualquier servicio. Por ejemplo, si queremos cambiar la configuración de samba por defecto deberemos robreescribir /etc/samba/smb.conf. Si nosotros hacemos un paquete que instale este fichero, el sistema de paquetería evitará instalar nuestro paquete informándonos de que uno de los ficheros del mismo pretende sobreescribir un fichero (/etc/smb/samba.conf) que pertenece a otro paquete. Para evitar esto lo que haremos es instalar /etc/samba/smb.conf.unidistro, hacer un dpkg-divert de /etc/samba/smb.conf y seguidamente hacer un enlace simbólico desde /etc/smb/samba.conf.unidistro a /etc/smb/samba.conf. Además nuestro paquete es lo suficientemente inteligente, para que una vez que se desinstale deshaga el cambio hecho y vuelva a dejar el fichero de configuración del paquete original.
Package generation
Once we have our packages defined in the xml document we need to create .deb files. Simply run this:
./framework fichero_xml_de_configuracion.xml -y
This will left all the packages defined in xml into the deb_directory
Creating a live-CD
To create a live distribution there are some steps:
- Create a debootstrap
- Create all the packages defined in xml.
- Create a local repository to be able to install our packges.
- Install all packages we want to
- Clean the distro
- Create the .iso
./framework fichero_xml_de_configuracion.xml -d create -y -r create -i paquete_a_instalar1 -i paquete_a_instalar2 -m
Community comments
maybe you could cooperate with CustomisedIsoImageTools spec and with Debian? -- AzraelNightwalker 2008-01-02 16:41:11
spanish texts should be splitted to separate subpages - ie. https://wiki.ubuntu.com/Unidistro/Espanol
Done, thx AzraelNightwalker
Subpages