Créer sa propre distribution Linux
[60 mn de lecture - paru le 11/24/2004 5:17:30 PM - Public : Confirmé]
|
   
|
Auteur
INTRODUCTION
This dissertation will aim to explain the conception of a Linux
mini-distribution that will provide an emergency rescue and recovery solution
to most systems
This dissertation will aim to explain the conception of a Linux
mini-distribution that will provide an emergency rescue and recovery solution
to most systems.
In case of a crash or of a failure of a system, we need a tool that
can be installed within a few minutes and without the need to erase the
contents of the hard-drive in order to backup some data, gain access to the
configuration files or temporary run some services.
This distribution will hold on a CD-ROM and will be easily bootable
from the CD.
It will provide common and useful administrative and network
applications and services. The following applications, among others, will be
implemented:
-
Shell
-
Base commands (ls, ps, cp, rm etc.)
-
Text editor
-
Disks management utilities (Fdisk, Lilo etc.)
-
Networking applications (Ftp, Telnet, SSH etc.)
-
Update, Upgrade and packages installation (APT)
It is enough typing searching for “Linux mini distribution” on
Google to see that there are many “custom” distributions existing that can even
hold on a single floppy disk for some of them.
The aim here is not to make a simple boot disk containing basic
commands, but to get a complete distribution by integrating the necessary
applications in order to provide the following services:
-
access to a crashed machine drive and to its
network;
-
temporary replacement of some services usually
provides by a station that has crashed or that is being maintained;
-
regular workstation services.
I- Comparison between several existing mini distributions
We can find several mini distributions by searching in Google, will
compare three distributions among them: Linux On A Floppy (LOAF), Linux Router
Project (LRP) and Fresco.
Some common characteristics of these distributions is that they are
quite small, they run on PCs with minimal requirements, they are specialized
and therefore have restricted functionalities.
For out project we have decides to explain how to build a more
complex distribution, also loaded in a ramdisk, but having more functionalities
in order to compete with distributions such as Debian, Suze or Redhat.
LOAF is a distribution created by Eric Benoit, it holds on a floppy
disk and can run on a 386 PC with only 4MB of RAM. It provides a text editor
and basic modules such as Lynx, Ftp, Telnet and Ssh. It
Cette
distribution a été crée par Eric Benoit, elle tient sur une disquette et est
capable de fonctionner sur pc 386 avec seulement 4 Mo de RAM.
Elle possède un
éditeur ainsi que des modules de bases tel que lynx, ftp, telnet et ssh. It is a polyvalent distribution but its funcionalities are
restricted.
LRP and FREESCO are network oriented distributions. They also fit on
one floppy disk and allow creating routers, terminal servers and other embedded
applications.
These distributions do not have text editors; it is not possible to
add scripts anyway. Their configuration is guided and easy, nevertheless, they
do not support many network cards which makes them not usable in many cases.
II- Our distribution
This distribution is based on system V. Init system V is the program
loaded by the kernel at during the system start-up. Its main purpose is to load
the different processes necessary to the start-up (gettys, NFS daemons, FTP
daemons…).
In order to be able to download and install new packages, drivers or
to customize the distribution, the apt-get or yum module will be included.
There is no need to include all packages possible on the CD-ROM and to load
them all – even if most useful ones would fit - since the administrator can
download and install packages depending on its needs. This way, the programs
loaded in the ramdisk is limited to what is strictly necessary and the
distribution is really scalable.
This distribution uses bash, its role is to reed your commands and
then to execute them if they are “internal” like cd or to find and execute the
program that they belong to if they are “external” like cp or startx. Bash has
also several options like command completion or an history of executed commands
that make its use more comfortable.
The scripts launched by init are usually Shell scripts executed by
bash. Having an own programming language in parallel with system utilities
available from the command line if a very powerful combination.
This type of distribution can be situated in between simple boot
disks and a distribution such as Knoppix. It has much more capacities than a
regular boot disk, but is not intended to be used as an office distribution.
The use of a CD-ROM to load the distribution is much faster and more reliable
than the use of floppy disks. It allows having a bigger system although it is
limited by the amount of RAM since the distribution is stored in a ramdisk
while we still need some RAM memory for executing processes.
The distribution includes numerous tools that support most
filesystems and network debugging tools. Modules for Telnet, FTP, an SSH server
and support for many network cards are included. HTTP text navigation and basic
networking elements such as ping, traceroute, and DHCP client or port scan
tools are integrated.
As stated before, installation of new modules is very easy using
Apt-get or Yum and does not require re-compile the kernel.
Nevertheless, new modules installation is temporary, since they are
loaded in the ramdisk. If all the data is lost when the computer is shut down,
it is still possible to save the configuration files to a USB key or any
storage device in order to recover them for a new installation.
To make its use friendlier, it is possible to open six consoles and
to switch between them like on any distribution.
A last important point is that we have to consider the
number and the size of the package we will use for each service we want to
provide. Indeed, if we want them to fit in the ramdisk they should be as light
as possible.
The distribution
requires a PC equipped with a compatible i386 processor. A Pentium processor or
above with 128 Mo of RAM memory is recommended because of the ramdisk.
Although the
mini-distribution requires a CD-ROM drive and a PC with a BIOS that support
booting from CD-ROM (generalized since 1997), the distribution supports a wide
range of peripherals.
|
|
LOAF
|
LRP et FREESCO
|
PROJET
|
|
Media
|
Floppy disk
|
Floppy disk
|
CD-ROM
|
|
Sofware
|
VI, network tools
|
Network tools,
IP modules, masquerading
|
Most common
tools and possibly any with APT
|
|
Evolution
|
NO
|
NO
|
YES
with
APT
|
III- Method
Before making a bootable CD-ROM of the image, we need to build our
file system and the distribution. We will keep in mind that the distribution
must not exceed the size of a CD-ROM (650 or 700 MB).
During the boot process, the kernel is loaded first, and then it
initializes device drivers and its internal data structures. Once it has been
done, the root file system needs to be loaded and mounted. Here, our root file
system must be loaded into RAM memory as if it was a disk, which is called a
ramdisk.
To build our distribution, we need a boot system that will load a
root file system into a ramdisk. We will start by creating the file system and
then we will see how to include the boot system and make the whole of it
bootable on a CD-ROM.
|