I googled for days, but didn’t find a good step by step tutorial for creating your own Fedora branding. Now that I learned it myself, I thought I’ll write one for all the people out there who would like to know how it works. In a later post I’ll also write about including the branding in your own distro using Revisor. Before you start reading you may like to scan and skim this web page, because we’ll use knowledge from there. We will base our work on the generic-* packages, which are included in Fedora. For creating the logos some GIMP skills will be useful. In this tutorial I’ll use gwarming as package name, so every time you see gwarming, replace it with the name you want to give your custom branding. Note that when editing .spec files, you may also want to write your own Changelog in %changelog. I didn’t cover that here.
To install all packages needed in this tutorial, do:
yum groupinstall “Development Tools”
yum install gimp yum-utils rpmdevtools
1.)Step one: Create a working directory and get the SRPMS
First, it would be good to have a working directory. In this tutorial I’ll use “/home/julian/Vorlagen/Spin/branding”. Change to that directory and create two sub-directories, “logos” for the logos and “release” for the release files and release notes. We will start with creating the logos.
2.)Step two: Edit the logos
Open a terminal and change to the “logos” directory you just created and issue the following command:
yumdownloader –source generic-logos
This will download the SRPM of generic-logos, that includes all the files we need. Now issue the following command to unpack it:
rpm2cpio generic-logos* | cpio -id
You should have three files in that directory now, generic-logos-version.src.rpm, generic-logos.spec and generic-logos-version.tar.bz2. We need to unpack the images now with a
tar xfj generic-logos-*.tar.bz2
Now we have a new directory, generic-logos-version. As I’m writing this on Fedora 11, I have generic-logos-11.0.1. You can leave the terminal now, because now you have to do the fun work: Editing the logos.
Change to the unpacked directory (e.g. /home/julian/Vorlagen/Spin/branding/logos/generic-logos-11.0.1/) and delete the generic-logos.spec in there. We already have that one directory above. Now be creative. Browse the directories and edit all pictures you’d like to edit. For example, enter the directory firstboot/ and right-click on firstboot-left.png and choose “Open with GNU Image Manipulation program”.
You can edit all the pictures or replace them with whatever you want. The pictures you don’t edit still won’t be affected by the Fedora trademarks. But keep an eye on the resolutions. Don’t change them. For example, firstboot-left.png is 160X600 pixels. Leave it like that.
If you want to scale images, open them with GIMP and choose Image->Scale Image. That is useful if you want to completely replace the logo. Note: If you derive your logos package from the generic-logos package, e.g. keep using some images from there or use their Makefile, you have to license them under GPL2.
The Plymouth theme is placed in plymouth/charge. The files will be displayed in order from progress-00.png to throbber-15.png. The throbber images will be showed after the progress pictures completed. In Fedora 11, they are the flashing Fedora logo, while progress is the white outline that fills with color. I replaced the throbber images with the image of our planet, starting in gray and becoming more colorful with every picture. This effect is easily reached by using GIMP’s Colors->Brightness/Contrast on any picture that is placed in throbber 15 and then get’s reduced brightness with every step back to throbber-00.png
3.)Step three: Rename the package
After you edited or replaced all the images, it’s time to rename the package. There are some places where we have to change the name:
In the Makefile. Edit generic-logos-11.0.1/Makefile and change line 1 to NAME = yourname-logos.
I am not a lawyer, but I think you have to add something to the COPYING file like “This package is derived from generic-logos and is subject to the same license as generic-logos.” But I’m not sure, so if you plan to earn money with your package you’d better ask a lawyer
Issue cp -r generic-logos-11.0.1 gwarming-logos-11.0.1 in the parent directory.
Instead of gwarming, use the name you also used in the Makefile.
Now issue tar cjf gwarming-logos.tar.bz2 gwarming-11.0.1/ to create an archive that contains all your edited images and changes.
Issue cp generic-logos.spec gwarming-logos.spec
Don’t do that on the generic-logos.spec in the generic-logos folder, do it in the top folder. In this tutorial that would be /home/julian/Vorlagen/Spin/branding/logos/generic-logos.spec
Edit gwarming-logos.spec (or however you called the file). Now replace Name: generic-logos with Name: gwarming-logos
Change Source0: generic-logos-%{version}.tar.bz2 to Source0: gwarming-logos-%{version}.tar.bz2
Use any %description you’d like to use.
In the %install section, replace
mkdir -p $RPM_BUILD_ROOT%{_datadir}/firstboot/themes/generic
for i in firstboot/* ; do
install -p -m 644 $i $RPM_BUILD_ROOT%{_datadir}/firstboot/themes/generic
done
with
mkdir -p $RPM_BUILD_ROOT%{_datadir}/firstboot/themes/gwarming
for i in firstboot/* ; do
install -p -m 644 $i $RPM_BUILD_ROOT%{_datadir}/firstboot/themes/gwarming
done
Now you’re done with the spec file. Close it, now it’s time to build the package.
4.)Step four: Build the logos package
It’s time to build a RPM package for the logos, so we can install it on any system. Issue rpmdev-setuptree and copy gwarming-logos.tar.bz2 to the directory ~/rpmbuild/SOURCES. Then copy gwarming-logos.spec to ~/rpmbuild/SPECS. Now change to the directory ~/rpmbuild/SPECS and issue rpmbuild -ba gwarming-logos.spec
If everything went right you should see a gwarming-logos-11.0.1-1.rpm in ~/rpmbuild/RPMS/noarch now. This is the package that contains all your logos. If you would install it now it would replace your Fedora branding with your own one. At this point, you’re done! If you also want to create your own release notes and release files, read on.
5.)Step five: Create your own release package
If you want to create your own distro based on Fedora (I will describe that in a later post) you will need to have your own release files. Here I’ll describe how to create these. The release files are needed for repository configuration and the release notes.
Create a new directory for the work on the release package. Change to that directory and issue
yumdownloader –source generic-release
Unpack the source RPM with
rpm2cpio generic-release* | cpio -id
You should have three files now: The generic-release-version.src.rpm, the generic-release.spec and generic-release-11.tar.gz. Unpack the generic-release-11.tar.gz package with tar xfz generic-release-11.tar.gz
Change to the generic-release-11 directory. Here we have a couple of files. The Fedora GPG keys used for package signing, the fedora repo files that include repository information about the Fedora repositories, a license file called GPL, a Makefile and a README.Generic-Release-Notes. There also is a generic-release.spec, delete it, we don’t need it as we already have one in the parent directory.
First, we will edit the README.Generic-Release-Notes. Just write something in there. You could insert common bugs, a description of your distro or a message, for example “This is Gwarming OS 11 beta 2, please donate to Al Gore when you read this”, “If you like the distro, send me a postcard!” or “Help me, I’m locked in a basement in Redmond and forced to create distros based on Fedora! Call 911!” After you’re done editing the file, save it as README.GWarming-Release-Notes and issue sed -i ’s/generic/gwarming/g’ Makefile.This will adjust the Makefile to our needs. Now include all the repos you’d like to use in your custom distro. For example, let’s assume we want Gwarming OS to include the adobe-linux repo and RPMFusion. So we’d have a look in /etc/yum.repos.d/ and copied adobe-linux-i386.repo, rpmfusion-free.repo and rpmfusion-free-updates.repo into the generic-release-11 directory. For every repo we add we also have to include the repo GPG key (or at least that would be good if you don’t want the user to get it manually). You can find the GPG keys of all enabled repos on your system in /etc/pki/rpm-gpg
In this example we’d copy RPM-GPG-KEY-adobe-linux and RPM-GPG-KEY-rpmfusion-free-fedora-11-* to the generic-release-11 directory.
Now change to generic-release-11s parent directory again and issue cp generic-release.spec gwarming-release.spec
Open the gwarming-release.spec. We need to adjust some things there. In the first two lines, adjust %define release_name to the name of your distro, and the %define dist_version to your distros version. Change Summary: Generic release files to Summary: GWarming release files and Name: generic-release to Name: gwarming-release. When doing that, keep an eye on the whitespaces. Don’t mix spaces and tabs after Name: or Summary:. Change Version: 11 to the version of your distro, e.g. 3 or 12. Don’t touch the Release: tag.
The %description and %description notes can be set to what you want again. In the %install section, adjust the echo “Generic release %{version} [...]” to echo “GWarming release %{version} [...]“.
Now adjust echo”cpe://o:generic:generic:%{version}” to echo “cpe://o:gwarming:gwarming:%{version}”.
Last but not least, adjust %doc README.Generic-Release-Notes to %doc README.GWarming-Release-Notes. You need to replace it with the name you gave the release notes file (case sensitive)!
Congratulations, you’re nearly done! All you need to do now is to create the RPMs, so you can include them in your custom distro. To do that, change to generic-release-11s parent directory again, issue a cp -r generic-release-11 gwarming-release-11 and pack the files with a tar czf gwarming-release.tar.gz gwarming-release-11/
Then copy gwarming-release.tar.gz to ~/rpmbuild/SOURCES and gwarming-release.spec to ~/rpmbuild/SPECS. Now go to ~/rpmbuild/SPECS and issue rpmbuild -ba gwarming-release.spec. Now you should have a gwarming-release-11-1.rpm and gwarming-release-notes-11-1 in ~/rpmbuild/RPMS/noarch. They contain your release files and release notes. Congratulations, you’re done! You can use these files to replace fedora-logos, fedora-release and fedora-release-notes in your own distro now. A tutorial how to that will appear on this blog in a couple of days. Now I have to grab a drink. That took days to write… If you have any questions, or some things seem unclear, don’t hesitate to ask in the comments!