Buy the latest issue online!
Never miss an update! Get PC Plus in your RSS reader, Twitter, and on Facebook

Tutorial: Build Your Own Linux Distro

If you find yourself making the same adjustments each time you install a new distribution, it's worth creating your own customised version.

We're used to thinking of Linux distributions being set in stone. They're either KDE or Gnome, use a certain kernel and bundle certain applications. But this doesn't have to be the case. If you find yourself making the same adjustments each time you install a new distribution, it's worth creating your own customised version. Revisor is a tool that lets you do just this, and in this tutorial, we'll show you how...

Update: And don't feel left out if you're a Windows user. Check out our tutorial about how to build your own Windows. And if you're a die hard Linux fan, check out our guides to cluster computing in Linux and booting into Linux over a network, Finally, if you want an even flashier way to put together a distro, why not use SUSE's tools and build it online?

1. Install Fedora

The Revisor tool has been a part of the Fedora distribution for the last few releases. This means you can use any of these versions to create your own Linux distribution, although we'd recommend using the latest – Fedora 10. Installation is very straightforward, and shouldn't be a problem if you've installed any other version of Linux from the last two years.

After installing the operating system, the only other prerequisite is the Revisor application itself. This can be installed by clicking on the Administration menu, selecting 'Add/Remove software' and searching for a package called revisor. Click ‘Apply’ and accept the additional packages that need to be installed.

However, there is one step that is vital to success, and that's updating Fedora to include the very latest patches. You can do this using the Update tool in the Administration menu. This is required because the version of Revisor that was bundled with Fedora 10 was broken, and this won't create a workable Live CD. You need to either use an older version, or update your 10 installation to use the fixed version of Revisor.

2. Disable security

After installation, Revisor can be found in the Applications | System Tools menu. Click on the icon and enter your root password. If you see an SELinux error, you will need to change a security setting for your system. SELinux is an ultra-tight Linux security system that keeps a close eye on what certain application can and can't do. Revisor falls out of its remit, so you need to change its level of protection to Permissive.

To do this, load the SELinux Management application from the System | Administration menu and change the Current Enforcing mode to Permissive. When you launch Revisor again, the error will have disappeared.

3. Getting started

From the Revisor main window, click 'Get Started'. You now have to decide how your new distribution will be booted. You can choose between the standard installation and Live media. The first option is a good choice if you're planning to install your own version of Fedora on many different machines, for example, in an office. The DVD or CD you create will let you install your own distribution, complete with your own set of applications, without any prompting. If you want to create your own distribution for personal use, then the chances are you'll find the Live media types more useful.

This creates either a Live CD/DVD or a USB stick installation of your distribution, and you'll be able to boot into your desktop from either of these installations by simply inserting the media into your PC. As with any Live media, you'll be able to work on your desktop and use the applications you choose, but your distribution won't touch the host machine's hard drive. This is a great solution for Internet cafes or college PCs. We've opted for the Optical media type installation, as we find this is the most flexible.

4. Repository information

Click on the ‘Forward’ button to bring up the package repository configuration page. This lists the sources for the packages that are going to be installable for your distribution, as well as the packages for a specific hardware type. These are decided by the option to the right of Configuration Section to Use, and by default this is set to the most generic option – f10-i386. If you want to build your Linux distribution for a different platform, such as Intel 64-bit or PowerPC, then you will need to use a version of Fedora running on that hardware. You can't build a distribution for an architecture different from the one which Revisor is running on.

Other than system architecture, another option you might want to change is the Destination Directory. This is where the final image for your distribution will be built. Beneath this option, you will see a list of the repositories that are going to be used for pulling the packages you want to include in your distribution. We disabled all but the simple Fedora repository.

5. Package management

Skip the page titled Load Kickstart Data. The step after this is the most important because it's where you get to choose the packages that are going to be installed on your own distribution. Not only will this selection define what can and can't be done with your distribution without any further modification, it will also define exactly how big your distribution is going to be. That's important if you want to fit everything onto CD.

