Hack 51 Copy Settings to Other Distributions 
Knoppix's intelligent hardware
auto-detection can get all of a computer's hardware
working out of the box. You can copy and reference the system files
Knoppix creates to ease configuration of a new or existing
installation.
With new hardware always coming
out and with many vendors failing to list their Linux support (or
lack thereof) on the box, it can sometimes be difficult to get all of
your hardware working under Linux. While scanning the Web for HOWTOs,
searching for the module that corresponds to your hardware, and
configuring it by hand can be a good learning experience, some people
might prefer to simply copy the information they need from a working
system. This is where Knoppix comes in. Because of the excellent
hardware detection and configuration Knoppix performs, there is a
good chance that if the hardware is capable of working on your Linux
distribution, it works in Knoppix. Many of the configuration files
and modules are common across distributions; if hardware works in
Knoppix, in many cases you can simply copy the configuration files
and information you need to your distribution without any extra fuss.
5.16.1 Copy X Settings
Even with some of the automated tools that are available to configure
X, it still seems to be one of the most problematic configuration
files. After spending hours trying to get X to work, booting up
Knoppix and having it work automatically might be a bit demoralizing.
But you should be rejoicing. X's configuration file
is pretty standard across Linux distributions, so you can copy
Knoppix's configuration to your distribution almost
directly.
Like pretty much every other Linux distribution, Knoppix stores
X's configuration in
/etc/X11/XF86Config-4. Provided you have a
similar version of X on your system, you can copy this file directly
to your system and get the same exact configuration that you have in
Knoppix. Knoppix does include quite a few fonts in the file, so X
might give some warnings about missing font paths if your fonts
aren't installed in the same location or
aren't installed at all. If you are experienced with
X configuration, you don't necessarily need to copy
the complete file but can instead reference particular sections, such
as the monitor section or input device sections.
For instance, to copy the complete monitor section that Knoppix uses,
copy all of the text starting with Section
"Monitor" and ending with EndSection to
your XF86Config-4 file. Then make sure that in
your screen section (this section starts with
Section "Screen") the
Monitor line has the same monitor name as the name
following Identifier in the monitor section you
pasted in.
5.16.2 Copy Module Information
For much of the hardware on a system, there aren't
many configuration files you need to bother with. You simply need to
load the right module for the hardware to start working. Sometimes
this means experimentation by loading multiple network card modules
one at a time to see which module works best for your network card.
Knoppix's kernel has most hardware built as a module
so it can load only the modules it needs to work on a particular
system. Most distributions by default have heavily modular kernels as
well, so you can reference the modules that Knoppix loads and load
the same modules on your system to get hardware working. This of
course assumes that the same modules are built in your particular
kernel.
The command lsmod shows all modules that are
currently loaded in a system. Under Knoppix, many different modules
are loaded by default, so it's best to have a
general idea of which modules you might be considering for a device
before digging through the output. For instance, if you are
configuring ALSA, most of the relevant modules in the
lsmod output are preceded by
snd- or reference other modules preceded by
snd- in the Used by column. If
you are really lazy, you could simply copy the full list of modules
and load them all, but it's better to try only the
modules you need.
5.16.3 Copy Kernel Configuration
In addition to referencing the modules that Knoppix loads at boot,
you can also reference the complete configuration Knoppix uses in its
kernel when building your own kernel. Knoppix stores a copy of the
configuration file for each kernel it includes in the
/boot directory in the format
config-kernel_version.
If you have a standard, unpatched kernel that's the
same revision as the one Knoppix uses, then you can simply copy the
configuration file to the root of your kernel source tree and name it
.config to start using it. If your kernel source
is located at /usr/src/linux-2.4.26, for
instance, copy Knoppix's configuration to
/usr/src/linux-2.4.26/.config. If your kernel
revision is greater than the one Knoppix uses (for instance, you want
to build 2.4.26 but the version of Knoppix you have uses a 2.4.25
kernel), then after you copy the configuration file to the kernel
source tree and name it .config, you must run
the following command from the root of the kernel tree to see new
kernel options:
root@ttyp0[linux-2.4.26]#
make oldconfig
Once the configuration is copied and ready, you can edit the
configuration and build the kernel as you would normally. Do not use
the kernel config for an older revision of the kernel (for instance,
Knoppix uses 2.4.26 but you want to use 2.4.24) because, while it
might work, problems may arise due to options that exist in the
Knoppix kernel that don't exist in the kernel you
are building. Also, do not use a configuration for a 2.4 kernel if
you are building a 2.6 kernel and vice versa.
Copying some of these settings from Knoppix to your system can
definitely save you time when trying to get hardware working.
Unfortunately, many of the other configuration files in
/etc, such as network settings, are specific to
either Debian or Knoppix, so you won't be able to
reference those files without making some changes to suit your
system, but at least you now have a good start in getting the
hardware to work.
|