If you do need to keep package size to a minimum, then we'd recommend opting for the XFCE desktop environment, rather than the fatter Gnome or KDE options. These are ideal choices if you want a more powerful environment, but you'll need a DVD's worth of capacity to make the distribution useful. You should also install everything listed in the base category, as these packages are needed to create a functional environment. By default, the Package Selection screen only displays groups of packages, rather than individual selections. If you want to install GIMP, for example, you need to switch to the Search view and type 'gimp' into the find field. You can then select the package from the results list. You should consider installing a web browser (Firefox), a word processor (OpenOffice.org), a music player (Amarok or Rhythmbox) and a video player (totem).

6. Distro configuration

You now have the opportunity to fine-tune your distribution to your liking. The first page is the most important, as this lets you define your language and keyboard layout, as well as the root password for your Live system. You can ignore the kernel parameters and the authentication page, although you should also add a single default network device on the following page and leave the firewall enabled for safety. You may also want to create a default user account.

When you're happy with your customisations, click on the ‘Forward’ button. Revisor will calculate dependencies (those packages that are required to make your selection work), and tell you how much space your distribution is going to use. If this is too much for your install medium, you will need to click 'Back' and remove some of the packages you've selected.

7. Composition

A basic installation of XFCE and GIMP took up around 700MB in our example. Clicking 'Forward' one more time will start the compilation process. This consists of 11 separate steps.

 

  1. Packages are downloaded
  2. The file system is created
  3. Packages are installed
  4. The system is configured
  5. Networking is configured
  6. The RAM file system is created
  7. The system is relabelled
  8. The bootloader menu is installed
  9. File systems are unmounted
  10. The kernel image is compressed
  11. The ISO image is created

 

The speed with which all of this is accomplished is obviously dependent on the number of packages you've chosen, the speed of your Internet connection and the capabilities of your machine. But to give you a ballpark figure, our Intel Core 2 Duo 6400@2.13GHz machine took around 90 minutes to build a 700MB-sized distribution.

8. Burn the disc

After the generation of the file has completed, you will find the final ISO located in a '/srv/revisor' subdirectory (as long as you didn't change that earlier). Our file was hidden in the Live folder, and called Fedora-10-Live-i386.iso. You need to burn this file to a blank CD, and you can do this from within Fedora by right-clicking on the ISO file and selecting 'Write to disc'. You have to be careful with ISO images, as you don't want to mistakenly write them as a single file to a new disc. You need to make sure they're used as an image to copy the contents from the ISO file onto the disc.

9. Give it a spin

When the burning process has finished, you're ready to launch your freshly squeezed Linux distribution. Insert the disc into the optical drive of your machine and reboot. You will also need to make sure that your system is configured to boot from the optical drive, either through your system BIOS or by a boot-time device selection menu.

This article originally appeared in Issue 279 of PC Plus.

Graham Morrison

Enjoyed this article? Subscribe to PC Plus and get your monthly digest of news, features and all the stories that matter delivered straight to your doorstep - worldwide. Click here for our latest offers.

I think everybody should try also SUSEstudio, which does everything that the revisor does and a lot more, It is still at alpha but I found it very usable.

www.susestudio.com

Felix Rdz's picture

problem with this is that the software is constantly being updated and changed so you are likely to have to do this constantly if you want to stay up to date.

Anonymous's picture
We're used to thinking of Linux distributions being set in stone.

We are, are we? Maybe if by "we" you mean "people that recently switched to Linux from Windows and still treat it like Windows". Some of us are well aware of the true flexibility of Linux.

Anyway, LSF is "making your own distro". This is just a customized package list on an installer. You can do the same thing with Debian by adding the packages you want to a minimal install (a few hundred MBs, no X) and using dpkg --get-selections and then dpkg --set-selections on subsequent minimal installs.

Anonymous's picture
LSF

LFS

Anonymous's picture

I'm a little off topic here, but I have a complaint. I am a Windows, BeOS, PC-BSD user. I constantly hear that Linux is the best. I'm not a guru, so I only use OS's that install to a partition of my choosing. Why do I have to make 2 or 3 different partitions to install Linux: no other OS makes me?

Anonymous's picture

Linux doesn't make you use 2 or more. It installs just fine on one partition. Although I prefer to use 6-8 partitions depending on use.

Anonymous's picture

that's right about using one partition. if you have enough memory, you can install linux on only 1 partition.

Anonymous's picture

Windows uses more than one partition. Best I can remember. Don't you normally have a :c and a :d drive? That's a partition. Its been a long time for me so I may be wrong here.

Anonymous's picture

Thanks for the well-written, informative article!

sammy's picture

By default Windows uses one partition (c:). a: is the floppy drive, d: is the cd/dvd drive. Certainly there are Windows setups with 2 or more HDs or 1 HD with multiple partitions; in those cases those drives are d:, e:, etc. The cd/dvd is bumped down another letter for each additional HD/partition.

Anonymous's picture

How do we do if we don't want packages to be downloaded, say if we had DVD of Fedora ? Because i don't always have internet connected.

Anonymous's picture
Why do I have to make 2 or 3 different partitions to > install Linux: no other OS makes me?

Like other people said, you don't *have* to use 2 or 3 partitions, Linux will work just fine with 1, but most people choose several for good reasons. If you use several partitions ( like /boot, /home, /temp, /usr/local, /media, etc) they all jive nicely, looking like subfolders of one larger directory (the root directory, '/'). But since they're different partitions you can format one without changing the others. E.g. imagine reinstalling windows os, but without worrying about backing up your My Documents folder as it's on a different partition (in Linux this might be your /home partition, whereas the OS is on the '/' partition). Also, you can fragment one partition, (like the /temp directory being used for writing and re-writing temporary internet files) without fragmenting any of your other partitions (in windows you would need to defrag your c: drive eventually). Last thing, while I'm on this role: all these extra 'drives' don't show up as a mess of c:, d:, e:, f:, etc on My Computer, they just have their seamlessly integrated folder names. There are probably more reasons it rocks that I don't about, but honestly it just makes a lot more sense than the windows structure.

Anonymous's picture

Linux From Scratch is making your own distribution. This is not. Linux from scratch and then Part 2 Beyond Linux From Scratch show you how to truly make your own Linux. From down loading and compiling the sources to installing and configuring adjacent files. You can find out more at the websites: http://www.linuxfromscratch.org If you have a 64Bit processor then you should go to http://cross-lfs.org (amd64, mips, ia64, etc...).

The above technique is a process known as Re-Mastering or Re-Packaging. Nothing wrong with that but you don't have full control.

taxtropel's picture

or you can always use archlinux

Anonymous's picture

What I'd like to do is to have a Linux (or other OS) boot up and run an AVI at start up, preferably looped so it keeps playing. Movix looked good - but then they added a menu option to play the AVI. Can anyone help with a way of doing this?

Anonymous's picture

Linux doesn't make you use 2 or more. It installs just fine on one partition. Although I prefer to use 6-8 partitions depending on use.

keitel's picture

Think of the hassles you have when you want to do a clean reinstallation of Windows—how do you preserve all your precious user data and documents? Or perhaps move them to a new machine?

In Linux, things are clearly separated, so user files and preferences live in one area, separate from system stuff. You can put the two on the same partition if you like, but keeping them separate makes it easier to, say, switch to a different distro, and leave the user files untouched. When I was first experimenting with Linux, I set aside 4 separate partitions for doing OS installs, all sharing the same user area, so that I could try out different ones without having to move my user stuff back and forth.

Also, you can even transfer the entire OS to, say, a new hard drive, just by using standard file-copying utilities. No need for a special “ghost” application! How’s that for flexibility?

Lawrence D'Oliveiro's picture

what a fun project! building your own Linux distro as if the major distros such as Ubuntu don't have thousands of man hours from skilled people put into them.. why fix something thats not broken? You can just take Ubuntu and modify it if you need to but building your own distro is a bit extreme unless you have a very good reason to do it or if you're trying to start an open source community project.

Clasamente's picture

I was lucky enough to be a part of the Suse Studio alpha group and it is certainly very impressive. My only negative comment is that i would like to be able to take a standard Suse install and take out what i don't need, rather than trying to build one up from scratch and remember to include every essential package.

Still, it's revolutionary y'know.

Biletul's picture

This is great, I think I give it a try with ubuntu, if that works?

Leo's picture

I hope these tips if I was not stuck on me halfway and be forced to take over again. Not even an expert but I do not want to give up Linux. It is more safe and beautiful.

piese auto's picture

thanks for a great great post, Can you write about the same topic but using mandriva as a based?

intipadi's picture

I think that users making open source mash ups of their own linux distros is healthy for the open source software ecosystem by keeping it robust and responsive to the variety of needs that arise with different users. People complain about how many different distros there are but I think the only problem with it is that most of them are not different enough. Stuff like this is more for toolin' around though. Anyone serious about making a distro should know code.

tylerdurden's picture

"By default Windows uses one partition (c:). a: is the floppy drive, d: is the cd/dvd drive."

Windows sometimes does install two partitions because there is the main partition (C:/) and there is also a Recovery partition (E:/)

bjamison's picture

Sure, if you have enough memory, you can install linux very easy!

finale coupe football's picture

nice post!

biletul zilei's picture

Thanks for sharing this good information with us.Bet Promotion

bet promotion's picture

Rather than respinning a whole distro, is it also possible to install an existing distro, install/remove a bunch of packages till you're happy, and make some sort of log/shell script out of that that can install/uninstall all these packages for you once you install the same distro / a new version of the same distro from scratch? Because I'd love that.

Clasamente Fotbal's picture

I’d just like to say thank you for writing this straight forward tutorial. This is the first tutorial that I have came across that makes perfect sense and allowed me to get started!

pariuri sportive's picture

I love returning back to this site and reading the quality content you always have on offer.

online poker's picture

Well, this is a very valuable post. Thanks for the information you provided. Aditional you can you can make some money from sport betting, we can help you to win with livescore|rezultate live|try it!

poker romania's picture

its a great post!thanks

casa pariurilor's picture

very good information and useful1 thanks

bwin's picture

Very interesting these articles. Please send me by email more information about these articles. thanks

fullbet's picture

Yes, Arch linux is the best one in this choice to have own linux distro.

- Robin

DailyTUT's picture

I'm a little off topic here, but I have a complaint. I am a Windows, BeOS, PC-BSD user. I constantly hear that Linux is the best. I'm not a guru, so I only use OS's that install to a partition of my choosing. Why do I have to make 2 or 3 different partitions to install Linux: no other OS makes me?

earth4energy's picture

hey buddy,this is one of the best posts that I’ve ever seen; you may include some more ideas in the same theme. I’m still waiting for some interesting thoughts from your side in your next post.

jerseys's picture

People complain about how many different distros there are but I think the only problem with it is that most of them are not different enough. Stuff like this is more for toolin' around though. Anyone serious about making a distro should know code. club penguin cheats

Mary's picture

Post new comment

The content of this field is kept private and will not be shown publicly.
If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
  • Internal paths in single or double quotes, written as "internal:node/99", for example, are replaced with the appropriate absolute URL or path. Paths to files in single or double quotes, written as "files:somefile.ext", for example, are replaced with the appropriate URL that can be used to download the file.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <p>

More information about formatting options

CAPTCHA
We apologise for making you prove your humanity...
Buy the latest issue online!
Future Digital Future